package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type TopPeerCategoryBotsPM struct {
}
const TopPeerCategoryBotsPMTypeID = 0xab661b5b
func (t TopPeerCategoryBotsPM ) construct () TopPeerCategoryClass { return &t }
var (
_ bin .Encoder = &TopPeerCategoryBotsPM {}
_ bin .Decoder = &TopPeerCategoryBotsPM {}
_ bin .BareEncoder = &TopPeerCategoryBotsPM {}
_ bin .BareDecoder = &TopPeerCategoryBotsPM {}
_ TopPeerCategoryClass = &TopPeerCategoryBotsPM {}
)
func (t *TopPeerCategoryBotsPM ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TopPeerCategoryBotsPM ) String () string {
if t == nil {
return "TopPeerCategoryBotsPM(nil)"
}
type Alias TopPeerCategoryBotsPM
return fmt .Sprintf ("TopPeerCategoryBotsPM%+v" , Alias (*t ))
}
func (*TopPeerCategoryBotsPM ) TypeID () uint32 {
return TopPeerCategoryBotsPMTypeID
}
func (*TopPeerCategoryBotsPM ) TypeName () string {
return "topPeerCategoryBotsPM"
}
func (t *TopPeerCategoryBotsPM ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "topPeerCategoryBotsPM" ,
ID : TopPeerCategoryBotsPMTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TopPeerCategoryBotsPM ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryBotsPM#ab661b5b as nil" )
}
b .PutID (TopPeerCategoryBotsPMTypeID )
return t .EncodeBare (b )
}
func (t *TopPeerCategoryBotsPM ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryBotsPM#ab661b5b as nil" )
}
return nil
}
func (t *TopPeerCategoryBotsPM ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryBotsPM#ab661b5b to nil" )
}
if err := b .ConsumeID (TopPeerCategoryBotsPMTypeID ); err != nil {
return fmt .Errorf ("unable to decode topPeerCategoryBotsPM#ab661b5b: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TopPeerCategoryBotsPM ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryBotsPM#ab661b5b to nil" )
}
return nil
}
type TopPeerCategoryBotsInline struct {
}
const TopPeerCategoryBotsInlineTypeID = 0x148677e2
func (t TopPeerCategoryBotsInline ) construct () TopPeerCategoryClass { return &t }
var (
_ bin .Encoder = &TopPeerCategoryBotsInline {}
_ bin .Decoder = &TopPeerCategoryBotsInline {}
_ bin .BareEncoder = &TopPeerCategoryBotsInline {}
_ bin .BareDecoder = &TopPeerCategoryBotsInline {}
_ TopPeerCategoryClass = &TopPeerCategoryBotsInline {}
)
func (t *TopPeerCategoryBotsInline ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TopPeerCategoryBotsInline ) String () string {
if t == nil {
return "TopPeerCategoryBotsInline(nil)"
}
type Alias TopPeerCategoryBotsInline
return fmt .Sprintf ("TopPeerCategoryBotsInline%+v" , Alias (*t ))
}
func (*TopPeerCategoryBotsInline ) TypeID () uint32 {
return TopPeerCategoryBotsInlineTypeID
}
func (*TopPeerCategoryBotsInline ) TypeName () string {
return "topPeerCategoryBotsInline"
}
func (t *TopPeerCategoryBotsInline ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "topPeerCategoryBotsInline" ,
ID : TopPeerCategoryBotsInlineTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TopPeerCategoryBotsInline ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryBotsInline#148677e2 as nil" )
}
b .PutID (TopPeerCategoryBotsInlineTypeID )
return t .EncodeBare (b )
}
func (t *TopPeerCategoryBotsInline ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryBotsInline#148677e2 as nil" )
}
return nil
}
func (t *TopPeerCategoryBotsInline ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryBotsInline#148677e2 to nil" )
}
if err := b .ConsumeID (TopPeerCategoryBotsInlineTypeID ); err != nil {
return fmt .Errorf ("unable to decode topPeerCategoryBotsInline#148677e2: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TopPeerCategoryBotsInline ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryBotsInline#148677e2 to nil" )
}
return nil
}
type TopPeerCategoryCorrespondents struct {
}
const TopPeerCategoryCorrespondentsTypeID = 0x637b7ed
func (t TopPeerCategoryCorrespondents ) construct () TopPeerCategoryClass { return &t }
var (
_ bin .Encoder = &TopPeerCategoryCorrespondents {}
_ bin .Decoder = &TopPeerCategoryCorrespondents {}
_ bin .BareEncoder = &TopPeerCategoryCorrespondents {}
_ bin .BareDecoder = &TopPeerCategoryCorrespondents {}
_ TopPeerCategoryClass = &TopPeerCategoryCorrespondents {}
)
func (t *TopPeerCategoryCorrespondents ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TopPeerCategoryCorrespondents ) String () string {
if t == nil {
return "TopPeerCategoryCorrespondents(nil)"
}
type Alias TopPeerCategoryCorrespondents
return fmt .Sprintf ("TopPeerCategoryCorrespondents%+v" , Alias (*t ))
}
func (*TopPeerCategoryCorrespondents ) TypeID () uint32 {
return TopPeerCategoryCorrespondentsTypeID
}
func (*TopPeerCategoryCorrespondents ) TypeName () string {
return "topPeerCategoryCorrespondents"
}
func (t *TopPeerCategoryCorrespondents ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "topPeerCategoryCorrespondents" ,
ID : TopPeerCategoryCorrespondentsTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TopPeerCategoryCorrespondents ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryCorrespondents#637b7ed as nil" )
}
b .PutID (TopPeerCategoryCorrespondentsTypeID )
return t .EncodeBare (b )
}
func (t *TopPeerCategoryCorrespondents ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryCorrespondents#637b7ed as nil" )
}
return nil
}
func (t *TopPeerCategoryCorrespondents ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryCorrespondents#637b7ed to nil" )
}
if err := b .ConsumeID (TopPeerCategoryCorrespondentsTypeID ); err != nil {
return fmt .Errorf ("unable to decode topPeerCategoryCorrespondents#637b7ed: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TopPeerCategoryCorrespondents ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryCorrespondents#637b7ed to nil" )
}
return nil
}
type TopPeerCategoryGroups struct {
}
const TopPeerCategoryGroupsTypeID = 0xbd17a14a
func (t TopPeerCategoryGroups ) construct () TopPeerCategoryClass { return &t }
var (
_ bin .Encoder = &TopPeerCategoryGroups {}
_ bin .Decoder = &TopPeerCategoryGroups {}
_ bin .BareEncoder = &TopPeerCategoryGroups {}
_ bin .BareDecoder = &TopPeerCategoryGroups {}
_ TopPeerCategoryClass = &TopPeerCategoryGroups {}
)
func (t *TopPeerCategoryGroups ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TopPeerCategoryGroups ) String () string {
if t == nil {
return "TopPeerCategoryGroups(nil)"
}
type Alias TopPeerCategoryGroups
return fmt .Sprintf ("TopPeerCategoryGroups%+v" , Alias (*t ))
}
func (*TopPeerCategoryGroups ) TypeID () uint32 {
return TopPeerCategoryGroupsTypeID
}
func (*TopPeerCategoryGroups ) TypeName () string {
return "topPeerCategoryGroups"
}
func (t *TopPeerCategoryGroups ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "topPeerCategoryGroups" ,
ID : TopPeerCategoryGroupsTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TopPeerCategoryGroups ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryGroups#bd17a14a as nil" )
}
b .PutID (TopPeerCategoryGroupsTypeID )
return t .EncodeBare (b )
}
func (t *TopPeerCategoryGroups ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryGroups#bd17a14a as nil" )
}
return nil
}
func (t *TopPeerCategoryGroups ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryGroups#bd17a14a to nil" )
}
if err := b .ConsumeID (TopPeerCategoryGroupsTypeID ); err != nil {
return fmt .Errorf ("unable to decode topPeerCategoryGroups#bd17a14a: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TopPeerCategoryGroups ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryGroups#bd17a14a to nil" )
}
return nil
}
type TopPeerCategoryChannels struct {
}
const TopPeerCategoryChannelsTypeID = 0x161d9628
func (t TopPeerCategoryChannels ) construct () TopPeerCategoryClass { return &t }
var (
_ bin .Encoder = &TopPeerCategoryChannels {}
_ bin .Decoder = &TopPeerCategoryChannels {}
_ bin .BareEncoder = &TopPeerCategoryChannels {}
_ bin .BareDecoder = &TopPeerCategoryChannels {}
_ TopPeerCategoryClass = &TopPeerCategoryChannels {}
)
func (t *TopPeerCategoryChannels ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TopPeerCategoryChannels ) String () string {
if t == nil {
return "TopPeerCategoryChannels(nil)"
}
type Alias TopPeerCategoryChannels
return fmt .Sprintf ("TopPeerCategoryChannels%+v" , Alias (*t ))
}
func (*TopPeerCategoryChannels ) TypeID () uint32 {
return TopPeerCategoryChannelsTypeID
}
func (*TopPeerCategoryChannels ) TypeName () string {
return "topPeerCategoryChannels"
}
func (t *TopPeerCategoryChannels ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "topPeerCategoryChannels" ,
ID : TopPeerCategoryChannelsTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TopPeerCategoryChannels ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryChannels#161d9628 as nil" )
}
b .PutID (TopPeerCategoryChannelsTypeID )
return t .EncodeBare (b )
}
func (t *TopPeerCategoryChannels ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryChannels#161d9628 as nil" )
}
return nil
}
func (t *TopPeerCategoryChannels ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryChannels#161d9628 to nil" )
}
if err := b .ConsumeID (TopPeerCategoryChannelsTypeID ); err != nil {
return fmt .Errorf ("unable to decode topPeerCategoryChannels#161d9628: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TopPeerCategoryChannels ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryChannels#161d9628 to nil" )
}
return nil
}
type TopPeerCategoryPhoneCalls struct {
}
const TopPeerCategoryPhoneCallsTypeID = 0x1e76a78c
func (t TopPeerCategoryPhoneCalls ) construct () TopPeerCategoryClass { return &t }
var (
_ bin .Encoder = &TopPeerCategoryPhoneCalls {}
_ bin .Decoder = &TopPeerCategoryPhoneCalls {}
_ bin .BareEncoder = &TopPeerCategoryPhoneCalls {}
_ bin .BareDecoder = &TopPeerCategoryPhoneCalls {}
_ TopPeerCategoryClass = &TopPeerCategoryPhoneCalls {}
)
func (t *TopPeerCategoryPhoneCalls ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TopPeerCategoryPhoneCalls ) String () string {
if t == nil {
return "TopPeerCategoryPhoneCalls(nil)"
}
type Alias TopPeerCategoryPhoneCalls
return fmt .Sprintf ("TopPeerCategoryPhoneCalls%+v" , Alias (*t ))
}
func (*TopPeerCategoryPhoneCalls ) TypeID () uint32 {
return TopPeerCategoryPhoneCallsTypeID
}
func (*TopPeerCategoryPhoneCalls ) TypeName () string {
return "topPeerCategoryPhoneCalls"
}
func (t *TopPeerCategoryPhoneCalls ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "topPeerCategoryPhoneCalls" ,
ID : TopPeerCategoryPhoneCallsTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TopPeerCategoryPhoneCalls ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryPhoneCalls#1e76a78c as nil" )
}
b .PutID (TopPeerCategoryPhoneCallsTypeID )
return t .EncodeBare (b )
}
func (t *TopPeerCategoryPhoneCalls ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryPhoneCalls#1e76a78c as nil" )
}
return nil
}
func (t *TopPeerCategoryPhoneCalls ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryPhoneCalls#1e76a78c to nil" )
}
if err := b .ConsumeID (TopPeerCategoryPhoneCallsTypeID ); err != nil {
return fmt .Errorf ("unable to decode topPeerCategoryPhoneCalls#1e76a78c: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TopPeerCategoryPhoneCalls ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryPhoneCalls#1e76a78c to nil" )
}
return nil
}
type TopPeerCategoryForwardUsers struct {
}
const TopPeerCategoryForwardUsersTypeID = 0xa8406ca9
func (t TopPeerCategoryForwardUsers ) construct () TopPeerCategoryClass { return &t }
var (
_ bin .Encoder = &TopPeerCategoryForwardUsers {}
_ bin .Decoder = &TopPeerCategoryForwardUsers {}
_ bin .BareEncoder = &TopPeerCategoryForwardUsers {}
_ bin .BareDecoder = &TopPeerCategoryForwardUsers {}
_ TopPeerCategoryClass = &TopPeerCategoryForwardUsers {}
)
func (t *TopPeerCategoryForwardUsers ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TopPeerCategoryForwardUsers ) String () string {
if t == nil {
return "TopPeerCategoryForwardUsers(nil)"
}
type Alias TopPeerCategoryForwardUsers
return fmt .Sprintf ("TopPeerCategoryForwardUsers%+v" , Alias (*t ))
}
func (*TopPeerCategoryForwardUsers ) TypeID () uint32 {
return TopPeerCategoryForwardUsersTypeID
}
func (*TopPeerCategoryForwardUsers ) TypeName () string {
return "topPeerCategoryForwardUsers"
}
func (t *TopPeerCategoryForwardUsers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "topPeerCategoryForwardUsers" ,
ID : TopPeerCategoryForwardUsersTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TopPeerCategoryForwardUsers ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryForwardUsers#a8406ca9 as nil" )
}
b .PutID (TopPeerCategoryForwardUsersTypeID )
return t .EncodeBare (b )
}
func (t *TopPeerCategoryForwardUsers ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryForwardUsers#a8406ca9 as nil" )
}
return nil
}
func (t *TopPeerCategoryForwardUsers ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryForwardUsers#a8406ca9 to nil" )
}
if err := b .ConsumeID (TopPeerCategoryForwardUsersTypeID ); err != nil {
return fmt .Errorf ("unable to decode topPeerCategoryForwardUsers#a8406ca9: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TopPeerCategoryForwardUsers ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryForwardUsers#a8406ca9 to nil" )
}
return nil
}
type TopPeerCategoryForwardChats struct {
}
const TopPeerCategoryForwardChatsTypeID = 0xfbeec0f0
func (t TopPeerCategoryForwardChats ) construct () TopPeerCategoryClass { return &t }
var (
_ bin .Encoder = &TopPeerCategoryForwardChats {}
_ bin .Decoder = &TopPeerCategoryForwardChats {}
_ bin .BareEncoder = &TopPeerCategoryForwardChats {}
_ bin .BareDecoder = &TopPeerCategoryForwardChats {}
_ TopPeerCategoryClass = &TopPeerCategoryForwardChats {}
)
func (t *TopPeerCategoryForwardChats ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TopPeerCategoryForwardChats ) String () string {
if t == nil {
return "TopPeerCategoryForwardChats(nil)"
}
type Alias TopPeerCategoryForwardChats
return fmt .Sprintf ("TopPeerCategoryForwardChats%+v" , Alias (*t ))
}
func (*TopPeerCategoryForwardChats ) TypeID () uint32 {
return TopPeerCategoryForwardChatsTypeID
}
func (*TopPeerCategoryForwardChats ) TypeName () string {
return "topPeerCategoryForwardChats"
}
func (t *TopPeerCategoryForwardChats ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "topPeerCategoryForwardChats" ,
ID : TopPeerCategoryForwardChatsTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TopPeerCategoryForwardChats ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryForwardChats#fbeec0f0 as nil" )
}
b .PutID (TopPeerCategoryForwardChatsTypeID )
return t .EncodeBare (b )
}
func (t *TopPeerCategoryForwardChats ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode topPeerCategoryForwardChats#fbeec0f0 as nil" )
}
return nil
}
func (t *TopPeerCategoryForwardChats ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryForwardChats#fbeec0f0 to nil" )
}
if err := b .ConsumeID (TopPeerCategoryForwardChatsTypeID ); err != nil {
return fmt .Errorf ("unable to decode topPeerCategoryForwardChats#fbeec0f0: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TopPeerCategoryForwardChats ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode topPeerCategoryForwardChats#fbeec0f0 to nil" )
}
return nil
}
const TopPeerCategoryClassName = "TopPeerCategory"
type TopPeerCategoryClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () TopPeerCategoryClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeTopPeerCategory (buf *bin .Buffer ) (TopPeerCategoryClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case TopPeerCategoryBotsPMTypeID :
v := TopPeerCategoryBotsPM {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , err )
}
return &v , nil
case TopPeerCategoryBotsInlineTypeID :
v := TopPeerCategoryBotsInline {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , err )
}
return &v , nil
case TopPeerCategoryCorrespondentsTypeID :
v := TopPeerCategoryCorrespondents {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , err )
}
return &v , nil
case TopPeerCategoryGroupsTypeID :
v := TopPeerCategoryGroups {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , err )
}
return &v , nil
case TopPeerCategoryChannelsTypeID :
v := TopPeerCategoryChannels {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , err )
}
return &v , nil
case TopPeerCategoryPhoneCallsTypeID :
v := TopPeerCategoryPhoneCalls {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , err )
}
return &v , nil
case TopPeerCategoryForwardUsersTypeID :
v := TopPeerCategoryForwardUsers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , err )
}
return &v , nil
case TopPeerCategoryForwardChatsTypeID :
v := TopPeerCategoryForwardChats {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode TopPeerCategoryClass: %w" , bin .NewUnexpectedID (id ))
}
}
type TopPeerCategoryBox struct {
TopPeerCategory TopPeerCategoryClass
}
func (b *TopPeerCategoryBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode TopPeerCategoryBox to nil" )
}
v , err := DecodeTopPeerCategory (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .TopPeerCategory = v
return nil
}
func (b *TopPeerCategoryBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .TopPeerCategory == nil {
return fmt .Errorf ("unable to encode TopPeerCategoryClass as nil" )
}
return b .TopPeerCategory .Encode (buf )
}
The pages are generated with Golds v0.6.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .