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

// EmojiGroup represents TL type `emojiGroup#7a9abda9`.
// Represents an emoji category¹.
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-categories
//
// See https://core.telegram.org/constructor/emojiGroup for reference.
type EmojiGroup struct {
	// Category name, i.e. "Animals", "Flags", "Faces" and so on...
	Title string
	// A single custom emoji used as preview for the category.
	IconEmojiID int64
	// A list of UTF-8 emojis, matching the category.
	Emoticons []string
}

// EmojiGroupTypeID is TL type id of EmojiGroup.
const EmojiGroupTypeID = 0x7a9abda9

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

func ( *EmojiGroup) () bool {
	if  == nil {
		return true
	}
	if !(.Title == "") {
		return false
	}
	if !(.IconEmojiID == 0) {
		return false
	}
	if !(.Emoticons == nil) {
		return false
	}

	return true
}

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

// FillFrom fills EmojiGroup from given interface.
func ( *EmojiGroup) ( interface {
	() ( string)
	() ( int64)
	() ( []string)
}) {
	.Title = .()
	.IconEmojiID = .()
	.Emoticons = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *EmojiGroup) () tdp.Type {
	 := tdp.Type{
		Name: "emojiGroup",
		ID:   EmojiGroupTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "IconEmojiID",
			SchemaName: "icon_emoji_id",
		},
		{
			Name:       "Emoticons",
			SchemaName: "emoticons",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *EmojiGroup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiGroup#7a9abda9 as nil")
	}
	.PutID(EmojiGroupTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *EmojiGroup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiGroup#7a9abda9 as nil")
	}
	.PutString(.Title)
	.PutLong(.IconEmojiID)
	.PutVectorHeader(len(.Emoticons))
	for ,  := range .Emoticons {
		.PutString()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *EmojiGroup) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode emojiGroup#7a9abda9 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode emojiGroup#7a9abda9: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode emojiGroup#7a9abda9: field icon_emoji_id: %w", )
		}
		.IconEmojiID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode emojiGroup#7a9abda9: field emoticons: %w", )
		}

		if  > 0 {
			.Emoticons = make([]string, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .String()
			if  != nil {
				return fmt.Errorf("unable to decode emojiGroup#7a9abda9: field emoticons: %w", )
			}
			.Emoticons = append(.Emoticons, )
		}
	}
	return nil
}

// GetTitle returns value of Title field.
func ( *EmojiGroup) () ( string) {
	if  == nil {
		return
	}
	return .Title
}

// GetIconEmojiID returns value of IconEmojiID field.
func ( *EmojiGroup) () ( int64) {
	if  == nil {
		return
	}
	return .IconEmojiID
}

// GetEmoticons returns value of Emoticons field.
func ( *EmojiGroup) () ( []string) {
	if  == nil {
		return
	}
	return .Emoticons
}