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

// MessagesGetAttachMenuBotsRequest represents TL type `messages.getAttachMenuBots#16fcc2cb`.
// Returns installed attachment menu bot mini apps »¹
//
// Links:
//  1. https://core.telegram.org/api/bots/attach
//
// See https://core.telegram.org/method/messages.getAttachMenuBots for reference.
type MessagesGetAttachMenuBotsRequest struct {
	// Hash for pagination, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int64
}

// MessagesGetAttachMenuBotsRequestTypeID is TL type id of MessagesGetAttachMenuBotsRequest.
const MessagesGetAttachMenuBotsRequestTypeID = 0x16fcc2cb

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

func ( *MessagesGetAttachMenuBotsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesGetAttachMenuBotsRequest from given interface.
func ( *MessagesGetAttachMenuBotsRequest) ( interface {
	() ( int64)
}) {
	.Hash = .()
}

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

// TypeName returns name of type in TL schema.
func (*MessagesGetAttachMenuBotsRequest) () string {
	return "messages.getAttachMenuBots"
}

// TypeInfo returns info about TL type.
func ( *MessagesGetAttachMenuBotsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getAttachMenuBots",
		ID:   MessagesGetAttachMenuBotsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetAttachMenuBotsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getAttachMenuBots#16fcc2cb as nil")
	}
	.PutID(MessagesGetAttachMenuBotsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetAttachMenuBotsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getAttachMenuBots#16fcc2cb as nil")
	}
	.PutLong(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesGetAttachMenuBotsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getAttachMenuBots#16fcc2cb to nil")
	}
	if  := .ConsumeID(MessagesGetAttachMenuBotsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.getAttachMenuBots#16fcc2cb: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetAttachMenuBotsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getAttachMenuBots#16fcc2cb to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getAttachMenuBots#16fcc2cb: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetHash returns value of Hash field.
func ( *MessagesGetAttachMenuBotsRequest) () ( int64) {
	if  == nil {
		return
	}
	return .Hash
}

// MessagesGetAttachMenuBots invokes method messages.getAttachMenuBots#16fcc2cb returning error if any.
// Returns installed attachment menu bot mini apps »¹
//
// Links:
//  1. https://core.telegram.org/api/bots/attach
//
// See https://core.telegram.org/method/messages.getAttachMenuBots for reference.
func ( *Client) ( context.Context,  int64) (AttachMenuBotsClass, error) {
	var  AttachMenuBotsBox

	 := &MessagesGetAttachMenuBotsRequest{
		Hash: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .AttachMenuBots, nil
}