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

// LangpackGetLangPackRequest represents TL type `langpack.getLangPack#f2f2330a`.
// Get localization pack strings
//
// See https://core.telegram.org/method/langpack.getLangPack for reference.
type LangpackGetLangPackRequest struct {
	// Language pack name, usually obtained from a language pack linkĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/api/links#language-pack-links
	LangPack string
	// Language code
	LangCode string
}

// LangpackGetLangPackRequestTypeID is TL type id of LangpackGetLangPackRequest.
const LangpackGetLangPackRequestTypeID = 0xf2f2330a

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

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

	return true
}

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

// FillFrom fills LangpackGetLangPackRequest from given interface.
func ( *LangpackGetLangPackRequest) ( interface {
	() ( string)
	() ( string)
}) {
	.LangPack = .()
	.LangCode = .()
}

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

// TypeName returns name of type in TL schema.
func (*LangpackGetLangPackRequest) () string {
	return "langpack.getLangPack"
}

// TypeInfo returns info about TL type.
func ( *LangpackGetLangPackRequest) () tdp.Type {
	 := tdp.Type{
		Name: "langpack.getLangPack",
		ID:   LangpackGetLangPackRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "LangPack",
			SchemaName: "lang_pack",
		},
		{
			Name:       "LangCode",
			SchemaName: "lang_code",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *LangpackGetLangPackRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode langpack.getLangPack#f2f2330a as nil")
	}
	.PutID(LangpackGetLangPackRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *LangpackGetLangPackRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode langpack.getLangPack#f2f2330a as nil")
	}
	.PutString(.LangPack)
	.PutString(.LangCode)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *LangpackGetLangPackRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode langpack.getLangPack#f2f2330a to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode langpack.getLangPack#f2f2330a: field lang_pack: %w", )
		}
		.LangPack = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode langpack.getLangPack#f2f2330a: field lang_code: %w", )
		}
		.LangCode = 
	}
	return nil
}

// GetLangPack returns value of LangPack field.
func ( *LangpackGetLangPackRequest) () ( string) {
	if  == nil {
		return
	}
	return .LangPack
}

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

// LangpackGetLangPack invokes method langpack.getLangPack#f2f2330a returning error if any.
// Get localization pack strings
//
// Possible errors:
//
//	400 LANG_CODE_NOT_SUPPORTED: The specified language code is not supported.
//	400 LANG_PACK_INVALID: The provided language pack is invalid.
//
// See https://core.telegram.org/method/langpack.getLangPack for reference.
func ( *Client) ( context.Context,  *LangpackGetLangPackRequest) (*LangPackDifference, error) {
	var  LangPackDifference

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