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

// BotsResetBotCommandsRequest represents TL type `bots.resetBotCommands#3d8de0f9`.
// Clear bot commands for the specified bot scope and language code
//
// See https://core.telegram.org/method/bots.resetBotCommands for reference.
type BotsResetBotCommandsRequest struct {
	// Command scope
	Scope BotCommandScopeClass
	// Language code
	LangCode string
}

// BotsResetBotCommandsRequestTypeID is TL type id of BotsResetBotCommandsRequest.
const BotsResetBotCommandsRequestTypeID = 0x3d8de0f9

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

func ( *BotsResetBotCommandsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Scope == nil) {
		return false
	}
	if !(.LangCode == "") {
		return false
	}

	return true
}

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

// FillFrom fills BotsResetBotCommandsRequest from given interface.
func ( *BotsResetBotCommandsRequest) ( interface {
	() ( BotCommandScopeClass)
	() ( string)
}) {
	.Scope = .()
	.LangCode = .()
}

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

// TypeName returns name of type in TL schema.
func (*BotsResetBotCommandsRequest) () string {
	return "bots.resetBotCommands"
}

// TypeInfo returns info about TL type.
func ( *BotsResetBotCommandsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "bots.resetBotCommands",
		ID:   BotsResetBotCommandsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Scope",
			SchemaName: "scope",
		},
		{
			Name:       "LangCode",
			SchemaName: "lang_code",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *BotsResetBotCommandsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.resetBotCommands#3d8de0f9 as nil")
	}
	.PutID(BotsResetBotCommandsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *BotsResetBotCommandsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.resetBotCommands#3d8de0f9 as nil")
	}
	if .Scope == nil {
		return fmt.Errorf("unable to encode bots.resetBotCommands#3d8de0f9: field scope is nil")
	}
	if  := .Scope.Encode();  != nil {
		return fmt.Errorf("unable to encode bots.resetBotCommands#3d8de0f9: field scope: %w", )
	}
	.PutString(.LangCode)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *BotsResetBotCommandsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode bots.resetBotCommands#3d8de0f9 to nil")
	}
	{
		,  := DecodeBotCommandScope()
		if  != nil {
			return fmt.Errorf("unable to decode bots.resetBotCommands#3d8de0f9: field scope: %w", )
		}
		.Scope = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode bots.resetBotCommands#3d8de0f9: field lang_code: %w", )
		}
		.LangCode = 
	}
	return nil
}

// GetScope returns value of Scope field.
func ( *BotsResetBotCommandsRequest) () ( BotCommandScopeClass) {
	if  == nil {
		return
	}
	return .Scope
}

// GetLangCode returns value of LangCode field.
func ( *BotsResetBotCommandsRequest) () ( string) {
	if  == nil {
		return
	}
	return .LangCode
}

// BotsResetBotCommands invokes method bots.resetBotCommands#3d8de0f9 returning error if any.
// Clear bot commands for the specified bot scope and language code
//
// Possible errors:
//
//	400 LANG_CODE_INVALID: The specified language code is invalid.
//
// See https://core.telegram.org/method/bots.resetBotCommands for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  *BotsResetBotCommandsRequest) (bool, error) {
	var  BoolBox

	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}