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

// InputBotInlineMessageMediaAuto represents TL type `inputBotInlineMessageMediaAuto#3380c786`.
// A media
//
// See https://core.telegram.org/constructor/inputBotInlineMessageMediaAuto for reference.
type InputBotInlineMessageMediaAuto struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, any eventual webpage preview will be shown on top of the message instead of at
	// the bottom.
	InvertMedia bool
	// Caption
	Message string
	// Message entities for styled text¹
	//
	// Links:
	//  1) https://core.telegram.org/api/entities
	//
	// Use SetEntities and GetEntities helpers.
	Entities []MessageEntityClass
	// Inline keyboard
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
}

// InputBotInlineMessageMediaAutoTypeID is TL type id of InputBotInlineMessageMediaAuto.
const InputBotInlineMessageMediaAutoTypeID = 0x3380c786

// construct implements constructor of InputBotInlineMessageClass.
func ( InputBotInlineMessageMediaAuto) () InputBotInlineMessageClass { return & }

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

	_ InputBotInlineMessageClass = &InputBotInlineMessageMediaAuto{}
)

func ( *InputBotInlineMessageMediaAuto) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.InvertMedia == false) {
		return false
	}
	if !(.Message == "") {
		return false
	}
	if !(.Entities == nil) {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageMediaAuto from given interface.
func ( *InputBotInlineMessageMediaAuto) ( interface {
	() ( bool)
	() ( string)
	() ( []MessageEntityClass,  bool)
	() ( ReplyMarkupClass,  bool)
}) {
	.InvertMedia = .()
	.Message = .()
	if ,  := .();  {
		.Entities = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageMediaAuto) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageMediaAuto",
		ID:   InputBotInlineMessageMediaAutoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "InvertMedia",
			SchemaName: "invert_media",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Entities",
			SchemaName: "entities",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputBotInlineMessageMediaAuto) () {
	if !(.InvertMedia == false) {
		.Flags.Set(3)
	}
	if !(.Entities == nil) {
		.Flags.Set(1)
	}
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageMediaAuto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaAuto#3380c786 as nil")
	}
	.PutID(InputBotInlineMessageMediaAutoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageMediaAuto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaAuto#3380c786 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaAuto#3380c786: field flags: %w", )
	}
	.PutString(.Message)
	if .Flags.Has(1) {
		.PutVectorHeader(len(.Entities))
		for ,  := range .Entities {
			if  == nil {
				return fmt.Errorf("unable to encode inputBotInlineMessageMediaAuto#3380c786: field entities element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode inputBotInlineMessageMediaAuto#3380c786: field entities element with index %d: %w", , )
			}
		}
	}
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaAuto#3380c786: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaAuto#3380c786: field reply_markup: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageMediaAuto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageMediaAuto#3380c786 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaAuto#3380c786: field flags: %w", )
		}
	}
	.InvertMedia = .Flags.Has(3)
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaAuto#3380c786: field message: %w", )
		}
		.Message = 
	}
	if .Flags.Has(1) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaAuto#3380c786: field entities: %w", )
		}

		if  > 0 {
			.Entities = make([]MessageEntityClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageEntity()
			if  != nil {
				return fmt.Errorf("unable to decode inputBotInlineMessageMediaAuto#3380c786: field entities: %w", )
			}
			.Entities = append(.Entities, )
		}
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaAuto#3380c786: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	return nil
}

// SetInvertMedia sets value of InvertMedia conditional field.
func ( *InputBotInlineMessageMediaAuto) ( bool) {
	if  {
		.Flags.Set(3)
		.InvertMedia = true
	} else {
		.Flags.Unset(3)
		.InvertMedia = false
	}
}

// GetInvertMedia returns value of InvertMedia conditional field.
func ( *InputBotInlineMessageMediaAuto) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// GetMessage returns value of Message field.
func ( *InputBotInlineMessageMediaAuto) () ( string) {
	if  == nil {
		return
	}
	return .Message
}

// SetEntities sets value of Entities conditional field.
func ( *InputBotInlineMessageMediaAuto) ( []MessageEntityClass) {
	.Flags.Set(1)
	.Entities = 
}

// GetEntities returns value of Entities conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaAuto) () ( []MessageEntityClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Entities, true
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *InputBotInlineMessageMediaAuto) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaAuto) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// MapEntities returns field Entities wrapped in MessageEntityClassArray helper.
func ( *InputBotInlineMessageMediaAuto) () ( MessageEntityClassArray,  bool) {
	if !.Flags.Has(1) {
		return , false
	}
	return MessageEntityClassArray(.Entities), true
}

// InputBotInlineMessageText represents TL type `inputBotInlineMessageText#3dcd7a87`.
// Simple text message
//
// See https://core.telegram.org/constructor/inputBotInlineMessageText for reference.
type InputBotInlineMessageText struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Disable webpage preview
	NoWebpage bool
	// If set, any eventual webpage preview will be shown on top of the message instead of at
	// the bottom.
	InvertMedia bool
	// Message
	Message string
	// Message entities for styled text¹
	//
	// Links:
	//  1) https://core.telegram.org/api/entities
	//
	// Use SetEntities and GetEntities helpers.
	Entities []MessageEntityClass
	// Inline keyboard
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
}

// InputBotInlineMessageTextTypeID is TL type id of InputBotInlineMessageText.
const InputBotInlineMessageTextTypeID = 0x3dcd7a87

