// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// 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{}
)

// InputFileLocation represents TL type `inputFileLocation#dfdaabe1`.
// DEPRECATED location of a photo
//
// See https://core.telegram.org/constructor/inputFileLocation for reference.
type InputFileLocation struct {
	// Server volume
	VolumeID int64
	// File identifier
	LocalID int
	// Check sum to access the file
	Secret int64
	// File reference¹
	//
	// Links:
	//  1) https://core.telegram.org/api/file_reference
	FileReference []byte
}

// InputFileLocationTypeID is TL type id of InputFileLocation.
const InputFileLocationTypeID = 0xdfdaabe1

// construct implements constructor of InputFileLocationClass.
func ( InputFileLocation) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputFileLocation.
var (
	_ bin.Encoder     = &InputFileLocation{}
	_ bin.Decoder     = &InputFileLocation{}
	_ bin.BareEncoder = &InputFileLocation{}
	_ bin.BareDecoder = &InputFileLocation{}

	_ InputFileLocationClass = &InputFileLocation{}
)

func ( *InputFileLocation) () bool {
	if  == nil {
		return true
	}
	if !(.VolumeID == 0) {
		return false
	}
	if !(.LocalID == 0) {
		return false
	}
	if !(.Secret == 0) {
		return false
	}
	if !(.FileReference == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputFileLocation) () string {
	if  == nil {
		return "InputFileLocation(nil)"
	}
	type  InputFileLocation
	return fmt.Sprintf("InputFileLocation%+v", (*))
}

// FillFrom fills InputFileLocation from given interface.
func ( *InputFileLocation) ( interface {
	() ( int64)
	() ( int)
	() ( int64)
	() ( []byte)
}) {
	.VolumeID = .()
	.LocalID = .()
	.Secret = .()
	.FileReference = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputFileLocation) () uint32 {
	return InputFileLocationTypeID
}

// TypeName returns name of type in TL schema.
func (*InputFileLocation) () string {
	return "inputFileLocation"
}

// TypeInfo returns info about TL type.
func ( *InputFileLocation) () tdp.Type {
	 := tdp.Type{
		Name: "inputFileLocation",
		ID:   InputFileLocationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "VolumeID",
			SchemaName: "volume_id",
		},
		{
			Name:       "LocalID",
			SchemaName: "local_id",
		},
		{
			Name:       "Secret",
			SchemaName: "secret",
		},
		{
			Name:       "FileReference",
			SchemaName: "file_reference",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputFileLocation#dfdaabe1 as nil")
	}
	.PutID(InputFileLocationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputFileLocation#dfdaabe1 as nil")
	}
	.PutLong(.VolumeID)
	.PutInt(.LocalID)
	.PutLong(.Secret)
	.PutBytes(.FileReference)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputFileLocation#dfdaabe1 to nil")
	}
	if  := .ConsumeID(InputFileLocationTypeID);  != nil {
		return fmt.Errorf("unable to decode inputFileLocation#dfdaabe1: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputFileLocation#dfdaabe1 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputFileLocation#dfdaabe1: field volume_id: %w", )
		}
		.VolumeID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputFileLocation#dfdaabe1: field local_id: %w", )
		}
		.LocalID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputFileLocation#dfdaabe1: field secret: %w", )
		}
		.Secret = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode inputFileLocation#dfdaabe1: field file_reference: %w", )
		}
		.FileReference = 
	}
	return nil
}

// GetVolumeID returns value of VolumeID field.
func ( *InputFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .VolumeID
}

// GetLocalID returns value of LocalID field.
func ( *InputFileLocation) () ( int) {
	if  == nil {
		return
	}
	return .LocalID
}

// GetSecret returns value of Secret field.
func ( *InputFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .Secret
}

// GetFileReference returns value of FileReference field.
func ( *InputFileLocation) () ( []byte) {
	if  == nil {
		return
	}
	return .FileReference
}

// InputEncryptedFileLocation represents TL type `inputEncryptedFileLocation#f5235d55`.
// Location of encrypted secret chat file.
//
// See https://core.telegram.org/constructor/inputEncryptedFileLocation for reference.
type InputEncryptedFileLocation struct {
	// File ID, id parameter value from encryptedFile¹
	//
	// Links:
	//  1) https://core.telegram.org/constructor/encryptedFile
	ID int64
	// Checksum, access_hash parameter value from encryptedFile¹
	//
	// Links:
	//  1) https://core.telegram.org/constructor/encryptedFile
	AccessHash int64
}

// InputEncryptedFileLocationTypeID is TL type id of InputEncryptedFileLocation.
const InputEncryptedFileLocationTypeID = 0xf5235d55

// construct implements constructor of InputFileLocationClass.
func ( InputEncryptedFileLocation) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputEncryptedFileLocation.
var (
	_ bin.Encoder     = &InputEncryptedFileLocation{}
	_ bin.Decoder     = &InputEncryptedFileLocation{}
	_ bin.BareEncoder = &InputEncryptedFileLocation{}
	_ bin.BareDecoder = &InputEncryptedFileLocation{}

	_ InputFileLocationClass = &InputEncryptedFileLocation{}
)

func ( *InputEncryptedFileLocation) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputEncryptedFileLocation) () string {
	if  == nil {
		return "InputEncryptedFileLocation(nil)"
	}
	type  InputEncryptedFileLocation
	return fmt.Sprintf("InputEncryptedFileLocation%+v", (*))
}

// FillFrom fills InputEncryptedFileLocation from given interface.
func ( *InputEncryptedFileLocation) ( interface {
	() ( int64)
	() ( int64)
}) {
	.ID = .()
	.AccessHash = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputEncryptedFileLocation) () uint32 {
	return InputEncryptedFileLocationTypeID
}

// TypeName returns name of type in TL schema.
func (*InputEncryptedFileLocation) () string {
	return "inputEncryptedFileLocation"
}

// TypeInfo returns info about TL type.
func ( *InputEncryptedFileLocation) () tdp.Type {
	 := tdp.Type{
		Name: "inputEncryptedFileLocation",
		ID:   InputEncryptedFileLocationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputEncryptedFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputEncryptedFileLocation#f5235d55 as nil")
	}
	.PutID(InputEncryptedFileLocationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputEncryptedFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputEncryptedFileLocation#f5235d55 as nil")
	}
	.PutLong(.ID)
	.PutLong(.AccessHash)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputEncryptedFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputEncryptedFileLocation#f5235d55 to nil")
	}
	if  := .ConsumeID(InputEncryptedFileLocationTypeID);  != nil {
		return fmt.Errorf("unable to decode inputEncryptedFileLocation#f5235d55: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputEncryptedFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputEncryptedFileLocation#f5235d55 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputEncryptedFileLocation#f5235d55: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputEncryptedFileLocation#f5235d55: field access_hash: %w", )
		}
		.AccessHash = 
	}
	return nil
}

// GetID returns value of ID field.
func ( *InputEncryptedFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .ID
}

// GetAccessHash returns value of AccessHash field.
func ( *InputEncryptedFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// InputDocumentFileLocation represents TL type `inputDocumentFileLocation#bad07584`.
// Document location (video, voice, audio, basically every type except photo)
//
// See https://core.telegram.org/constructor/inputDocumentFileLocation for reference.
type InputDocumentFileLocation struct {
	// Document ID
	ID int64
	// access_hash parameter from the document¹ constructor
	//
	// Links:
	//  1) https://core.telegram.org/constructor/document
	AccessHash int64
	// File reference¹
	//
	// Links:
	//  1) https://core.telegram.org/api/file_reference
	FileReference []byte
	// Thumbnail size to download the thumbnail
	ThumbSize string
}

// InputDocumentFileLocationTypeID is TL type id of InputDocumentFileLocation.
const InputDocumentFileLocationTypeID = 0xbad07584

// construct implements constructor of InputFileLocationClass.
func ( InputDocumentFileLocation) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputDocumentFileLocation.
var (
	_ bin.Encoder     = &InputDocumentFileLocation{}
	_ bin.Decoder     = &InputDocumentFileLocation{}
	_ bin.BareEncoder = &InputDocumentFileLocation{}
	_ bin.BareDecoder = &InputDocumentFileLocation{}

	_ InputFileLocationClass = &InputDocumentFileLocation{}
)

func ( *InputDocumentFileLocation) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}
	if !(.FileReference == nil) {
		return false
	}
	if !(.ThumbSize == "") {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputDocumentFileLocation) () string {
	if  == nil {
		return "InputDocumentFileLocation(nil)"
	}
	type  InputDocumentFileLocation
	return fmt.Sprintf("InputDocumentFileLocation%+v", (*))
}

// FillFrom fills InputDocumentFileLocation from given interface.
func ( *InputDocumentFileLocation) ( interface {
	() ( int64)
	() ( int64)
	() ( []byte)
	() ( string)
}) {
	.ID = .()
	.AccessHash = .()
	.FileReference = .()
	.ThumbSize = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputDocumentFileLocation) () uint32 {
	return InputDocumentFileLocationTypeID
}

// TypeName returns name of type in TL schema.
func (*InputDocumentFileLocation) () string {
	return "inputDocumentFileLocation"
}

// TypeInfo returns info about TL type.
func ( *InputDocumentFileLocation) () tdp.Type {
	 := tdp.Type{
		Name: "inputDocumentFileLocation",
		ID:   InputDocumentFileLocationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
		{
			Name:       "FileReference",
			SchemaName: "file_reference",
		},
		{
			Name:       "ThumbSize",
			SchemaName: "thumb_size",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputDocumentFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputDocumentFileLocation#bad07584 as nil")
	}
	.PutID(InputDocumentFileLocationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputDocumentFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputDocumentFileLocation#bad07584 as nil")
	}
	.PutLong(.ID)
	.PutLong(.AccessHash)
	.PutBytes(.FileReference)
	.PutString(.ThumbSize)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputDocumentFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputDocumentFileLocation#bad07584 to nil")
	}
	if  := .ConsumeID(InputDocumentFileLocationTypeID);  != nil {
		return fmt.Errorf("unable to decode inputDocumentFileLocation#bad07584: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputDocumentFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputDocumentFileLocation#bad07584 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputDocumentFileLocation#bad07584: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputDocumentFileLocation#bad07584: field access_hash: %w", )
		}
		.AccessHash = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode inputDocumentFileLocation#bad07584: field file_reference: %w", )
		}
		.FileReference = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputDocumentFileLocation#bad07584: field thumb_size: %w", )
		}
		.ThumbSize = 
	}
	return nil
}

// GetID returns value of ID field.
func ( *InputDocumentFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .ID
}

// GetAccessHash returns value of AccessHash field.
func ( *InputDocumentFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// GetFileReference returns value of FileReference field.
func ( *InputDocumentFileLocation) () ( []byte) {
	if  == nil {
		return
	}
	return .FileReference
}

// GetThumbSize returns value of ThumbSize field.
func ( *InputDocumentFileLocation) () ( string) {
	if  == nil {
		return
	}
	return .ThumbSize
}

// InputSecureFileLocation represents TL type `inputSecureFileLocation#cbc7ee28`.
// Location of encrypted telegram passport¹ file.
//
// Links:
//  1. https://core.telegram.org/passport
//
// See https://core.telegram.org/constructor/inputSecureFileLocation for reference.
type InputSecureFileLocation struct {
	// File ID, id parameter value from secureFile¹
	//
	// Links:
	//  1) https://core.telegram.org/constructor/secureFile
	ID int64
	// Checksum, access_hash parameter value from secureFile¹
	//
	// Links:
	//  1) https://core.telegram.org/constructor/secureFile
	AccessHash int64
}

// InputSecureFileLocationTypeID is TL type id of InputSecureFileLocation.
const InputSecureFileLocationTypeID = 0xcbc7ee28

// construct implements constructor of InputFileLocationClass.
func ( InputSecureFileLocation) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputSecureFileLocation.
var (
	_ bin.Encoder     = &InputSecureFileLocation{}
	_ bin.Decoder     = &InputSecureFileLocation{}
	_ bin.BareEncoder = &InputSecureFileLocation{}
	_ bin.BareDecoder = &InputSecureFileLocation{}

	_ InputFileLocationClass = &InputSecureFileLocation{}
)

func ( *InputSecureFileLocation) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputSecureFileLocation) () string {
	if  == nil {
		return "InputSecureFileLocation(nil)"
	}
	type  InputSecureFileLocation
	return fmt.Sprintf("InputSecureFileLocation%+v", (*))
}

// FillFrom fills InputSecureFileLocation from given interface.
func ( *InputSecureFileLocation) ( interface {
	() ( int64)
	() ( int64)
}) {
	.ID = .()
	.AccessHash = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputSecureFileLocation) () uint32 {
	return InputSecureFileLocationTypeID
}

// TypeName returns name of type in TL schema.
func (*InputSecureFileLocation) () string {
	return "inputSecureFileLocation"
}

// TypeInfo returns info about TL type.
func ( *InputSecureFileLocation) () tdp.Type {
	 := tdp.Type{
		Name: "inputSecureFileLocation",
		ID:   InputSecureFileLocationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputSecureFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputSecureFileLocation#cbc7ee28 as nil")
	}
	.PutID(InputSecureFileLocationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputSecureFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputSecureFileLocation#cbc7ee28 as nil")
	}
	.PutLong(.ID)
	.PutLong(.AccessHash)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputSecureFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputSecureFileLocation#cbc7ee28 to nil")
	}
	if  := .ConsumeID(InputSecureFileLocationTypeID);  != nil {
		return fmt.Errorf("unable to decode inputSecureFileLocation#cbc7ee28: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputSecureFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputSecureFileLocation#cbc7ee28 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputSecureFileLocation#cbc7ee28: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputSecureFileLocation#cbc7ee28: field access_hash: %w", )
		}
		.AccessHash = 
	}
	return nil
}

// GetID returns value of ID field.
func ( *InputSecureFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .ID
}

// GetAccessHash returns value of AccessHash field.
func ( *InputSecureFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// InputTakeoutFileLocation represents TL type `inputTakeoutFileLocation#29be5899`.
// Used to download a JSON file that will contain all personal data related to features
// that do not have a specialized takeout method¹ yet, see here »² for more info on
// the takeout API.
//
// Links:
//  1. https://core.telegram.org/api/takeout
//  2. https://core.telegram.org/api/takeout
//
// See https://core.telegram.org/constructor/inputTakeoutFileLocation for reference.
type InputTakeoutFileLocation struct {
}

// InputTakeoutFileLocationTypeID is TL type id of InputTakeoutFileLocation.
const InputTakeoutFileLocationTypeID = 0x29be5899

// construct implements constructor of InputFileLocationClass.
func ( InputTakeoutFileLocation) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputTakeoutFileLocation.
var (
	_ bin.Encoder     = &InputTakeoutFileLocation{}
	_ bin.Decoder     = &InputTakeoutFileLocation{}
	_ bin.BareEncoder = &InputTakeoutFileLocation{}
	_ bin.BareDecoder = &InputTakeoutFileLocation{}

	_ InputFileLocationClass = &InputTakeoutFileLocation{}
)

func ( *InputTakeoutFileLocation) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputTakeoutFileLocation) () string {
	if  == nil {
		return "InputTakeoutFileLocation(nil)"
	}
	type  InputTakeoutFileLocation
	return fmt.Sprintf("InputTakeoutFileLocation%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputTakeoutFileLocation) () uint32 {
	return InputTakeoutFileLocationTypeID
}

// TypeName returns name of type in TL schema.
func (*InputTakeoutFileLocation) () string {
	return "inputTakeoutFileLocation"
}

// TypeInfo returns info about TL type.
func ( *InputTakeoutFileLocation) () tdp.Type {
	 := tdp.Type{
		Name: "inputTakeoutFileLocation",
		ID:   InputTakeoutFileLocationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *InputTakeoutFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputTakeoutFileLocation#29be5899 as nil")
	}
	.PutID(InputTakeoutFileLocationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputTakeoutFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputTakeoutFileLocation#29be5899 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *InputTakeoutFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputTakeoutFileLocation#29be5899 to nil")
	}
	if  := .ConsumeID(InputTakeoutFileLocationTypeID);  != nil {
		return fmt.Errorf("unable to decode inputTakeoutFileLocation#29be5899: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputTakeoutFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputTakeoutFileLocation#29be5899 to nil")
	}
	return nil
}

// InputPhotoFileLocation represents TL type `inputPhotoFileLocation#40181ffe`.
// Use this object to download a photo with upload.getFile¹ method
//
// Links:
//  1. https://core.telegram.org/method/upload.getFile
//
// See https://core.telegram.org/constructor/inputPhotoFileLocation for reference.
type InputPhotoFileLocation struct {
	// Photo ID, obtained from the photo¹ object
	//
	// Links:
	//  1) https://core.telegram.org/constructor/photo
	ID int64
	// Photo's access hash, obtained from the photo¹ object
	//
	// Links:
	//  1) https://core.telegram.org/constructor/photo
	AccessHash int64
	// File reference¹
	//
	// Links:
	//  1) https://core.telegram.org/api/file_reference
	FileReference []byte
	// The PhotoSize¹ to download: must be set to the type field of the desired PhotoSize
	// object of the photo²
	//
	// Links:
	//  1) https://core.telegram.org/type/PhotoSize
	//  2) https://core.telegram.org/constructor/photo
	ThumbSize string
}

// InputPhotoFileLocationTypeID is TL type id of InputPhotoFileLocation.
const InputPhotoFileLocationTypeID = 0x40181ffe

// construct implements constructor of InputFileLocationClass.
func ( InputPhotoFileLocation) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputPhotoFileLocation.
var (
	_ bin.Encoder     = &InputPhotoFileLocation{}
	_ bin.Decoder     = &InputPhotoFileLocation{}
	_ bin.BareEncoder = &InputPhotoFileLocation{}
	_ bin.BareDecoder = &InputPhotoFileLocation{}

	_ InputFileLocationClass = &InputPhotoFileLocation{}
)

func ( *InputPhotoFileLocation) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}
	if !(.FileReference == nil) {
		return false
	}
	if !(.ThumbSize == "") {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputPhotoFileLocation) () string {
	if  == nil {
		return "InputPhotoFileLocation(nil)"
	}
	type  InputPhotoFileLocation
	return fmt.Sprintf("InputPhotoFileLocation%+v", (*))
}

// FillFrom fills InputPhotoFileLocation from given interface.
func ( *InputPhotoFileLocation) ( interface {
	() ( int64)
	() ( int64)
	() ( []byte)
	() ( string)
}) {
	.ID = .()
	.AccessHash = .()
	.FileReference = .()
	.ThumbSize = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputPhotoFileLocation) () uint32 {
	return InputPhotoFileLocationTypeID
}

// TypeName returns name of type in TL schema.
func (*InputPhotoFileLocation) () string {
	return "inputPhotoFileLocation"
}

// TypeInfo returns info about TL type.
func ( *InputPhotoFileLocation) () tdp.Type {
	 := tdp.Type{
		Name: "inputPhotoFileLocation",
		ID:   InputPhotoFileLocationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
		{
			Name:       "FileReference",
			SchemaName: "file_reference",
		},
		{
			Name:       "ThumbSize",
			SchemaName: "thumb_size",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputPhotoFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPhotoFileLocation#40181ffe as nil")
	}
	.PutID(InputPhotoFileLocationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputPhotoFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPhotoFileLocation#40181ffe as nil")
	}
	.PutLong(.ID)
	.PutLong(.AccessHash)
	.PutBytes(.FileReference)
	.PutString(.ThumbSize)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputPhotoFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPhotoFileLocation#40181ffe to nil")
	}
	if  := .ConsumeID(InputPhotoFileLocationTypeID);  != nil {
		return fmt.Errorf("unable to decode inputPhotoFileLocation#40181ffe: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputPhotoFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPhotoFileLocation#40181ffe to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoFileLocation#40181ffe: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoFileLocation#40181ffe: field access_hash: %w", )
		}
		.AccessHash = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoFileLocation#40181ffe: field file_reference: %w", )
		}
		.FileReference = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoFileLocation#40181ffe: field thumb_size: %w", )
		}
		.ThumbSize = 
	}
	return nil
}

// GetID returns value of ID field.
func ( *InputPhotoFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .ID
}

// GetAccessHash returns value of AccessHash field.
func ( *InputPhotoFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// GetFileReference returns value of FileReference field.
func ( *InputPhotoFileLocation) () ( []byte) {
	if  == nil {
		return
	}
	return .FileReference
}

// GetThumbSize returns value of ThumbSize field.
func ( *InputPhotoFileLocation) () ( string) {
	if  == nil {
		return
	}
	return .ThumbSize
}

// InputPhotoLegacyFileLocation represents TL type `inputPhotoLegacyFileLocation#d83466f3`.
// DEPRECATED legacy photo file location
//
// See https://core.telegram.org/constructor/inputPhotoLegacyFileLocation for reference.
type InputPhotoLegacyFileLocation struct {
	// Photo ID
	ID int64
	// Access hash
	AccessHash int64
	// File reference
	FileReference []byte
	// Volume ID
	VolumeID int64
	// Local ID
	LocalID int
	// Secret
	Secret int64
}

// InputPhotoLegacyFileLocationTypeID is TL type id of InputPhotoLegacyFileLocation.
const InputPhotoLegacyFileLocationTypeID = 0xd83466f3

// construct implements constructor of InputFileLocationClass.
func ( InputPhotoLegacyFileLocation) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputPhotoLegacyFileLocation.
var (
	_ bin.Encoder     = &InputPhotoLegacyFileLocation{}
	_ bin.Decoder     = &InputPhotoLegacyFileLocation{}
	_ bin.BareEncoder = &InputPhotoLegacyFileLocation{}
	_ bin.BareDecoder = &InputPhotoLegacyFileLocation{}

	_ InputFileLocationClass = &InputPhotoLegacyFileLocation{}
)

func ( *InputPhotoLegacyFileLocation) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}
	if !(.FileReference == nil) {
		return false
	}
	if !(.VolumeID == 0) {
		return false
	}
	if !(.LocalID == 0) {
		return false
	}
	if !(.Secret == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputPhotoLegacyFileLocation) () string {
	if  == nil {
		return "InputPhotoLegacyFileLocation(nil)"
	}
	type  InputPhotoLegacyFileLocation
	return fmt.Sprintf("InputPhotoLegacyFileLocation%+v", (*))
}

// FillFrom fills InputPhotoLegacyFileLocation from given interface.
func ( *InputPhotoLegacyFileLocation) ( interface {
	() ( int64)
	() ( int64)
	() ( []byte)
	() ( int64)
	() ( int)
	() ( int64)
}) {
	.ID = .()
	.AccessHash = .()
	.FileReference = .()
	.VolumeID = .()
	.LocalID = .()
	.Secret = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputPhotoLegacyFileLocation) () uint32 {
	return InputPhotoLegacyFileLocationTypeID
}

// TypeName returns name of type in TL schema.
func (*InputPhotoLegacyFileLocation) () string {
	return "inputPhotoLegacyFileLocation"
}

// TypeInfo returns info about TL type.
func ( *InputPhotoLegacyFileLocation) () tdp.Type {
	 := tdp.Type{
		Name: "inputPhotoLegacyFileLocation",
		ID:   InputPhotoLegacyFileLocationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.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 
}

// Encode implements bin.Encoder.
func ( *InputPhotoLegacyFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPhotoLegacyFileLocation#d83466f3 as nil")
	}
	.PutID(InputPhotoLegacyFileLocationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputPhotoLegacyFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPhotoLegacyFileLocation#d83466f3 as nil")
	}
	.PutLong(.ID)
	.PutLong(.AccessHash)
	.PutBytes(.FileReference)
	.PutLong(.VolumeID)
	.PutInt(.LocalID)
	.PutLong(.Secret)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputPhotoLegacyFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPhotoLegacyFileLocation#d83466f3 to nil")
	}
	if  := .ConsumeID(InputPhotoLegacyFileLocationTypeID);  != nil {
		return fmt.Errorf("unable to decode inputPhotoLegacyFileLocation#d83466f3: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputPhotoLegacyFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPhotoLegacyFileLocation#d83466f3 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoLegacyFileLocation#d83466f3: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoLegacyFileLocation#d83466f3: field access_hash: %w", )
		}
		.AccessHash = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoLegacyFileLocation#d83466f3: field file_reference: %w", )
		}
		.FileReference = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoLegacyFileLocation#d83466f3: field volume_id: %w", )
		}
		.VolumeID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoLegacyFileLocation#d83466f3: field local_id: %w", )
		}
		.LocalID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhotoLegacyFileLocation#d83466f3: field secret: %w", )
		}
		.Secret = 
	}
	return nil
}

// GetID returns value of ID field.
func ( *InputPhotoLegacyFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .ID
}

// GetAccessHash returns value of AccessHash field.
func ( *InputPhotoLegacyFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// GetFileReference returns value of FileReference field.
func ( *InputPhotoLegacyFileLocation) () ( []byte) {
	if  == nil {
		return
	}
	return .FileReference
}

// GetVolumeID returns value of VolumeID field.
func ( *InputPhotoLegacyFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .VolumeID
}

// GetLocalID returns value of LocalID field.
func ( *InputPhotoLegacyFileLocation) () ( int) {
	if  == nil {
		return
	}
	return .LocalID
}

// GetSecret returns value of Secret field.
func ( *InputPhotoLegacyFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .Secret
}

// InputPeerPhotoFileLocation represents TL type `inputPeerPhotoFileLocation#37257e99`.
// Location of profile photo of channel/group/supergroup/user
//
// See https://core.telegram.org/constructor/inputPeerPhotoFileLocation for reference.
type InputPeerPhotoFileLocation struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether to download the high-quality version of the picture
	Big bool
	// The peer whose profile picture should be downloaded
	Peer InputPeerClass
	// Photo ID
	PhotoID int64
}

// InputPeerPhotoFileLocationTypeID is TL type id of InputPeerPhotoFileLocation.
const InputPeerPhotoFileLocationTypeID = 0x37257e99

// construct implements constructor of InputFileLocationClass.
func ( InputPeerPhotoFileLocation) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputPeerPhotoFileLocation.
var (
	_ bin.Encoder     = &InputPeerPhotoFileLocation{}
	_ bin.Decoder     = &InputPeerPhotoFileLocation{}
	_ bin.BareEncoder = &InputPeerPhotoFileLocation{}
	_ bin.BareDecoder = &InputPeerPhotoFileLocation{}

	_ InputFileLocationClass = &InputPeerPhotoFileLocation{}
)

func ( *InputPeerPhotoFileLocation) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Big == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.PhotoID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputPeerPhotoFileLocation) () string {
	if  == nil {
		return "InputPeerPhotoFileLocation(nil)"
	}
	type  InputPeerPhotoFileLocation
	return fmt.Sprintf("InputPeerPhotoFileLocation%+v", (*))
}

// FillFrom fills InputPeerPhotoFileLocation from given interface.
func ( *InputPeerPhotoFileLocation) ( interface {
	() ( bool)
	() ( InputPeerClass)
	() ( int64)
}) {
	.Big = .()
	.Peer = .()
	.PhotoID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputPeerPhotoFileLocation) () uint32 {
	return InputPeerPhotoFileLocationTypeID
}

// TypeName returns name of type in TL schema.
func (*InputPeerPhotoFileLocation) () string {
	return "inputPeerPhotoFileLocation"
}

// TypeInfo returns info about TL type.
func ( *InputPeerPhotoFileLocation) () tdp.Type {
	 := tdp.Type{
		Name: "inputPeerPhotoFileLocation",
		ID:   InputPeerPhotoFileLocationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Big",
			SchemaName: "big",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "PhotoID",
			SchemaName: "photo_id",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputPeerPhotoFileLocation) () {
	if !(.Big == false) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *InputPeerPhotoFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPeerPhotoFileLocation#37257e99 as nil")
	}
	.PutID(InputPeerPhotoFileLocationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputPeerPhotoFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPeerPhotoFileLocation#37257e99 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputPeerPhotoFileLocation#37257e99: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode inputPeerPhotoFileLocation#37257e99: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode inputPeerPhotoFileLocation#37257e99: field peer: %w", )
	}
	.PutLong(.PhotoID)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputPeerPhotoFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPeerPhotoFileLocation#37257e99 to nil")
	}
	if  := .ConsumeID(InputPeerPhotoFileLocationTypeID);  != nil {
		return fmt.Errorf("unable to decode inputPeerPhotoFileLocation#37257e99: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputPeerPhotoFileLocation) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPeerPhotoFileLocation#37257e99 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputPeerPhotoFileLocation#37257e99: field flags: %w", )
		}
	}
	.Big = .Flags.Has(0)
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode inputPeerPhotoFileLocation#37257e99: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPeerPhotoFileLocation#37257e99: field photo_id: %w", )
		}
		.PhotoID = 
	}
	return nil
}

// SetBig sets value of Big conditional field.
func ( *InputPeerPhotoFileLocation) ( bool) {
	if  {
		.Flags.Set(0)
		.Big = true
	} else {
		.Flags.Unset(0)
		.Big = false
	}
}

// GetBig returns value of Big conditional field.
func ( *InputPeerPhotoFileLocation) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetPeer returns value of Peer field.
func ( *InputPeerPhotoFileLocation) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetPhotoID returns value of PhotoID field.
func ( *InputPeerPhotoFileLocation) () ( int64) {
	if  == nil {
		return
	}
	return .PhotoID
}

// InputStickerSetThumb represents TL type `inputStickerSetThumb#9d84f3db`.
// Location of stickerset thumbnail (see files¹)
//
// Links:
//  1. https://core.telegram.org/api/files
//
// See https://core.telegram.org/constructor/inputStickerSetThumb for reference.
type InputStickerSetThumb struct {
	// Sticker set
	Stickerset InputStickerSetClass
	// Thumbnail version
	ThumbVersion int
}

// InputStickerSetThumbTypeID is TL type id of InputStickerSetThumb.
const InputStickerSetThumbTypeID = 0x9d84f3db

// construct implements constructor of InputFileLocationClass.
func ( InputStickerSetThumb) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputStickerSetThumb.
var (
	_ bin.Encoder     = &InputStickerSetThumb{}
	_ bin.Decoder     = &InputStickerSetThumb{}
	_ bin.BareEncoder = &InputStickerSetThumb{}
	_ bin.BareDecoder = &InputStickerSetThumb{}

	_ InputFileLocationClass = &InputStickerSetThumb{}
)

func ( *InputStickerSetThumb) () bool {
	if  == nil {
		return true
	}
	if !(.Stickerset == nil) {
		return false
	}
	if !(.ThumbVersion == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputStickerSetThumb) () string {
	if  == nil {
		return "InputStickerSetThumb(nil)"
	}
	type  InputStickerSetThumb
	return fmt.Sprintf("InputStickerSetThumb%+v", (*))
}

// FillFrom fills InputStickerSetThumb from given interface.
func ( *InputStickerSetThumb) ( interface {
	() ( InputStickerSetClass)
	() ( int)
}) {
	.Stickerset = .()
	.ThumbVersion = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetThumb) () uint32 {
	return InputStickerSetThumbTypeID
}

// TypeName returns name of type in TL schema.
func (*InputStickerSetThumb) () string {
	return "inputStickerSetThumb"
}

// TypeInfo returns info about TL type.
func ( *InputStickerSetThumb) () tdp.Type {
	 := tdp.Type{
		Name: "inputStickerSetThumb",
		ID:   InputStickerSetThumbTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Stickerset",
			SchemaName: "stickerset",
		},
		{
			Name:       "ThumbVersion",
			SchemaName: "thumb_version",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputStickerSetThumb) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputStickerSetThumb#9d84f3db as nil")
	}
	.PutID(InputStickerSetThumbTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputStickerSetThumb) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputStickerSetThumb#9d84f3db as nil")
	}
	if .Stickerset == nil {
		return fmt.Errorf("unable to encode inputStickerSetThumb#9d84f3db: field stickerset is nil")
	}
	if  := .Stickerset.Encode();  != nil {
		return fmt.Errorf("unable to encode inputStickerSetThumb#9d84f3db: field stickerset: %w", )
	}
	.PutInt(.ThumbVersion)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputStickerSetThumb) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputStickerSetThumb#9d84f3db to nil")
	}
	if  := .ConsumeID(InputStickerSetThumbTypeID);  != nil {
		return fmt.Errorf("unable to decode inputStickerSetThumb#9d84f3db: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputStickerSetThumb) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputStickerSetThumb#9d84f3db to nil")
	}
	{
		,  := DecodeInputStickerSet()
		if  != nil {
			return fmt.Errorf("unable to decode inputStickerSetThumb#9d84f3db: field stickerset: %w", )
		}
		.Stickerset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputStickerSetThumb#9d84f3db: field thumb_version: %w", )
		}
		.ThumbVersion = 
	}
	return nil
}

// GetStickerset returns value of Stickerset field.
func ( *InputStickerSetThumb) () ( InputStickerSetClass) {
	if  == nil {
		return
	}
	return .Stickerset
}

// GetThumbVersion returns value of ThumbVersion field.
func ( *InputStickerSetThumb) () ( int) {
	if  == nil {
		return
	}
	return .ThumbVersion
}

// InputGroupCallStream represents TL type `inputGroupCallStream#598a92a`.
// Chunk of a livestream
//
// See https://core.telegram.org/constructor/inputGroupCallStream for reference.
type InputGroupCallStream struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Livestream info
	Call InputGroupCall
	// Timestamp in milliseconds
	TimeMs int64
	// Specifies the duration of the video segment to fetch in milliseconds, by bitshifting
	// 1000 to the right scale times: duration_ms := 1000 >> scale
	Scale int
	// Selected video channel
	//
	// Use SetVideoChannel and GetVideoChannel helpers.
	VideoChannel int
	// Selected video quality (0 = lowest, 1 = medium, 2 = best)
	//
	// Use SetVideoQuality and GetVideoQuality helpers.
	VideoQuality int
}

// InputGroupCallStreamTypeID is TL type id of InputGroupCallStream.
const InputGroupCallStreamTypeID = 0x598a92a

// construct implements constructor of InputFileLocationClass.
func ( InputGroupCallStream) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputGroupCallStream.
var (
	_ bin.Encoder     = &InputGroupCallStream{}
	_ bin.Decoder     = &InputGroupCallStream{}
	_ bin.BareEncoder = &InputGroupCallStream{}
	_ bin.BareDecoder = &InputGroupCallStream{}

	_ InputFileLocationClass = &InputGroupCallStream{}
)

func ( *InputGroupCallStream) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Call.Zero()) {
		return false
	}
	if !(.TimeMs == 0) {
		return false
	}
	if !(.Scale == 0) {
		return false
	}
	if !(.VideoChannel == 0) {
		return false
	}
	if !(.VideoQuality == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputGroupCallStream) () string {
	if  == nil {
		return "InputGroupCallStream(nil)"
	}
	type  InputGroupCallStream
	return fmt.Sprintf("InputGroupCallStream%+v", (*))
}

// FillFrom fills InputGroupCallStream from given interface.
func ( *InputGroupCallStream) ( interface {
	() ( InputGroupCall)
	() ( int64)
	() ( int)
	() ( int,  bool)
	() ( int,  bool)
}) {
	.Call = .()
	.TimeMs = .()
	.Scale = .()
	if ,  := .();  {
		.VideoChannel = 
	}

	if ,  := .();  {
		.VideoQuality = 
	}

}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputGroupCallStream) () uint32 {
	return InputGroupCallStreamTypeID
}

// TypeName returns name of type in TL schema.
func (*InputGroupCallStream) () string {
	return "inputGroupCallStream"
}

// TypeInfo returns info about TL type.
func ( *InputGroupCallStream) () tdp.Type {
	 := tdp.Type{
		Name: "inputGroupCallStream",
		ID:   InputGroupCallStreamTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "TimeMs",
			SchemaName: "time_ms",
		},
		{
			Name:       "Scale",
			SchemaName: "scale",
		},
		{
			Name:       "VideoChannel",
			SchemaName: "video_channel",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "VideoQuality",
			SchemaName: "video_quality",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputGroupCallStream) () {
	if !(.VideoChannel == 0) {
		.Flags.Set(0)
	}
	if !(.VideoQuality == 0) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *InputGroupCallStream) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputGroupCallStream#598a92a as nil")
	}
	.PutID(InputGroupCallStreamTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputGroupCallStream) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputGroupCallStream#598a92a as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputGroupCallStream#598a92a: field flags: %w", )
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode inputGroupCallStream#598a92a: field call: %w", )
	}
	.PutLong(.TimeMs)
	.PutInt(.Scale)
	if .Flags.Has(0) {
		.PutInt(.VideoChannel)
	}
	if .Flags.Has(0) {
		.PutInt(.VideoQuality)
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *InputGroupCallStream) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputGroupCallStream#598a92a to nil")
	}
	if  := .ConsumeID(InputGroupCallStreamTypeID);  != nil {
		return fmt.Errorf("unable to decode inputGroupCallStream#598a92a: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputGroupCallStream) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputGroupCallStream#598a92a to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputGroupCallStream#598a92a: field flags: %w", )
		}
	}
	{
		if  := .Call.Decode();  != nil {
			return fmt.Errorf("unable to decode inputGroupCallStream#598a92a: field call: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputGroupCallStream#598a92a: field time_ms: %w", )
		}
		.TimeMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputGroupCallStream#598a92a: field scale: %w", )
		}
		.Scale = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputGroupCallStream#598a92a: field video_channel: %w", )
		}
		.VideoChannel = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputGroupCallStream#598a92a: field video_quality: %w", )
		}
		.VideoQuality = 
	}
	return nil
}

// GetCall returns value of Call field.
func ( *InputGroupCallStream) () ( InputGroupCall) {
	if  == nil {
		return
	}
	return .Call
}

// GetTimeMs returns value of TimeMs field.
func ( *InputGroupCallStream) () ( int64) {
	if  == nil {
		return
	}
	return .TimeMs
}

// GetScale returns value of Scale field.
func ( *InputGroupCallStream) () ( int) {
	if  == nil {
		return
	}
	return .Scale
}

// SetVideoChannel sets value of VideoChannel conditional field.
func ( *InputGroupCallStream) ( int) {
	.Flags.Set(0)
	.VideoChannel = 
}

// GetVideoChannel returns value of VideoChannel conditional field and
// boolean which is true if field was set.
func ( *InputGroupCallStream) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .VideoChannel, true
}

// SetVideoQuality sets value of VideoQuality conditional field.
func ( *InputGroupCallStream) ( int) {
	.Flags.Set(0)
	.VideoQuality = 
}

// GetVideoQuality returns value of VideoQuality conditional field and
// boolean which is true if field was set.
func ( *InputGroupCallStream) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .VideoQuality, true
}

// InputPeerPhotoFileLocationLegacy represents TL type `inputPeerPhotoFileLocationLegacy#27d69997`.
//
// See https://core.telegram.org/constructor/inputPeerPhotoFileLocationLegacy for reference.
type InputPeerPhotoFileLocationLegacy struct {
	// Flags field of InputPeerPhotoFileLocationLegacy.
	Flags bin.Fields
	// Big field of InputPeerPhotoFileLocationLegacy.
	Big bool
	// Peer field of InputPeerPhotoFileLocationLegacy.
	Peer InputPeerClass
	// VolumeID field of InputPeerPhotoFileLocationLegacy.
	VolumeID int64
	// LocalID field of InputPeerPhotoFileLocationLegacy.
	LocalID int
}

// InputPeerPhotoFileLocationLegacyTypeID is TL type id of InputPeerPhotoFileLocationLegacy.
const InputPeerPhotoFileLocationLegacyTypeID = 0x27d69997

// construct implements constructor of InputFileLocationClass.
func ( InputPeerPhotoFileLocationLegacy) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputPeerPhotoFileLocationLegacy.
var (
	_ bin.Encoder     = &InputPeerPhotoFileLocationLegacy{}
	_ bin.Decoder     = &InputPeerPhotoFileLocationLegacy{}
	_ bin.BareEncoder = &InputPeerPhotoFileLocationLegacy{}
	_ bin.BareDecoder = &InputPeerPhotoFileLocationLegacy{}

	_ InputFileLocationClass = &InputPeerPhotoFileLocationLegacy{}
)

func ( *InputPeerPhotoFileLocationLegacy) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Big == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.VolumeID == 0) {
		return false
	}
	if !(.LocalID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputPeerPhotoFileLocationLegacy) () string {
	if  == nil {
		return "InputPeerPhotoFileLocationLegacy(nil)"
	}
	type  InputPeerPhotoFileLocationLegacy
	return fmt.Sprintf("InputPeerPhotoFileLocationLegacy%+v", (*))
}

// FillFrom fills InputPeerPhotoFileLocationLegacy from given interface.
func ( *InputPeerPhotoFileLocationLegacy) ( interface {
	() ( bool)
	() ( InputPeerClass)
	() ( int64)
	() ( int)
}) {
	.Big = .()
	.Peer = .()
	.VolumeID = .()
	.LocalID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputPeerPhotoFileLocationLegacy) () uint32 {
	return InputPeerPhotoFileLocationLegacyTypeID
}

// TypeName returns name of type in TL schema.
func (*InputPeerPhotoFileLocationLegacy) () string {
	return "inputPeerPhotoFileLocationLegacy"
}

// TypeInfo returns info about TL type.
func ( *InputPeerPhotoFileLocationLegacy) () tdp.Type {
	 := tdp.Type{
		Name: "inputPeerPhotoFileLocationLegacy",
		ID:   InputPeerPhotoFileLocationLegacyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Big",
			SchemaName: "big",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "VolumeID",
			SchemaName: "volume_id",
		},
		{
			Name:       "LocalID",
			SchemaName: "local_id",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputPeerPhotoFileLocationLegacy) () {
	if !(.Big == false) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *InputPeerPhotoFileLocationLegacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPeerPhotoFileLocationLegacy#27d69997 as nil")
	}
	.PutID(InputPeerPhotoFileLocationLegacyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputPeerPhotoFileLocationLegacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPeerPhotoFileLocationLegacy#27d69997 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputPeerPhotoFileLocationLegacy#27d69997: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode inputPeerPhotoFileLocationLegacy#27d69997: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode inputPeerPhotoFileLocationLegacy#27d69997: field peer: %w", )
	}
	.PutLong(.VolumeID)
	.PutInt(.LocalID)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputPeerPhotoFileLocationLegacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPeerPhotoFileLocationLegacy#27d69997 to nil")
	}
	if  := .ConsumeID(InputPeerPhotoFileLocationLegacyTypeID);  != nil {
		return fmt.Errorf("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputPeerPhotoFileLocationLegacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPeerPhotoFileLocationLegacy#27d69997 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: field flags: %w", )
		}
	}
	.Big = .Flags.Has(0)
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: field volume_id: %w", )
		}
		.VolumeID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputPeerPhotoFileLocationLegacy#27d69997: field local_id: %w", )
		}
		.LocalID = 
	}
	return nil
}

// SetBig sets value of Big conditional field.
func ( *InputPeerPhotoFileLocationLegacy) ( bool) {
	if  {
		.Flags.Set(0)
		.Big = true
	} else {
		.Flags.Unset(0)
		.Big = false
	}
}

// GetBig returns value of Big conditional field.
func ( *InputPeerPhotoFileLocationLegacy) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetPeer returns value of Peer field.
func ( *InputPeerPhotoFileLocationLegacy) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetVolumeID returns value of VolumeID field.
func ( *InputPeerPhotoFileLocationLegacy) () ( int64) {
	if  == nil {
		return
	}
	return .VolumeID
}

// GetLocalID returns value of LocalID field.
func ( *InputPeerPhotoFileLocationLegacy) () ( int) {
	if  == nil {
		return
	}
	return .LocalID
}

// InputStickerSetThumbLegacy represents TL type `inputStickerSetThumbLegacy#dbaeae9`.
//
// See https://core.telegram.org/constructor/inputStickerSetThumbLegacy for reference.
type InputStickerSetThumbLegacy struct {
	// Stickerset field of InputStickerSetThumbLegacy.
	Stickerset InputStickerSetClass
	// VolumeID field of InputStickerSetThumbLegacy.
	VolumeID int64
	// LocalID field of InputStickerSetThumbLegacy.
	LocalID int
}

// InputStickerSetThumbLegacyTypeID is TL type id of InputStickerSetThumbLegacy.
const InputStickerSetThumbLegacyTypeID = 0xdbaeae9

// construct implements constructor of InputFileLocationClass.
func ( InputStickerSetThumbLegacy) () InputFileLocationClass { return & }

// Ensuring interfaces in compile-time for InputStickerSetThumbLegacy.
var (
	_ bin.Encoder     = &InputStickerSetThumbLegacy{}
	_ bin.Decoder     = &InputStickerSetThumbLegacy{}
	_ bin.BareEncoder = &InputStickerSetThumbLegacy{}
	_ bin.BareDecoder = &InputStickerSetThumbLegacy{}

	_ InputFileLocationClass = &InputStickerSetThumbLegacy{}
)

