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

// HelpGetCountriesListRequest represents TL type `help.getCountriesList#735787a8`.
// Get name, ISO code, localized name and phone codes/patterns of all available countries
//
// See https://core.telegram.org/method/help.getCountriesList for reference.
type HelpGetCountriesListRequest struct {
	// Language code of the current user
	LangCode string
	// Hash for pagination, for more info click hereĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int
}

// HelpGetCountriesListRequestTypeID is TL type id of HelpGetCountriesListRequest.
const HelpGetCountriesListRequestTypeID = 0x735787a8

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

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

	return true
}

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

// FillFrom fills HelpGetCountriesListRequest from given interface.
func ( *HelpGetCountriesListRequest) ( interface {
	() ( string)
	() ( int)
}) {
	.LangCode = .()
	.Hash = .()
}

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

// TypeName returns name of type in TL schema.
func (*HelpGetCountriesListRequest) () string {
	return "help.getCountriesList"
}

// TypeInfo returns info about TL type.
func ( *HelpGetCountriesListRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.getCountriesList",
		ID:   HelpGetCountriesListRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "LangCode",
			SchemaName: "lang_code",
		},
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpGetCountriesListRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getCountriesList#735787a8 as nil")
	}
	.PutID(HelpGetCountriesListRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpGetCountriesListRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getCountriesList#735787a8 as nil")
	}
	.PutString(.LangCode)
	.PutInt(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *HelpGetCountriesListRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getCountriesList#735787a8 to nil")
	}
	if  := .ConsumeID(HelpGetCountriesListRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode help.getCountriesList#735787a8: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *HelpGetCountriesListRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getCountriesList#735787a8 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode help.getCountriesList#735787a8: field lang_code: %w", )
		}
		.LangCode = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode help.getCountriesList#735787a8: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

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

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

// HelpGetCountriesList invokes method help.getCountriesList#735787a8 returning error if any.
// Get name, ISO code, localized name and phone codes/patterns of all available countries
//
// See https://core.telegram.org/method/help.getCountriesList for reference.
func ( *Client) ( context.Context,  *HelpGetCountriesListRequest) (HelpCountriesListClass, error) {
	var  HelpCountriesListBox

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