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

// EmojiStatusEmpty represents TL type `emojiStatusEmpty#2de11aae`.
// No emoji status is set
//
// See https://core.telegram.org/constructor/emojiStatusEmpty for reference.
type EmojiStatusEmpty struct {
}

// EmojiStatusEmptyTypeID is TL type id of EmojiStatusEmpty.
const EmojiStatusEmptyTypeID = 0x2de11aae

// construct implements constructor of EmojiStatusClass.
func ( EmojiStatusEmpty) () EmojiStatusClass { return & }

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

	_ EmojiStatusClass = &EmojiStatusEmpty{}
)

func ( *EmojiStatusEmpty) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *EmojiStatusEmpty) () tdp.Type {
	 := tdp.Type{
		Name: "emojiStatusEmpty",
		ID:   EmojiStatusEmptyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *EmojiStatusEmpty) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiStatusEmpty#2de11aae as nil")
	}
	.PutID(EmojiStatusEmptyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *EmojiStatusEmpty) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiStatusEmpty#2de11aae as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *EmojiStatusEmpty) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode emojiStatusEmpty#2de11aae to nil")
	}
	return nil
}

// EmojiStatus represents TL type `emojiStatus#e7ff068a`.
// An emoji status¹
//
// Links:
//  1. https://core.telegram.org/api/emoji-status
//
// See https://core.telegram.org/constructor/emojiStatus for reference.
type EmojiStatus struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Custom emoji document ID¹
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	DocumentID int64
	// If set, the emoji status will be active until the specified unixtime.
	//
	// Use SetUntil and GetUntil helpers.
	Until int
}

// EmojiStatusTypeID is TL type id of EmojiStatus.
const EmojiStatusTypeID = 0xe7ff068a

// construct implements constructor of EmojiStatusClass.
func ( EmojiStatus) () EmojiStatusClass { return & }

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

	_ EmojiStatusClass = &EmojiStatus{}
)

func ( *EmojiStatus) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.DocumentID == 0) {
		return false
	}
	if !(.Until == 0) {
		return false
	}

	return true
}

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

// FillFrom fills EmojiStatus from given interface.
func ( *EmojiStatus) ( interface {
	() ( int64)
	() ( int,  bool)
}) {
	.DocumentID = .()
	if ,  := .();  {
		.Until = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *EmojiStatus) () tdp.Type {
	 := tdp.Type{
		Name: "emojiStatus",
		ID:   EmojiStatusTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "DocumentID",
			SchemaName: "document_id",
		},
		{
			Name:       "Until",
			SchemaName: "until",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *EmojiStatus) () {
	if !(.Until == 0) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *EmojiStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiStatus#e7ff068a as nil")
	}
	.PutID(EmojiStatusTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *EmojiStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiStatus#e7ff068a as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode emojiStatus#e7ff068a: field flags: %w", )
	}
	.PutLong(.DocumentID)
	if .Flags.Has(0) {
		.PutInt(.Until)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *EmojiStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode emojiStatus#e7ff068a to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode emojiStatus#e7ff068a: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatus#e7ff068a: field document_id: %w", )
		}
		.DocumentID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatus#e7ff068a: field until: %w", )
		}
		.Until = 
	}
	return nil
}

// GetDocumentID returns value of DocumentID field.
func ( *EmojiStatus) () ( int64) {
	if  == nil {
		return
	}
	return .DocumentID
}

// SetUntil sets value of Until conditional field.
func ( *EmojiStatus) ( int) {
	.Flags.Set(0)
	.Until = 
}

// GetUntil returns value of Until conditional field and
// boolean which is true if field was set.
func ( *EmojiStatus) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Until, true
}

// EmojiStatusCollectible represents TL type `emojiStatusCollectible#7184603b`.
// An owned collectible gift »¹ as emoji status.
// Cannot be passed to account.updateEmojiStatus¹, must be converted to an
// inputEmojiStatusCollectible² first before passing it to that method.
//
// Links:
//  1. https://core.telegram.org/api/gifts#collectible-gifts
//  2. https://core.telegram.org/method/account.updateEmojiStatus
//  3. https://core.telegram.org/constructor/inputEmojiStatusCollectible
//
// See https://core.telegram.org/constructor/emojiStatusCollectible for reference.
type EmojiStatusCollectible struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// ID of the collectible (from starGiftUnique¹.id).
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftUnique
	CollectibleID int64
	// ID of the custom emoji¹ representing the status.
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	DocumentID int64
	// Name of the collectible.
	Title string
	// Unique identifier of the collectible that may be used to create a collectible gift
	// link »¹ for the current collectible, or to fetch further info about the collectible
	// using payments.getUniqueStarGift².
	//
	// Links:
	//  1) https://core.telegram.org/api/links#collectible-gift-link
	//  2) https://core.telegram.org/method/payments.getUniqueStarGift
	Slug string
	// The ID of a pattern to apply on the profile's backdrop, correlated to the
	// starGiftAttributePattern¹ from the gift in slug.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftAttributePattern
	PatternDocumentID int64
	// Color of the center of the profile backdrop in RGB24 format, from the gift's
	// starGiftAttributeBackdrop¹.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftAttributeBackdrop
	CenterColor int
	// Color of the edges of the profile backdrop in RGB24 format, from the gift's
	// starGiftAttributeBackdrop¹.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftAttributeBackdrop
	EdgeColor int
	// Color of the pattern_document_id applied on the profile backdrop in RGB24 format, from
	// the gift's starGiftAttributeBackdrop¹.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftAttributeBackdrop
	PatternColor int
	// Color of text on the profile backdrop in RGB24 format, from the gift's
	// starGiftAttributeBackdrop¹.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftAttributeBackdrop
	TextColor int
	// If set, the emoji status will be active until the specified unixtime.
	//
	// Use SetUntil and GetUntil helpers.
	Until int
}

// EmojiStatusCollectibleTypeID is TL type id of EmojiStatusCollectible.
const EmojiStatusCollectibleTypeID = 0x7184603b

// construct implements constructor of EmojiStatusClass.
func ( EmojiStatusCollectible) () EmojiStatusClass { return & }

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

	_ EmojiStatusClass = &EmojiStatusCollectible{}
)

func ( *EmojiStatusCollectible) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.CollectibleID == 0) {
		return false
	}
	if !(.DocumentID == 0) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.Slug == "") {
		return false
	}
	if !(.PatternDocumentID == 0) {
		return false
	}
	if !(.CenterColor == 0) {
		return false
	}
	if !(.EdgeColor == 0) {
		return false
	}
	if !(.PatternColor == 0) {
		return false
	}
	if !(.TextColor == 0) {
		return false
	}
	if !(.Until == 0) {
		return false
	}

	return true
}

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

// FillFrom fills EmojiStatusCollectible from given interface.
func ( *EmojiStatusCollectible) ( interface {
	() ( int64)
	() ( int64)
	() ( string)
	() ( string)
	() ( int64)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int,  bool)
}) {
	.CollectibleID = .()
	.DocumentID = .()
	.Title = .()
	.Slug = .()
	.PatternDocumentID = .()
	.CenterColor = .()
	.EdgeColor = .()
	.PatternColor = .()
	.TextColor = .()
	if ,  := .();  {
		.Until = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *EmojiStatusCollectible) () tdp.Type {
	 := tdp.Type{
		Name: "emojiStatusCollectible",
		ID:   EmojiStatusCollectibleTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "CollectibleID",
			SchemaName: "collectible_id",
		},
		{
			Name:       "DocumentID",
			SchemaName: "document_id",
		},
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "Slug",
			SchemaName: "slug",
		},
		{
			Name:       "PatternDocumentID",
			SchemaName: "pattern_document_id",
		},
		{
			Name:       "CenterColor",
			SchemaName: "center_color",
		},
		{
			Name:       "EdgeColor",
			SchemaName: "edge_color",
		},
		{
			Name:       "PatternColor",
			SchemaName: "pattern_color",
		},
		{
			Name:       "TextColor",
			SchemaName: "text_color",
		},
		{
			Name:       "Until",
			SchemaName: "until",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *EmojiStatusCollectible) () {
	if !(.Until == 0) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *EmojiStatusCollectible) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiStatusCollectible#7184603b as nil")
	}
	.PutID(EmojiStatusCollectibleTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *EmojiStatusCollectible) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiStatusCollectible#7184603b as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode emojiStatusCollectible#7184603b: field flags: %w", )
	}
	.PutLong(.CollectibleID)
	.PutLong(.DocumentID)
	.PutString(.Title)
	.PutString(.Slug)
	.PutLong(.PatternDocumentID)
	.PutInt(.CenterColor)
	.PutInt(.EdgeColor)
	.PutInt(.PatternColor)
	.PutInt(.TextColor)
	if .Flags.Has(0) {
		.PutInt(.Until)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *EmojiStatusCollectible) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode emojiStatusCollectible#7184603b to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field collectible_id: %w", )
		}
		.CollectibleID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field document_id: %w", )
		}
		.DocumentID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field slug: %w", )
		}
		.Slug = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field pattern_document_id: %w", )
		}
		.PatternDocumentID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field center_color: %w", )
		}
		.CenterColor = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field edge_color: %w", )
		}
		.EdgeColor = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field pattern_color: %w", )
		}
		.PatternColor = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field text_color: %w", )
		}
		.TextColor = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode emojiStatusCollectible#7184603b: field until: %w", )
		}
		.Until = 
	}
	return nil
}

// GetCollectibleID returns value of CollectibleID field.
func ( *EmojiStatusCollectible) () ( int64) {
	if  == nil {
		return
	}
	return .CollectibleID
}

// GetDocumentID returns value of DocumentID field.
func ( *EmojiStatusCollectible) () ( int64) {
	if  == nil {
		return
	}
	return .DocumentID
}

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

// GetSlug returns value of Slug field.
func ( *EmojiStatusCollectible) () ( string) {
	if  == nil {
		return
	}
	return .Slug
}

// GetPatternDocumentID returns value of PatternDocumentID field.
func ( *EmojiStatusCollectible) () ( int64) {
	if  == nil {
		return
	}
	return .PatternDocumentID
}

// GetCenterColor returns value of CenterColor field.
func ( *EmojiStatusCollectible) () ( int) {
	if  == nil {
		return
	}
	return .CenterColor
}

// GetEdgeColor returns value of EdgeColor field.
func ( *EmojiStatusCollectible) () ( int) {
	if  == nil {
		return
	}
	return .EdgeColor
}

// GetPatternColor returns value of PatternColor field.
func ( *EmojiStatusCollectible) () ( int) {
	if  == nil {
		return
	}
	return .PatternColor
}

// GetTextColor returns value of TextColor field.
func ( *EmojiStatusCollectible) () ( int) {
	if  == nil {
		return
	}
	return .TextColor
}

// SetUntil sets value of Until conditional field.
func ( *EmojiStatusCollectible) ( int) {
	.Flags.Set(0)
	.Until = 
}

// GetUntil returns value of Until conditional field and
// boolean which is true if field was set.
func ( *EmojiStatusCollectible) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Until, true
}

// InputEmojiStatusCollectible represents TL type `inputEmojiStatusCollectible#7141dbf`.
// An owned collectible gift »¹ as emoji status: can only be used in account
// updateEmojiStatus², is never returned by the API.
// Note that once set, the status will be returned to users as a emojiStatusCollectible¹
// constructor, instead (which cannot be passed to account.updateEmojiStatus², and must
// be converted to an inputEmojiStatusCollectible³ first).
//
// Links:
//  1. https://core.telegram.org/api/gifts#collectible-gifts
//  2. https://core.telegram.org/method/account.updateEmojiStatus
//  3. https://core.telegram.org/constructor/emojiStatusCollectible
//  4. https://core.telegram.org/method/account.updateEmojiStatus
//  5. https://core.telegram.org/constructor/inputEmojiStatusCollectible
//
// See https://core.telegram.org/constructor/inputEmojiStatusCollectible for reference.
type InputEmojiStatusCollectible struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// ID of the collectible (from starGiftUnique¹.id).
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftUnique
	CollectibleID int64
	// If set, the emoji status will be active until the specified unixtime.
	//
	// Use SetUntil and GetUntil helpers.
	Until int
}