// construct implements constructor of InputBotInlineMessageClass.
func ( InputBotInlineMessageText) () InputBotInlineMessageClass { return & }

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

	_ InputBotInlineMessageClass = &InputBotInlineMessageText{}
)

func ( *InputBotInlineMessageText) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.NoWebpage == false) {
		return false
	}
	if !(.InvertMedia == false) {
		return false
	}
	if !(.Message == "") {
		return false
	}
	if !(.Entities == nil) {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageText from given interface.
func ( *InputBotInlineMessageText) ( interface {
	() ( bool)
	() ( bool)
	() ( string)
	() ( []MessageEntityClass,  bool)
	() ( ReplyMarkupClass,  bool)
}) {
	.NoWebpage = .()
	.InvertMedia = .()
	.Message = .()
	if ,  := .();  {
		.Entities = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageText) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageText",
		ID:   InputBotInlineMessageTextTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "NoWebpage",
			SchemaName: "no_webpage",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "InvertMedia",
			SchemaName: "invert_media",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Entities",
			SchemaName: "entities",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputBotInlineMessageText) () {
	if !(.NoWebpage == false) {
		.Flags.Set(0)
	}
	if !(.InvertMedia == false) {
		.Flags.Set(3)
	}
	if !(.Entities == nil) {
		.Flags.Set(1)
	}
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageText) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageText#3dcd7a87 as nil")
	}
	.PutID(InputBotInlineMessageTextTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageText) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageText#3dcd7a87 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageText#3dcd7a87: field flags: %w", )
	}
	.PutString(.Message)
	if .Flags.Has(1) {
		.PutVectorHeader(len(.Entities))
		for ,  := range .Entities {
			if  == nil {
				return fmt.Errorf("unable to encode inputBotInlineMessageText#3dcd7a87: field entities element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode inputBotInlineMessageText#3dcd7a87: field entities element with index %d: %w", , )
			}
		}
	}
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageText#3dcd7a87: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageText#3dcd7a87: field reply_markup: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageText) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageText#3dcd7a87 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageText#3dcd7a87: field flags: %w", )
		}
	}
	.NoWebpage = .Flags.Has(0)
	.InvertMedia = .Flags.Has(3)
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageText#3dcd7a87: field message: %w", )
		}
		.Message = 
	}
	if .Flags.Has(1) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageText#3dcd7a87: field entities: %w", )
		}

		if  > 0 {
			.Entities = make([]MessageEntityClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageEntity()
			if  != nil {
				return fmt.Errorf("unable to decode inputBotInlineMessageText#3dcd7a87: field entities: %w", )
			}
			.Entities = append(.Entities, )
		}
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageText#3dcd7a87: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	return nil
}

// SetNoWebpage sets value of NoWebpage conditional field.
func ( *InputBotInlineMessageText) ( bool) {
	if  {
		.Flags.Set(0)
		.NoWebpage = true
	} else {
		.Flags.Unset(0)
		.NoWebpage = false
	}
}

// GetNoWebpage returns value of NoWebpage conditional field.
func ( *InputBotInlineMessageText) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetInvertMedia sets value of InvertMedia conditional field.
func ( *InputBotInlineMessageText) ( bool) {
	if  {
		.Flags.Set(3)
		.InvertMedia = true
	} else {
		.Flags.Unset(3)
		.InvertMedia = false
	}
}

// GetInvertMedia returns value of InvertMedia conditional field.
func ( *InputBotInlineMessageText) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// GetMessage returns value of Message field.
func ( *InputBotInlineMessageText) () ( string) {
	if  == nil {
		return
	}
	return .Message
}

// SetEntities sets value of Entities conditional field.
func ( *InputBotInlineMessageText) ( []MessageEntityClass) {
	.Flags.Set(1)
	.Entities = 
}

// GetEntities returns value of Entities conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageText) () ( []MessageEntityClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Entities, true
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *InputBotInlineMessageText) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageText) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// MapEntities returns field Entities wrapped in MessageEntityClassArray helper.
func ( *InputBotInlineMessageText) () ( MessageEntityClassArray,  bool) {
	if !.Flags.Has(1) {
		return , false
	}
	return MessageEntityClassArray(.Entities), true
}

// InputBotInlineMessageMediaGeo represents TL type `inputBotInlineMessageMediaGeo#96929a85`.
// Geolocation
//
// See https://core.telegram.org/constructor/inputBotInlineMessageMediaGeo for reference.
type InputBotInlineMessageMediaGeo struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Geolocation
	GeoPoint InputGeoPointClass
	// For live locations¹, a direction in which the location moves, in degrees; 1-360
	//
	// Links:
	//  1) https://core.telegram.org/api/live-location
	//
	// Use SetHeading and GetHeading helpers.
	Heading int
	// Validity period
	//
	// Use SetPeriod and GetPeriod helpers.
	Period int
	// For live locations¹, a maximum distance to another chat member for proximity alerts,
	// in meters (0-100000)
	//
	// Links:
	//  1) https://core.telegram.org/api/live-location
	//
	// Use SetProximityNotificationRadius and GetProximityNotificationRadius helpers.
	ProximityNotificationRadius int
	// Reply markup for bot/inline keyboards
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
}

