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

// LangpackGetStringsRequest represents TL type `langpack.getStrings#efea3803`.
// Get strings from a language pack
//
// See https://core.telegram.org/method/langpack.getStrings for reference.
type LangpackGetStringsRequest 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
	// Strings to get
	Keys []string
}

// LangpackGetStringsRequestTypeID is TL type id of LangpackGetStringsRequest.
const LangpackGetStringsRequestTypeID = 0xefea3803

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

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

	return true
}

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

// FillFrom fills LangpackGetStringsRequest from given interface.
func ( *LangpackGetStringsRequest) ( interface {
	() ( string)
	() ( string)
	() ( []string)
}) {
	.LangPack = .()
	.LangCode = .()
	.Keys = .()
}

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

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

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

// Encode implements bin.Encoder.
func ( *LangpackGetStringsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode langpack.getStrings#efea3803 as nil")
	}
	.PutID(LangpackGetStringsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *LangpackGetStringsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode langpack.getStrings#efea3803 as nil")
	}
	.PutString(.LangPack)
	.PutString(.LangCode)
	.PutVectorHeader(len(.Keys))
	for ,  := range .Keys {
		.PutString()
	}
	return nil
}

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

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

		if  > 0 {
			.Keys = make([]string, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .String()
			if  != nil {
				return fmt.Errorf("unable to decode langpack.getStrings#efea3803: field keys: %w", )
			}
			.Keys = append(.Keys, )
		}
	}
	return nil
}

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

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

// GetKeys returns value of Keys field.
func ( *LangpackGetStringsRequest) () ( []string) {
	if  == nil {
		return
	}
	return .Keys
}

// LangpackGetStrings invokes method langpack.getStrings#efea3803 returning error if any.
// Get strings from a language pack
//
// 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.getStrings for reference.
func ( *Client) ( context.Context,  *LangpackGetStringsRequest) ([]LangPackStringClass, error) {
	var  LangPackStringClassVector

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