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

// MessagesGetEmojiProfilePhotoGroupsRequest represents TL type `messages.getEmojiProfilePhotoGroups#21a548f3`.
// Represents a list of emoji categories¹, to be used when selecting custom emojis to
// set as profile picture².
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-categories
//  2. https://core.telegram.org/api/files#sticker-profile-pictures
//
// See https://core.telegram.org/method/messages.getEmojiProfilePhotoGroups for reference.
type MessagesGetEmojiProfilePhotoGroupsRequest struct {
	// Hash for pagination, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int
}

// MessagesGetEmojiProfilePhotoGroupsRequestTypeID is TL type id of MessagesGetEmojiProfilePhotoGroupsRequest.
const MessagesGetEmojiProfilePhotoGroupsRequestTypeID = 0x21a548f3

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

func ( *MessagesGetEmojiProfilePhotoGroupsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesGetEmojiProfilePhotoGroupsRequest from given interface.
func ( *MessagesGetEmojiProfilePhotoGroupsRequest) ( interface {
	() ( int)
}) {
	.Hash = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesGetEmojiProfilePhotoGroupsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getEmojiProfilePhotoGroups",
		ID:   MessagesGetEmojiProfilePhotoGroupsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetEmojiProfilePhotoGroupsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiProfilePhotoGroups#21a548f3 as nil")
	}
	.PutID(MessagesGetEmojiProfilePhotoGroupsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetEmojiProfilePhotoGroupsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiProfilePhotoGroups#21a548f3 as nil")
	}
	.PutInt(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesGetEmojiProfilePhotoGroupsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getEmojiProfilePhotoGroups#21a548f3 to nil")
	}
	if  := .ConsumeID(MessagesGetEmojiProfilePhotoGroupsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.getEmojiProfilePhotoGroups#21a548f3: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetEmojiProfilePhotoGroupsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getEmojiProfilePhotoGroups#21a548f3 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getEmojiProfilePhotoGroups#21a548f3: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetHash returns value of Hash field.
func ( *MessagesGetEmojiProfilePhotoGroupsRequest) () ( int) {
	if  == nil {
		return
	}
	return .Hash
}

// MessagesGetEmojiProfilePhotoGroups invokes method messages.getEmojiProfilePhotoGroups#21a548f3 returning error if any.
// Represents a list of emoji categories¹, to be used when selecting custom emojis to
// set as profile picture².
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-categories
//  2. https://core.telegram.org/api/files#sticker-profile-pictures
//
// See https://core.telegram.org/method/messages.getEmojiProfilePhotoGroups for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  int) (MessagesEmojiGroupsClass, error) {
	var  MessagesEmojiGroupsBox

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