// InputBotInlineMessageMediaGeoTypeID is TL type id of InputBotInlineMessageMediaGeo.
const InputBotInlineMessageMediaGeoTypeID = 0x96929a85

// construct implements constructor of InputBotInlineMessageClass.
func ( InputBotInlineMessageMediaGeo) () InputBotInlineMessageClass { return & }

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

	_ InputBotInlineMessageClass = &InputBotInlineMessageMediaGeo{}
)

func ( *InputBotInlineMessageMediaGeo) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.GeoPoint == nil) {
		return false
	}
	if !(.Heading == 0) {
		return false
	}
	if !(.Period == 0) {
		return false
	}
	if !(.ProximityNotificationRadius == 0) {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageMediaGeo from given interface.
func ( *InputBotInlineMessageMediaGeo) ( interface {
	() ( InputGeoPointClass)
	() ( int,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( ReplyMarkupClass,  bool)
}) {
	.GeoPoint = .()
	if ,  := .();  {
		.Heading = 
	}

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

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageMediaGeo) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageMediaGeo",
		ID:   InputBotInlineMessageMediaGeoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "GeoPoint",
			SchemaName: "geo_point",
		},
		{
			Name:       "Heading",
			SchemaName: "heading",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Period",
			SchemaName: "period",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "ProximityNotificationRadius",
			SchemaName: "proximity_notification_radius",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputBotInlineMessageMediaGeo) () {
	if !(.Heading == 0) {
		.Flags.Set(0)
	}
	if !(.Period == 0) {
		.Flags.Set(1)
	}
	if !(.ProximityNotificationRadius == 0) {
		.Flags.Set(3)
	}
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageMediaGeo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaGeo#96929a85 as nil")
	}
	.PutID(InputBotInlineMessageMediaGeoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageMediaGeo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaGeo#96929a85 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaGeo#96929a85: field flags: %w", )
	}
	if .GeoPoint == nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaGeo#96929a85: field geo_point is nil")
	}
	if  := .GeoPoint.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaGeo#96929a85: field geo_point: %w", )
	}
	if .Flags.Has(0) {
		.PutInt(.Heading)
	}
	if .Flags.Has(1) {
		.PutInt(.Period)
	}
	if .Flags.Has(3) {
		.PutInt(.ProximityNotificationRadius)
	}
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaGeo#96929a85: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaGeo#96929a85: field reply_markup: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageMediaGeo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageMediaGeo#96929a85 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaGeo#96929a85: field flags: %w", )
		}
	}
	{
		,  := DecodeInputGeoPoint()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaGeo#96929a85: field geo_point: %w", )
		}
		.GeoPoint = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaGeo#96929a85: field heading: %w", )
		}
		.Heading = 
	}
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaGeo#96929a85: field period: %w", )
		}
		.Period = 
	}
	if .Flags.Has(3) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaGeo#96929a85: field proximity_notification_radius: %w", )
		}
		.ProximityNotificationRadius = 
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaGeo#96929a85: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	return nil
}

// GetGeoPoint returns value of GeoPoint field.
func ( *InputBotInlineMessageMediaGeo) () ( InputGeoPointClass) {
	if  == nil {
		return
	}
	return .GeoPoint
}

// SetHeading sets value of Heading conditional field.
func ( *InputBotInlineMessageMediaGeo) ( int) {
	.Flags.Set(0)
	.Heading = 
}

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

// SetPeriod sets value of Period conditional field.
func ( *InputBotInlineMessageMediaGeo) ( int) {
	.Flags.Set(1)
	.Period = 
}

// GetPeriod returns value of Period conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaGeo) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Period, true
}

// SetProximityNotificationRadius sets value of ProximityNotificationRadius conditional field.
func ( *InputBotInlineMessageMediaGeo) ( int) {
	.Flags.Set(3)
	.ProximityNotificationRadius = 
}

// GetProximityNotificationRadius returns value of ProximityNotificationRadius conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaGeo) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .ProximityNotificationRadius, true
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *InputBotInlineMessageMediaGeo) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaGeo) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// InputBotInlineMessageMediaVenue represents TL type `inputBotInlineMessageMediaVenue#417bbf11`.
// Venue
//
// See https://core.telegram.org/constructor/inputBotInlineMessageMediaVenue for reference.
type InputBotInlineMessageMediaVenue struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Geolocation
	GeoPoint InputGeoPointClass
	// Venue name
	Title string
	// Address
	Address string
	// Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be
	// supported
	Provider string
	// Venue ID in the provider's database
	VenueID string
	// Venue type in the provider's database
	VenueType string
	// Inline keyboard
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
}

// InputBotInlineMessageMediaVenueTypeID is TL type id of InputBotInlineMessageMediaVenue.
const InputBotInlineMessageMediaVenueTypeID = 0x417bbf11

// construct implements constructor of InputBotInlineMessageClass.
func ( InputBotInlineMessageMediaVenue) () InputBotInlineMessageClass { return & }

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

	_ InputBotInlineMessageClass = &InputBotInlineMessageMediaVenue{}
)

