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

// ReplyKeyboardHide represents TL type `replyKeyboardHide#a03e5b85`.
// Hide sent bot keyboard
//
// See https://core.telegram.org/constructor/replyKeyboardHide for reference.
type ReplyKeyboardHide struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Use this flag if you want to remove the keyboard for specific users only. Targets: 1)
	// users that are @mentioned in the text of the Message object; 2) if the bot's message
	// is a reply (has reply_to_message_id), sender of the original message.Example: A user
	// votes in a poll, bot returns confirmation message in reply to the vote and removes the
	// keyboard for that user, while still showing the keyboard with poll options to users
	// who haven't voted yet
	Selective bool
}

// ReplyKeyboardHideTypeID is TL type id of ReplyKeyboardHide.
const ReplyKeyboardHideTypeID = 0xa03e5b85

// construct implements constructor of ReplyMarkupClass.
func ( ReplyKeyboardHide) () ReplyMarkupClass { return & }

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

	_ ReplyMarkupClass = &ReplyKeyboardHide{}
)

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

	return true
}

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

// FillFrom fills ReplyKeyboardHide from given interface.
func ( *ReplyKeyboardHide) ( interface {
	() ( bool)
}) {
	.Selective = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ReplyKeyboardHide) () tdp.Type {
	 := tdp.Type{
		Name: "replyKeyboardHide",
		ID:   ReplyKeyboardHideTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Selective",
			SchemaName: "selective",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *ReplyKeyboardHide) () {
	if !(.Selective == false) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *ReplyKeyboardHide) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode replyKeyboardHide#a03e5b85 as nil")
	}
	.PutID(ReplyKeyboardHideTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ReplyKeyboardHide) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode replyKeyboardHide#a03e5b85 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode replyKeyboardHide#a03e5b85: field flags: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ReplyKeyboardHide) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode replyKeyboardHide#a03e5b85 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode replyKeyboardHide#a03e5b85: field flags: %w", )
		}
	}
	.Selective = .Flags.Has(2)
	return nil
}

// SetSelective sets value of Selective conditional field.
func ( *ReplyKeyboardHide) ( bool) {
	if  {
		.Flags.Set(2)
		.Selective = true
	} else {
		.Flags.Unset(2)
		.Selective = false
	}
}

// GetSelective returns value of Selective conditional field.
func ( *ReplyKeyboardHide) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// ReplyKeyboardForceReply represents TL type `replyKeyboardForceReply#86b40b08`.
// Force the user to send a reply
//
// See https://core.telegram.org/constructor/replyKeyboardForceReply for reference.
type ReplyKeyboardForceReply struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Requests clients to hide the keyboard as soon as it's been used. The keyboard will
	// still be available, but clients will automatically display the usual letter-keyboard
	// in the chat – the user can press a special button in the input field to see the
	// custom keyboard again.
	SingleUse bool
	// Use this parameter if you want to show the keyboard to specific users only. Targets:
	// 1) users that are @mentioned in the text of the Message object; 2) if the bot's
	// message is a reply (has reply_to_message_id), sender of the original message. Example:
	// A user requests to change the bot's language, bot replies to the request with a
	// keyboard to select the new language. Other users in the group don't see the keyboard.
	Selective bool
	// The placeholder to be shown in the input field when the keyboard is active; 1-64
	// characters.
	//
	// Use SetPlaceholder and GetPlaceholder helpers.
	Placeholder string
}

// ReplyKeyboardForceReplyTypeID is TL type id of ReplyKeyboardForceReply.
const ReplyKeyboardForceReplyTypeID = 0x86b40b08

// construct implements constructor of ReplyMarkupClass.
func ( ReplyKeyboardForceReply) () ReplyMarkupClass { return & }

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

	_ ReplyMarkupClass = &ReplyKeyboardForceReply{}
)

func ( *ReplyKeyboardForceReply) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.SingleUse == false) {
		return false
	}
	if !(.Selective == false) {
		return false
	}
	if !(.Placeholder == "") {
		return false
	}

	return true
}

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