func ( *InputStickerSetThumbLegacy) () bool {
	if  == nil {
		return true
	}
	if !(.Stickerset == nil) {
		return false
	}
	if !(.VolumeID == 0) {
		return false
	}
	if !(.LocalID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputStickerSetThumbLegacy) () string {
	if  == nil {
		return "InputStickerSetThumbLegacy(nil)"
	}
	type  InputStickerSetThumbLegacy
	return fmt.Sprintf("InputStickerSetThumbLegacy%+v", (*))
}

// FillFrom fills InputStickerSetThumbLegacy from given interface.
func ( *InputStickerSetThumbLegacy) ( interface {
	() ( InputStickerSetClass)
	() ( int64)
	() ( int)
}) {
	.Stickerset = .()
	.VolumeID = .()
	.LocalID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputStickerSetThumbLegacy) () uint32 {
	return InputStickerSetThumbLegacyTypeID
}

// TypeName returns name of type in TL schema.
func (*InputStickerSetThumbLegacy) () string {
	return "inputStickerSetThumbLegacy"
}

// TypeInfo returns info about TL type.
func ( *InputStickerSetThumbLegacy) () tdp.Type {
	 := tdp.Type{
		Name: "inputStickerSetThumbLegacy",
		ID:   InputStickerSetThumbLegacyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Stickerset",
			SchemaName: "stickerset",
		},
		{
			Name:       "VolumeID",
			SchemaName: "volume_id",
		},
		{
			Name:       "LocalID",
			SchemaName: "local_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputStickerSetThumbLegacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputStickerSetThumbLegacy#dbaeae9 as nil")
	}
	.PutID(InputStickerSetThumbLegacyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputStickerSetThumbLegacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputStickerSetThumbLegacy#dbaeae9 as nil")
	}
	if .Stickerset == nil {
		return fmt.Errorf("unable to encode inputStickerSetThumbLegacy#dbaeae9: field stickerset is nil")
	}
	if  := .Stickerset.Encode();  != nil {
		return fmt.Errorf("unable to encode inputStickerSetThumbLegacy#dbaeae9: field stickerset: %w", )
	}
	.PutLong(.VolumeID)
	.PutInt(.LocalID)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputStickerSetThumbLegacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputStickerSetThumbLegacy#dbaeae9 to nil")
	}
	if  := .ConsumeID(InputStickerSetThumbLegacyTypeID);  != nil {
		return fmt.Errorf("unable to decode inputStickerSetThumbLegacy#dbaeae9: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputStickerSetThumbLegacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputStickerSetThumbLegacy#dbaeae9 to nil")
	}
	{
		,  := DecodeInputStickerSet()
		if  != nil {
			return fmt.Errorf("unable to decode inputStickerSetThumbLegacy#dbaeae9: field stickerset: %w", )
		}
		.Stickerset = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputStickerSetThumbLegacy#dbaeae9: field volume_id: %w", )
		}
		.VolumeID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputStickerSetThumbLegacy#dbaeae9: field local_id: %w", )
		}
		.LocalID = 
	}
	return nil
}

// GetStickerset returns value of Stickerset field.
func ( *InputStickerSetThumbLegacy) () ( InputStickerSetClass) {
	if  == nil {
		return
	}
	return .Stickerset
}

// GetVolumeID returns value of VolumeID field.
func ( *InputStickerSetThumbLegacy) () ( int64) {
	if  == nil {
		return
	}
	return .VolumeID
}

// GetLocalID returns value of LocalID field.
func ( *InputStickerSetThumbLegacy) () ( int) {
	if  == nil {
		return
	}
	return .LocalID
}

// InputFileLocationClassName is schema name of InputFileLocationClass.
const InputFileLocationClassName = "InputFileLocation"

// InputFileLocationClass represents InputFileLocation generic type.
//
// See https://core.telegram.org/type/InputFileLocation for reference.
//
// Example:
//
//	g, err := tg.DecodeInputFileLocation(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.InputFileLocation: // inputFileLocation#dfdaabe1
//	case *tg.InputEncryptedFileLocation: // inputEncryptedFileLocation#f5235d55
//	case *tg.InputDocumentFileLocation: // inputDocumentFileLocation#bad07584
//	case *tg.InputSecureFileLocation: // inputSecureFileLocation#cbc7ee28
//	case *tg.InputTakeoutFileLocation: // inputTakeoutFileLocation#29be5899
//	case *tg.InputPhotoFileLocation: // inputPhotoFileLocation#40181ffe
//	case *tg.InputPhotoLegacyFileLocation: // inputPhotoLegacyFileLocation#d83466f3
//	case *tg.InputPeerPhotoFileLocation: // inputPeerPhotoFileLocation#37257e99
//	case *tg.InputStickerSetThumb: // inputStickerSetThumb#9d84f3db
//	case *tg.InputGroupCallStream: // inputGroupCallStream#598a92a
//	case *tg.InputPeerPhotoFileLocationLegacy: // inputPeerPhotoFileLocationLegacy#27d69997
//	case *tg.InputStickerSetThumbLegacy: // inputStickerSetThumbLegacy#dbaeae9
//	default: panic(v)
//	}
type InputFileLocationClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() InputFileLocationClass

	// 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
}

// DecodeInputFileLocation implements binary de-serialization for InputFileLocationClass.
func ( *bin.Buffer) (InputFileLocationClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case InputFileLocationTypeID:
		// Decoding inputFileLocation#dfdaabe1.
		 := InputFileLocation{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputEncryptedFileLocationTypeID:
		// Decoding inputEncryptedFileLocation#f5235d55.
		 := InputEncryptedFileLocation{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputDocumentFileLocationTypeID:
		// Decoding inputDocumentFileLocation#bad07584.
		 := InputDocumentFileLocation{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputSecureFileLocationTypeID:
		// Decoding inputSecureFileLocation#cbc7ee28.
		 := InputSecureFileLocation{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputTakeoutFileLocationTypeID:
		// Decoding inputTakeoutFileLocation#29be5899.
		 := InputTakeoutFileLocation{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputPhotoFileLocationTypeID:
		// Decoding inputPhotoFileLocation#40181ffe.
		 := InputPhotoFileLocation{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputPhotoLegacyFileLocationTypeID:
		// Decoding inputPhotoLegacyFileLocation#d83466f3.
		 := InputPhotoLegacyFileLocation{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputPeerPhotoFileLocationTypeID:
		// Decoding inputPeerPhotoFileLocation#37257e99.
		 := InputPeerPhotoFileLocation{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputStickerSetThumbTypeID:
		// Decoding inputStickerSetThumb#9d84f3db.
		 := InputStickerSetThumb{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputGroupCallStreamTypeID:
		// Decoding inputGroupCallStream#598a92a.
		 := InputGroupCallStream{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputPeerPhotoFileLocationLegacyTypeID:
		// Decoding inputPeerPhotoFileLocationLegacy#27d69997.
		 := InputPeerPhotoFileLocationLegacy{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	case InputStickerSetThumbLegacyTypeID:
		// Decoding inputStickerSetThumbLegacy#dbaeae9.
		 := InputStickerSetThumbLegacy{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode InputFileLocationClass: %w", bin.NewUnexpectedID())
	}
}

// InputFileLocation boxes the InputFileLocationClass providing a helper.
type InputFileLocationBox struct {
	InputFileLocation InputFileLocationClass
}

// Decode implements bin.Decoder for InputFileLocationBox.
func ( *InputFileLocationBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode InputFileLocationBox to nil")
	}
	,  := DecodeInputFileLocation()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.InputFileLocation = 
	return nil
}

// Encode implements bin.Encode for InputFileLocationBox.
func ( *InputFileLocationBox) ( *bin.Buffer) error {
	if  == nil || .InputFileLocation == nil {
		return fmt.Errorf("unable to encode InputFileLocationClass as nil")
	}
	return .InputFileLocation.Encode()
}