Files
mautrix-telegram/pkg/gotd/tdapi/tl_premium_feature_gen.go
T
2025-06-27 20:03:37 -07:00

3644 lines
108 KiB
Go

// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_ = context.Background()
_ = fmt.Stringer(nil)
_ = strings.Builder{}
_ = errors.Is
_ = multierr.AppendInto
_ = sort.Ints
_ = tdp.Format
_ = tgerr.Error{}
_ = tdjson.Encoder{}
)
// PremiumFeatureIncreasedLimits represents TL type `premiumFeatureIncreasedLimits#6a6be1b7`.
type PremiumFeatureIncreasedLimits struct {
}
// PremiumFeatureIncreasedLimitsTypeID is TL type id of PremiumFeatureIncreasedLimits.
const PremiumFeatureIncreasedLimitsTypeID = 0x6a6be1b7
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureIncreasedLimits) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureIncreasedLimits.
var (
_ bin.Encoder = &PremiumFeatureIncreasedLimits{}
_ bin.Decoder = &PremiumFeatureIncreasedLimits{}
_ bin.BareEncoder = &PremiumFeatureIncreasedLimits{}
_ bin.BareDecoder = &PremiumFeatureIncreasedLimits{}
_ PremiumFeatureClass = &PremiumFeatureIncreasedLimits{}
)
func (p *PremiumFeatureIncreasedLimits) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureIncreasedLimits) String() string {
if p == nil {
return "PremiumFeatureIncreasedLimits(nil)"
}
type Alias PremiumFeatureIncreasedLimits
return fmt.Sprintf("PremiumFeatureIncreasedLimits%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureIncreasedLimits) TypeID() uint32 {
return PremiumFeatureIncreasedLimitsTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureIncreasedLimits) TypeName() string {
return "premiumFeatureIncreasedLimits"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureIncreasedLimits) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureIncreasedLimits",
ID: PremiumFeatureIncreasedLimitsTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureIncreasedLimits) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureIncreasedLimits#6a6be1b7 as nil")
}
b.PutID(PremiumFeatureIncreasedLimitsTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureIncreasedLimits) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureIncreasedLimits#6a6be1b7 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureIncreasedLimits) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureIncreasedLimits#6a6be1b7 to nil")
}
if err := b.ConsumeID(PremiumFeatureIncreasedLimitsTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureIncreasedLimits#6a6be1b7: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureIncreasedLimits) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureIncreasedLimits#6a6be1b7 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureIncreasedLimits) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureIncreasedLimits#6a6be1b7 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureIncreasedLimits")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureIncreasedLimits) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureIncreasedLimits#6a6be1b7 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureIncreasedLimits"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureIncreasedLimits#6a6be1b7: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureIncreasedUploadFileSize represents TL type `premiumFeatureIncreasedUploadFileSize#6ccce473`.
type PremiumFeatureIncreasedUploadFileSize struct {
}
// PremiumFeatureIncreasedUploadFileSizeTypeID is TL type id of PremiumFeatureIncreasedUploadFileSize.
const PremiumFeatureIncreasedUploadFileSizeTypeID = 0x6ccce473
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureIncreasedUploadFileSize) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureIncreasedUploadFileSize.
var (
_ bin.Encoder = &PremiumFeatureIncreasedUploadFileSize{}
_ bin.Decoder = &PremiumFeatureIncreasedUploadFileSize{}
_ bin.BareEncoder = &PremiumFeatureIncreasedUploadFileSize{}
_ bin.BareDecoder = &PremiumFeatureIncreasedUploadFileSize{}
_ PremiumFeatureClass = &PremiumFeatureIncreasedUploadFileSize{}
)
func (p *PremiumFeatureIncreasedUploadFileSize) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureIncreasedUploadFileSize) String() string {
if p == nil {
return "PremiumFeatureIncreasedUploadFileSize(nil)"
}
type Alias PremiumFeatureIncreasedUploadFileSize
return fmt.Sprintf("PremiumFeatureIncreasedUploadFileSize%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureIncreasedUploadFileSize) TypeID() uint32 {
return PremiumFeatureIncreasedUploadFileSizeTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureIncreasedUploadFileSize) TypeName() string {
return "premiumFeatureIncreasedUploadFileSize"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureIncreasedUploadFileSize) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureIncreasedUploadFileSize",
ID: PremiumFeatureIncreasedUploadFileSizeTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureIncreasedUploadFileSize) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureIncreasedUploadFileSize#6ccce473 as nil")
}
b.PutID(PremiumFeatureIncreasedUploadFileSizeTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureIncreasedUploadFileSize) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureIncreasedUploadFileSize#6ccce473 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureIncreasedUploadFileSize) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureIncreasedUploadFileSize#6ccce473 to nil")
}
if err := b.ConsumeID(PremiumFeatureIncreasedUploadFileSizeTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureIncreasedUploadFileSize#6ccce473: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureIncreasedUploadFileSize) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureIncreasedUploadFileSize#6ccce473 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureIncreasedUploadFileSize) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureIncreasedUploadFileSize#6ccce473 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureIncreasedUploadFileSize")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureIncreasedUploadFileSize) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureIncreasedUploadFileSize#6ccce473 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureIncreasedUploadFileSize"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureIncreasedUploadFileSize#6ccce473: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureImprovedDownloadSpeed represents TL type `premiumFeatureImprovedDownloadSpeed#f00b4a3e`.
type PremiumFeatureImprovedDownloadSpeed struct {
}
// PremiumFeatureImprovedDownloadSpeedTypeID is TL type id of PremiumFeatureImprovedDownloadSpeed.
const PremiumFeatureImprovedDownloadSpeedTypeID = 0xf00b4a3e
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureImprovedDownloadSpeed) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureImprovedDownloadSpeed.
var (
_ bin.Encoder = &PremiumFeatureImprovedDownloadSpeed{}
_ bin.Decoder = &PremiumFeatureImprovedDownloadSpeed{}
_ bin.BareEncoder = &PremiumFeatureImprovedDownloadSpeed{}
_ bin.BareDecoder = &PremiumFeatureImprovedDownloadSpeed{}
_ PremiumFeatureClass = &PremiumFeatureImprovedDownloadSpeed{}
)
func (p *PremiumFeatureImprovedDownloadSpeed) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureImprovedDownloadSpeed) String() string {
if p == nil {
return "PremiumFeatureImprovedDownloadSpeed(nil)"
}
type Alias PremiumFeatureImprovedDownloadSpeed
return fmt.Sprintf("PremiumFeatureImprovedDownloadSpeed%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureImprovedDownloadSpeed) TypeID() uint32 {
return PremiumFeatureImprovedDownloadSpeedTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureImprovedDownloadSpeed) TypeName() string {
return "premiumFeatureImprovedDownloadSpeed"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureImprovedDownloadSpeed) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureImprovedDownloadSpeed",
ID: PremiumFeatureImprovedDownloadSpeedTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureImprovedDownloadSpeed) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureImprovedDownloadSpeed#f00b4a3e as nil")
}
b.PutID(PremiumFeatureImprovedDownloadSpeedTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureImprovedDownloadSpeed) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureImprovedDownloadSpeed#f00b4a3e as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureImprovedDownloadSpeed) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureImprovedDownloadSpeed#f00b4a3e to nil")
}
if err := b.ConsumeID(PremiumFeatureImprovedDownloadSpeedTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureImprovedDownloadSpeed#f00b4a3e: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureImprovedDownloadSpeed) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureImprovedDownloadSpeed#f00b4a3e to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureImprovedDownloadSpeed) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureImprovedDownloadSpeed#f00b4a3e as nil")
}
b.ObjStart()
b.PutID("premiumFeatureImprovedDownloadSpeed")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureImprovedDownloadSpeed) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureImprovedDownloadSpeed#f00b4a3e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureImprovedDownloadSpeed"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureImprovedDownloadSpeed#f00b4a3e: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureVoiceRecognition represents TL type `premiumFeatureVoiceRecognition#4cc89fde`.
type PremiumFeatureVoiceRecognition struct {
}
// PremiumFeatureVoiceRecognitionTypeID is TL type id of PremiumFeatureVoiceRecognition.
const PremiumFeatureVoiceRecognitionTypeID = 0x4cc89fde
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureVoiceRecognition) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureVoiceRecognition.
var (
_ bin.Encoder = &PremiumFeatureVoiceRecognition{}
_ bin.Decoder = &PremiumFeatureVoiceRecognition{}
_ bin.BareEncoder = &PremiumFeatureVoiceRecognition{}
_ bin.BareDecoder = &PremiumFeatureVoiceRecognition{}
_ PremiumFeatureClass = &PremiumFeatureVoiceRecognition{}
)
func (p *PremiumFeatureVoiceRecognition) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureVoiceRecognition) String() string {
if p == nil {
return "PremiumFeatureVoiceRecognition(nil)"
}
type Alias PremiumFeatureVoiceRecognition
return fmt.Sprintf("PremiumFeatureVoiceRecognition%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureVoiceRecognition) TypeID() uint32 {
return PremiumFeatureVoiceRecognitionTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureVoiceRecognition) TypeName() string {
return "premiumFeatureVoiceRecognition"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureVoiceRecognition) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureVoiceRecognition",
ID: PremiumFeatureVoiceRecognitionTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureVoiceRecognition) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureVoiceRecognition#4cc89fde as nil")
}
b.PutID(PremiumFeatureVoiceRecognitionTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureVoiceRecognition) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureVoiceRecognition#4cc89fde as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureVoiceRecognition) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureVoiceRecognition#4cc89fde to nil")
}
if err := b.ConsumeID(PremiumFeatureVoiceRecognitionTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureVoiceRecognition#4cc89fde: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureVoiceRecognition) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureVoiceRecognition#4cc89fde to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureVoiceRecognition) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureVoiceRecognition#4cc89fde as nil")
}
b.ObjStart()
b.PutID("premiumFeatureVoiceRecognition")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureVoiceRecognition) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureVoiceRecognition#4cc89fde to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureVoiceRecognition"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureVoiceRecognition#4cc89fde: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureDisabledAds represents TL type `premiumFeatureDisabledAds#8847624a`.
type PremiumFeatureDisabledAds struct {
}
// PremiumFeatureDisabledAdsTypeID is TL type id of PremiumFeatureDisabledAds.
const PremiumFeatureDisabledAdsTypeID = 0x8847624a
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureDisabledAds) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureDisabledAds.
var (
_ bin.Encoder = &PremiumFeatureDisabledAds{}
_ bin.Decoder = &PremiumFeatureDisabledAds{}
_ bin.BareEncoder = &PremiumFeatureDisabledAds{}
_ bin.BareDecoder = &PremiumFeatureDisabledAds{}
_ PremiumFeatureClass = &PremiumFeatureDisabledAds{}
)
func (p *PremiumFeatureDisabledAds) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureDisabledAds) String() string {
if p == nil {
return "PremiumFeatureDisabledAds(nil)"
}
type Alias PremiumFeatureDisabledAds
return fmt.Sprintf("PremiumFeatureDisabledAds%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureDisabledAds) TypeID() uint32 {
return PremiumFeatureDisabledAdsTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureDisabledAds) TypeName() string {
return "premiumFeatureDisabledAds"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureDisabledAds) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureDisabledAds",
ID: PremiumFeatureDisabledAdsTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureDisabledAds) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureDisabledAds#8847624a as nil")
}
b.PutID(PremiumFeatureDisabledAdsTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureDisabledAds) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureDisabledAds#8847624a as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureDisabledAds) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureDisabledAds#8847624a to nil")
}
if err := b.ConsumeID(PremiumFeatureDisabledAdsTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureDisabledAds#8847624a: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureDisabledAds) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureDisabledAds#8847624a to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureDisabledAds) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureDisabledAds#8847624a as nil")
}
b.ObjStart()
b.PutID("premiumFeatureDisabledAds")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureDisabledAds) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureDisabledAds#8847624a to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureDisabledAds"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureDisabledAds#8847624a: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureUniqueReactions represents TL type `premiumFeatureUniqueReactions#2db3b017`.
type PremiumFeatureUniqueReactions struct {
}
// PremiumFeatureUniqueReactionsTypeID is TL type id of PremiumFeatureUniqueReactions.
const PremiumFeatureUniqueReactionsTypeID = 0x2db3b017
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureUniqueReactions) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureUniqueReactions.
var (
_ bin.Encoder = &PremiumFeatureUniqueReactions{}
_ bin.Decoder = &PremiumFeatureUniqueReactions{}
_ bin.BareEncoder = &PremiumFeatureUniqueReactions{}
_ bin.BareDecoder = &PremiumFeatureUniqueReactions{}
_ PremiumFeatureClass = &PremiumFeatureUniqueReactions{}
)
func (p *PremiumFeatureUniqueReactions) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureUniqueReactions) String() string {
if p == nil {
return "PremiumFeatureUniqueReactions(nil)"
}
type Alias PremiumFeatureUniqueReactions
return fmt.Sprintf("PremiumFeatureUniqueReactions%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureUniqueReactions) TypeID() uint32 {
return PremiumFeatureUniqueReactionsTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureUniqueReactions) TypeName() string {
return "premiumFeatureUniqueReactions"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureUniqueReactions) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureUniqueReactions",
ID: PremiumFeatureUniqueReactionsTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureUniqueReactions) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUniqueReactions#2db3b017 as nil")
}
b.PutID(PremiumFeatureUniqueReactionsTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureUniqueReactions) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUniqueReactions#2db3b017 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureUniqueReactions) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUniqueReactions#2db3b017 to nil")
}
if err := b.ConsumeID(PremiumFeatureUniqueReactionsTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureUniqueReactions#2db3b017: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureUniqueReactions) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUniqueReactions#2db3b017 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureUniqueReactions) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUniqueReactions#2db3b017 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureUniqueReactions")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureUniqueReactions) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUniqueReactions#2db3b017 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureUniqueReactions"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureUniqueReactions#2db3b017: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureUniqueStickers represents TL type `premiumFeatureUniqueStickers#82b97c00`.
type PremiumFeatureUniqueStickers struct {
}
// PremiumFeatureUniqueStickersTypeID is TL type id of PremiumFeatureUniqueStickers.
const PremiumFeatureUniqueStickersTypeID = 0x82b97c00
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureUniqueStickers) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureUniqueStickers.
var (
_ bin.Encoder = &PremiumFeatureUniqueStickers{}
_ bin.Decoder = &PremiumFeatureUniqueStickers{}
_ bin.BareEncoder = &PremiumFeatureUniqueStickers{}
_ bin.BareDecoder = &PremiumFeatureUniqueStickers{}
_ PremiumFeatureClass = &PremiumFeatureUniqueStickers{}
)
func (p *PremiumFeatureUniqueStickers) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureUniqueStickers) String() string {
if p == nil {
return "PremiumFeatureUniqueStickers(nil)"
}
type Alias PremiumFeatureUniqueStickers
return fmt.Sprintf("PremiumFeatureUniqueStickers%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureUniqueStickers) TypeID() uint32 {
return PremiumFeatureUniqueStickersTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureUniqueStickers) TypeName() string {
return "premiumFeatureUniqueStickers"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureUniqueStickers) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureUniqueStickers",
ID: PremiumFeatureUniqueStickersTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureUniqueStickers) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUniqueStickers#82b97c00 as nil")
}
b.PutID(PremiumFeatureUniqueStickersTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureUniqueStickers) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUniqueStickers#82b97c00 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureUniqueStickers) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUniqueStickers#82b97c00 to nil")
}
if err := b.ConsumeID(PremiumFeatureUniqueStickersTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureUniqueStickers#82b97c00: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureUniqueStickers) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUniqueStickers#82b97c00 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureUniqueStickers) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUniqueStickers#82b97c00 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureUniqueStickers")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureUniqueStickers) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUniqueStickers#82b97c00 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureUniqueStickers"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureUniqueStickers#82b97c00: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureCustomEmoji represents TL type `premiumFeatureCustomEmoji#4f6ddb4c`.
type PremiumFeatureCustomEmoji struct {
}
// PremiumFeatureCustomEmojiTypeID is TL type id of PremiumFeatureCustomEmoji.
const PremiumFeatureCustomEmojiTypeID = 0x4f6ddb4c
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureCustomEmoji) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureCustomEmoji.
var (
_ bin.Encoder = &PremiumFeatureCustomEmoji{}
_ bin.Decoder = &PremiumFeatureCustomEmoji{}
_ bin.BareEncoder = &PremiumFeatureCustomEmoji{}
_ bin.BareDecoder = &PremiumFeatureCustomEmoji{}
_ PremiumFeatureClass = &PremiumFeatureCustomEmoji{}
)
func (p *PremiumFeatureCustomEmoji) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureCustomEmoji) String() string {
if p == nil {
return "PremiumFeatureCustomEmoji(nil)"
}
type Alias PremiumFeatureCustomEmoji
return fmt.Sprintf("PremiumFeatureCustomEmoji%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureCustomEmoji) TypeID() uint32 {
return PremiumFeatureCustomEmojiTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureCustomEmoji) TypeName() string {
return "premiumFeatureCustomEmoji"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureCustomEmoji) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureCustomEmoji",
ID: PremiumFeatureCustomEmojiTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureCustomEmoji) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureCustomEmoji#4f6ddb4c as nil")
}
b.PutID(PremiumFeatureCustomEmojiTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureCustomEmoji) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureCustomEmoji#4f6ddb4c as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureCustomEmoji) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureCustomEmoji#4f6ddb4c to nil")
}
if err := b.ConsumeID(PremiumFeatureCustomEmojiTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureCustomEmoji#4f6ddb4c: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureCustomEmoji) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureCustomEmoji#4f6ddb4c to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureCustomEmoji) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureCustomEmoji#4f6ddb4c as nil")
}
b.ObjStart()
b.PutID("premiumFeatureCustomEmoji")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureCustomEmoji) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureCustomEmoji#4f6ddb4c to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureCustomEmoji"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureCustomEmoji#4f6ddb4c: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureAdvancedChatManagement represents TL type `premiumFeatureAdvancedChatManagement#2f774d1a`.
type PremiumFeatureAdvancedChatManagement struct {
}
// PremiumFeatureAdvancedChatManagementTypeID is TL type id of PremiumFeatureAdvancedChatManagement.
const PremiumFeatureAdvancedChatManagementTypeID = 0x2f774d1a
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureAdvancedChatManagement) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureAdvancedChatManagement.
var (
_ bin.Encoder = &PremiumFeatureAdvancedChatManagement{}
_ bin.Decoder = &PremiumFeatureAdvancedChatManagement{}
_ bin.BareEncoder = &PremiumFeatureAdvancedChatManagement{}
_ bin.BareDecoder = &PremiumFeatureAdvancedChatManagement{}
_ PremiumFeatureClass = &PremiumFeatureAdvancedChatManagement{}
)
func (p *PremiumFeatureAdvancedChatManagement) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureAdvancedChatManagement) String() string {
if p == nil {
return "PremiumFeatureAdvancedChatManagement(nil)"
}
type Alias PremiumFeatureAdvancedChatManagement
return fmt.Sprintf("PremiumFeatureAdvancedChatManagement%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureAdvancedChatManagement) TypeID() uint32 {
return PremiumFeatureAdvancedChatManagementTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureAdvancedChatManagement) TypeName() string {
return "premiumFeatureAdvancedChatManagement"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureAdvancedChatManagement) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureAdvancedChatManagement",
ID: PremiumFeatureAdvancedChatManagementTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureAdvancedChatManagement) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAdvancedChatManagement#2f774d1a as nil")
}
b.PutID(PremiumFeatureAdvancedChatManagementTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureAdvancedChatManagement) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAdvancedChatManagement#2f774d1a as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureAdvancedChatManagement) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAdvancedChatManagement#2f774d1a to nil")
}
if err := b.ConsumeID(PremiumFeatureAdvancedChatManagementTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureAdvancedChatManagement#2f774d1a: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureAdvancedChatManagement) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAdvancedChatManagement#2f774d1a to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureAdvancedChatManagement) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAdvancedChatManagement#2f774d1a as nil")
}
b.ObjStart()
b.PutID("premiumFeatureAdvancedChatManagement")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureAdvancedChatManagement) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAdvancedChatManagement#2f774d1a to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureAdvancedChatManagement"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureAdvancedChatManagement#2f774d1a: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureProfileBadge represents TL type `premiumFeatureProfileBadge#ded30c2`.
type PremiumFeatureProfileBadge struct {
}
// PremiumFeatureProfileBadgeTypeID is TL type id of PremiumFeatureProfileBadge.
const PremiumFeatureProfileBadgeTypeID = 0xded30c2
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureProfileBadge) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureProfileBadge.
var (
_ bin.Encoder = &PremiumFeatureProfileBadge{}
_ bin.Decoder = &PremiumFeatureProfileBadge{}
_ bin.BareEncoder = &PremiumFeatureProfileBadge{}
_ bin.BareDecoder = &PremiumFeatureProfileBadge{}
_ PremiumFeatureClass = &PremiumFeatureProfileBadge{}
)
func (p *PremiumFeatureProfileBadge) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureProfileBadge) String() string {
if p == nil {
return "PremiumFeatureProfileBadge(nil)"
}
type Alias PremiumFeatureProfileBadge
return fmt.Sprintf("PremiumFeatureProfileBadge%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureProfileBadge) TypeID() uint32 {
return PremiumFeatureProfileBadgeTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureProfileBadge) TypeName() string {
return "premiumFeatureProfileBadge"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureProfileBadge) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureProfileBadge",
ID: PremiumFeatureProfileBadgeTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureProfileBadge) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureProfileBadge#ded30c2 as nil")
}
b.PutID(PremiumFeatureProfileBadgeTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureProfileBadge) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureProfileBadge#ded30c2 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureProfileBadge) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureProfileBadge#ded30c2 to nil")
}
if err := b.ConsumeID(PremiumFeatureProfileBadgeTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureProfileBadge#ded30c2: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureProfileBadge) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureProfileBadge#ded30c2 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureProfileBadge) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureProfileBadge#ded30c2 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureProfileBadge")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureProfileBadge) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureProfileBadge#ded30c2 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureProfileBadge"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureProfileBadge#ded30c2: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureEmojiStatus represents TL type `premiumFeatureEmojiStatus#fdd2cce1`.
type PremiumFeatureEmojiStatus struct {
}
// PremiumFeatureEmojiStatusTypeID is TL type id of PremiumFeatureEmojiStatus.
const PremiumFeatureEmojiStatusTypeID = 0xfdd2cce1
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureEmojiStatus) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureEmojiStatus.
var (
_ bin.Encoder = &PremiumFeatureEmojiStatus{}
_ bin.Decoder = &PremiumFeatureEmojiStatus{}
_ bin.BareEncoder = &PremiumFeatureEmojiStatus{}
_ bin.BareDecoder = &PremiumFeatureEmojiStatus{}
_ PremiumFeatureClass = &PremiumFeatureEmojiStatus{}
)
func (p *PremiumFeatureEmojiStatus) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureEmojiStatus) String() string {
if p == nil {
return "PremiumFeatureEmojiStatus(nil)"
}
type Alias PremiumFeatureEmojiStatus
return fmt.Sprintf("PremiumFeatureEmojiStatus%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureEmojiStatus) TypeID() uint32 {
return PremiumFeatureEmojiStatusTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureEmojiStatus) TypeName() string {
return "premiumFeatureEmojiStatus"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureEmojiStatus) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureEmojiStatus",
ID: PremiumFeatureEmojiStatusTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureEmojiStatus) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureEmojiStatus#fdd2cce1 as nil")
}
b.PutID(PremiumFeatureEmojiStatusTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureEmojiStatus) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureEmojiStatus#fdd2cce1 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureEmojiStatus) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureEmojiStatus#fdd2cce1 to nil")
}
if err := b.ConsumeID(PremiumFeatureEmojiStatusTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureEmojiStatus#fdd2cce1: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureEmojiStatus) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureEmojiStatus#fdd2cce1 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureEmojiStatus) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureEmojiStatus#fdd2cce1 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureEmojiStatus")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureEmojiStatus) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureEmojiStatus#fdd2cce1 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureEmojiStatus"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureEmojiStatus#fdd2cce1: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureAnimatedProfilePhoto represents TL type `premiumFeatureAnimatedProfilePhoto#f9fecce6`.
type PremiumFeatureAnimatedProfilePhoto struct {
}
// PremiumFeatureAnimatedProfilePhotoTypeID is TL type id of PremiumFeatureAnimatedProfilePhoto.
const PremiumFeatureAnimatedProfilePhotoTypeID = 0xf9fecce6
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureAnimatedProfilePhoto) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureAnimatedProfilePhoto.
var (
_ bin.Encoder = &PremiumFeatureAnimatedProfilePhoto{}
_ bin.Decoder = &PremiumFeatureAnimatedProfilePhoto{}
_ bin.BareEncoder = &PremiumFeatureAnimatedProfilePhoto{}
_ bin.BareDecoder = &PremiumFeatureAnimatedProfilePhoto{}
_ PremiumFeatureClass = &PremiumFeatureAnimatedProfilePhoto{}
)
func (p *PremiumFeatureAnimatedProfilePhoto) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureAnimatedProfilePhoto) String() string {
if p == nil {
return "PremiumFeatureAnimatedProfilePhoto(nil)"
}
type Alias PremiumFeatureAnimatedProfilePhoto
return fmt.Sprintf("PremiumFeatureAnimatedProfilePhoto%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureAnimatedProfilePhoto) TypeID() uint32 {
return PremiumFeatureAnimatedProfilePhotoTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureAnimatedProfilePhoto) TypeName() string {
return "premiumFeatureAnimatedProfilePhoto"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureAnimatedProfilePhoto) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureAnimatedProfilePhoto",
ID: PremiumFeatureAnimatedProfilePhotoTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureAnimatedProfilePhoto) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAnimatedProfilePhoto#f9fecce6 as nil")
}
b.PutID(PremiumFeatureAnimatedProfilePhotoTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureAnimatedProfilePhoto) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAnimatedProfilePhoto#f9fecce6 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureAnimatedProfilePhoto) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAnimatedProfilePhoto#f9fecce6 to nil")
}
if err := b.ConsumeID(PremiumFeatureAnimatedProfilePhotoTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureAnimatedProfilePhoto#f9fecce6: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureAnimatedProfilePhoto) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAnimatedProfilePhoto#f9fecce6 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureAnimatedProfilePhoto) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAnimatedProfilePhoto#f9fecce6 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureAnimatedProfilePhoto")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureAnimatedProfilePhoto) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAnimatedProfilePhoto#f9fecce6 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureAnimatedProfilePhoto"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureAnimatedProfilePhoto#f9fecce6: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureForumTopicIcon represents TL type `premiumFeatureForumTopicIcon#ceef6342`.
type PremiumFeatureForumTopicIcon struct {
}
// PremiumFeatureForumTopicIconTypeID is TL type id of PremiumFeatureForumTopicIcon.
const PremiumFeatureForumTopicIconTypeID = 0xceef6342
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureForumTopicIcon) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureForumTopicIcon.
var (
_ bin.Encoder = &PremiumFeatureForumTopicIcon{}
_ bin.Decoder = &PremiumFeatureForumTopicIcon{}
_ bin.BareEncoder = &PremiumFeatureForumTopicIcon{}
_ bin.BareDecoder = &PremiumFeatureForumTopicIcon{}
_ PremiumFeatureClass = &PremiumFeatureForumTopicIcon{}
)
func (p *PremiumFeatureForumTopicIcon) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureForumTopicIcon) String() string {
if p == nil {
return "PremiumFeatureForumTopicIcon(nil)"
}
type Alias PremiumFeatureForumTopicIcon
return fmt.Sprintf("PremiumFeatureForumTopicIcon%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureForumTopicIcon) TypeID() uint32 {
return PremiumFeatureForumTopicIconTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureForumTopicIcon) TypeName() string {
return "premiumFeatureForumTopicIcon"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureForumTopicIcon) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureForumTopicIcon",
ID: PremiumFeatureForumTopicIconTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureForumTopicIcon) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureForumTopicIcon#ceef6342 as nil")
}
b.PutID(PremiumFeatureForumTopicIconTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureForumTopicIcon) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureForumTopicIcon#ceef6342 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureForumTopicIcon) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureForumTopicIcon#ceef6342 to nil")
}
if err := b.ConsumeID(PremiumFeatureForumTopicIconTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureForumTopicIcon#ceef6342: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureForumTopicIcon) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureForumTopicIcon#ceef6342 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureForumTopicIcon) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureForumTopicIcon#ceef6342 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureForumTopicIcon")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureForumTopicIcon) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureForumTopicIcon#ceef6342 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureForumTopicIcon"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureForumTopicIcon#ceef6342: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureAppIcons represents TL type `premiumFeatureAppIcons#5e79f489`.
type PremiumFeatureAppIcons struct {
}
// PremiumFeatureAppIconsTypeID is TL type id of PremiumFeatureAppIcons.
const PremiumFeatureAppIconsTypeID = 0x5e79f489
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureAppIcons) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureAppIcons.
var (
_ bin.Encoder = &PremiumFeatureAppIcons{}
_ bin.Decoder = &PremiumFeatureAppIcons{}
_ bin.BareEncoder = &PremiumFeatureAppIcons{}
_ bin.BareDecoder = &PremiumFeatureAppIcons{}
_ PremiumFeatureClass = &PremiumFeatureAppIcons{}
)
func (p *PremiumFeatureAppIcons) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureAppIcons) String() string {
if p == nil {
return "PremiumFeatureAppIcons(nil)"
}
type Alias PremiumFeatureAppIcons
return fmt.Sprintf("PremiumFeatureAppIcons%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureAppIcons) TypeID() uint32 {
return PremiumFeatureAppIconsTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureAppIcons) TypeName() string {
return "premiumFeatureAppIcons"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureAppIcons) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureAppIcons",
ID: PremiumFeatureAppIconsTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureAppIcons) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAppIcons#5e79f489 as nil")
}
b.PutID(PremiumFeatureAppIconsTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureAppIcons) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAppIcons#5e79f489 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureAppIcons) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAppIcons#5e79f489 to nil")
}
if err := b.ConsumeID(PremiumFeatureAppIconsTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureAppIcons#5e79f489: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureAppIcons) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAppIcons#5e79f489 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureAppIcons) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAppIcons#5e79f489 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureAppIcons")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureAppIcons) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAppIcons#5e79f489 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureAppIcons"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureAppIcons#5e79f489: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureRealTimeChatTranslation represents TL type `premiumFeatureRealTimeChatTranslation#bbd80280`.
type PremiumFeatureRealTimeChatTranslation struct {
}
// PremiumFeatureRealTimeChatTranslationTypeID is TL type id of PremiumFeatureRealTimeChatTranslation.
const PremiumFeatureRealTimeChatTranslationTypeID = 0xbbd80280
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureRealTimeChatTranslation) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureRealTimeChatTranslation.
var (
_ bin.Encoder = &PremiumFeatureRealTimeChatTranslation{}
_ bin.Decoder = &PremiumFeatureRealTimeChatTranslation{}
_ bin.BareEncoder = &PremiumFeatureRealTimeChatTranslation{}
_ bin.BareDecoder = &PremiumFeatureRealTimeChatTranslation{}
_ PremiumFeatureClass = &PremiumFeatureRealTimeChatTranslation{}
)
func (p *PremiumFeatureRealTimeChatTranslation) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureRealTimeChatTranslation) String() string {
if p == nil {
return "PremiumFeatureRealTimeChatTranslation(nil)"
}
type Alias PremiumFeatureRealTimeChatTranslation
return fmt.Sprintf("PremiumFeatureRealTimeChatTranslation%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureRealTimeChatTranslation) TypeID() uint32 {
return PremiumFeatureRealTimeChatTranslationTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureRealTimeChatTranslation) TypeName() string {
return "premiumFeatureRealTimeChatTranslation"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureRealTimeChatTranslation) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureRealTimeChatTranslation",
ID: PremiumFeatureRealTimeChatTranslationTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureRealTimeChatTranslation) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureRealTimeChatTranslation#bbd80280 as nil")
}
b.PutID(PremiumFeatureRealTimeChatTranslationTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureRealTimeChatTranslation) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureRealTimeChatTranslation#bbd80280 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureRealTimeChatTranslation) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureRealTimeChatTranslation#bbd80280 to nil")
}
if err := b.ConsumeID(PremiumFeatureRealTimeChatTranslationTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureRealTimeChatTranslation#bbd80280: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureRealTimeChatTranslation) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureRealTimeChatTranslation#bbd80280 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureRealTimeChatTranslation) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureRealTimeChatTranslation#bbd80280 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureRealTimeChatTranslation")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureRealTimeChatTranslation) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureRealTimeChatTranslation#bbd80280 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureRealTimeChatTranslation"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureRealTimeChatTranslation#bbd80280: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureUpgradedStories represents TL type `premiumFeatureUpgradedStories#9008051b`.
type PremiumFeatureUpgradedStories struct {
}
// PremiumFeatureUpgradedStoriesTypeID is TL type id of PremiumFeatureUpgradedStories.
const PremiumFeatureUpgradedStoriesTypeID = 0x9008051b
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureUpgradedStories) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureUpgradedStories.
var (
_ bin.Encoder = &PremiumFeatureUpgradedStories{}
_ bin.Decoder = &PremiumFeatureUpgradedStories{}
_ bin.BareEncoder = &PremiumFeatureUpgradedStories{}
_ bin.BareDecoder = &PremiumFeatureUpgradedStories{}
_ PremiumFeatureClass = &PremiumFeatureUpgradedStories{}
)
func (p *PremiumFeatureUpgradedStories) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureUpgradedStories) String() string {
if p == nil {
return "PremiumFeatureUpgradedStories(nil)"
}
type Alias PremiumFeatureUpgradedStories
return fmt.Sprintf("PremiumFeatureUpgradedStories%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureUpgradedStories) TypeID() uint32 {
return PremiumFeatureUpgradedStoriesTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureUpgradedStories) TypeName() string {
return "premiumFeatureUpgradedStories"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureUpgradedStories) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureUpgradedStories",
ID: PremiumFeatureUpgradedStoriesTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureUpgradedStories) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUpgradedStories#9008051b as nil")
}
b.PutID(PremiumFeatureUpgradedStoriesTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureUpgradedStories) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUpgradedStories#9008051b as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureUpgradedStories) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUpgradedStories#9008051b to nil")
}
if err := b.ConsumeID(PremiumFeatureUpgradedStoriesTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureUpgradedStories#9008051b: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureUpgradedStories) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUpgradedStories#9008051b to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureUpgradedStories) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureUpgradedStories#9008051b as nil")
}
b.ObjStart()
b.PutID("premiumFeatureUpgradedStories")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureUpgradedStories) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureUpgradedStories#9008051b to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureUpgradedStories"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureUpgradedStories#9008051b: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureChatBoost represents TL type `premiumFeatureChatBoost#5df89f1b`.
type PremiumFeatureChatBoost struct {
}
// PremiumFeatureChatBoostTypeID is TL type id of PremiumFeatureChatBoost.
const PremiumFeatureChatBoostTypeID = 0x5df89f1b
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureChatBoost) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureChatBoost.
var (
_ bin.Encoder = &PremiumFeatureChatBoost{}
_ bin.Decoder = &PremiumFeatureChatBoost{}
_ bin.BareEncoder = &PremiumFeatureChatBoost{}
_ bin.BareDecoder = &PremiumFeatureChatBoost{}
_ PremiumFeatureClass = &PremiumFeatureChatBoost{}
)
func (p *PremiumFeatureChatBoost) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureChatBoost) String() string {
if p == nil {
return "PremiumFeatureChatBoost(nil)"
}
type Alias PremiumFeatureChatBoost
return fmt.Sprintf("PremiumFeatureChatBoost%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureChatBoost) TypeID() uint32 {
return PremiumFeatureChatBoostTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureChatBoost) TypeName() string {
return "premiumFeatureChatBoost"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureChatBoost) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureChatBoost",
ID: PremiumFeatureChatBoostTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureChatBoost) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureChatBoost#5df89f1b as nil")
}
b.PutID(PremiumFeatureChatBoostTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureChatBoost) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureChatBoost#5df89f1b as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureChatBoost) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureChatBoost#5df89f1b to nil")
}
if err := b.ConsumeID(PremiumFeatureChatBoostTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureChatBoost#5df89f1b: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureChatBoost) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureChatBoost#5df89f1b to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureChatBoost) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureChatBoost#5df89f1b as nil")
}
b.ObjStart()
b.PutID("premiumFeatureChatBoost")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureChatBoost) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureChatBoost#5df89f1b to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureChatBoost"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureChatBoost#5df89f1b: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureAccentColor represents TL type `premiumFeatureAccentColor#361ac59e`.
type PremiumFeatureAccentColor struct {
}
// PremiumFeatureAccentColorTypeID is TL type id of PremiumFeatureAccentColor.
const PremiumFeatureAccentColorTypeID = 0x361ac59e
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureAccentColor) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureAccentColor.
var (
_ bin.Encoder = &PremiumFeatureAccentColor{}
_ bin.Decoder = &PremiumFeatureAccentColor{}
_ bin.BareEncoder = &PremiumFeatureAccentColor{}
_ bin.BareDecoder = &PremiumFeatureAccentColor{}
_ PremiumFeatureClass = &PremiumFeatureAccentColor{}
)
func (p *PremiumFeatureAccentColor) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureAccentColor) String() string {
if p == nil {
return "PremiumFeatureAccentColor(nil)"
}
type Alias PremiumFeatureAccentColor
return fmt.Sprintf("PremiumFeatureAccentColor%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureAccentColor) TypeID() uint32 {
return PremiumFeatureAccentColorTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureAccentColor) TypeName() string {
return "premiumFeatureAccentColor"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureAccentColor) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureAccentColor",
ID: PremiumFeatureAccentColorTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureAccentColor) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAccentColor#361ac59e as nil")
}
b.PutID(PremiumFeatureAccentColorTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureAccentColor) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAccentColor#361ac59e as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureAccentColor) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAccentColor#361ac59e to nil")
}
if err := b.ConsumeID(PremiumFeatureAccentColorTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureAccentColor#361ac59e: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureAccentColor) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAccentColor#361ac59e to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureAccentColor) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureAccentColor#361ac59e as nil")
}
b.ObjStart()
b.PutID("premiumFeatureAccentColor")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureAccentColor) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureAccentColor#361ac59e to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureAccentColor"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureAccentColor#361ac59e: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureBackgroundForBoth represents TL type `premiumFeatureBackgroundForBoth#2246eefa`.
type PremiumFeatureBackgroundForBoth struct {
}
// PremiumFeatureBackgroundForBothTypeID is TL type id of PremiumFeatureBackgroundForBoth.
const PremiumFeatureBackgroundForBothTypeID = 0x2246eefa
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureBackgroundForBoth) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureBackgroundForBoth.
var (
_ bin.Encoder = &PremiumFeatureBackgroundForBoth{}
_ bin.Decoder = &PremiumFeatureBackgroundForBoth{}
_ bin.BareEncoder = &PremiumFeatureBackgroundForBoth{}
_ bin.BareDecoder = &PremiumFeatureBackgroundForBoth{}
_ PremiumFeatureClass = &PremiumFeatureBackgroundForBoth{}
)
func (p *PremiumFeatureBackgroundForBoth) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureBackgroundForBoth) String() string {
if p == nil {
return "PremiumFeatureBackgroundForBoth(nil)"
}
type Alias PremiumFeatureBackgroundForBoth
return fmt.Sprintf("PremiumFeatureBackgroundForBoth%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureBackgroundForBoth) TypeID() uint32 {
return PremiumFeatureBackgroundForBothTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureBackgroundForBoth) TypeName() string {
return "premiumFeatureBackgroundForBoth"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureBackgroundForBoth) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureBackgroundForBoth",
ID: PremiumFeatureBackgroundForBothTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureBackgroundForBoth) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureBackgroundForBoth#2246eefa as nil")
}
b.PutID(PremiumFeatureBackgroundForBothTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureBackgroundForBoth) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureBackgroundForBoth#2246eefa as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureBackgroundForBoth) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureBackgroundForBoth#2246eefa to nil")
}
if err := b.ConsumeID(PremiumFeatureBackgroundForBothTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureBackgroundForBoth#2246eefa: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureBackgroundForBoth) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureBackgroundForBoth#2246eefa to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureBackgroundForBoth) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureBackgroundForBoth#2246eefa as nil")
}
b.ObjStart()
b.PutID("premiumFeatureBackgroundForBoth")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureBackgroundForBoth) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureBackgroundForBoth#2246eefa to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureBackgroundForBoth"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureBackgroundForBoth#2246eefa: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureSavedMessagesTags represents TL type `premiumFeatureSavedMessagesTags#3bcbe986`.
type PremiumFeatureSavedMessagesTags struct {
}
// PremiumFeatureSavedMessagesTagsTypeID is TL type id of PremiumFeatureSavedMessagesTags.
const PremiumFeatureSavedMessagesTagsTypeID = 0x3bcbe986
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureSavedMessagesTags) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureSavedMessagesTags.
var (
_ bin.Encoder = &PremiumFeatureSavedMessagesTags{}
_ bin.Decoder = &PremiumFeatureSavedMessagesTags{}
_ bin.BareEncoder = &PremiumFeatureSavedMessagesTags{}
_ bin.BareDecoder = &PremiumFeatureSavedMessagesTags{}
_ PremiumFeatureClass = &PremiumFeatureSavedMessagesTags{}
)
func (p *PremiumFeatureSavedMessagesTags) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureSavedMessagesTags) String() string {
if p == nil {
return "PremiumFeatureSavedMessagesTags(nil)"
}
type Alias PremiumFeatureSavedMessagesTags
return fmt.Sprintf("PremiumFeatureSavedMessagesTags%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureSavedMessagesTags) TypeID() uint32 {
return PremiumFeatureSavedMessagesTagsTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureSavedMessagesTags) TypeName() string {
return "premiumFeatureSavedMessagesTags"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureSavedMessagesTags) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureSavedMessagesTags",
ID: PremiumFeatureSavedMessagesTagsTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureSavedMessagesTags) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureSavedMessagesTags#3bcbe986 as nil")
}
b.PutID(PremiumFeatureSavedMessagesTagsTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureSavedMessagesTags) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureSavedMessagesTags#3bcbe986 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureSavedMessagesTags) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureSavedMessagesTags#3bcbe986 to nil")
}
if err := b.ConsumeID(PremiumFeatureSavedMessagesTagsTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureSavedMessagesTags#3bcbe986: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureSavedMessagesTags) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureSavedMessagesTags#3bcbe986 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureSavedMessagesTags) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureSavedMessagesTags#3bcbe986 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureSavedMessagesTags")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureSavedMessagesTags) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureSavedMessagesTags#3bcbe986 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureSavedMessagesTags"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureSavedMessagesTags#3bcbe986: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureMessagePrivacy represents TL type `premiumFeatureMessagePrivacy#2fd278f6`.
type PremiumFeatureMessagePrivacy struct {
}
// PremiumFeatureMessagePrivacyTypeID is TL type id of PremiumFeatureMessagePrivacy.
const PremiumFeatureMessagePrivacyTypeID = 0x2fd278f6
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureMessagePrivacy) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureMessagePrivacy.
var (
_ bin.Encoder = &PremiumFeatureMessagePrivacy{}
_ bin.Decoder = &PremiumFeatureMessagePrivacy{}
_ bin.BareEncoder = &PremiumFeatureMessagePrivacy{}
_ bin.BareDecoder = &PremiumFeatureMessagePrivacy{}
_ PremiumFeatureClass = &PremiumFeatureMessagePrivacy{}
)
func (p *PremiumFeatureMessagePrivacy) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureMessagePrivacy) String() string {
if p == nil {
return "PremiumFeatureMessagePrivacy(nil)"
}
type Alias PremiumFeatureMessagePrivacy
return fmt.Sprintf("PremiumFeatureMessagePrivacy%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureMessagePrivacy) TypeID() uint32 {
return PremiumFeatureMessagePrivacyTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureMessagePrivacy) TypeName() string {
return "premiumFeatureMessagePrivacy"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureMessagePrivacy) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureMessagePrivacy",
ID: PremiumFeatureMessagePrivacyTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureMessagePrivacy) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureMessagePrivacy#2fd278f6 as nil")
}
b.PutID(PremiumFeatureMessagePrivacyTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureMessagePrivacy) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureMessagePrivacy#2fd278f6 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureMessagePrivacy) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureMessagePrivacy#2fd278f6 to nil")
}
if err := b.ConsumeID(PremiumFeatureMessagePrivacyTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureMessagePrivacy#2fd278f6: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureMessagePrivacy) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureMessagePrivacy#2fd278f6 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureMessagePrivacy) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureMessagePrivacy#2fd278f6 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureMessagePrivacy")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureMessagePrivacy) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureMessagePrivacy#2fd278f6 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureMessagePrivacy"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureMessagePrivacy#2fd278f6: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureLastSeenTimes represents TL type `premiumFeatureLastSeenTimes#d2914a8f`.
type PremiumFeatureLastSeenTimes struct {
}
// PremiumFeatureLastSeenTimesTypeID is TL type id of PremiumFeatureLastSeenTimes.
const PremiumFeatureLastSeenTimesTypeID = 0xd2914a8f
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureLastSeenTimes) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureLastSeenTimes.
var (
_ bin.Encoder = &PremiumFeatureLastSeenTimes{}
_ bin.Decoder = &PremiumFeatureLastSeenTimes{}
_ bin.BareEncoder = &PremiumFeatureLastSeenTimes{}
_ bin.BareDecoder = &PremiumFeatureLastSeenTimes{}
_ PremiumFeatureClass = &PremiumFeatureLastSeenTimes{}
)
func (p *PremiumFeatureLastSeenTimes) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureLastSeenTimes) String() string {
if p == nil {
return "PremiumFeatureLastSeenTimes(nil)"
}
type Alias PremiumFeatureLastSeenTimes
return fmt.Sprintf("PremiumFeatureLastSeenTimes%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureLastSeenTimes) TypeID() uint32 {
return PremiumFeatureLastSeenTimesTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureLastSeenTimes) TypeName() string {
return "premiumFeatureLastSeenTimes"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureLastSeenTimes) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureLastSeenTimes",
ID: PremiumFeatureLastSeenTimesTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureLastSeenTimes) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureLastSeenTimes#d2914a8f as nil")
}
b.PutID(PremiumFeatureLastSeenTimesTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureLastSeenTimes) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureLastSeenTimes#d2914a8f as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureLastSeenTimes) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureLastSeenTimes#d2914a8f to nil")
}
if err := b.ConsumeID(PremiumFeatureLastSeenTimesTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureLastSeenTimes#d2914a8f: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureLastSeenTimes) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureLastSeenTimes#d2914a8f to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureLastSeenTimes) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureLastSeenTimes#d2914a8f as nil")
}
b.ObjStart()
b.PutID("premiumFeatureLastSeenTimes")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureLastSeenTimes) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureLastSeenTimes#d2914a8f to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureLastSeenTimes"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureLastSeenTimes#d2914a8f: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureBusiness represents TL type `premiumFeatureBusiness#a6609704`.
type PremiumFeatureBusiness struct {
}
// PremiumFeatureBusinessTypeID is TL type id of PremiumFeatureBusiness.
const PremiumFeatureBusinessTypeID = 0xa6609704
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureBusiness) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureBusiness.
var (
_ bin.Encoder = &PremiumFeatureBusiness{}
_ bin.Decoder = &PremiumFeatureBusiness{}
_ bin.BareEncoder = &PremiumFeatureBusiness{}
_ bin.BareDecoder = &PremiumFeatureBusiness{}
_ PremiumFeatureClass = &PremiumFeatureBusiness{}
)
func (p *PremiumFeatureBusiness) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureBusiness) String() string {
if p == nil {
return "PremiumFeatureBusiness(nil)"
}
type Alias PremiumFeatureBusiness
return fmt.Sprintf("PremiumFeatureBusiness%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureBusiness) TypeID() uint32 {
return PremiumFeatureBusinessTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureBusiness) TypeName() string {
return "premiumFeatureBusiness"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureBusiness) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureBusiness",
ID: PremiumFeatureBusinessTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureBusiness) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureBusiness#a6609704 as nil")
}
b.PutID(PremiumFeatureBusinessTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureBusiness) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureBusiness#a6609704 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureBusiness) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureBusiness#a6609704 to nil")
}
if err := b.ConsumeID(PremiumFeatureBusinessTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureBusiness#a6609704: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureBusiness) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureBusiness#a6609704 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureBusiness) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureBusiness#a6609704 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureBusiness")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureBusiness) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureBusiness#a6609704 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureBusiness"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureBusiness#a6609704: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureMessageEffects represents TL type `premiumFeatureMessageEffects#d4e35061`.
type PremiumFeatureMessageEffects struct {
}
// PremiumFeatureMessageEffectsTypeID is TL type id of PremiumFeatureMessageEffects.
const PremiumFeatureMessageEffectsTypeID = 0xd4e35061
// construct implements constructor of PremiumFeatureClass.
func (p PremiumFeatureMessageEffects) construct() PremiumFeatureClass { return &p }
// Ensuring interfaces in compile-time for PremiumFeatureMessageEffects.
var (
_ bin.Encoder = &PremiumFeatureMessageEffects{}
_ bin.Decoder = &PremiumFeatureMessageEffects{}
_ bin.BareEncoder = &PremiumFeatureMessageEffects{}
_ bin.BareDecoder = &PremiumFeatureMessageEffects{}
_ PremiumFeatureClass = &PremiumFeatureMessageEffects{}
)
func (p *PremiumFeatureMessageEffects) Zero() bool {
if p == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (p *PremiumFeatureMessageEffects) String() string {
if p == nil {
return "PremiumFeatureMessageEffects(nil)"
}
type Alias PremiumFeatureMessageEffects
return fmt.Sprintf("PremiumFeatureMessageEffects%+v", Alias(*p))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PremiumFeatureMessageEffects) TypeID() uint32 {
return PremiumFeatureMessageEffectsTypeID
}
// TypeName returns name of type in TL schema.
func (*PremiumFeatureMessageEffects) TypeName() string {
return "premiumFeatureMessageEffects"
}
// TypeInfo returns info about TL type.
func (p *PremiumFeatureMessageEffects) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "premiumFeatureMessageEffects",
ID: PremiumFeatureMessageEffectsTypeID,
}
if p == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (p *PremiumFeatureMessageEffects) Encode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureMessageEffects#d4e35061 as nil")
}
b.PutID(PremiumFeatureMessageEffectsTypeID)
return p.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (p *PremiumFeatureMessageEffects) EncodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureMessageEffects#d4e35061 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (p *PremiumFeatureMessageEffects) Decode(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureMessageEffects#d4e35061 to nil")
}
if err := b.ConsumeID(PremiumFeatureMessageEffectsTypeID); err != nil {
return fmt.Errorf("unable to decode premiumFeatureMessageEffects#d4e35061: %w", err)
}
return p.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (p *PremiumFeatureMessageEffects) DecodeBare(b *bin.Buffer) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureMessageEffects#d4e35061 to nil")
}
return nil
}
// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (p *PremiumFeatureMessageEffects) EncodeTDLibJSON(b tdjson.Encoder) error {
if p == nil {
return fmt.Errorf("can't encode premiumFeatureMessageEffects#d4e35061 as nil")
}
b.ObjStart()
b.PutID("premiumFeatureMessageEffects")
b.Comma()
b.StripComma()
b.ObjEnd()
return nil
}
// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (p *PremiumFeatureMessageEffects) DecodeTDLibJSON(b tdjson.Decoder) error {
if p == nil {
return fmt.Errorf("can't decode premiumFeatureMessageEffects#d4e35061 to nil")
}
return b.Obj(func(b tdjson.Decoder, key []byte) error {
switch string(key) {
case tdjson.TypeField:
if err := b.ConsumeID("premiumFeatureMessageEffects"); err != nil {
return fmt.Errorf("unable to decode premiumFeatureMessageEffects#d4e35061: %w", err)
}
default:
return b.Skip()
}
return nil
})
}
// PremiumFeatureClassName is schema name of PremiumFeatureClass.
const PremiumFeatureClassName = "PremiumFeature"
// PremiumFeatureClass represents PremiumFeature generic type.
//
// Example:
//
// g, err := tdapi.DecodePremiumFeature(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *tdapi.PremiumFeatureIncreasedLimits: // premiumFeatureIncreasedLimits#6a6be1b7
// case *tdapi.PremiumFeatureIncreasedUploadFileSize: // premiumFeatureIncreasedUploadFileSize#6ccce473
// case *tdapi.PremiumFeatureImprovedDownloadSpeed: // premiumFeatureImprovedDownloadSpeed#f00b4a3e
// case *tdapi.PremiumFeatureVoiceRecognition: // premiumFeatureVoiceRecognition#4cc89fde
// case *tdapi.PremiumFeatureDisabledAds: // premiumFeatureDisabledAds#8847624a
// case *tdapi.PremiumFeatureUniqueReactions: // premiumFeatureUniqueReactions#2db3b017
// case *tdapi.PremiumFeatureUniqueStickers: // premiumFeatureUniqueStickers#82b97c00
// case *tdapi.PremiumFeatureCustomEmoji: // premiumFeatureCustomEmoji#4f6ddb4c
// case *tdapi.PremiumFeatureAdvancedChatManagement: // premiumFeatureAdvancedChatManagement#2f774d1a
// case *tdapi.PremiumFeatureProfileBadge: // premiumFeatureProfileBadge#ded30c2
// case *tdapi.PremiumFeatureEmojiStatus: // premiumFeatureEmojiStatus#fdd2cce1
// case *tdapi.PremiumFeatureAnimatedProfilePhoto: // premiumFeatureAnimatedProfilePhoto#f9fecce6
// case *tdapi.PremiumFeatureForumTopicIcon: // premiumFeatureForumTopicIcon#ceef6342
// case *tdapi.PremiumFeatureAppIcons: // premiumFeatureAppIcons#5e79f489
// case *tdapi.PremiumFeatureRealTimeChatTranslation: // premiumFeatureRealTimeChatTranslation#bbd80280
// case *tdapi.PremiumFeatureUpgradedStories: // premiumFeatureUpgradedStories#9008051b
// case *tdapi.PremiumFeatureChatBoost: // premiumFeatureChatBoost#5df89f1b
// case *tdapi.PremiumFeatureAccentColor: // premiumFeatureAccentColor#361ac59e
// case *tdapi.PremiumFeatureBackgroundForBoth: // premiumFeatureBackgroundForBoth#2246eefa
// case *tdapi.PremiumFeatureSavedMessagesTags: // premiumFeatureSavedMessagesTags#3bcbe986
// case *tdapi.PremiumFeatureMessagePrivacy: // premiumFeatureMessagePrivacy#2fd278f6
// case *tdapi.PremiumFeatureLastSeenTimes: // premiumFeatureLastSeenTimes#d2914a8f
// case *tdapi.PremiumFeatureBusiness: // premiumFeatureBusiness#a6609704
// case *tdapi.PremiumFeatureMessageEffects: // premiumFeatureMessageEffects#d4e35061
// default: panic(v)
// }
type PremiumFeatureClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() PremiumFeatureClass
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
TypeID() uint32
// TypeName returns name of type in TL schema.
TypeName() string
// String implements fmt.Stringer.
String() string
// Zero returns true if current object has a zero value.
Zero() bool
EncodeTDLibJSON(b tdjson.Encoder) error
DecodeTDLibJSON(b tdjson.Decoder) error
}
// DecodePremiumFeature implements binary de-serialization for PremiumFeatureClass.
func DecodePremiumFeature(buf *bin.Buffer) (PremiumFeatureClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case PremiumFeatureIncreasedLimitsTypeID:
// Decoding premiumFeatureIncreasedLimits#6a6be1b7.
v := PremiumFeatureIncreasedLimits{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureIncreasedUploadFileSizeTypeID:
// Decoding premiumFeatureIncreasedUploadFileSize#6ccce473.
v := PremiumFeatureIncreasedUploadFileSize{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureImprovedDownloadSpeedTypeID:
// Decoding premiumFeatureImprovedDownloadSpeed#f00b4a3e.
v := PremiumFeatureImprovedDownloadSpeed{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureVoiceRecognitionTypeID:
// Decoding premiumFeatureVoiceRecognition#4cc89fde.
v := PremiumFeatureVoiceRecognition{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureDisabledAdsTypeID:
// Decoding premiumFeatureDisabledAds#8847624a.
v := PremiumFeatureDisabledAds{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureUniqueReactionsTypeID:
// Decoding premiumFeatureUniqueReactions#2db3b017.
v := PremiumFeatureUniqueReactions{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureUniqueStickersTypeID:
// Decoding premiumFeatureUniqueStickers#82b97c00.
v := PremiumFeatureUniqueStickers{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureCustomEmojiTypeID:
// Decoding premiumFeatureCustomEmoji#4f6ddb4c.
v := PremiumFeatureCustomEmoji{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureAdvancedChatManagementTypeID:
// Decoding premiumFeatureAdvancedChatManagement#2f774d1a.
v := PremiumFeatureAdvancedChatManagement{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureProfileBadgeTypeID:
// Decoding premiumFeatureProfileBadge#ded30c2.
v := PremiumFeatureProfileBadge{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureEmojiStatusTypeID:
// Decoding premiumFeatureEmojiStatus#fdd2cce1.
v := PremiumFeatureEmojiStatus{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureAnimatedProfilePhotoTypeID:
// Decoding premiumFeatureAnimatedProfilePhoto#f9fecce6.
v := PremiumFeatureAnimatedProfilePhoto{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureForumTopicIconTypeID:
// Decoding premiumFeatureForumTopicIcon#ceef6342.
v := PremiumFeatureForumTopicIcon{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureAppIconsTypeID:
// Decoding premiumFeatureAppIcons#5e79f489.
v := PremiumFeatureAppIcons{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureRealTimeChatTranslationTypeID:
// Decoding premiumFeatureRealTimeChatTranslation#bbd80280.
v := PremiumFeatureRealTimeChatTranslation{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureUpgradedStoriesTypeID:
// Decoding premiumFeatureUpgradedStories#9008051b.
v := PremiumFeatureUpgradedStories{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureChatBoostTypeID:
// Decoding premiumFeatureChatBoost#5df89f1b.
v := PremiumFeatureChatBoost{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureAccentColorTypeID:
// Decoding premiumFeatureAccentColor#361ac59e.
v := PremiumFeatureAccentColor{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureBackgroundForBothTypeID:
// Decoding premiumFeatureBackgroundForBoth#2246eefa.
v := PremiumFeatureBackgroundForBoth{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureSavedMessagesTagsTypeID:
// Decoding premiumFeatureSavedMessagesTags#3bcbe986.
v := PremiumFeatureSavedMessagesTags{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureMessagePrivacyTypeID:
// Decoding premiumFeatureMessagePrivacy#2fd278f6.
v := PremiumFeatureMessagePrivacy{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureLastSeenTimesTypeID:
// Decoding premiumFeatureLastSeenTimes#d2914a8f.
v := PremiumFeatureLastSeenTimes{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureBusinessTypeID:
// Decoding premiumFeatureBusiness#a6609704.
v := PremiumFeatureBusiness{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case PremiumFeatureMessageEffectsTypeID:
// Decoding premiumFeatureMessageEffects#d4e35061.
v := PremiumFeatureMessageEffects{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", bin.NewUnexpectedID(id))
}
}
// DecodeTDLibJSONPremiumFeature implements binary de-serialization for PremiumFeatureClass.
func DecodeTDLibJSONPremiumFeature(buf tdjson.Decoder) (PremiumFeatureClass, error) {
id, err := buf.FindTypeID()
if err != nil {
return nil, err
}
switch id {
case "premiumFeatureIncreasedLimits":
// Decoding premiumFeatureIncreasedLimits#6a6be1b7.
v := PremiumFeatureIncreasedLimits{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureIncreasedUploadFileSize":
// Decoding premiumFeatureIncreasedUploadFileSize#6ccce473.
v := PremiumFeatureIncreasedUploadFileSize{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureImprovedDownloadSpeed":
// Decoding premiumFeatureImprovedDownloadSpeed#f00b4a3e.
v := PremiumFeatureImprovedDownloadSpeed{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureVoiceRecognition":
// Decoding premiumFeatureVoiceRecognition#4cc89fde.
v := PremiumFeatureVoiceRecognition{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureDisabledAds":
// Decoding premiumFeatureDisabledAds#8847624a.
v := PremiumFeatureDisabledAds{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureUniqueReactions":
// Decoding premiumFeatureUniqueReactions#2db3b017.
v := PremiumFeatureUniqueReactions{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureUniqueStickers":
// Decoding premiumFeatureUniqueStickers#82b97c00.
v := PremiumFeatureUniqueStickers{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureCustomEmoji":
// Decoding premiumFeatureCustomEmoji#4f6ddb4c.
v := PremiumFeatureCustomEmoji{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureAdvancedChatManagement":
// Decoding premiumFeatureAdvancedChatManagement#2f774d1a.
v := PremiumFeatureAdvancedChatManagement{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureProfileBadge":
// Decoding premiumFeatureProfileBadge#ded30c2.
v := PremiumFeatureProfileBadge{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureEmojiStatus":
// Decoding premiumFeatureEmojiStatus#fdd2cce1.
v := PremiumFeatureEmojiStatus{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureAnimatedProfilePhoto":
// Decoding premiumFeatureAnimatedProfilePhoto#f9fecce6.
v := PremiumFeatureAnimatedProfilePhoto{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureForumTopicIcon":
// Decoding premiumFeatureForumTopicIcon#ceef6342.
v := PremiumFeatureForumTopicIcon{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureAppIcons":
// Decoding premiumFeatureAppIcons#5e79f489.
v := PremiumFeatureAppIcons{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureRealTimeChatTranslation":
// Decoding premiumFeatureRealTimeChatTranslation#bbd80280.
v := PremiumFeatureRealTimeChatTranslation{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureUpgradedStories":
// Decoding premiumFeatureUpgradedStories#9008051b.
v := PremiumFeatureUpgradedStories{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureChatBoost":
// Decoding premiumFeatureChatBoost#5df89f1b.
v := PremiumFeatureChatBoost{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureAccentColor":
// Decoding premiumFeatureAccentColor#361ac59e.
v := PremiumFeatureAccentColor{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureBackgroundForBoth":
// Decoding premiumFeatureBackgroundForBoth#2246eefa.
v := PremiumFeatureBackgroundForBoth{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureSavedMessagesTags":
// Decoding premiumFeatureSavedMessagesTags#3bcbe986.
v := PremiumFeatureSavedMessagesTags{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureMessagePrivacy":
// Decoding premiumFeatureMessagePrivacy#2fd278f6.
v := PremiumFeatureMessagePrivacy{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureLastSeenTimes":
// Decoding premiumFeatureLastSeenTimes#d2914a8f.
v := PremiumFeatureLastSeenTimes{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureBusiness":
// Decoding premiumFeatureBusiness#a6609704.
v := PremiumFeatureBusiness{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
case "premiumFeatureMessageEffects":
// Decoding premiumFeatureMessageEffects#d4e35061.
v := PremiumFeatureMessageEffects{}
if err := v.DecodeTDLibJSON(buf); err != nil {
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", tdjson.NewUnexpectedID(id))
}
}
// PremiumFeature boxes the PremiumFeatureClass providing a helper.
type PremiumFeatureBox struct {
PremiumFeature PremiumFeatureClass
}
// Decode implements bin.Decoder for PremiumFeatureBox.
func (b *PremiumFeatureBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode PremiumFeatureBox to nil")
}
v, err := DecodePremiumFeature(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.PremiumFeature = v
return nil
}
// Encode implements bin.Encode for PremiumFeatureBox.
func (b *PremiumFeatureBox) Encode(buf *bin.Buffer) error {
if b == nil || b.PremiumFeature == nil {
return fmt.Errorf("unable to encode PremiumFeatureClass as nil")
}
return b.PremiumFeature.Encode(buf)
}
// DecodeTDLibJSON implements bin.Decoder for PremiumFeatureBox.
func (b *PremiumFeatureBox) DecodeTDLibJSON(buf tdjson.Decoder) error {
if b == nil {
return fmt.Errorf("unable to decode PremiumFeatureBox to nil")
}
v, err := DecodeTDLibJSONPremiumFeature(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.PremiumFeature = v
return nil
}
// EncodeTDLibJSON implements bin.Encode for PremiumFeatureBox.
func (b *PremiumFeatureBox) EncodeTDLibJSON(buf tdjson.Encoder) error {
if b == nil || b.PremiumFeature == nil {
return fmt.Errorf("unable to encode PremiumFeatureClass as nil")
}
return b.PremiumFeature.EncodeTDLibJSON(buf)
}