// InputEmojiStatusCollectibleTypeID is TL type id of InputEmojiStatusCollectible.
const InputEmojiStatusCollectibleTypeID = 0x7141dbf

// construct implements constructor of EmojiStatusClass.
func ( InputEmojiStatusCollectible) () EmojiStatusClass { return & }

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

	_ EmojiStatusClass = &InputEmojiStatusCollectible{}
)

func ( *InputEmojiStatusCollectible) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.CollectibleID == 0) {
		return false
	}
	if !(.Until == 0) {
		return false
	}

	return true
}

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

// FillFrom fills InputEmojiStatusCollectible from given interface.
func ( *InputEmojiStatusCollectible) ( interface {
	() ( int64)
	() ( int,  bool)
}) {
	.CollectibleID = .()
	if ,  := .();  {
		.Until = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *InputEmojiStatusCollectible) () tdp.Type {
	 := tdp.Type{
		Name: "inputEmojiStatusCollectible",
		ID:   InputEmojiStatusCollectibleTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "CollectibleID",
			SchemaName: "collectible_id",
		},
		{
			Name:       "Until",
			SchemaName: "until",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *InputEmojiStatusCollectible) () {
	if !(.Until == 0) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *InputEmojiStatusCollectible) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputEmojiStatusCollectible#7141dbf as nil")
	}
	.PutID(InputEmojiStatusCollectibleTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputEmojiStatusCollectible) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputEmojiStatusCollectible#7141dbf as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode inputEmojiStatusCollectible#7141dbf: field flags: %w", )
	}
	.PutLong(.CollectibleID)
	if .Flags.Has(0) {
		.PutInt(.Until)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputEmojiStatusCollectible) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputEmojiStatusCollectible#7141dbf to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode inputEmojiStatusCollectible#7141dbf: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputEmojiStatusCollectible#7141dbf: field collectible_id: %w", )
		}
		.CollectibleID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputEmojiStatusCollectible#7141dbf: field until: %w", )
		}
		.Until = 
	}
	return nil
}

// GetCollectibleID returns value of CollectibleID field.
func ( *InputEmojiStatusCollectible) () ( int64) {
	if  == nil {
		return
	}
	return .CollectibleID
}

// SetUntil sets value of Until conditional field.
func ( *InputEmojiStatusCollectible) ( int) {
	.Flags.Set(0)
	.Until = 
}

// GetUntil returns value of Until conditional field and
// boolean which is true if field was set.
func ( *InputEmojiStatusCollectible) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Until, true
}

// EmojiStatusClassName is schema name of EmojiStatusClass.
const EmojiStatusClassName = "EmojiStatus"

// EmojiStatusClass represents EmojiStatus generic type.
//
// See https://core.telegram.org/type/EmojiStatus for reference.
//
// Constructors:
//   - [EmojiStatusEmpty]
//   - [EmojiStatus]
//   - [EmojiStatusCollectible]
//   - [InputEmojiStatusCollectible]
//
// Example:
//
//	g, err := tg.DecodeEmojiStatus(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.EmojiStatusEmpty: // emojiStatusEmpty#2de11aae
//	case *tg.EmojiStatus: // emojiStatus#e7ff068a
//	case *tg.EmojiStatusCollectible: // emojiStatusCollectible#7184603b
//	case *tg.InputEmojiStatusCollectible: // inputEmojiStatusCollectible#7141dbf
//	default: panic(v)
//	}
type EmojiStatusClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() EmojiStatusClass

	// TypeID returns type id in TL schema.
	//
	// See https://core.telegram.org/mtproto/TL-tl#remarks.
	TypeID() uint32
	// TypeName returns name of type in TL schema.
	TypeName() string
	// String implements fmt.Stringer.
	String() string
	// Zero returns true if current object has a zero value.
	Zero() bool

	// AsNotEmpty tries to map EmojiStatusClass to NotEmptyEmojiStatus.
	AsNotEmpty() (NotEmptyEmojiStatus, bool)
}

