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

// AccountUpdateEmojiStatusRequest represents TL type `account.updateEmojiStatus#fbd3de6b`.
// Set an emoji status¹
//
// Links:
//  1. https://core.telegram.org/api/emoji-status
//
// See https://core.telegram.org/method/account.updateEmojiStatus for reference.
type AccountUpdateEmojiStatusRequest struct {
	// Emoji status¹ to set
	//
	// Links:
	//  1) https://core.telegram.org/api/emoji-status
	EmojiStatus EmojiStatusClass
}

// AccountUpdateEmojiStatusRequestTypeID is TL type id of AccountUpdateEmojiStatusRequest.
const AccountUpdateEmojiStatusRequestTypeID = 0xfbd3de6b

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

func ( *AccountUpdateEmojiStatusRequest) () bool {
	if  == nil {
		return true
	}
	if !(.EmojiStatus == nil) {
		return false
	}

	return true
}

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

// FillFrom fills AccountUpdateEmojiStatusRequest from given interface.
func ( *AccountUpdateEmojiStatusRequest) ( interface {
	() ( EmojiStatusClass)
}) {
	.EmojiStatus = .()
}

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

// TypeName returns name of type in TL schema.
func (*AccountUpdateEmojiStatusRequest) () string {
	return "account.updateEmojiStatus"
}

// TypeInfo returns info about TL type.
func ( *AccountUpdateEmojiStatusRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.updateEmojiStatus",
		ID:   AccountUpdateEmojiStatusRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "EmojiStatus",
			SchemaName: "emoji_status",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountUpdateEmojiStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.updateEmojiStatus#fbd3de6b as nil")
	}
	.PutID(AccountUpdateEmojiStatusRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountUpdateEmojiStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.updateEmojiStatus#fbd3de6b as nil")
	}
	if .EmojiStatus == nil {
		return fmt.Errorf("unable to encode account.updateEmojiStatus#fbd3de6b: field emoji_status is nil")
	}
	if  := .EmojiStatus.Encode();  != nil {
		return fmt.Errorf("unable to encode account.updateEmojiStatus#fbd3de6b: field emoji_status: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountUpdateEmojiStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.updateEmojiStatus#fbd3de6b to nil")
	}
	{
		,  := DecodeEmojiStatus()
		if  != nil {
			return fmt.Errorf("unable to decode account.updateEmojiStatus#fbd3de6b: field emoji_status: %w", )
		}
		.EmojiStatus = 
	}
	return nil
}

// GetEmojiStatus returns value of EmojiStatus field.
func ( *AccountUpdateEmojiStatusRequest) () ( EmojiStatusClass) {
	if  == nil {
		return
	}
	return .EmojiStatus
}

// GetEmojiStatusAsNotEmpty returns mapped value of EmojiStatus field.
func ( *AccountUpdateEmojiStatusRequest) () (NotEmptyEmojiStatus, bool) {
	return .EmojiStatus.AsNotEmpty()
}

// AccountUpdateEmojiStatus invokes method account.updateEmojiStatus#fbd3de6b returning error if any.
// Set an emoji status¹
//
// Links:
//  1. https://core.telegram.org/api/emoji-status
//
// Possible errors:
//
//	400 DOCUMENT_INVALID: The specified document is invalid.
//
// See https://core.telegram.org/method/account.updateEmojiStatus for reference.
func ( *Client) ( context.Context,  EmojiStatusClass) (bool, error) {
	var  BoolBox

	 := &AccountUpdateEmojiStatusRequest{
		EmojiStatus: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}