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 InputFileLocation struct {
VolumeID int64
LocalID int
Secret int64
FileReference []byte
}
const InputFileLocationTypeID = 0xdfdaabe1
func (i InputFileLocation ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputFileLocation {}
_ bin .Decoder = &InputFileLocation {}
_ bin .BareEncoder = &InputFileLocation {}
_ bin .BareDecoder = &InputFileLocation {}
_ InputFileLocationClass = &InputFileLocation {}
)
func (i *InputFileLocation ) Zero () bool {
if i == nil {
return true
}
if !(i .VolumeID == 0 ) {
return false
}
if !(i .LocalID == 0 ) {
return false
}
if !(i .Secret == 0 ) {
return false
}
if !(i .FileReference == nil ) {
return false
}
return true
}
func (i *InputFileLocation ) String () string {
if i == nil {
return "InputFileLocation(nil)"
}
type Alias InputFileLocation
return fmt .Sprintf ("InputFileLocation%+v" , Alias (*i ))
}
func (i *InputFileLocation ) FillFrom (from interface {
GetVolumeID () (value int64 )
GetLocalID () (value int )
GetSecret () (value int64 )
GetFileReference () (value []byte )
}) {
i .VolumeID = from .GetVolumeID ()
i .LocalID = from .GetLocalID ()
i .Secret = from .GetSecret ()
i .FileReference = from .GetFileReference ()
}
func (*InputFileLocation ) TypeID () uint32 {
return InputFileLocationTypeID
}
func (*InputFileLocation ) TypeName () string {
return "inputFileLocation"
}
func (i *InputFileLocation ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputFileLocation" ,
ID : InputFileLocationTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "VolumeID" ,
SchemaName : "volume_id" ,
},
{
Name : "LocalID" ,
SchemaName : "local_id" ,
},
{
Name : "Secret" ,
SchemaName : "secret" ,
},
{
Name : "FileReference" ,
SchemaName : "file_reference" ,
},
}
return typ
}
func (i *InputFileLocation ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputFileLocation#dfdaabe1 as nil" )
}
b .PutID (InputFileLocationTypeID )
return i .EncodeBare (b )
}
func (i *InputFileLocation ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputFileLocation#dfdaabe1 as nil" )
}
b .PutLong (i .VolumeID )
b .PutInt (i .LocalID )
b .PutLong (i .Secret )
b .PutBytes (i .FileReference )
return nil
}
func (i *InputFileLocation ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputFileLocation#dfdaabe1 to nil" )
}
if err := b .ConsumeID (InputFileLocationTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputFileLocation#dfdaabe1: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputFileLocation ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputFileLocation#dfdaabe1 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputFileLocation#dfdaabe1: field volume_id: %w" , err )
}
i .VolumeID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputFileLocation#dfdaabe1: field local_id: %w" , err )
}
i .LocalID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputFileLocation#dfdaabe1: field secret: %w" , err )
}
i .Secret = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode inputFileLocation#dfdaabe1: field file_reference: %w" , err )
}
i .FileReference = value
}
return nil
}
func (i *InputFileLocation ) GetVolumeID () (value int64 ) {
if i == nil {
return
}
return i .VolumeID
}
func (i *InputFileLocation ) GetLocalID () (value int ) {
if i == nil {
return
}
return i .LocalID
}
func (i *InputFileLocation ) GetSecret () (value int64 ) {
if i == nil {
return
}
return i .Secret
}
func (i *InputFileLocation ) GetFileReference () (value []byte ) {
if i == nil {
return
}
return i .FileReference
}
type InputEncryptedFileLocation struct {
ID int64
AccessHash int64
}
const InputEncryptedFileLocationTypeID = 0xf5235d55
func (i InputEncryptedFileLocation ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputEncryptedFileLocation {}
_ bin .Decoder = &InputEncryptedFileLocation {}
_ bin .BareEncoder = &InputEncryptedFileLocation {}
_ bin .BareDecoder = &InputEncryptedFileLocation {}
_ InputFileLocationClass = &InputEncryptedFileLocation {}
)
func (i *InputEncryptedFileLocation ) Zero () bool {
if i == nil {
return true
}
if !(i .ID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
return true
}
func (i *InputEncryptedFileLocation ) String () string {
if i == nil {
return "InputEncryptedFileLocation(nil)"
}
type Alias InputEncryptedFileLocation
return fmt .Sprintf ("InputEncryptedFileLocation%+v" , Alias (*i ))
}
func (i *InputEncryptedFileLocation ) FillFrom (from interface {
GetID () (value int64 )
GetAccessHash () (value int64 )
}) {
i .ID = from .GetID ()
i .AccessHash = from .GetAccessHash ()
}
func (*InputEncryptedFileLocation ) TypeID () uint32 {
return InputEncryptedFileLocationTypeID
}
func (*InputEncryptedFileLocation ) TypeName () string {
return "inputEncryptedFileLocation"
}
func (i *InputEncryptedFileLocation ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputEncryptedFileLocation" ,
ID : InputEncryptedFileLocationTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
}
return typ
}
func (i *InputEncryptedFileLocation ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputEncryptedFileLocation#f5235d55 as nil" )
}
b .PutID (InputEncryptedFileLocationTypeID )
return i .EncodeBare (b )
}
func (i *InputEncryptedFileLocation ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputEncryptedFileLocation#f5235d55 as nil" )
}
b .PutLong (i .ID )
b .PutLong (i .AccessHash )
return nil
}
func (i *InputEncryptedFileLocation ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputEncryptedFileLocation#f5235d55 to nil" )
}
if err := b .ConsumeID (InputEncryptedFileLocationTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputEncryptedFileLocation#f5235d55: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputEncryptedFileLocation ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputEncryptedFileLocation#f5235d55 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputEncryptedFileLocation#f5235d55: field id: %w" , err )
}
i .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputEncryptedFileLocation#f5235d55: field access_hash: %w" , err )
}
i .AccessHash = value
}
return nil
}
func (i *InputEncryptedFileLocation ) GetID () (value int64 ) {
if i == nil {
return
}
return i .ID
}
func (i *InputEncryptedFileLocation ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
type InputDocumentFileLocation struct {
ID int64
AccessHash int64
FileReference []byte
ThumbSize string
}
const InputDocumentFileLocationTypeID = 0xbad07584
func (i InputDocumentFileLocation ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputDocumentFileLocation {}
_ bin .Decoder = &InputDocumentFileLocation {}
_ bin .BareEncoder = &InputDocumentFileLocation {}
_ bin .BareDecoder = &InputDocumentFileLocation {}
_ InputFileLocationClass = &InputDocumentFileLocation {}
)
func (i *InputDocumentFileLocation ) Zero () bool {
if i == nil {
return true
}
if !(i .ID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
if !(i .FileReference == nil ) {
return false
}
if !(i .ThumbSize == "" ) {
return false
}
return true
}
func (i *InputDocumentFileLocation ) String () string {
if i == nil {
return "InputDocumentFileLocation(nil)"
}
type Alias InputDocumentFileLocation
return fmt .Sprintf ("InputDocumentFileLocation%+v" , Alias (*i ))
}
func (i *InputDocumentFileLocation ) FillFrom (from interface {
GetID () (value int64 )
GetAccessHash () (value int64 )
GetFileReference () (value []byte )
GetThumbSize () (value string )
}) {
i .ID = from .GetID ()
i .AccessHash = from .GetAccessHash ()
i .FileReference = from .GetFileReference ()
i .ThumbSize = from .GetThumbSize ()
}
func (*InputDocumentFileLocation ) TypeID () uint32 {
return InputDocumentFileLocationTypeID
}
func (*InputDocumentFileLocation ) TypeName () string {
return "inputDocumentFileLocation"
}
func (i *InputDocumentFileLocation ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputDocumentFileLocation" ,
ID : InputDocumentFileLocationTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
{
Name : "FileReference" ,
SchemaName : "file_reference" ,
},
{
Name : "ThumbSize" ,
SchemaName : "thumb_size" ,
},
}
return typ
}
func (i *InputDocumentFileLocation ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputDocumentFileLocation#bad07584 as nil" )
}
b .PutID (InputDocumentFileLocationTypeID )
return i .EncodeBare (b )
}
func (i *InputDocumentFileLocation ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputDocumentFileLocation#bad07584 as nil" )
}
b .PutLong (i .ID )
b .PutLong (i .AccessHash )
b .PutBytes (i .FileReference )
b .PutString (i .ThumbSize )
return nil
}
func (i *InputDocumentFileLocation ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputDocumentFileLocation#bad07584 to nil" )
}
if err := b .ConsumeID (InputDocumentFileLocationTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputDocumentFileLocation#bad07584: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputDocumentFileLocation ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputDocumentFileLocation#bad07584 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputDocumentFileLocation#bad07584: field id: %w" , err )
}
i .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputDocumentFileLocation#bad07584: field access_hash: %w" , err )
}
i .AccessHash = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode inputDocumentFileLocation#bad07584: field file_reference: %w" , err )
}
i .FileReference = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode inputDocumentFileLocation#bad07584: field thumb_size: %w" , err )
}
i .ThumbSize = value
}
return nil
}
func (i *InputDocumentFileLocation ) GetID () (value int64 ) {
if i == nil {
return
}
return i .ID
}
func (i *InputDocumentFileLocation ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
func (i *InputDocumentFileLocation ) GetFileReference () (value []byte ) {
if i == nil {
return
}
return i .FileReference
}
func (i *InputDocumentFileLocation ) GetThumbSize () (value string ) {
if i == nil {
return
}
return i .ThumbSize
}
type InputSecureFileLocation struct {
ID int64
AccessHash int64
}
const InputSecureFileLocationTypeID = 0xcbc7ee28
func (i InputSecureFileLocation ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputSecureFileLocation {}
_ bin .Decoder = &InputSecureFileLocation {}
_ bin .BareEncoder = &InputSecureFileLocation {}
_ bin .BareDecoder = &InputSecureFileLocation {}
_ InputFileLocationClass = &InputSecureFileLocation {}
)
func (i *InputSecureFileLocation ) Zero () bool {
if i == nil {
return true
}
if !(i .ID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
return true
}
func (i *InputSecureFileLocation ) String () string {
if i == nil {
return "InputSecureFileLocation(nil)"
}
type Alias InputSecureFileLocation
return fmt .Sprintf ("InputSecureFileLocation%+v" , Alias (*i ))
}
func (i *InputSecureFileLocation ) FillFrom (from interface {
GetID () (value int64 )
GetAccessHash () (value int64 )
}) {
i .ID = from .GetID ()
i .AccessHash = from .GetAccessHash ()
}
func (*InputSecureFileLocation ) TypeID () uint32 {
return InputSecureFileLocationTypeID
}
func (*InputSecureFileLocation ) TypeName () string {
return "inputSecureFileLocation"
}
func (i *InputSecureFileLocation ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputSecureFileLocation" ,
ID : InputSecureFileLocationTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
}
return typ
}
func (i *InputSecureFileLocation ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputSecureFileLocation#cbc7ee28 as nil" )
}
b .PutID (InputSecureFileLocationTypeID )
return i .EncodeBare (b )
}
func (i *InputSecureFileLocation ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputSecureFileLocation#cbc7ee28 as nil" )
}
b .PutLong (i .ID )
b .PutLong (i .AccessHash )
return nil
}
func (i *InputSecureFileLocation ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputSecureFileLocation#cbc7ee28 to nil" )
}
if err := b .ConsumeID (InputSecureFileLocationTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputSecureFileLocation#cbc7ee28: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputSecureFileLocation ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputSecureFileLocation#cbc7ee28 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputSecureFileLocation#cbc7ee28: field id: %w" , err )
}
i .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputSecureFileLocation#cbc7ee28: field access_hash: %w" , err )
}
i .AccessHash = value
}
return nil
}
func (i *InputSecureFileLocation ) GetID () (value int64 ) {
if i == nil {
return
}
return i .ID
}
func (i *InputSecureFileLocation ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
type InputTakeoutFileLocation struct {
}
const InputTakeoutFileLocationTypeID = 0x29be5899
func (i InputTakeoutFileLocation ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputTakeoutFileLocation {}
_ bin .Decoder = &InputTakeoutFileLocation {}
_ bin .BareEncoder = &InputTakeoutFileLocation {}
_ bin .BareDecoder = &InputTakeoutFileLocation {}
_ InputFileLocationClass = &InputTakeoutFileLocation {}
)
func (i *InputTakeoutFileLocation ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputTakeoutFileLocation ) String () string {
if i == nil {
return "InputTakeoutFileLocation(nil)"
}
type Alias InputTakeoutFileLocation
return fmt .Sprintf ("InputTakeoutFileLocation%+v" , Alias (*i ))
}
func (*InputTakeoutFileLocation ) TypeID () uint32 {
return InputTakeoutFileLocationTypeID
}
func (*InputTakeoutFileLocation ) TypeName () string {
return "inputTakeoutFileLocation"
}
func (i *InputTakeoutFileLocation ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputTakeoutFileLocation" ,
ID : InputTakeoutFileLocationTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputTakeoutFileLocation ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputTakeoutFileLocation#29be5899 as nil" )
}
b .PutID (InputTakeoutFileLocationTypeID )
return i .EncodeBare (b )
}
func (i *InputTakeoutFileLocation ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputTakeoutFileLocation#29be5899 as nil" )
}
return nil
}
func (i *InputTakeoutFileLocation ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputTakeoutFileLocation#29be5899 to nil" )
}
if err := b .ConsumeID (InputTakeoutFileLocationTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputTakeoutFileLocation#29be5899: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputTakeoutFileLocation ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputTakeoutFileLocation#29be5899 to nil" )
}
return nil
}
type InputPhotoFileLocation struct {
ID int64
AccessHash int64
FileReference []byte
ThumbSize string
}
const InputPhotoFileLocationTypeID = 0x40181ffe
func (i InputPhotoFileLocation ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputPhotoFileLocation {}
_ bin .Decoder = &InputPhotoFileLocation {}
_ bin .BareEncoder = &InputPhotoFileLocation {}
_ bin .BareDecoder = &InputPhotoFileLocation {}
_ InputFileLocationClass = &InputPhotoFileLocation {}
)
func (i *InputPhotoFileLocation ) Zero () bool {
if i == nil {
return true
}
if !(i .ID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
if !(i .FileReference == nil ) {
return false
}
if !(i .ThumbSize == "" ) {
return false
}
return true
}
func (i *InputPhotoFileLocation ) String () string {
if i == nil {
return "InputPhotoFileLocation(nil)"
}
type Alias InputPhotoFileLocation
return fmt .Sprintf ("InputPhotoFileLocation%+v" , Alias (*i ))
}
func (i *InputPhotoFileLocation ) FillFrom (from interface {
GetID () (value int64 )
GetAccessHash () (value int64 )
GetFileReference () (value []byte )
GetThumbSize () (value string )
}) {
i .ID = from .GetID ()
i .AccessHash = from .GetAccessHash ()
i .FileReference = from .GetFileReference ()
i .ThumbSize = from .GetThumbSize ()
}
func (*InputPhotoFileLocation ) TypeID () uint32 {
return InputPhotoFileLocationTypeID
}
func (*InputPhotoFileLocation ) TypeName () string {
return "inputPhotoFileLocation"
}
func (i *InputPhotoFileLocation ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPhotoFileLocation" ,
ID : InputPhotoFileLocationTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
{
Name : "FileReference" ,
SchemaName : "file_reference" ,
},
{
Name : "ThumbSize" ,
SchemaName : "thumb_size" ,
},
}
return typ
}
func (i *InputPhotoFileLocation ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPhotoFileLocation#40181ffe as nil" )
}
b .PutID (InputPhotoFileLocationTypeID )
return i .EncodeBare (b )
}
func (i *InputPhotoFileLocation ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPhotoFileLocation#40181ffe as nil" )
}
b .PutLong (i .ID )
b .PutLong (i .AccessHash )
b .PutBytes (i .FileReference )
b .PutString (i .ThumbSize )
return nil
}
func (i *InputPhotoFileLocation ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPhotoFileLocation#40181ffe to nil" )
}
if err := b .ConsumeID (InputPhotoFileLocationTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPhotoFileLocation#40181ffe: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPhotoFileLocation ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPhotoFileLocation#40181ffe to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoFileLocation#40181ffe: field id: %w" , err )
}
i .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoFileLocation#40181ffe: field access_hash: %w" , err )
}
i .AccessHash = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoFileLocation#40181ffe: field file_reference: %w" , err )
}
i .FileReference = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoFileLocation#40181ffe: field thumb_size: %w" , err )
}
i .ThumbSize = value
}
return nil
}
func (i *InputPhotoFileLocation ) GetID () (value int64 ) {
if i == nil {
return
}
return i .ID
}
func (i *InputPhotoFileLocation ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
func (i *InputPhotoFileLocation ) GetFileReference () (value []byte ) {
if i == nil {
return
}
return i .FileReference
}
func (i *InputPhotoFileLocation ) GetThumbSize () (value string ) {
if i == nil {
return
}
return i .ThumbSize
}
type InputPhotoLegacyFileLocation struct {
ID int64
AccessHash int64
FileReference []byte
VolumeID int64
LocalID int
Secret int64
}
const InputPhotoLegacyFileLocationTypeID = 0xd83466f3
func (i InputPhotoLegacyFileLocation ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputPhotoLegacyFileLocation {}
_ bin .Decoder = &InputPhotoLegacyFileLocation {}
_ bin .BareEncoder = &InputPhotoLegacyFileLocation {}
_ bin .BareDecoder = &InputPhotoLegacyFileLocation {}
_ InputFileLocationClass = &InputPhotoLegacyFileLocation {}
)
func (i *InputPhotoLegacyFileLocation ) Zero () bool {
if i == nil {
return true
}
if !(i .ID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
if !(i .FileReference == nil ) {
return false
}
if !(i .VolumeID == 0 ) {
return false
}
if !(i .LocalID == 0 ) {
return false
}
if !(i .Secret == 0 ) {
return false
}
return true
}
func (i *InputPhotoLegacyFileLocation ) String () string {
if i == nil {
return "InputPhotoLegacyFileLocation(nil)"
}
type Alias InputPhotoLegacyFileLocation
return fmt .Sprintf ("InputPhotoLegacyFileLocation%+v" , Alias (*i ))
}
func (i *InputPhotoLegacyFileLocation ) FillFrom (from interface {
GetID () (value int64 )
GetAccessHash () (value int64 )
GetFileReference () (value []byte )
GetVolumeID () (value int64 )
GetLocalID () (value int )
GetSecret () (value int64 )
}) {
i .ID = from .GetID ()
i .AccessHash = from .GetAccessHash ()
i .FileReference = from .GetFileReference ()
i .VolumeID = from .GetVolumeID ()
i .LocalID = from .GetLocalID ()
i .Secret = from .GetSecret ()
}
func (*InputPhotoLegacyFileLocation ) TypeID () uint32 {
return InputPhotoLegacyFileLocationTypeID
}
func (*InputPhotoLegacyFileLocation ) TypeName () string {
return "inputPhotoLegacyFileLocation"
}
func (i *InputPhotoLegacyFileLocation ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPhotoLegacyFileLocation" ,
ID : InputPhotoLegacyFileLocationTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
{
Name : "FileReference" ,
SchemaName : "file_reference" ,
},
{
Name : "VolumeID" ,
SchemaName : "volume_id" ,
},
{
Name : "LocalID" ,
SchemaName : "local_id" ,
},
{
Name : "Secret" ,
SchemaName : "secret" ,
},
}
return typ
}
func (i *InputPhotoLegacyFileLocation ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPhotoLegacyFileLocation#d83466f3 as nil" )
}
b .PutID (InputPhotoLegacyFileLocationTypeID )
return i .EncodeBare (b )
}
func (i *InputPhotoLegacyFileLocation ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPhotoLegacyFileLocation#d83466f3 as nil" )
}
b .PutLong (i .ID )
b .PutLong (i .AccessHash )
b .PutBytes (i .FileReference )
b .PutLong (i .VolumeID )
b .PutInt (i .LocalID )
b .PutLong (i .Secret )
return nil
}
func (i *InputPhotoLegacyFileLocation ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPhotoLegacyFileLocation#d83466f3 to nil" )
}
if err := b .ConsumeID (InputPhotoLegacyFileLocationTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPhotoLegacyFileLocation#d83466f3: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPhotoLegacyFileLocation ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPhotoLegacyFileLocation#d83466f3 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoLegacyFileLocation#d83466f3: field id: %w" , err )
}
i .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoLegacyFileLocation#d83466f3: field access_hash: %w" , err )
}
i .AccessHash = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoLegacyFileLocation#d83466f3: field file_reference: %w" , err )
}
i .FileReference = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoLegacyFileLocation#d83466f3: field volume_id: %w" , err )
}
i .VolumeID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoLegacyFileLocation#d83466f3: field local_id: %w" , err )
}
i .LocalID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPhotoLegacyFileLocation#d83466f3: field secret: %w" , err )
}
i .Secret = value
}
return nil
}
func (i *InputPhotoLegacyFileLocation ) GetID () (value int64 ) {
if i == nil {
return
}
return i .ID
}
func (i *InputPhotoLegacyFileLocation ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
func (i *InputPhotoLegacyFileLocation ) GetFileReference () (value []byte ) {
if i == nil {
return
}
return i .FileReference
}
func (i *InputPhotoLegacyFileLocation ) GetVolumeID () (value int64 ) {
if i == nil {
return
}
return i .VolumeID
}
func (i *InputPhotoLegacyFileLocation ) GetLocalID () (value int ) {
if i == nil {
return
}
return i .LocalID
}
func (i *InputPhotoLegacyFileLocation ) GetSecret () (value int64 ) {
if i == nil {
return
}
return i .Secret
}
type InputPeerPhotoFileLocation struct {
Flags bin .Fields
Big bool
Peer InputPeerClass
PhotoID int64
}
const InputPeerPhotoFileLocationTypeID = 0x37257e99
func (i InputPeerPhotoFileLocation ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputPeerPhotoFileLocation {}
_ bin .Decoder = &InputPeerPhotoFileLocation {}
_ bin .BareEncoder = &InputPeerPhotoFileLocation {}
_ bin .BareDecoder = &InputPeerPhotoFileLocation {}
_ InputFileLocationClass = &InputPeerPhotoFileLocation {}
)
func (i *InputPeerPhotoFileLocation ) Zero () bool {
if i == nil {
return true
}
if !(i .Flags .Zero ()) {
return false
}
if !(i .Big == false ) {
return false
}
if !(i .Peer == nil ) {
return false
}
if !(i .PhotoID == 0 ) {
return false
}
return true
}
func (i *InputPeerPhotoFileLocation ) String () string {
if i == nil {
return "InputPeerPhotoFileLocation(nil)"
}
type Alias InputPeerPhotoFileLocation
return fmt .Sprintf ("InputPeerPhotoFileLocation%+v" , Alias (*i ))
}
func (i *InputPeerPhotoFileLocation ) FillFrom (from interface {
GetBig () (value bool )
GetPeer () (value InputPeerClass )
GetPhotoID () (value int64 )
}) {
i .Big = from .GetBig ()
i .Peer = from .GetPeer ()
i .PhotoID = from .GetPhotoID ()
}
func (*InputPeerPhotoFileLocation ) TypeID () uint32 {
return InputPeerPhotoFileLocationTypeID
}
func (*InputPeerPhotoFileLocation ) TypeName () string {
return "inputPeerPhotoFileLocation"
}
func (i *InputPeerPhotoFileLocation ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerPhotoFileLocation" ,
ID : InputPeerPhotoFileLocationTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Big" ,
SchemaName : "big" ,
Null : !i .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "PhotoID" ,
SchemaName : "photo_id" ,
},
}
return typ
}
func (i *InputPeerPhotoFileLocation ) SetFlags () {
if !(i .Big == false ) {
i .Flags .Set (0 )
}
}
func (i *InputPeerPhotoFileLocation ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerPhotoFileLocation#37257e99 as nil" )
}
b .PutID (InputPeerPhotoFileLocationTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerPhotoFileLocation ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerPhotoFileLocation#37257e99 as nil" )
}
i .SetFlags ()
if err := i .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputPeerPhotoFileLocation#37257e99: field flags: %w" , err )
}
if i .Peer == nil {
return fmt .Errorf ("unable to encode inputPeerPhotoFileLocation#37257e99: field peer is nil" )
}
if err := i .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputPeerPhotoFileLocation#37257e99: field peer: %w" , err )
}
b .PutLong (i .PhotoID )
return nil
}
func (i *InputPeerPhotoFileLocation ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerPhotoFileLocation#37257e99 to nil" )
}
if err := b .ConsumeID (InputPeerPhotoFileLocationTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocation#37257e99: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerPhotoFileLocation ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerPhotoFileLocation#37257e99 to nil" )
}
{
if err := i .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocation#37257e99: field flags: %w" , err )
}
}
i .Big = i .Flags .Has (0 )
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocation#37257e99: field peer: %w" , err )
}
i .Peer = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocation#37257e99: field photo_id: %w" , err )
}
i .PhotoID = value
}
return nil
}
func (i *InputPeerPhotoFileLocation ) SetBig (value bool ) {
if value {
i .Flags .Set (0 )
i .Big = true
} else {
i .Flags .Unset (0 )
i .Big = false
}
}
func (i *InputPeerPhotoFileLocation ) GetBig () (value bool ) {
if i == nil {
return
}
return i .Flags .Has (0 )
}
func (i *InputPeerPhotoFileLocation ) GetPeer () (value InputPeerClass ) {
if i == nil {
return
}
return i .Peer
}
func (i *InputPeerPhotoFileLocation ) GetPhotoID () (value int64 ) {
if i == nil {
return
}
return i .PhotoID
}
type InputStickerSetThumb struct {
Stickerset InputStickerSetClass
ThumbVersion int
}
const InputStickerSetThumbTypeID = 0x9d84f3db
func (i InputStickerSetThumb ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputStickerSetThumb {}
_ bin .Decoder = &InputStickerSetThumb {}
_ bin .BareEncoder = &InputStickerSetThumb {}
_ bin .BareDecoder = &InputStickerSetThumb {}
_ InputFileLocationClass = &InputStickerSetThumb {}
)
func (i *InputStickerSetThumb ) Zero () bool {
if i == nil {
return true
}
if !(i .Stickerset == nil ) {
return false
}
if !(i .ThumbVersion == 0 ) {
return false
}
return true
}
func (i *InputStickerSetThumb ) String () string {
if i == nil {
return "InputStickerSetThumb(nil)"
}
type Alias InputStickerSetThumb
return fmt .Sprintf ("InputStickerSetThumb%+v" , Alias (*i ))
}
func (i *InputStickerSetThumb ) FillFrom (from interface {
GetStickerset () (value InputStickerSetClass )
GetThumbVersion () (value int )
}) {
i .Stickerset = from .GetStickerset ()
i .ThumbVersion = from .GetThumbVersion ()
}
func (*InputStickerSetThumb ) TypeID () uint32 {
return InputStickerSetThumbTypeID
}
func (*InputStickerSetThumb ) TypeName () string {
return "inputStickerSetThumb"
}
func (i *InputStickerSetThumb ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputStickerSetThumb" ,
ID : InputStickerSetThumbTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Stickerset" ,
SchemaName : "stickerset" ,
},
{
Name : "ThumbVersion" ,
SchemaName : "thumb_version" ,
},
}
return typ
}
func (i *InputStickerSetThumb ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputStickerSetThumb#9d84f3db as nil" )
}
b .PutID (InputStickerSetThumbTypeID )
return i .EncodeBare (b )
}
func (i *InputStickerSetThumb ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputStickerSetThumb#9d84f3db as nil" )
}
if i .Stickerset == nil {
return fmt .Errorf ("unable to encode inputStickerSetThumb#9d84f3db: field stickerset is nil" )
}
if err := i .Stickerset .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputStickerSetThumb#9d84f3db: field stickerset: %w" , err )
}
b .PutInt (i .ThumbVersion )
return nil
}
func (i *InputStickerSetThumb ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputStickerSetThumb#9d84f3db to nil" )
}
if err := b .ConsumeID (InputStickerSetThumbTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputStickerSetThumb#9d84f3db: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputStickerSetThumb ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputStickerSetThumb#9d84f3db to nil" )
}
{
value , err := DecodeInputStickerSet (b )
if err != nil {
return fmt .Errorf ("unable to decode inputStickerSetThumb#9d84f3db: field stickerset: %w" , err )
}
i .Stickerset = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputStickerSetThumb#9d84f3db: field thumb_version: %w" , err )
}
i .ThumbVersion = value
}
return nil
}
func (i *InputStickerSetThumb ) GetStickerset () (value InputStickerSetClass ) {
if i == nil {
return
}
return i .Stickerset
}
func (i *InputStickerSetThumb ) GetThumbVersion () (value int ) {
if i == nil {
return
}
return i .ThumbVersion
}
type InputGroupCallStream struct {
Flags bin .Fields
Call InputGroupCall
TimeMs int64
Scale int
VideoChannel int
VideoQuality int
}
const InputGroupCallStreamTypeID = 0x598a92a
func (i InputGroupCallStream ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputGroupCallStream {}
_ bin .Decoder = &InputGroupCallStream {}
_ bin .BareEncoder = &InputGroupCallStream {}
_ bin .BareDecoder = &InputGroupCallStream {}
_ InputFileLocationClass = &InputGroupCallStream {}
)
func (i *InputGroupCallStream ) Zero () bool {
if i == nil {
return true
}
if !(i .Flags .Zero ()) {
return false
}
if !(i .Call .Zero ()) {
return false
}
if !(i .TimeMs == 0 ) {
return false
}
if !(i .Scale == 0 ) {
return false
}
if !(i .VideoChannel == 0 ) {
return false
}
if !(i .VideoQuality == 0 ) {
return false
}
return true
}
func (i *InputGroupCallStream ) String () string {
if i == nil {
return "InputGroupCallStream(nil)"
}
type Alias InputGroupCallStream
return fmt .Sprintf ("InputGroupCallStream%+v" , Alias (*i ))
}
func (i *InputGroupCallStream ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetTimeMs () (value int64 )
GetScale () (value int )
GetVideoChannel () (value int , ok bool )
GetVideoQuality () (value int , ok bool )
}) {
i .Call = from .GetCall ()
i .TimeMs = from .GetTimeMs ()
i .Scale = from .GetScale ()
if val , ok := from .GetVideoChannel (); ok {
i .VideoChannel = val
}
if val , ok := from .GetVideoQuality (); ok {
i .VideoQuality = val
}
}
func (*InputGroupCallStream ) TypeID () uint32 {
return InputGroupCallStreamTypeID
}
func (*InputGroupCallStream ) TypeName () string {
return "inputGroupCallStream"
}
func (i *InputGroupCallStream ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputGroupCallStream" ,
ID : InputGroupCallStreamTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "TimeMs" ,
SchemaName : "time_ms" ,
},
{
Name : "Scale" ,
SchemaName : "scale" ,
},
{
Name : "VideoChannel" ,
SchemaName : "video_channel" ,
Null : !i .Flags .Has (0 ),
},
{
Name : "VideoQuality" ,
SchemaName : "video_quality" ,
Null : !i .Flags .Has (0 ),
},
}
return typ
}
func (i *InputGroupCallStream ) SetFlags () {
if !(i .VideoChannel == 0 ) {
i .Flags .Set (0 )
}
if !(i .VideoQuality == 0 ) {
i .Flags .Set (0 )
}
}
func (i *InputGroupCallStream ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputGroupCallStream#598a92a as nil" )
}
b .PutID (InputGroupCallStreamTypeID )
return i .EncodeBare (b )
}
func (i *InputGroupCallStream ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputGroupCallStream#598a92a as nil" )
}
i .SetFlags ()
if err := i .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputGroupCallStream#598a92a: field flags: %w" , err )
}
if err := i .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputGroupCallStream#598a92a: field call: %w" , err )
}
b .PutLong (i .TimeMs )
b .PutInt (i .Scale )
if i .Flags .Has (0 ) {
b .PutInt (i .VideoChannel )
}
if i .Flags .Has (0 ) {
b .PutInt (i .VideoQuality )
}
return nil
}
func (i *InputGroupCallStream ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputGroupCallStream#598a92a to nil" )
}
if err := b .ConsumeID (InputGroupCallStreamTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputGroupCallStream#598a92a: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputGroupCallStream ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputGroupCallStream#598a92a to nil" )
}
{
if err := i .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode inputGroupCallStream#598a92a: field flags: %w" , err )
}
}
{
if err := i .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode inputGroupCallStream#598a92a: field call: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputGroupCallStream#598a92a: field time_ms: %w" , err )
}
i .TimeMs = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputGroupCallStream#598a92a: field scale: %w" , err )
}
i .Scale = value
}
if i .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputGroupCallStream#598a92a: field video_channel: %w" , err )
}
i .VideoChannel = value
}
if i .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputGroupCallStream#598a92a: field video_quality: %w" , err )
}
i .VideoQuality = value
}
return nil
}
func (i *InputGroupCallStream ) GetCall () (value InputGroupCall ) {
if i == nil {
return
}
return i .Call
}
func (i *InputGroupCallStream ) GetTimeMs () (value int64 ) {
if i == nil {
return
}
return i .TimeMs
}
func (i *InputGroupCallStream ) GetScale () (value int ) {
if i == nil {
return
}
return i .Scale
}
func (i *InputGroupCallStream ) SetVideoChannel (value int ) {
i .Flags .Set (0 )
i .VideoChannel = value
}
func (i *InputGroupCallStream ) GetVideoChannel () (value int , ok bool ) {
if i == nil {
return
}
if !i .Flags .Has (0 ) {
return value , false
}
return i .VideoChannel , true
}
func (i *InputGroupCallStream ) SetVideoQuality (value int ) {
i .Flags .Set (0 )
i .VideoQuality = value
}
func (i *InputGroupCallStream ) GetVideoQuality () (value int , ok bool ) {
if i == nil {
return
}
if !i .Flags .Has (0 ) {
return value , false
}
return i .VideoQuality , true
}
type InputPeerPhotoFileLocationLegacy struct {
Flags bin .Fields
Big bool
Peer InputPeerClass
VolumeID int64
LocalID int
}
const InputPeerPhotoFileLocationLegacyTypeID = 0x27d69997
func (i InputPeerPhotoFileLocationLegacy ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputPeerPhotoFileLocationLegacy {}
_ bin .Decoder = &InputPeerPhotoFileLocationLegacy {}
_ bin .BareEncoder = &InputPeerPhotoFileLocationLegacy {}
_ bin .BareDecoder = &InputPeerPhotoFileLocationLegacy {}
_ InputFileLocationClass = &InputPeerPhotoFileLocationLegacy {}
)
func (i *InputPeerPhotoFileLocationLegacy ) Zero () bool {
if i == nil {
return true
}
if !(i .Flags .Zero ()) {
return false
}
if !(i .Big == false ) {
return false
}
if !(i .Peer == nil ) {
return false
}
if !(i .VolumeID == 0 ) {
return false
}
if !(i .LocalID == 0 ) {
return false
}
return true
}
func (i *InputPeerPhotoFileLocationLegacy ) String () string {
if i == nil {
return "InputPeerPhotoFileLocationLegacy(nil)"
}
type Alias InputPeerPhotoFileLocationLegacy
return fmt .Sprintf ("InputPeerPhotoFileLocationLegacy%+v" , Alias (*i ))
}
func (i *InputPeerPhotoFileLocationLegacy ) FillFrom (from interface {
GetBig () (value bool )
GetPeer () (value InputPeerClass )
GetVolumeID () (value int64 )
GetLocalID () (value int )
}) {
i .Big = from .GetBig ()
i .Peer = from .GetPeer ()
i .VolumeID = from .GetVolumeID ()
i .LocalID = from .GetLocalID ()
}
func (*InputPeerPhotoFileLocationLegacy ) TypeID () uint32 {
return InputPeerPhotoFileLocationLegacyTypeID
}
func (*InputPeerPhotoFileLocationLegacy ) TypeName () string {
return "inputPeerPhotoFileLocationLegacy"
}
func (i *InputPeerPhotoFileLocationLegacy ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerPhotoFileLocationLegacy" ,
ID : InputPeerPhotoFileLocationLegacyTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Big" ,
SchemaName : "big" ,
Null : !i .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "VolumeID" ,
SchemaName : "volume_id" ,
},
{
Name : "LocalID" ,
SchemaName : "local_id" ,
},
}
return typ
}
func (i *InputPeerPhotoFileLocationLegacy ) SetFlags () {
if !(i .Big == false ) {
i .Flags .Set (0 )
}
}
func (i *InputPeerPhotoFileLocationLegacy ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerPhotoFileLocationLegacy#27d69997 as nil" )
}
b .PutID (InputPeerPhotoFileLocationLegacyTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerPhotoFileLocationLegacy ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerPhotoFileLocationLegacy#27d69997 as nil" )
}
i .SetFlags ()
if err := i .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputPeerPhotoFileLocationLegacy#27d69997: field flags: %w" , err )
}
if i .Peer == nil {
return fmt .Errorf ("unable to encode inputPeerPhotoFileLocationLegacy#27d69997: field peer is nil" )
}
if err := i .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputPeerPhotoFileLocationLegacy#27d69997: field peer: %w" , err )
}
b .PutLong (i .VolumeID )
b .PutInt (i .LocalID )
return nil
}
func (i *InputPeerPhotoFileLocationLegacy ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerPhotoFileLocationLegacy#27d69997 to nil" )
}
if err := b .ConsumeID (InputPeerPhotoFileLocationLegacyTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerPhotoFileLocationLegacy ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerPhotoFileLocationLegacy#27d69997 to nil" )
}
{
if err := i .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: field flags: %w" , err )
}
}
i .Big = i .Flags .Has (0 )
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: field peer: %w" , err )
}
i .Peer = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: field volume_id: %w" , err )
}
i .VolumeID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: field local_id: %w" , err )
}
i .LocalID = value
}
return nil
}
func (i *InputPeerPhotoFileLocationLegacy ) SetBig (value bool ) {
if value {
i .Flags .Set (0 )
i .Big = true
} else {
i .Flags .Unset (0 )
i .Big = false
}
}
func (i *InputPeerPhotoFileLocationLegacy ) GetBig () (value bool ) {
if i == nil {
return
}
return i .Flags .Has (0 )
}
func (i *InputPeerPhotoFileLocationLegacy ) GetPeer () (value InputPeerClass ) {
if i == nil {
return
}
return i .Peer
}
func (i *InputPeerPhotoFileLocationLegacy ) GetVolumeID () (value int64 ) {
if i == nil {
return
}
return i .VolumeID
}
func (i *InputPeerPhotoFileLocationLegacy ) GetLocalID () (value int ) {
if i == nil {
return
}
return i .LocalID
}
type InputStickerSetThumbLegacy struct {
Stickerset InputStickerSetClass
VolumeID int64
LocalID int
}
const InputStickerSetThumbLegacyTypeID = 0xdbaeae9
func (i InputStickerSetThumbLegacy ) construct () InputFileLocationClass { return &i }
var (
_ bin .Encoder = &InputStickerSetThumbLegacy {}
_ bin .Decoder = &InputStickerSetThumbLegacy {}
_ bin .BareEncoder = &InputStickerSetThumbLegacy {}
_ bin .BareDecoder = &InputStickerSetThumbLegacy {}
_ InputFileLocationClass = &InputStickerSetThumbLegacy {}
)
func (i *InputStickerSetThumbLegacy ) Zero () bool {
if i == nil {
return true
}
if !(i .Stickerset == nil ) {
return false
}
if !(i .VolumeID == 0 ) {
return false
}
if !(i .LocalID == 0 ) {
return false
}
return true
}
func (i *InputStickerSetThumbLegacy ) String () string {
if i == nil {
return "InputStickerSetThumbLegacy(nil)"
}
type Alias InputStickerSetThumbLegacy
return fmt .Sprintf ("InputStickerSetThumbLegacy%+v" , Alias (*i ))
}
func (i *InputStickerSetThumbLegacy ) FillFrom (from interface {
GetStickerset () (value InputStickerSetClass )
GetVolumeID () (value int64 )
GetLocalID () (value int )
}) {
i .Stickerset = from .GetStickerset ()
i .VolumeID = from .GetVolumeID ()
i .LocalID = from .GetLocalID ()
}
func (*InputStickerSetThumbLegacy ) TypeID () uint32 {
return InputStickerSetThumbLegacyTypeID
}
func (*InputStickerSetThumbLegacy ) TypeName () string {
return "inputStickerSetThumbLegacy"
}
func (i *InputStickerSetThumbLegacy ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputStickerSetThumbLegacy" ,
ID : InputStickerSetThumbLegacyTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Stickerset" ,
SchemaName : "stickerset" ,
},
{
Name : "VolumeID" ,
SchemaName : "volume_id" ,
},
{
Name : "LocalID" ,
SchemaName : "local_id" ,
},
}
return typ
}
func (i *InputStickerSetThumbLegacy ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputStickerSetThumbLegacy#dbaeae9 as nil" )
}
b .PutID (InputStickerSetThumbLegacyTypeID )
return i .EncodeBare (b )
}
func (i *InputStickerSetThumbLegacy ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputStickerSetThumbLegacy#dbaeae9 as nil" )
}
if i .Stickerset == nil {
return fmt .Errorf ("unable to encode inputStickerSetThumbLegacy#dbaeae9: field stickerset is nil" )
}
if err := i .Stickerset .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputStickerSetThumbLegacy#dbaeae9: field stickerset: %w" , err )
}
b .PutLong (i .VolumeID )
b .PutInt (i .LocalID )
return nil
}
func (i *InputStickerSetThumbLegacy ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputStickerSetThumbLegacy#dbaeae9 to nil" )
}
if err := b .ConsumeID (InputStickerSetThumbLegacyTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputStickerSetThumbLegacy#dbaeae9: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputStickerSetThumbLegacy ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputStickerSetThumbLegacy#dbaeae9 to nil" )
}
{
value , err := DecodeInputStickerSet (b )
if err != nil {
return fmt .Errorf ("unable to decode inputStickerSetThumbLegacy#dbaeae9: field stickerset: %w" , err )
}
i .Stickerset = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputStickerSetThumbLegacy#dbaeae9: field volume_id: %w" , err )
}
i .VolumeID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputStickerSetThumbLegacy#dbaeae9: field local_id: %w" , err )
}
i .LocalID = value
}
return nil
}
func (i *InputStickerSetThumbLegacy ) GetStickerset () (value InputStickerSetClass ) {
if i == nil {
return
}
return i .Stickerset
}
func (i *InputStickerSetThumbLegacy ) GetVolumeID () (value int64 ) {
if i == nil {
return
}
return i .VolumeID
}
func (i *InputStickerSetThumbLegacy ) GetLocalID () (value int ) {
if i == nil {
return
}
return i .LocalID
}
const InputFileLocationClassName = "InputFileLocation"
type InputFileLocationClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () InputFileLocationClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeInputFileLocation (buf *bin .Buffer ) (InputFileLocationClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case InputFileLocationTypeID :
v := InputFileLocation {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputEncryptedFileLocationTypeID :
v := InputEncryptedFileLocation {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputDocumentFileLocationTypeID :
v := InputDocumentFileLocation {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputSecureFileLocationTypeID :
v := InputSecureFileLocation {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputTakeoutFileLocationTypeID :
v := InputTakeoutFileLocation {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputPhotoFileLocationTypeID :
v := InputPhotoFileLocation {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputPhotoLegacyFileLocationTypeID :
v := InputPhotoLegacyFileLocation {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputPeerPhotoFileLocationTypeID :
v := InputPeerPhotoFileLocation {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputStickerSetThumbTypeID :
v := InputStickerSetThumb {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputGroupCallStreamTypeID :
v := InputGroupCallStream {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputPeerPhotoFileLocationLegacyTypeID :
v := InputPeerPhotoFileLocationLegacy {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
case InputStickerSetThumbLegacyTypeID :
v := InputStickerSetThumbLegacy {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode InputFileLocationClass: %w" , bin .NewUnexpectedID (id ))
}
}
type InputFileLocationBox struct {
InputFileLocation InputFileLocationClass
}
func (b *InputFileLocationBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode InputFileLocationBox to nil" )
}
v , err := DecodeInputFileLocation (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .InputFileLocation = v
return nil
}
func (b *InputFileLocationBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .InputFileLocation == nil {
return fmt .Errorf ("unable to encode InputFileLocationClass as nil" )
}
return b .InputFileLocation .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 .