// FillFrom fills ReplyKeyboardForceReply from given interface.
func ( *ReplyKeyboardForceReply) ( interface {
	() ( bool)
	() ( bool)
	() ( string,  bool)
}) {
	.SingleUse = .()
	.Selective = .()
	if ,  := .();  {
		.Placeholder = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *ReplyKeyboardForceReply) () tdp.Type {
	 := tdp.Type{
		Name: "replyKeyboardForceReply",
		ID:   ReplyKeyboardForceReplyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "SingleUse",
			SchemaName: "single_use",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Selective",
			SchemaName: "selective",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Placeholder",
			SchemaName: "placeholder",
			Null:       !.Flags.Has(3),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *ReplyKeyboardForceReply) () {
	if !(.SingleUse == false) {
		.Flags.Set(1)
	}
	if !(.Selective == false) {
		.Flags.Set(2)
	}
	if !(.Placeholder == "") {
		.Flags.Set(3)
	}
}

// Encode implements bin.Encoder.
func ( *ReplyKeyboardForceReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode replyKeyboardForceReply#86b40b08 as nil")
	}
	.PutID(ReplyKeyboardForceReplyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ReplyKeyboardForceReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode replyKeyboardForceReply#86b40b08 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode replyKeyboardForceReply#86b40b08: field flags: %w", )
	}
	if .Flags.Has(3) {
		.PutString(.Placeholder)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ReplyKeyboardForceReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode replyKeyboardForceReply#86b40b08 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode replyKeyboardForceReply#86b40b08: field flags: %w", )
		}
	}
	.SingleUse = .Flags.Has(1)
	.Selective = .Flags.Has(2)
	if .Flags.Has(3) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode replyKeyboardForceReply#86b40b08: field placeholder: %w", )
		}
		.Placeholder = 
	}
	return nil
}

// SetSingleUse sets value of SingleUse conditional field.
func ( *ReplyKeyboardForceReply) ( bool) {
	if  {
		.Flags.Set(1)
		.SingleUse = true
	} else {
		.Flags.Unset(1)
		.SingleUse = false
	}
}

// GetSingleUse returns value of SingleUse conditional field.
func ( *ReplyKeyboardForceReply) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetSelective sets value of Selective conditional field.
func ( *ReplyKeyboardForceReply) ( bool) {
	if  {
		.Flags.Set(2)
		.Selective = true
	} else {
		.Flags.Unset(2)
		.Selective = false
	}
}

// GetSelective returns value of Selective conditional field.
func ( *ReplyKeyboardForceReply) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetPlaceholder sets value of Placeholder conditional field.
func ( *ReplyKeyboardForceReply) ( string) {
	.Flags.Set(3)
	.Placeholder = 
}

// GetPlaceholder returns value of Placeholder conditional field and
// boolean which is true if field was set.
func ( *ReplyKeyboardForceReply) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .Placeholder, true
}

// ReplyKeyboardMarkup represents TL type `replyKeyboardMarkup#85dd99d1`.
// Bot keyboard
//
// See https://core.telegram.org/constructor/replyKeyboardMarkup for reference.
type ReplyKeyboardMarkup struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Requests clients to resize the keyboard vertically for optimal fit (e.g., make the
	// keyboard smaller if there are just two rows of buttons). If not set, the custom
	// keyboard is always of the same height as the app's standard keyboard.
	Resize bool
	// Requests clients to hide the keyboard as soon as it's been used. The keyboard will
	// still be available, but clients will automatically display the usual letter-keyboard
	// in the chat – the user can press a special button in the input field to see the
	// custom keyboard again.
	SingleUse bool
	// Use this parameter if you want to show the keyboard to specific users only. Targets:
	// 1) users that are @mentioned in the text of the Message object; 2) if the bot's
	// message is a reply (has reply_to_message_id), sender of the original message.Example:
	// A user requests to change the bot's language, bot replies to the request with a
	// keyboard to select the new language. Other users in the group don't see the keyboard.
	Selective bool
	// Requests clients to always show the keyboard when the regular keyboard is hidden.
	Persistent bool
	// Button row
	Rows []KeyboardButtonRow
	// The placeholder to be shown in the input field when the keyboard is active; 1-64
	// characters.
	//
	// Use SetPlaceholder and GetPlaceholder helpers.
	Placeholder string
}

// ReplyKeyboardMarkupTypeID is TL type id of ReplyKeyboardMarkup.
const ReplyKeyboardMarkupTypeID = 0x85dd99d1

// construct implements constructor of ReplyMarkupClass.
func ( ReplyKeyboardMarkup) () ReplyMarkupClass { return & }

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

	_ ReplyMarkupClass = &ReplyKeyboardMarkup{}
)

func ( *ReplyKeyboardMarkup) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Resize == false) {
		return false
	}
	if !(.SingleUse == false) {
		return false
	}
	if !(.Selective == false) {
		return false
	}
	if !(.Persistent == false) {
		return false
	}
	if !(.Rows == nil) {
		return false
	}
	if !(.Placeholder == "") {
		return false
	}

	return true
}

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

