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

// EmojiLanguage represents TL type `emojiLanguage#b3fb5361`.
// Emoji language
//
// See https://core.telegram.org/constructor/emojiLanguage for reference.
type EmojiLanguage struct {
	// Language code
	LangCode string
}

// EmojiLanguageTypeID is TL type id of EmojiLanguage.
const EmojiLanguageTypeID = 0xb3fb5361

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

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

	return true
}

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

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

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

// TypeName returns name of type in TL schema.
func (*EmojiLanguage) () string {
	return "emojiLanguage"
}

// TypeInfo returns info about TL type.
func ( *EmojiLanguage) () tdp.Type {
	 := tdp.Type{
		Name: "emojiLanguage",
		ID:   EmojiLanguageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "LangCode",
			SchemaName: "lang_code",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *EmojiLanguage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiLanguage#b3fb5361 as nil")
	}
	.PutID(EmojiLanguageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *EmojiLanguage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiLanguage#b3fb5361 as nil")
	}
	.PutString(.LangCode)
	return nil
}

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

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

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