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

// MessagesGetEmojiKeywordsLanguagesRequest represents TL type `messages.getEmojiKeywordsLanguages#4e9963b2`.
// Obtain a list of related languages that must be used when fetching emoji keyword lists
// »¹.
// Usually the method will return the passed language codes (if localized) + en + some
// language codes for similar languages (if applicable).
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-keywords
//
// See https://core.telegram.org/method/messages.getEmojiKeywordsLanguages for reference.
type MessagesGetEmojiKeywordsLanguagesRequest struct {
	// The user's language codes
	LangCodes []string
}

// MessagesGetEmojiKeywordsLanguagesRequestTypeID is TL type id of MessagesGetEmojiKeywordsLanguagesRequest.
const MessagesGetEmojiKeywordsLanguagesRequestTypeID = 0x4e9963b2

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

func ( *MessagesGetEmojiKeywordsLanguagesRequest) () bool {
	if  == nil {
		return true
	}
	if !(.LangCodes == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesGetEmojiKeywordsLanguagesRequest from given interface.
func ( *MessagesGetEmojiKeywordsLanguagesRequest) ( interface {
	() ( []string)
}) {
	.LangCodes = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesGetEmojiKeywordsLanguagesRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getEmojiKeywordsLanguages",
		ID:   MessagesGetEmojiKeywordsLanguagesRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "LangCodes",
			SchemaName: "lang_codes",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetEmojiKeywordsLanguagesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiKeywordsLanguages#4e9963b2 as nil")
	}
	.PutID(MessagesGetEmojiKeywordsLanguagesRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetEmojiKeywordsLanguagesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiKeywordsLanguages#4e9963b2 as nil")
	}
	.PutVectorHeader(len(.LangCodes))
	for ,  := range .LangCodes {
		.PutString()
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesGetEmojiKeywordsLanguagesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getEmojiKeywordsLanguages#4e9963b2 to nil")
	}
	if  := .ConsumeID(MessagesGetEmojiKeywordsLanguagesRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.getEmojiKeywordsLanguages#4e9963b2: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetEmojiKeywordsLanguagesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getEmojiKeywordsLanguages#4e9963b2 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getEmojiKeywordsLanguages#4e9963b2: field lang_codes: %w", )
		}

		if  > 0 {
			.LangCodes = make([]string, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .String()
			if  != nil {
				return fmt.Errorf("unable to decode messages.getEmojiKeywordsLanguages#4e9963b2: field lang_codes: %w", )
			}
			.LangCodes = append(.LangCodes, )
		}
	}
	return nil
}

// GetLangCodes returns value of LangCodes field.
func ( *MessagesGetEmojiKeywordsLanguagesRequest) () ( []string) {
	if  == nil {
		return
	}
	return .LangCodes
}

// MessagesGetEmojiKeywordsLanguages invokes method messages.getEmojiKeywordsLanguages#4e9963b2 returning error if any.
// Obtain a list of related languages that must be used when fetching emoji keyword lists
// »¹.
// Usually the method will return the passed language codes (if localized) + en + some
// language codes for similar languages (if applicable).
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-keywords
//
// See https://core.telegram.org/method/messages.getEmojiKeywordsLanguages for reference.
func ( *Client) ( context.Context,  []string) ([]EmojiLanguage, error) {
	var  EmojiLanguageVector

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