// FillFrom fills ReplyKeyboardMarkup from given interface.
func ( *ReplyKeyboardMarkup) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( []KeyboardButtonRow)
	() ( string,  bool)
}) {
	.Resize = .()
	.SingleUse = .()
	.Selective = .()
	.Persistent = .()
	.Rows = .()
	if ,  := .();  {
		.Placeholder = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *ReplyKeyboardMarkup) () tdp.Type {
	 := tdp.Type{
		Name: "replyKeyboardMarkup",
		ID:   ReplyKeyboardMarkupTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Resize",
			SchemaName: "resize",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "SingleUse",
			SchemaName: "single_use",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Selective",
			SchemaName: "selective",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Persistent",
			SchemaName: "persistent",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "Rows",
			SchemaName: "rows",
		},
		{
			Name:       "Placeholder",
			SchemaName: "placeholder",
			Null:       !.Flags.Has(3),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *ReplyKeyboardMarkup) () {
	if !(.Resize == false) {
		.Flags.Set(0)
	}
	if !(.SingleUse == false) {
		.Flags.Set(1)
	}
	if !(.Selective == false) {
		.Flags.Set(2)
	}
	if !(.Persistent == false) {
		.Flags.Set(4)
	}
	if !(.Placeholder == "") {
		.Flags.Set(3)
	}
}

// Encode implements bin.Encoder.
func ( *ReplyKeyboardMarkup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode replyKeyboardMarkup#85dd99d1 as nil")
	}
	.PutID(ReplyKeyboardMarkupTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ReplyKeyboardMarkup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode replyKeyboardMarkup#85dd99d1 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode replyKeyboardMarkup#85dd99d1: field flags: %w", )
	}
	.PutVectorHeader(len(.Rows))
	for ,  := range .Rows {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode replyKeyboardMarkup#85dd99d1: field rows element with index %d: %w", , )
		}
	}
	if .Flags.Has(3) {
		.PutString(.Placeholder)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ReplyKeyboardMarkup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode replyKeyboardMarkup#85dd99d1 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode replyKeyboardMarkup#85dd99d1: field flags: %w", )
		}
	}
	.Resize = .Flags.Has(0)
	.SingleUse = .Flags.Has(1)
	.Selective = .Flags.Has(2)
	.Persistent = .Flags.Has(4)
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode replyKeyboardMarkup#85dd99d1: field rows: %w", )
		}

		if  > 0 {
			.Rows = make([]KeyboardButtonRow, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  KeyboardButtonRow
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode replyKeyboardMarkup#85dd99d1: field rows: %w", )
			}
			.Rows = append(.Rows, )
		}
	}
	if .Flags.Has(3) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode replyKeyboardMarkup#85dd99d1: field placeholder: %w", )
		}
		.Placeholder = 
	}
	return nil
}

// SetResize sets value of Resize conditional field.
func ( *ReplyKeyboardMarkup) ( bool) {
	if  {
		.Flags.Set(0)
		.Resize = true
	} else {
		.Flags.Unset(0)
		.Resize = false
	}
}

// GetResize returns value of Resize conditional field.
func ( *ReplyKeyboardMarkup) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetSingleUse sets value of SingleUse conditional field.
func ( *ReplyKeyboardMarkup) ( bool) {
	if  {
		.Flags.Set(1)
		.SingleUse = true
	} else {
		.Flags.Unset(1)
		.SingleUse = false
	}
}

// GetSingleUse returns value of SingleUse conditional field.
func ( *ReplyKeyboardMarkup) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetSelective sets value of Selective conditional field.
func ( *ReplyKeyboardMarkup) ( bool) {
	if  {
		.Flags.Set(2)
		.Selective = true
	} else {
		.Flags.Unset(2)
		.Selective = false
	}
}

// GetSelective returns value of Selective conditional field.
func ( *ReplyKeyboardMarkup) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetPersistent sets value of Persistent conditional field.
func ( *ReplyKeyboardMarkup) ( bool) {
	if  {
		.Flags.Set(4)
		.Persistent = true
	} else {
		.Flags.Unset(4)
		.Persistent = false
	}
}

// GetPersistent returns value of Persistent conditional field.
func ( *ReplyKeyboardMarkup) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(4)
}

// GetRows returns value of Rows field.
func ( *ReplyKeyboardMarkup) () ( []KeyboardButtonRow) {
	if  == nil {
		return
	}
	return .Rows
}