// NotEmptyEmojiStatus represents NotEmpty subset of EmojiStatusClass.
type NotEmptyEmojiStatus interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() EmojiStatusClass

	// TypeID returns type id in TL schema.
	//
	// See https://core.telegram.org/mtproto/TL-tl#remarks.
	TypeID() uint32
	// TypeName returns name of type in TL schema.
	TypeName() string
	// String implements fmt.Stringer.
	String() string
	// Zero returns true if current object has a zero value.
	Zero() bool

	// If set, the emoji status will be active until the specified unixtime.
	GetUntil() (value int, ok bool)
}

// AsNotEmpty tries to map EmojiStatusEmpty to NotEmptyEmojiStatus.
func ( *EmojiStatusEmpty) () (NotEmptyEmojiStatus, bool) {
	,  := (EmojiStatusClass()).(NotEmptyEmojiStatus)
	return , 
}

// AsNotEmpty tries to map EmojiStatus to NotEmptyEmojiStatus.
func ( *EmojiStatus) () (NotEmptyEmojiStatus, bool) {
	,  := (EmojiStatusClass()).(NotEmptyEmojiStatus)
	return , 
}

// AsNotEmpty tries to map EmojiStatusCollectible to NotEmptyEmojiStatus.
func ( *EmojiStatusCollectible) () (NotEmptyEmojiStatus, bool) {
	,  := (EmojiStatusClass()).(NotEmptyEmojiStatus)
	return , 
}

// AsNotEmpty tries to map InputEmojiStatusCollectible to NotEmptyEmojiStatus.
func ( *InputEmojiStatusCollectible) () (NotEmptyEmojiStatus, bool) {
	,  := (EmojiStatusClass()).(NotEmptyEmojiStatus)
	return , 
}

// DecodeEmojiStatus implements binary de-serialization for EmojiStatusClass.
func ( *bin.Buffer) (EmojiStatusClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case EmojiStatusEmptyTypeID:
		// Decoding emojiStatusEmpty#2de11aae.
		 := EmojiStatusEmpty{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode EmojiStatusClass: %w", )
		}
		return &, nil
	case EmojiStatusTypeID:
		// Decoding emojiStatus#e7ff068a.
		 := EmojiStatus{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode EmojiStatusClass: %w", )
		}
		return &, nil
	case EmojiStatusCollectibleTypeID:
		// Decoding emojiStatusCollectible#7184603b.
		 := EmojiStatusCollectible{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode EmojiStatusClass: %w", )
		}
		return &, nil
	case InputEmojiStatusCollectibleTypeID:
		// Decoding inputEmojiStatusCollectible#7141dbf.
		 := InputEmojiStatusCollectible{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode EmojiStatusClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode EmojiStatusClass: %w", bin.NewUnexpectedID())
	}
}

// EmojiStatus boxes the EmojiStatusClass providing a helper.
type EmojiStatusBox struct {
	EmojiStatus EmojiStatusClass
}

// Decode implements bin.Decoder for EmojiStatusBox.
func ( *EmojiStatusBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode EmojiStatusBox to nil")
	}
	,  := DecodeEmojiStatus()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.EmojiStatus = 
	return nil
}

// Encode implements bin.Encode for EmojiStatusBox.
func ( *EmojiStatusBox) ( *bin.Buffer) error {
	if  == nil || .EmojiStatus == nil {
		return fmt.Errorf("unable to encode EmojiStatusClass as nil")
	}
	return .EmojiStatus.Encode()
}