func ( *InputBotInlineMessageMediaVenue) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.GeoPoint == nil) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.Address == "") {
		return false
	}
	if !(.Provider == "") {
		return false
	}
	if !(.VenueID == "") {
		return false
	}
	if !(.VenueType == "") {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageMediaVenue from given interface.
func ( *InputBotInlineMessageMediaVenue) ( interface {
	() ( InputGeoPointClass)
	() ( string)
	() ( string)
	() ( string)
	() ( string)
	() ( string)
	() ( ReplyMarkupClass,  bool)
}) {
	.GeoPoint = .()
	.Title = .()
	.Address = .()
	.Provider = .()
	.VenueID = .()
	.VenueType = .()
	if ,  := .();  {
		.ReplyMarkup = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageMediaVenue) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageMediaVenue",
		ID:   InputBotInlineMessageMediaVenueTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "GeoPoint",
			SchemaName: "geo_point",
		},
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "Address",
			SchemaName: "address",
		},
		{
			Name:       "Provider",
			SchemaName: "provider",
		},
		{
			Name:       "VenueID",
			SchemaName: "venue_id",
		},
		{
			Name:       "VenueType",
			SchemaName: "venue_type",
		},
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputBotInlineMessageMediaVenue) () {
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageMediaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaVenue#417bbf11 as nil")
	}
	.PutID(InputBotInlineMessageMediaVenueTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageMediaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaVenue#417bbf11 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaVenue#417bbf11: field flags: %w", )
	}
	if .GeoPoint == nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaVenue#417bbf11: field geo_point is nil")
	}
	if  := .GeoPoint.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaVenue#417bbf11: field geo_point: %w", )
	}
	.PutString(.Title)
	.PutString(.Address)
	.PutString(.Provider)
	.PutString(.VenueID)
	.PutString(.VenueType)
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaVenue#417bbf11: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaVenue#417bbf11: field reply_markup: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageMediaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageMediaVenue#417bbf11 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaVenue#417bbf11: field flags: %w", )
		}
	}
	{
		,  := DecodeInputGeoPoint()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaVenue#417bbf11: field geo_point: %w", )
		}
		.GeoPoint = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaVenue#417bbf11: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaVenue#417bbf11: field address: %w", )
		}
		.Address = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaVenue#417bbf11: field provider: %w", )
		}
		.Provider = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaVenue#417bbf11: field venue_id: %w", )
		}
		.VenueID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaVenue#417bbf11: field venue_type: %w", )
		}
		.VenueType = 
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaVenue#417bbf11: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	return nil
}

// GetGeoPoint returns value of GeoPoint field.
func ( *InputBotInlineMessageMediaVenue) () ( InputGeoPointClass) {
	if  == nil {
		return
	}
	return .GeoPoint
}

// GetTitle returns value of Title field.
func ( *InputBotInlineMessageMediaVenue) () ( string) {
	if  == nil {
		return
	}
	return .Title
}

// GetAddress returns value of Address field.
func ( *InputBotInlineMessageMediaVenue) () ( string) {
	if  == nil {
		return
	}
	return .Address
}

// GetProvider returns value of Provider field.
func ( *InputBotInlineMessageMediaVenue) () ( string) {
	if  == nil {
		return
	}
	return .Provider
}

// GetVenueID returns value of VenueID field.
func ( *InputBotInlineMessageMediaVenue) () ( string) {
	if  == nil {
		return
	}
	return .VenueID
}

// GetVenueType returns value of VenueType field.
func ( *InputBotInlineMessageMediaVenue) () ( string) {
	if  == nil {
		return
	}
	return .VenueType
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *InputBotInlineMessageMediaVenue) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaVenue) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// InputBotInlineMessageMediaContact represents TL type `inputBotInlineMessageMediaContact#a6edbffd`.
// A contact
//
// See https://core.telegram.org/constructor/inputBotInlineMessageMediaContact for reference.
type InputBotInlineMessageMediaContact struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Phone number
	PhoneNumber string
	// First name
	FirstName string
	// Last name
	LastName string
	// VCard info
	Vcard string
	// Inline keyboard
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
}

// InputBotInlineMessageMediaContactTypeID is TL type id of InputBotInlineMessageMediaContact.
const InputBotInlineMessageMediaContactTypeID = 0xa6edbffd

// construct implements constructor of InputBotInlineMessageClass.
func ( InputBotInlineMessageMediaContact) () InputBotInlineMessageClass { return & }

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

	_ InputBotInlineMessageClass = &InputBotInlineMessageMediaContact{}
)

func ( *InputBotInlineMessageMediaContact) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.PhoneNumber == "") {
		return false
	}
	if !(.FirstName == "") {
		return false
	}
	if !(.LastName == "") {
		return false
	}
	if !(.Vcard == "") {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageMediaContact from given interface.
func ( *InputBotInlineMessageMediaContact) ( interface {
	() ( string)
	() ( string)
	() ( string)
	() ( string)
	() ( ReplyMarkupClass,  bool)
}) {
	.PhoneNumber = .()
	.FirstName = .()
	.LastName = .()
	.Vcard = .()
	if ,  := .();  {
		.ReplyMarkup = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageMediaContact) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageMediaContact",
		ID:   InputBotInlineMessageMediaContactTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PhoneNumber",
			SchemaName: "phone_number",
		},
		{
			Name:       "FirstName",
			SchemaName: "first_name",
		},
		{
			Name:       "LastName",
			SchemaName: "last_name",
		},
		{
			Name:       "Vcard",
			SchemaName: "vcard",
		},
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputBotInlineMessageMediaContact) () {
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageMediaContact) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaContact#a6edbffd as nil")
	}
	.PutID(InputBotInlineMessageMediaContactTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageMediaContact) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaContact#a6edbffd as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaContact#a6edbffd: field flags: %w", )
	}
	.PutString(.PhoneNumber)
	.PutString(.FirstName)
	.PutString(.LastName)
	.PutString(.Vcard)
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaContact#a6edbffd: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaContact#a6edbffd: field reply_markup: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageMediaContact) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageMediaContact#a6edbffd to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaContact#a6edbffd: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaContact#a6edbffd: field phone_number: %w", )
		}
		.PhoneNumber = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaContact#a6edbffd: field first_name: %w", )
		}
		.FirstName = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaContact#a6edbffd: field last_name: %w", )
		}
		.LastName = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaContact#a6edbffd: field vcard: %w", )
		}
		.Vcard = 
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaContact#a6edbffd: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	return nil
}