// SetPlaceholder sets value of Placeholder conditional field.
func ( *ReplyKeyboardMarkup) ( string) {
	.Flags.Set(3)
	.Placeholder = 
}

// GetPlaceholder returns value of Placeholder conditional field and
// boolean which is true if field was set.
func ( *ReplyKeyboardMarkup) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .Placeholder, true
}

// ReplyInlineMarkup represents TL type `replyInlineMarkup#48a30254`.
// Bot or inline keyboard
//
// See https://core.telegram.org/constructor/replyInlineMarkup for reference.
type ReplyInlineMarkup struct {
	// Bot or inline keyboard rows
	Rows []KeyboardButtonRow
}

// ReplyInlineMarkupTypeID is TL type id of ReplyInlineMarkup.
const ReplyInlineMarkupTypeID = 0x48a30254

// construct implements constructor of ReplyMarkupClass.
func ( ReplyInlineMarkup) () ReplyMarkupClass { return & }

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

	_ ReplyMarkupClass = &ReplyInlineMarkup{}
)

func ( *ReplyInlineMarkup) () bool {
	if  == nil {
		return true
	}
	if !(.Rows == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ReplyInlineMarkup from given interface.
func ( *ReplyInlineMarkup) ( interface {
	() ( []KeyboardButtonRow)
}) {
	.Rows = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ReplyInlineMarkup) () tdp.Type {
	 := tdp.Type{
		Name: "replyInlineMarkup",
		ID:   ReplyInlineMarkupTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Rows",
			SchemaName: "rows",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ReplyInlineMarkup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode replyInlineMarkup#48a30254 as nil")
	}
	.PutID(ReplyInlineMarkupTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ReplyInlineMarkup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode replyInlineMarkup#48a30254 as nil")
	}
	.PutVectorHeader(len(.Rows))
	for ,  := range .Rows {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode replyInlineMarkup#48a30254: field rows element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ReplyInlineMarkup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode replyInlineMarkup#48a30254 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode replyInlineMarkup#48a30254: field rows: %w", )
		}

		if  > 0 {
			.Rows = make([]KeyboardButtonRow, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  KeyboardButtonRow
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode replyInlineMarkup#48a30254: field rows: %w", )
			}
			.Rows = append(.Rows, )
		}
	}
	return nil
}

// GetRows returns value of Rows field.
func ( *ReplyInlineMarkup) () ( []KeyboardButtonRow) {
	if  == nil {
		return
	}
	return .Rows
}

// ReplyMarkupClassName is schema name of ReplyMarkupClass.
const ReplyMarkupClassName = "ReplyMarkup"

// ReplyMarkupClass represents ReplyMarkup generic type.
//
// See https://core.telegram.org/type/ReplyMarkup for reference.
//
// Example:
//
//	g, err := tg.DecodeReplyMarkup(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.ReplyKeyboardHide: // replyKeyboardHide#a03e5b85
//	case *tg.ReplyKeyboardForceReply: // replyKeyboardForceReply#86b40b08
//	case *tg.ReplyKeyboardMarkup: // replyKeyboardMarkup#85dd99d1
//	case *tg.ReplyInlineMarkup: // replyInlineMarkup#48a30254
//	default: panic(v)
//	}
type ReplyMarkupClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() ReplyMarkupClass

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

// DecodeReplyMarkup implements binary de-serialization for ReplyMarkupClass.
func ( *bin.Buffer) (ReplyMarkupClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case ReplyKeyboardHideTypeID:
		// Decoding replyKeyboardHide#a03e5b85.
		 := ReplyKeyboardHide{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ReplyMarkupClass: %w", )
		}
		return &, nil
	case ReplyKeyboardForceReplyTypeID:
		// Decoding replyKeyboardForceReply#86b40b08.
		 := ReplyKeyboardForceReply{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ReplyMarkupClass: %w", )
		}
		return &, nil
	case ReplyKeyboardMarkupTypeID:
		// Decoding replyKeyboardMarkup#85dd99d1.
		 := ReplyKeyboardMarkup{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ReplyMarkupClass: %w", )
		}
		return &, nil
	case ReplyInlineMarkupTypeID:
		// Decoding replyInlineMarkup#48a30254.
		 := ReplyInlineMarkup{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ReplyMarkupClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode ReplyMarkupClass: %w", bin.NewUnexpectedID())
	}
}

// ReplyMarkup boxes the ReplyMarkupClass providing a helper.
type ReplyMarkupBox struct {
	ReplyMarkup ReplyMarkupClass
}

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

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