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

// KeyboardInlineButtonRow represents TL type `keyboardInlineButtonRow#19420af6`.
//
// See https://core.telegram.org/constructor/keyboardInlineButtonRow for reference.
type KeyboardInlineButtonRow struct {
	// Buttons field of KeyboardInlineButtonRow.
	Buttons []KeyboardInlineButton
}

// KeyboardInlineButtonRowTypeID is TL type id of KeyboardInlineButtonRow.
const KeyboardInlineButtonRowTypeID = 0x19420af6

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

func ( *KeyboardInlineButtonRow) () bool {
	if  == nil {
		return true
	}
	if !(.Buttons == nil) {
		return false
	}

	return true
}

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

// FillFrom fills KeyboardInlineButtonRow from given interface.
func ( *KeyboardInlineButtonRow) ( interface {
	() ( []KeyboardInlineButton)
}) {
	.Buttons = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *KeyboardInlineButtonRow) () tdp.Type {
	 := tdp.Type{
		Name: "keyboardInlineButtonRow",
		ID:   KeyboardInlineButtonRowTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Buttons",
			SchemaName: "buttons",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *KeyboardInlineButtonRow) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode keyboardInlineButtonRow#19420af6 as nil")
	}
	.PutID(KeyboardInlineButtonRowTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *KeyboardInlineButtonRow) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode keyboardInlineButtonRow#19420af6 as nil")
	}
	.PutVectorHeader(len(.Buttons))
	for ,  := range .Buttons {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode keyboardInlineButtonRow#19420af6: field buttons element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *KeyboardInlineButtonRow) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode keyboardInlineButtonRow#19420af6 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode keyboardInlineButtonRow#19420af6: field buttons: %w", )
		}

		if  > 0 {
			.Buttons = make([]KeyboardInlineButton, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  KeyboardInlineButton
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode keyboardInlineButtonRow#19420af6: field buttons: %w", )
			}
			.Buttons = append(.Buttons, )
		}
	}
	return nil
}

// GetButtons returns value of Buttons field.
func ( *KeyboardInlineButtonRow) () ( []KeyboardInlineButton) {
	if  == nil {
		return
	}
	return .Buttons
}