// GetPhoneNumber returns value of PhoneNumber field.
func ( *InputBotInlineMessageMediaContact) () ( string) {
	if  == nil {
		return
	}
	return .PhoneNumber
}

// GetFirstName returns value of FirstName field.
func ( *InputBotInlineMessageMediaContact) () ( string) {
	if  == nil {
		return
	}
	return .FirstName
}

// GetLastName returns value of LastName field.
func ( *InputBotInlineMessageMediaContact) () ( string) {
	if  == nil {
		return
	}
	return .LastName
}

// GetVcard returns value of Vcard field.
func ( *InputBotInlineMessageMediaContact) () ( string) {
	if  == nil {
		return
	}
	return .Vcard
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *InputBotInlineMessageMediaContact) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaContact) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// InputBotInlineMessageGame represents TL type `inputBotInlineMessageGame#4b425864`.
// A game
//
// See https://core.telegram.org/constructor/inputBotInlineMessageGame for reference.
type InputBotInlineMessageGame struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Inline keyboard
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
}

// InputBotInlineMessageGameTypeID is TL type id of InputBotInlineMessageGame.
const InputBotInlineMessageGameTypeID = 0x4b425864

// construct implements constructor of InputBotInlineMessageClass.
func ( InputBotInlineMessageGame) () InputBotInlineMessageClass { return & }

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

	_ InputBotInlineMessageClass = &InputBotInlineMessageGame{}
)

func ( *InputBotInlineMessageGame) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageGame from given interface.
func ( *InputBotInlineMessageGame) ( interface {
	() ( ReplyMarkupClass,  bool)
}) {
	if ,  := .();  {
		.ReplyMarkup = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageGame) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageGame",
		ID:   InputBotInlineMessageGameTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputBotInlineMessageGame) () {
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageGame) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageGame#4b425864 as nil")
	}
	.PutID(InputBotInlineMessageGameTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageGame) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageGame#4b425864 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageGame#4b425864: field flags: %w", )
	}
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageGame#4b425864: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageGame#4b425864: field reply_markup: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageGame) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageGame#4b425864 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageGame#4b425864: field flags: %w", )
		}
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageGame#4b425864: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	return nil
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *InputBotInlineMessageGame) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageGame) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// InputBotInlineMessageMediaInvoice represents TL type `inputBotInlineMessageMediaInvoice#d7e78225`.
// An invoice
//
// See https://core.telegram.org/constructor/inputBotInlineMessageMediaInvoice for reference.
type InputBotInlineMessageMediaInvoice struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Product name, 1-32 characters
	Title string
	// Product description, 1-255 characters
	Description string
	// Invoice photo
	//
	// Use SetPhoto and GetPhoto helpers.
	Photo InputWebDocument
	// The invoice
	Invoice Invoice
	// Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use
	// for your internal processes.
	Payload []byte
	// Payments provider token, obtained via Botfather¹
	//
	// Links:
	//  1) https://t.me/botfather
	Provider string
	// A JSON-serialized object for data about the invoice, which will be shared with the
	// payment provider. A detailed description of the required fields should be provided by
	// the payment provider.
	ProviderData DataJSON
	// Inline keyboard
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
}

// InputBotInlineMessageMediaInvoiceTypeID is TL type id of InputBotInlineMessageMediaInvoice.
const InputBotInlineMessageMediaInvoiceTypeID = 0xd7e78225

// construct implements constructor of InputBotInlineMessageClass.
func ( InputBotInlineMessageMediaInvoice) () InputBotInlineMessageClass { return & }

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

	_ InputBotInlineMessageClass = &InputBotInlineMessageMediaInvoice{}
)

