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 ProfileTabPosts struct {
}
const ProfileTabPostsTypeID = 0xb98cd696
func (p ProfileTabPosts ) construct () ProfileTabClass { return &p }
var (
_ bin .Encoder = &ProfileTabPosts {}
_ bin .Decoder = &ProfileTabPosts {}
_ bin .BareEncoder = &ProfileTabPosts {}
_ bin .BareDecoder = &ProfileTabPosts {}
_ ProfileTabClass = &ProfileTabPosts {}
)
func (p *ProfileTabPosts ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *ProfileTabPosts ) String () string {
if p == nil {
return "ProfileTabPosts(nil)"
}
type Alias ProfileTabPosts
return fmt .Sprintf ("ProfileTabPosts%+v" , Alias (*p ))
}
func (*ProfileTabPosts ) TypeID () uint32 {
return ProfileTabPostsTypeID
}
func (*ProfileTabPosts ) TypeName () string {
return "profileTabPosts"
}
func (p *ProfileTabPosts ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "profileTabPosts" ,
ID : ProfileTabPostsTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *ProfileTabPosts ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabPosts#b98cd696 as nil" )
}
b .PutID (ProfileTabPostsTypeID )
return p .EncodeBare (b )
}
func (p *ProfileTabPosts ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabPosts#b98cd696 as nil" )
}
return nil
}
func (p *ProfileTabPosts ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabPosts#b98cd696 to nil" )
}
if err := b .ConsumeID (ProfileTabPostsTypeID ); err != nil {
return fmt .Errorf ("unable to decode profileTabPosts#b98cd696: %w" , err )
}
return p .DecodeBare (b )
}
func (p *ProfileTabPosts ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabPosts#b98cd696 to nil" )
}
return nil
}
type ProfileTabGifts struct {
}
const ProfileTabGiftsTypeID = 0x4d4bd46a
func (p ProfileTabGifts ) construct () ProfileTabClass { return &p }
var (
_ bin .Encoder = &ProfileTabGifts {}
_ bin .Decoder = &ProfileTabGifts {}
_ bin .BareEncoder = &ProfileTabGifts {}
_ bin .BareDecoder = &ProfileTabGifts {}
_ ProfileTabClass = &ProfileTabGifts {}
)
func (p *ProfileTabGifts ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *ProfileTabGifts ) String () string {
if p == nil {
return "ProfileTabGifts(nil)"
}
type Alias ProfileTabGifts
return fmt .Sprintf ("ProfileTabGifts%+v" , Alias (*p ))
}
func (*ProfileTabGifts ) TypeID () uint32 {
return ProfileTabGiftsTypeID
}
func (*ProfileTabGifts ) TypeName () string {
return "profileTabGifts"
}
func (p *ProfileTabGifts ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "profileTabGifts" ,
ID : ProfileTabGiftsTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *ProfileTabGifts ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabGifts#4d4bd46a as nil" )
}
b .PutID (ProfileTabGiftsTypeID )
return p .EncodeBare (b )
}
func (p *ProfileTabGifts ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabGifts#4d4bd46a as nil" )
}
return nil
}
func (p *ProfileTabGifts ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabGifts#4d4bd46a to nil" )
}
if err := b .ConsumeID (ProfileTabGiftsTypeID ); err != nil {
return fmt .Errorf ("unable to decode profileTabGifts#4d4bd46a: %w" , err )
}
return p .DecodeBare (b )
}
func (p *ProfileTabGifts ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabGifts#4d4bd46a to nil" )
}
return nil
}
type ProfileTabMedia struct {
}
const ProfileTabMediaTypeID = 0x72c64955
func (p ProfileTabMedia ) construct () ProfileTabClass { return &p }
var (
_ bin .Encoder = &ProfileTabMedia {}
_ bin .Decoder = &ProfileTabMedia {}
_ bin .BareEncoder = &ProfileTabMedia {}
_ bin .BareDecoder = &ProfileTabMedia {}
_ ProfileTabClass = &ProfileTabMedia {}
)
func (p *ProfileTabMedia ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *ProfileTabMedia ) String () string {
if p == nil {
return "ProfileTabMedia(nil)"
}
type Alias ProfileTabMedia
return fmt .Sprintf ("ProfileTabMedia%+v" , Alias (*p ))
}
func (*ProfileTabMedia ) TypeID () uint32 {
return ProfileTabMediaTypeID
}
func (*ProfileTabMedia ) TypeName () string {
return "profileTabMedia"
}
func (p *ProfileTabMedia ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "profileTabMedia" ,
ID : ProfileTabMediaTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *ProfileTabMedia ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabMedia#72c64955 as nil" )
}
b .PutID (ProfileTabMediaTypeID )
return p .EncodeBare (b )
}
func (p *ProfileTabMedia ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabMedia#72c64955 as nil" )
}
return nil
}
func (p *ProfileTabMedia ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabMedia#72c64955 to nil" )
}
if err := b .ConsumeID (ProfileTabMediaTypeID ); err != nil {
return fmt .Errorf ("unable to decode profileTabMedia#72c64955: %w" , err )
}
return p .DecodeBare (b )
}
func (p *ProfileTabMedia ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabMedia#72c64955 to nil" )
}
return nil
}
type ProfileTabFiles struct {
}
const ProfileTabFilesTypeID = 0xab339c00
func (p ProfileTabFiles ) construct () ProfileTabClass { return &p }
var (
_ bin .Encoder = &ProfileTabFiles {}
_ bin .Decoder = &ProfileTabFiles {}
_ bin .BareEncoder = &ProfileTabFiles {}
_ bin .BareDecoder = &ProfileTabFiles {}
_ ProfileTabClass = &ProfileTabFiles {}
)
func (p *ProfileTabFiles ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *ProfileTabFiles ) String () string {
if p == nil {
return "ProfileTabFiles(nil)"
}
type Alias ProfileTabFiles
return fmt .Sprintf ("ProfileTabFiles%+v" , Alias (*p ))
}
func (*ProfileTabFiles ) TypeID () uint32 {
return ProfileTabFilesTypeID
}
func (*ProfileTabFiles ) TypeName () string {
return "profileTabFiles"
}
func (p *ProfileTabFiles ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "profileTabFiles" ,
ID : ProfileTabFilesTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *ProfileTabFiles ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabFiles#ab339c00 as nil" )
}
b .PutID (ProfileTabFilesTypeID )
return p .EncodeBare (b )
}
func (p *ProfileTabFiles ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabFiles#ab339c00 as nil" )
}
return nil
}
func (p *ProfileTabFiles ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabFiles#ab339c00 to nil" )
}
if err := b .ConsumeID (ProfileTabFilesTypeID ); err != nil {
return fmt .Errorf ("unable to decode profileTabFiles#ab339c00: %w" , err )
}
return p .DecodeBare (b )
}
func (p *ProfileTabFiles ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabFiles#ab339c00 to nil" )
}
return nil
}
type ProfileTabMusic struct {
}
const ProfileTabMusicTypeID = 0x9f27d26e
func (p ProfileTabMusic ) construct () ProfileTabClass { return &p }
var (
_ bin .Encoder = &ProfileTabMusic {}
_ bin .Decoder = &ProfileTabMusic {}
_ bin .BareEncoder = &ProfileTabMusic {}
_ bin .BareDecoder = &ProfileTabMusic {}
_ ProfileTabClass = &ProfileTabMusic {}
)
func (p *ProfileTabMusic ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *ProfileTabMusic ) String () string {
if p == nil {
return "ProfileTabMusic(nil)"
}
type Alias ProfileTabMusic
return fmt .Sprintf ("ProfileTabMusic%+v" , Alias (*p ))
}
func (*ProfileTabMusic ) TypeID () uint32 {
return ProfileTabMusicTypeID
}
func (*ProfileTabMusic ) TypeName () string {
return "profileTabMusic"
}
func (p *ProfileTabMusic ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "profileTabMusic" ,
ID : ProfileTabMusicTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *ProfileTabMusic ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabMusic#9f27d26e as nil" )
}
b .PutID (ProfileTabMusicTypeID )
return p .EncodeBare (b )
}
func (p *ProfileTabMusic ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabMusic#9f27d26e as nil" )
}
return nil
}
func (p *ProfileTabMusic ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabMusic#9f27d26e to nil" )
}
if err := b .ConsumeID (ProfileTabMusicTypeID ); err != nil {
return fmt .Errorf ("unable to decode profileTabMusic#9f27d26e: %w" , err )
}
return p .DecodeBare (b )
}
func (p *ProfileTabMusic ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabMusic#9f27d26e to nil" )
}
return nil
}
type ProfileTabVoice struct {
}
const ProfileTabVoiceTypeID = 0xe477092e
func (p ProfileTabVoice ) construct () ProfileTabClass { return &p }
var (
_ bin .Encoder = &ProfileTabVoice {}
_ bin .Decoder = &ProfileTabVoice {}
_ bin .BareEncoder = &ProfileTabVoice {}
_ bin .BareDecoder = &ProfileTabVoice {}
_ ProfileTabClass = &ProfileTabVoice {}
)
func (p *ProfileTabVoice ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *ProfileTabVoice ) String () string {
if p == nil {
return "ProfileTabVoice(nil)"
}
type Alias ProfileTabVoice
return fmt .Sprintf ("ProfileTabVoice%+v" , Alias (*p ))
}
func (*ProfileTabVoice ) TypeID () uint32 {
return ProfileTabVoiceTypeID
}
func (*ProfileTabVoice ) TypeName () string {
return "profileTabVoice"
}
func (p *ProfileTabVoice ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "profileTabVoice" ,
ID : ProfileTabVoiceTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *ProfileTabVoice ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabVoice#e477092e as nil" )
}
b .PutID (ProfileTabVoiceTypeID )
return p .EncodeBare (b )
}
func (p *ProfileTabVoice ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabVoice#e477092e as nil" )
}
return nil
}
func (p *ProfileTabVoice ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabVoice#e477092e to nil" )
}
if err := b .ConsumeID (ProfileTabVoiceTypeID ); err != nil {
return fmt .Errorf ("unable to decode profileTabVoice#e477092e: %w" , err )
}
return p .DecodeBare (b )
}
func (p *ProfileTabVoice ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabVoice#e477092e to nil" )
}
return nil
}
type ProfileTabLinks struct {
}
const ProfileTabLinksTypeID = 0xd3656499
func (p ProfileTabLinks ) construct () ProfileTabClass { return &p }
var (
_ bin .Encoder = &ProfileTabLinks {}
_ bin .Decoder = &ProfileTabLinks {}
_ bin .BareEncoder = &ProfileTabLinks {}
_ bin .BareDecoder = &ProfileTabLinks {}
_ ProfileTabClass = &ProfileTabLinks {}
)
func (p *ProfileTabLinks ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *ProfileTabLinks ) String () string {
if p == nil {
return "ProfileTabLinks(nil)"
}
type Alias ProfileTabLinks
return fmt .Sprintf ("ProfileTabLinks%+v" , Alias (*p ))
}
func (*ProfileTabLinks ) TypeID () uint32 {
return ProfileTabLinksTypeID
}
func (*ProfileTabLinks ) TypeName () string {
return "profileTabLinks"
}
func (p *ProfileTabLinks ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "profileTabLinks" ,
ID : ProfileTabLinksTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *ProfileTabLinks ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabLinks#d3656499 as nil" )
}
b .PutID (ProfileTabLinksTypeID )
return p .EncodeBare (b )
}
func (p *ProfileTabLinks ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabLinks#d3656499 as nil" )
}
return nil
}
func (p *ProfileTabLinks ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabLinks#d3656499 to nil" )
}
if err := b .ConsumeID (ProfileTabLinksTypeID ); err != nil {
return fmt .Errorf ("unable to decode profileTabLinks#d3656499: %w" , err )
}
return p .DecodeBare (b )
}
func (p *ProfileTabLinks ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabLinks#d3656499 to nil" )
}
return nil
}
type ProfileTabGifs struct {
}
const ProfileTabGifsTypeID = 0xa2c0f695
func (p ProfileTabGifs ) construct () ProfileTabClass { return &p }
var (
_ bin .Encoder = &ProfileTabGifs {}
_ bin .Decoder = &ProfileTabGifs {}
_ bin .BareEncoder = &ProfileTabGifs {}
_ bin .BareDecoder = &ProfileTabGifs {}
_ ProfileTabClass = &ProfileTabGifs {}
)
func (p *ProfileTabGifs ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *ProfileTabGifs ) String () string {
if p == nil {
return "ProfileTabGifs(nil)"
}
type Alias ProfileTabGifs
return fmt .Sprintf ("ProfileTabGifs%+v" , Alias (*p ))
}
func (*ProfileTabGifs ) TypeID () uint32 {
return ProfileTabGifsTypeID
}
func (*ProfileTabGifs ) TypeName () string {
return "profileTabGifs"
}
func (p *ProfileTabGifs ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "profileTabGifs" ,
ID : ProfileTabGifsTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *ProfileTabGifs ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabGifs#a2c0f695 as nil" )
}
b .PutID (ProfileTabGifsTypeID )
return p .EncodeBare (b )
}
func (p *ProfileTabGifs ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode profileTabGifs#a2c0f695 as nil" )
}
return nil
}
func (p *ProfileTabGifs ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabGifs#a2c0f695 to nil" )
}
if err := b .ConsumeID (ProfileTabGifsTypeID ); err != nil {
return fmt .Errorf ("unable to decode profileTabGifs#a2c0f695: %w" , err )
}
return p .DecodeBare (b )
}
func (p *ProfileTabGifs ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode profileTabGifs#a2c0f695 to nil" )
}
return nil
}
const ProfileTabClassName = "ProfileTab"
type ProfileTabClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () ProfileTabClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeProfileTab (buf *bin .Buffer ) (ProfileTabClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case ProfileTabPostsTypeID :
v := ProfileTabPosts {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , err )
}
return &v , nil
case ProfileTabGiftsTypeID :
v := ProfileTabGifts {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , err )
}
return &v , nil
case ProfileTabMediaTypeID :
v := ProfileTabMedia {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , err )
}
return &v , nil
case ProfileTabFilesTypeID :
v := ProfileTabFiles {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , err )
}
return &v , nil
case ProfileTabMusicTypeID :
v := ProfileTabMusic {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , err )
}
return &v , nil
case ProfileTabVoiceTypeID :
v := ProfileTabVoice {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , err )
}
return &v , nil
case ProfileTabLinksTypeID :
v := ProfileTabLinks {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , err )
}
return &v , nil
case ProfileTabGifsTypeID :
v := ProfileTabGifs {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode ProfileTabClass: %w" , bin .NewUnexpectedID (id ))
}
}
type ProfileTabBox struct {
ProfileTab ProfileTabClass
}
func (b *ProfileTabBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode ProfileTabBox to nil" )
}
v , err := DecodeProfileTab (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .ProfileTab = v
return nil
}
func (b *ProfileTabBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .ProfileTab == nil {
return fmt .Errorf ("unable to encode ProfileTabClass as nil" )
}
return b .ProfileTab .Encode (buf )
}
The pages are generated with Golds v0.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .