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

// ChannelsUpdateEmojiStatusRequest represents TL type `channels.updateEmojiStatus#f0d3e6a8`.
//
// See https://core.telegram.org/method/channels.updateEmojiStatus for reference.
type ChannelsUpdateEmojiStatusRequest struct {
	// Channel field of ChannelsUpdateEmojiStatusRequest.
	Channel InputChannelClass
	// EmojiStatus field of ChannelsUpdateEmojiStatusRequest.
	EmojiStatus EmojiStatusClass
}

// ChannelsUpdateEmojiStatusRequestTypeID is TL type id of ChannelsUpdateEmojiStatusRequest.
const ChannelsUpdateEmojiStatusRequestTypeID = 0xf0d3e6a8

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *ChannelsUpdateEmojiStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channels.updateEmojiStatus#f0d3e6a8 as nil")
	}
	.PutID(ChannelsUpdateEmojiStatusRequestTypeID)
	return .EncodeBare()
}

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

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

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

// GetChannel returns value of Channel field.
func ( *ChannelsUpdateEmojiStatusRequest) () ( InputChannelClass) {
	if  == nil {
		return
	}
	return .Channel
}

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

// GetChannelAsNotEmpty returns mapped value of Channel field.
func ( *ChannelsUpdateEmojiStatusRequest) () (NotEmptyInputChannel, bool) {
	return .Channel.AsNotEmpty()
}

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

// ChannelsUpdateEmojiStatus invokes method channels.updateEmojiStatus#f0d3e6a8 returning error if any.
//
// See https://core.telegram.org/method/channels.updateEmojiStatus for reference.
func ( *Client) ( context.Context,  *ChannelsUpdateEmojiStatusRequest) (UpdatesClass, error) {
	var  UpdatesBox

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