func ( *InputBotInlineMessageMediaInvoice) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.Description == "") {
		return false
	}
	if !(.Photo.Zero()) {
		return false
	}
	if !(.Invoice.Zero()) {
		return false
	}
	if !(.Payload == nil) {
		return false
	}
	if !(.Provider == "") {
		return false
	}
	if !(.ProviderData.Zero()) {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageMediaInvoice from given interface.
func ( *InputBotInlineMessageMediaInvoice) ( interface {
	() ( string)
	() ( string)
	() ( InputWebDocument,  bool)
	() ( Invoice)
	() ( []byte)
	() ( string)
	() ( DataJSON)
	() ( ReplyMarkupClass,  bool)
}) {
	.Title = .()
	.Description = .()
	if ,  := .();  {
		.Photo = 
	}

	.Invoice = .()
	.Payload = .()
	.Provider = .()
	.ProviderData = .()
	if ,  := .();  {
		.ReplyMarkup = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageMediaInvoice) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageMediaInvoice",
		ID:   InputBotInlineMessageMediaInvoiceTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "Description",
			SchemaName: "description",
		},
		{
			Name:       "Photo",
			SchemaName: "photo",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Invoice",
			SchemaName: "invoice",
		},
		{
			Name:       "Payload",
			SchemaName: "payload",
		},
		{
			Name:       "Provider",
			SchemaName: "provider",
		},
		{
			Name:       "ProviderData",
			SchemaName: "provider_data",
		},
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputBotInlineMessageMediaInvoice) () {
	if !(.Photo.Zero()) {
		.Flags.Set(0)
	}
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageMediaInvoice) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaInvoice#d7e78225 as nil")
	}
	.PutID(InputBotInlineMessageMediaInvoiceTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageMediaInvoice) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaInvoice#d7e78225 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaInvoice#d7e78225: field flags: %w", )
	}
	.PutString(.Title)
	.PutString(.Description)
	if .Flags.Has(0) {
		if  := .Photo.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaInvoice#d7e78225: field photo: %w", )
		}
	}
	if  := .Invoice.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaInvoice#d7e78225: field invoice: %w", )
	}
	.PutBytes(.Payload)
	.PutString(.Provider)
	if  := .ProviderData.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaInvoice#d7e78225: field provider_data: %w", )
	}
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaInvoice#d7e78225: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaInvoice#d7e78225: field reply_markup: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageMediaInvoice) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageMediaInvoice#d7e78225 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field description: %w", )
		}
		.Description = 
	}
	if .Flags.Has(0) {
		if  := .Photo.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field photo: %w", )
		}
	}
	{
		if  := .Invoice.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field invoice: %w", )
		}
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field payload: %w", )
		}
		.Payload = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field provider: %w", )
		}
		.Provider = 
	}
	{
		if  := .ProviderData.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field provider_data: %w", )
		}
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaInvoice#d7e78225: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	return nil
}

// GetTitle returns value of Title field.
func ( *InputBotInlineMessageMediaInvoice) () ( string) {
	if  == nil {
		return
	}
	return .Title
}

// GetDescription returns value of Description field.
func ( *InputBotInlineMessageMediaInvoice) () ( string) {
	if  == nil {
		return
	}
	return .Description
}

// SetPhoto sets value of Photo conditional field.
func ( *InputBotInlineMessageMediaInvoice) ( InputWebDocument) {
	.Flags.Set(0)
	.Photo = 
}

// GetPhoto returns value of Photo conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaInvoice) () ( InputWebDocument,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Photo, true
}

// GetInvoice returns value of Invoice field.
func ( *InputBotInlineMessageMediaInvoice) () ( Invoice) {
	if  == nil {
		return
	}
	return .Invoice
}

// GetPayload returns value of Payload field.
func ( *InputBotInlineMessageMediaInvoice) () ( []byte) {
	if  == nil {
		return
	}
	return .Payload
}

// GetProvider returns value of Provider field.
func ( *InputBotInlineMessageMediaInvoice) () ( string) {
	if  == nil {
		return
	}
	return .Provider
}

// GetProviderData returns value of ProviderData field.
func ( *InputBotInlineMessageMediaInvoice) () ( DataJSON) {
	if  == nil {
		return
	}
	return .ProviderData
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *InputBotInlineMessageMediaInvoice) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaInvoice) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// InputBotInlineMessageMediaWebPage represents TL type `inputBotInlineMessageMediaWebPage#bddcc510`.
// Specifies options that will be used to generate the link preview for the message, or
// even a standalone link preview without an attached message.
//
// See https://core.telegram.org/constructor/inputBotInlineMessageMediaWebPage for reference.
type InputBotInlineMessageMediaWebPage struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, any eventual webpage preview will be shown on top of the message instead of at
	// the bottom.
	InvertMedia bool
	// If set, specifies that a large media preview should be used.
	ForceLargeMedia bool
	// If set, specifies that a small media preview should be used.
	ForceSmallMedia bool
	// If not set, a WEBPAGE_NOT_FOUND RPC error will be emitted if a webpage preview cannot
	// be generated for the specified url; otherwise, no error will be emitted (unless the
	// provided message is also empty, in which case a MESSAGE_EMPTY will be emitted,
	// instead).
	Optional bool
	// The message, can be empty.
	Message string
	// Message entities for styled text¹
	//
	// Links:
	//  1) https://core.telegram.org/api/entities
	//
	// Use SetEntities and GetEntities helpers.
	Entities []MessageEntityClass
	// The URL to use for the link preview.
	URL string
	// Inline keyboard
	//
	// Use SetReplyMarkup and GetReplyMarkup helpers.
	ReplyMarkup ReplyMarkupClass
}

// InputBotInlineMessageMediaWebPageTypeID is TL type id of InputBotInlineMessageMediaWebPage.
const InputBotInlineMessageMediaWebPageTypeID = 0xbddcc510

// construct implements constructor of InputBotInlineMessageClass.
func ( InputBotInlineMessageMediaWebPage) () InputBotInlineMessageClass { return & }

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

	_ InputBotInlineMessageClass = &InputBotInlineMessageMediaWebPage{}
)

func ( *InputBotInlineMessageMediaWebPage) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.InvertMedia == false) {
		return false
	}
	if !(.ForceLargeMedia == false) {
		return false
	}
	if !(.ForceSmallMedia == false) {
		return false
	}
	if !(.Optional == false) {
		return false
	}
	if !(.Message == "") {
		return false
	}
	if !(.Entities == nil) {
		return false
	}
	if !(.URL == "") {
		return false
	}
	if !(.ReplyMarkup == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageMediaWebPage from given interface.
func ( *InputBotInlineMessageMediaWebPage) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( string)
	() ( []MessageEntityClass,  bool)
	() ( string)
	() ( ReplyMarkupClass,  bool)
}) {
	.InvertMedia = .()
	.ForceLargeMedia = .()
	.ForceSmallMedia = .()
	.Optional = .()
	.Message = .()
	if ,  := .();  {
		.Entities = 
	}

	.URL = .()
	if ,  := .();  {
		.ReplyMarkup = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageMediaWebPage) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageMediaWebPage",
		ID:   InputBotInlineMessageMediaWebPageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "InvertMedia",
			SchemaName: "invert_media",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "ForceLargeMedia",
			SchemaName: "force_large_media",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "ForceSmallMedia",
			SchemaName: "force_small_media",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "Optional",
			SchemaName: "optional",
			Null:       !.Flags.Has(6),
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Entities",
			SchemaName: "entities",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "URL",
			SchemaName: "url",
		},
		{
			Name:       "ReplyMarkup",
			SchemaName: "reply_markup",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputBotInlineMessageMediaWebPage) () {
	if !(.InvertMedia == false) {
		.Flags.Set(3)
	}
	if !(.ForceLargeMedia == false) {
		.Flags.Set(4)
	}
	if !(.ForceSmallMedia == false) {
		.Flags.Set(5)
	}
	if !(.Optional == false) {
		.Flags.Set(6)
	}
	if !(.Entities == nil) {
		.Flags.Set(1)
	}
	if !(.ReplyMarkup == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageMediaWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaWebPage#bddcc510 as nil")
	}
	.PutID(InputBotInlineMessageMediaWebPageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageMediaWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageMediaWebPage#bddcc510 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBotInlineMessageMediaWebPage#bddcc510: field flags: %w", )
	}
	.PutString(.Message)
	if .Flags.Has(1) {
		.PutVectorHeader(len(.Entities))
		for ,  := range .Entities {
			if  == nil {
				return fmt.Errorf("unable to encode inputBotInlineMessageMediaWebPage#bddcc510: field entities element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode inputBotInlineMessageMediaWebPage#bddcc510: field entities element with index %d: %w", , )
			}
		}
	}
	.PutString(.URL)
	if .Flags.Has(2) {
		if .ReplyMarkup == nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaWebPage#bddcc510: field reply_markup is nil")
		}
		if  := .ReplyMarkup.Encode();  != nil {
			return fmt.Errorf("unable to encode inputBotInlineMessageMediaWebPage#bddcc510: field reply_markup: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageMediaWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageMediaWebPage#bddcc510 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaWebPage#bddcc510: field flags: %w", )
		}
	}
	.InvertMedia = .Flags.Has(3)
	.ForceLargeMedia = .Flags.Has(4)
	.ForceSmallMedia = .Flags.Has(5)
	.Optional = .Flags.Has(6)
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaWebPage#bddcc510: field message: %w", )
		}
		.Message = 
	}
	if .Flags.Has(1) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaWebPage#bddcc510: field entities: %w", )
		}

		if  > 0 {
			.Entities = make([]MessageEntityClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageEntity()
			if  != nil {
				return fmt.Errorf("unable to decode inputBotInlineMessageMediaWebPage#bddcc510: field entities: %w", )
			}
			.Entities = append(.Entities, )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaWebPage#bddcc510: field url: %w", )
		}
		.URL = 
	}
	if .Flags.Has(2) {
		,  := DecodeReplyMarkup()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageMediaWebPage#bddcc510: field reply_markup: %w", )
		}
		.ReplyMarkup = 
	}
	return nil
}

// SetInvertMedia sets value of InvertMedia conditional field.
func ( *InputBotInlineMessageMediaWebPage) ( bool) {
	if  {
		.Flags.Set(3)
		.InvertMedia = true
	} else {
		.Flags.Unset(3)
		.InvertMedia = false
	}
}

// GetInvertMedia returns value of InvertMedia conditional field.
func ( *InputBotInlineMessageMediaWebPage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// SetForceLargeMedia sets value of ForceLargeMedia conditional field.
func ( *InputBotInlineMessageMediaWebPage) ( bool) {
	if  {
		.Flags.Set(4)
		.ForceLargeMedia = true
	} else {
		.Flags.Unset(4)
		.ForceLargeMedia = false
	}
}

// GetForceLargeMedia returns value of ForceLargeMedia conditional field.
func ( *InputBotInlineMessageMediaWebPage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(4)
}

// SetForceSmallMedia sets value of ForceSmallMedia conditional field.
func ( *InputBotInlineMessageMediaWebPage) ( bool) {
	if  {
		.Flags.Set(5)
		.ForceSmallMedia = true
	} else {
		.Flags.Unset(5)
		.ForceSmallMedia = false
	}
}

// GetForceSmallMedia returns value of ForceSmallMedia conditional field.
func ( *InputBotInlineMessageMediaWebPage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(5)
}

// SetOptional sets value of Optional conditional field.
func ( *InputBotInlineMessageMediaWebPage) ( bool) {
	if  {
		.Flags.Set(6)
		.Optional = true
	} else {
		.Flags.Unset(6)
		.Optional = false
	}
}

// GetOptional returns value of Optional conditional field.
func ( *InputBotInlineMessageMediaWebPage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(6)
}

// GetMessage returns value of Message field.
func ( *InputBotInlineMessageMediaWebPage) () ( string) {
	if  == nil {
		return
	}
	return .Message
}

// SetEntities sets value of Entities conditional field.
func ( *InputBotInlineMessageMediaWebPage) ( []MessageEntityClass) {
	.Flags.Set(1)
	.Entities = 
}

// GetEntities returns value of Entities conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaWebPage) () ( []MessageEntityClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Entities, true
}

// GetURL returns value of URL field.
func ( *InputBotInlineMessageMediaWebPage) () ( string) {
	if  == nil {
		return
	}
	return .URL
}

// SetReplyMarkup sets value of ReplyMarkup conditional field.
func ( *InputBotInlineMessageMediaWebPage) ( ReplyMarkupClass) {
	.Flags.Set(2)
	.ReplyMarkup = 
}

// GetReplyMarkup returns value of ReplyMarkup conditional field and
// boolean which is true if field was set.
func ( *InputBotInlineMessageMediaWebPage) () ( ReplyMarkupClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyMarkup, true
}

// MapEntities returns field Entities wrapped in MessageEntityClassArray helper.
func ( *InputBotInlineMessageMediaWebPage) () ( MessageEntityClassArray,  bool) {
	if !.Flags.Has(1) {
		return , false
	}
	return MessageEntityClassArray(.Entities), true
}

// InputBotInlineMessageClassName is schema name of InputBotInlineMessageClass.
const InputBotInlineMessageClassName = "InputBotInlineMessage"

// InputBotInlineMessageClass represents InputBotInlineMessage generic type.
//
// See https://core.telegram.org/type/InputBotInlineMessage for reference.
//
// Example:
//
//	g, err := tg.DecodeInputBotInlineMessage(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.InputBotInlineMessageMediaAuto: // inputBotInlineMessageMediaAuto#3380c786
//	case *tg.InputBotInlineMessageText: // inputBotInlineMessageText#3dcd7a87
//	case *tg.InputBotInlineMessageMediaGeo: // inputBotInlineMessageMediaGeo#96929a85
//	case *tg.InputBotInlineMessageMediaVenue: // inputBotInlineMessageMediaVenue#417bbf11
//	case *tg.InputBotInlineMessageMediaContact: // inputBotInlineMessageMediaContact#a6edbffd
//	case *tg.InputBotInlineMessageGame: // inputBotInlineMessageGame#4b425864
//	case *tg.InputBotInlineMessageMediaInvoice: // inputBotInlineMessageMediaInvoice#d7e78225
//	case *tg.InputBotInlineMessageMediaWebPage: // inputBotInlineMessageMediaWebPage#bddcc510
//	default: panic(v)
//	}
type InputBotInlineMessageClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() InputBotInlineMessageClass

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

	// Inline keyboard
	GetReplyMarkup() (value ReplyMarkupClass, ok bool)
}

// DecodeInputBotInlineMessage implements binary de-serialization for InputBotInlineMessageClass.
func ( *bin.Buffer) (InputBotInlineMessageClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case InputBotInlineMessageMediaAutoTypeID:
		// Decoding inputBotInlineMessageMediaAuto#3380c786.
		 := InputBotInlineMessageMediaAuto{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", )
		}
		return &, nil
	case InputBotInlineMessageTextTypeID:
		// Decoding inputBotInlineMessageText#3dcd7a87.
		 := InputBotInlineMessageText{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", )
		}
		return &, nil
	case InputBotInlineMessageMediaGeoTypeID:
		// Decoding inputBotInlineMessageMediaGeo#96929a85.
		 := InputBotInlineMessageMediaGeo{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", )
		}
		return &, nil
	case InputBotInlineMessageMediaVenueTypeID:
		// Decoding inputBotInlineMessageMediaVenue#417bbf11.
		 := InputBotInlineMessageMediaVenue{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", )
		}
		return &, nil
	case InputBotInlineMessageMediaContactTypeID:
		// Decoding inputBotInlineMessageMediaContact#a6edbffd.
		 := InputBotInlineMessageMediaContact{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", )
		}
		return &, nil
	case InputBotInlineMessageGameTypeID:
		// Decoding inputBotInlineMessageGame#4b425864.
		 := InputBotInlineMessageGame{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", )
		}
		return &, nil
	case InputBotInlineMessageMediaInvoiceTypeID:
		// Decoding inputBotInlineMessageMediaInvoice#d7e78225.
		 := InputBotInlineMessageMediaInvoice{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", )
		}
		return &, nil
	case InputBotInlineMessageMediaWebPageTypeID:
		// Decoding inputBotInlineMessageMediaWebPage#bddcc510.
		 := InputBotInlineMessageMediaWebPage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode InputBotInlineMessageClass: %w", bin.NewUnexpectedID())
	}
}

// InputBotInlineMessage boxes the InputBotInlineMessageClass providing a helper.
type InputBotInlineMessageBox struct {
	InputBotInlineMessage InputBotInlineMessageClass
}

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

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