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

// UpdatesTooLong represents TL type `updatesTooLong#e317af7e`.
// Too many updates, it is necessary to execute updates.getDifference¹.
//
// Links:
//  1. https://core.telegram.org/method/updates.getDifference
//
// See https://core.telegram.org/constructor/updatesTooLong for reference.
type UpdatesTooLong struct {
}

// UpdatesTooLongTypeID is TL type id of UpdatesTooLong.
const UpdatesTooLongTypeID = 0xe317af7e

// construct implements constructor of UpdatesClass.
func ( UpdatesTooLong) () UpdatesClass { return & }

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

	_ UpdatesClass = &UpdatesTooLong{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdatesTooLong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatesTooLong#e317af7e as nil")
	}
	.PutID(UpdatesTooLongTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatesTooLong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatesTooLong#e317af7e as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatesTooLong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatesTooLong#e317af7e to nil")
	}
	return nil
}

// UpdateShortMessage represents TL type `updateShortMessage#313bc7f8`.
// Info about a message sent to (received from) another user
//
// See https://core.telegram.org/constructor/updateShortMessage for reference.
type UpdateShortMessage struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the message is outgoing
	Out bool
	// Whether we were mentioned in the message
	Mentioned bool
	// Whether there are some unread mentions in this message
	MediaUnread bool
	// If true, the message is a silent message, no notifications should be triggered
	Silent bool
	// The message ID
	ID int
	// The ID of the sender (if outgoing will be the ID of the destination) of the message
	UserID int64
	// The message
	Message string
	// PTS¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// PTS count¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
	// date¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Date int
	// Info about a forwarded message
	//
	// Use SetFwdFrom and GetFwdFrom helpers.
	FwdFrom MessageFwdHeader
	// Info about the inline bot used to generate this message
	//
	// Use SetViaBotID and GetViaBotID helpers.
	ViaBotID int64
	// Reply and thread¹ information
	//
	// Links:
	//  1) https://core.telegram.org/api/threads
	//
	// Use SetReplyTo and GetReplyTo helpers.
	ReplyTo MessageReplyHeaderClass
	// Entities¹ for styled text
	//
	// Links:
	//  1) https://core.telegram.org/api/entities
	//
	// Use SetEntities and GetEntities helpers.
	Entities []MessageEntityClass
	// Time To Live of the message, once message.date+message.ttl_period === time(), the
	// message will be deleted on the server, and must be deleted locally as well.
	//
	// Use SetTTLPeriod and GetTTLPeriod helpers.
	TTLPeriod int
}

// UpdateShortMessageTypeID is TL type id of UpdateShortMessage.
const UpdateShortMessageTypeID = 0x313bc7f8

// construct implements constructor of UpdatesClass.
func ( UpdateShortMessage) () UpdatesClass { return & }

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

	_ UpdatesClass = &UpdateShortMessage{}
)

func ( *UpdateShortMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Out == false) {
		return false
	}
	if !(.Mentioned == false) {
		return false
	}
	if !(.MediaUnread == false) {
		return false
	}
	if !(.Silent == false) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Message == "") {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.FwdFrom.Zero()) {
		return false
	}
	if !(.ViaBotID == 0) {
		return false
	}
	if !(.ReplyTo == nil) {
		return false
	}
	if !(.Entities == nil) {
		return false
	}
	if !(.TTLPeriod == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateShortMessage from given interface.
func ( *UpdateShortMessage) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( int)
	() ( int64)
	() ( string)
	() ( int)
	() ( int)
	() ( int)
	() ( MessageFwdHeader,  bool)
	() ( int64,  bool)
	() ( MessageReplyHeaderClass,  bool)
	() ( []MessageEntityClass,  bool)
	() ( int,  bool)
}) {
	.Out = .()
	.Mentioned = .()
	.MediaUnread = .()
	.Silent = .()
	.ID = .()
	.UserID = .()
	.Message = .()
	.Pts = .()
	.PtsCount = .()
	.Date = .()
	if ,  := .();  {
		.FwdFrom = 
	}

	if ,  := .();  {
		.ViaBotID = 
	}

	if ,  := .();  {
		.ReplyTo = 
	}

	if ,  := .();  {
		.Entities = 
	}

	if ,  := .();  {
		.TTLPeriod = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateShortMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateShortMessage",
		ID:   UpdateShortMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Out",
			SchemaName: "out",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Mentioned",
			SchemaName: "mentioned",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "MediaUnread",
			SchemaName: "media_unread",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "Silent",
			SchemaName: "silent",
			Null:       !.Flags.Has(13),
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "FwdFrom",
			SchemaName: "fwd_from",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "ViaBotID",
			SchemaName: "via_bot_id",
			Null:       !.Flags.Has(11),
		},
		{
			Name:       "ReplyTo",
			SchemaName: "reply_to",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Entities",
			SchemaName: "entities",
			Null:       !.Flags.Has(7),
		},
		{
			Name:       "TTLPeriod",
			SchemaName: "ttl_period",
			Null:       !.Flags.Has(25),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateShortMessage) () {
	if !(.Out == false) {
		.Flags.Set(1)
	}
	if !(.Mentioned == false) {
		.Flags.Set(4)
	}
	if !(.MediaUnread == false) {
		.Flags.Set(5)
	}
	if !(.Silent == false) {
		.Flags.Set(13)
	}
	if !(.FwdFrom.Zero()) {
		.Flags.Set(2)
	}
	if !(.ViaBotID == 0) {
		.Flags.Set(11)
	}
	if !(.ReplyTo == nil) {
		.Flags.Set(3)
	}
	if !(.Entities == nil) {
		.Flags.Set(7)
	}
	if !(.TTLPeriod == 0) {
		.Flags.Set(25)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateShortMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateShortMessage#313bc7f8 as nil")
	}
	.PutID(UpdateShortMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateShortMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateShortMessage#313bc7f8 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field flags: %w", )
	}
	.PutInt(.ID)
	.PutLong(.UserID)
	.PutString(.Message)
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	.PutInt(.Date)
	if .Flags.Has(2) {
		if  := .FwdFrom.Encode();  != nil {
			return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field fwd_from: %w", )
		}
	}
	if .Flags.Has(11) {
		.PutLong(.ViaBotID)
	}
	if .Flags.Has(3) {
		if .ReplyTo == nil {
			return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field reply_to is nil")
		}
		if  := .ReplyTo.Encode();  != nil {
			return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field reply_to: %w", )
		}
	}
	if .Flags.Has(7) {
		.PutVectorHeader(len(.Entities))
		for ,  := range .Entities {
			if  == nil {
				return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field entities element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode updateShortMessage#313bc7f8: field entities element with index %d: %w", , )
			}
		}
	}
	if .Flags.Has(25) {
		.PutInt(.TTLPeriod)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateShortMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateShortMessage#313bc7f8 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field flags: %w", )
		}
	}
	.Out = .Flags.Has(1)
	.Mentioned = .Flags.Has(4)
	.MediaUnread = .Flags.Has(5)
	.Silent = .Flags.Has(13)
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field message: %w", )
		}
		.Message = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field pts_count: %w", )
		}
		.PtsCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field date: %w", )
		}
		.Date = 
	}
	if .Flags.Has(2) {
		if  := .FwdFrom.Decode();  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field fwd_from: %w", )
		}
	}
	if .Flags.Has(11) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field via_bot_id: %w", )
		}
		.ViaBotID = 
	}
	if .Flags.Has(3) {
		,  := DecodeMessageReplyHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field reply_to: %w", )
		}
		.ReplyTo = 
	}
	if .Flags.Has(7) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field entities: %w", )
		}

		if  > 0 {
			.Entities = make([]MessageEntityClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageEntity()
			if  != nil {
				return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field entities: %w", )
			}
			.Entities = append(.Entities, )
		}
	}
	if .Flags.Has(25) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortMessage#313bc7f8: field ttl_period: %w", )
		}
		.TTLPeriod = 
	}
	return nil
}

// SetOut sets value of Out conditional field.
func ( *UpdateShortMessage) ( bool) {
	if  {
		.Flags.Set(1)
		.Out = true
	} else {
		.Flags.Unset(1)
		.Out = false
	}
}

// GetOut returns value of Out conditional field.
func ( *UpdateShortMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetMentioned sets value of Mentioned conditional field.
func ( *UpdateShortMessage) ( bool) {
	if  {
		.Flags.Set(4)
		.Mentioned = true
	} else {
		.Flags.Unset(4)
		.Mentioned = false
	}
}

// GetMentioned returns value of Mentioned conditional field.
func ( *UpdateShortMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(4)
}

// SetMediaUnread sets value of MediaUnread conditional field.
func ( *UpdateShortMessage) ( bool) {
	if  {
		.Flags.Set(5)
		.MediaUnread = true
	} else {
		.Flags.Unset(5)
		.MediaUnread = false
	}
}

// GetMediaUnread returns value of MediaUnread conditional field.
func ( *UpdateShortMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(5)
}

// SetSilent sets value of Silent conditional field.
func ( *UpdateShortMessage) ( bool) {
	if  {
		.Flags.Set(13)
		.Silent = true
	} else {
		.Flags.Unset(13)
		.Silent = false
	}
}

// GetSilent returns value of Silent conditional field.
func ( *UpdateShortMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(13)
}

// GetID returns value of ID field.
func ( *UpdateShortMessage) () ( int) {
	if  == nil {
		return
	}
	return .ID
}

// GetUserID returns value of UserID field.
func ( *UpdateShortMessage) () ( int64) {
	if  == nil {
		return
	}
	return .UserID
}

// GetMessage returns value of Message field.
func ( *UpdateShortMessage) () ( string) {
	if  == nil {
		return
	}
	return .Message
}

// GetPts returns value of Pts field.
func ( *UpdateShortMessage) () ( int) {
	if  == nil {
		return
	}
	return .Pts
}

// GetPtsCount returns value of PtsCount field.
func ( *UpdateShortMessage) () ( int) {
	if  == nil {
		return
	}
	return .PtsCount
}

// GetDate returns value of Date field.
func ( *UpdateShortMessage) () ( int) {
	if  == nil {
		return
	}
	return .Date
}

// SetFwdFrom sets value of FwdFrom conditional field.
func ( *UpdateShortMessage) ( MessageFwdHeader) {
	.Flags.Set(2)
	.FwdFrom = 
}

// GetFwdFrom returns value of FwdFrom conditional field and
// boolean which is true if field was set.
func ( *UpdateShortMessage) () ( MessageFwdHeader,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .FwdFrom, true
}

// SetViaBotID sets value of ViaBotID conditional field.
func ( *UpdateShortMessage) ( int64) {
	.Flags.Set(11)
	.ViaBotID = 
}

// GetViaBotID returns value of ViaBotID conditional field and
// boolean which is true if field was set.
func ( *UpdateShortMessage) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(11) {
		return , false
	}
	return .ViaBotID, true
}

// SetReplyTo sets value of ReplyTo conditional field.
func ( *UpdateShortMessage) ( MessageReplyHeaderClass) {
	.Flags.Set(3)
	.ReplyTo = 
}

// GetReplyTo returns value of ReplyTo conditional field and
// boolean which is true if field was set.
func ( *UpdateShortMessage) () ( MessageReplyHeaderClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .ReplyTo, true
}

// SetEntities sets value of Entities conditional field.
func ( *UpdateShortMessage) ( []MessageEntityClass) {
	.Flags.Set(7)
	.Entities = 
}

// GetEntities returns value of Entities conditional field and
// boolean which is true if field was set.
func ( *UpdateShortMessage) () ( []MessageEntityClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(7) {
		return , false
	}
	return .Entities, true
}

// SetTTLPeriod sets value of TTLPeriod conditional field.
func ( *UpdateShortMessage) ( int) {
	.Flags.Set(25)
	.TTLPeriod = 
}

// GetTTLPeriod returns value of TTLPeriod conditional field and
// boolean which is true if field was set.
func ( *UpdateShortMessage) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(25) {
		return , false
	}
	return .TTLPeriod, true
}

// MapEntities returns field Entities wrapped in MessageEntityClassArray helper.
func ( *UpdateShortMessage) () ( MessageEntityClassArray,  bool) {
	if !.Flags.Has(7) {
		return , false
	}
	return MessageEntityClassArray(.Entities), true
}

// UpdateShortChatMessage represents TL type `updateShortChatMessage#4d6deea5`.
// Shortened constructor containing info on one new incoming text message from a chat
//
// See https://core.telegram.org/constructor/updateShortChatMessage for reference.
type UpdateShortChatMessage struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the message is outgoing
	Out bool
	// Whether we were mentioned in this message
	Mentioned bool
	// Whether the message contains some unread mentions
	MediaUnread bool
	// If true, the message is a silent message, no notifications should be triggered
	Silent bool
	// ID of the message
	ID int
	// ID of the sender of the message
	FromID int64
	// ID of the chat where the message was sent
	ChatID int64
	// Message
	Message string
	// PTS¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// PTS count¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
	// date¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Date int
	// Info about a forwarded message
	//
	// Use SetFwdFrom and GetFwdFrom helpers.
	FwdFrom MessageFwdHeader
	// Info about the inline bot used to generate this message
	//
	// Use SetViaBotID and GetViaBotID helpers.
	ViaBotID int64
	// Reply (thread) information
	//
	// Use SetReplyTo and GetReplyTo helpers.
	ReplyTo MessageReplyHeaderClass
	// Entities¹ for styled text
	//
	// Links:
	//  1) https://core.telegram.org/api/entities
	//
	// Use SetEntities and GetEntities helpers.
	Entities []MessageEntityClass
	// Time To Live of the message, once updateShortChatMessage.date+updateShortChatMessage
	// ttl_period === time(), the message will be deleted on the server, and must be deleted
	// locally as well.
	//
	// Use SetTTLPeriod and GetTTLPeriod helpers.
	TTLPeriod int
}

// UpdateShortChatMessageTypeID is TL type id of UpdateShortChatMessage.
const UpdateShortChatMessageTypeID = 0x4d6deea5

// construct implements constructor of UpdatesClass.
func ( UpdateShortChatMessage) () UpdatesClass { return & }

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

	_ UpdatesClass = &UpdateShortChatMessage{}
)

func ( *UpdateShortChatMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Out == false) {
		return false
	}
	if !(.Mentioned == false) {
		return false
	}
	if !(.MediaUnread == false) {
		return false
	}
	if !(.Silent == false) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.FromID == 0) {
		return false
	}
	if !(.ChatID == 0) {
		return false
	}
	if !(.Message == "") {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.FwdFrom.Zero()) {
		return false
	}
	if !(.ViaBotID == 0) {
		return false
	}
	if !(.ReplyTo == nil) {
		return false
	}
	if !(.Entities == nil) {
		return false
	}
	if !(.TTLPeriod == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateShortChatMessage from given interface.
func ( *UpdateShortChatMessage) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( int)
	() ( int64)
	() ( int64)
	() ( string)
	() ( int)
	() ( int)
	() ( int)
	() ( MessageFwdHeader,  bool)
	() ( int64,  bool)
	() ( MessageReplyHeaderClass,  bool)
	() ( []MessageEntityClass,  bool)
	() ( int,  bool)
}) {
	.Out = .()
	.Mentioned = .()
	.MediaUnread = .()
	.Silent = .()
	.ID = .()
	.FromID = .()
	.ChatID = .()
	.Message = .()
	.Pts = .()
	.PtsCount = .()
	.Date = .()
	if ,  := .();  {
		.FwdFrom = 
	}

	if ,  := .();  {
		.ViaBotID = 
	}

	if ,  := .();  {
		.ReplyTo = 
	}

	if ,  := .();  {
		.Entities = 
	}

	if ,  := .();  {
		.TTLPeriod = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateShortChatMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateShortChatMessage",
		ID:   UpdateShortChatMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Out",
			SchemaName: "out",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Mentioned",
			SchemaName: "mentioned",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "MediaUnread",
			SchemaName: "media_unread",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "Silent",
			SchemaName: "silent",
			Null:       !.Flags.Has(13),
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "FromID",
			SchemaName: "from_id",
		},
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "FwdFrom",
			SchemaName: "fwd_from",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "ViaBotID",
			SchemaName: "via_bot_id",
			Null:       !.Flags.Has(11),
		},
		{
			Name:       "ReplyTo",
			SchemaName: "reply_to",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Entities",
			SchemaName: "entities",
			Null:       !.Flags.Has(7),
		},
		{
			Name:       "TTLPeriod",
			SchemaName: "ttl_period",
			Null:       !.Flags.Has(25),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateShortChatMessage) () {
	if !(.Out == false) {
		.Flags.Set(1)
	}
	if !(.Mentioned == false) {
		.Flags.Set(4)
	}
	if !(.MediaUnread == false) {
		.Flags.Set(5)
	}
	if !(.Silent == false) {
		.Flags.Set(13)
	}
	if !(.FwdFrom.Zero()) {
		.Flags.Set(2)
	}
	if !(.ViaBotID == 0) {
		.Flags.Set(11)
	}
	if !(.ReplyTo == nil) {
		.Flags.Set(3)
	}
	if !(.Entities == nil) {
		.Flags.Set(7)
	}
	if !(.TTLPeriod == 0) {
		.Flags.Set(25)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateShortChatMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateShortChatMessage#4d6deea5 as nil")
	}
	.PutID(UpdateShortChatMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateShortChatMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateShortChatMessage#4d6deea5 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field flags: %w", )
	}
	.PutInt(.ID)
	.PutLong(.FromID)
	.PutLong(.ChatID)
	.PutString(.Message)
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	.PutInt(.Date)
	if .Flags.Has(2) {
		if  := .FwdFrom.Encode();  != nil {
			return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field fwd_from: %w", )
		}
	}
	if .Flags.Has(11) {
		.PutLong(.ViaBotID)
	}
	if .Flags.Has(3) {
		if .ReplyTo == nil {
			return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field reply_to is nil")
		}
		if  := .ReplyTo.Encode();  != nil {
			return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field reply_to: %w", )
		}
	}
	if .Flags.Has(7) {
		.PutVectorHeader(len(.Entities))
		for ,  := range .Entities {
			if  == nil {
				return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field entities element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode updateShortChatMessage#4d6deea5: field entities element with index %d: %w", , )
			}
		}
	}
	if .Flags.Has(25) {
		.PutInt(.TTLPeriod)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateShortChatMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateShortChatMessage#4d6deea5 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field flags: %w", )
		}
	}
	.Out = .Flags.Has(1)
	.Mentioned = .Flags.Has(4)
	.MediaUnread = .Flags.Has(5)
	.Silent = .Flags.Has(13)
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field from_id: %w", )
		}
		.FromID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field message: %w", )
		}
		.Message = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field pts_count: %w", )
		}
		.PtsCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field date: %w", )
		}
		.Date = 
	}
	if .Flags.Has(2) {
		if  := .FwdFrom.Decode();  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field fwd_from: %w", )
		}
	}
	if .Flags.Has(11) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field via_bot_id: %w", )
		}
		.ViaBotID = 
	}
	if .Flags.Has(3) {
		,  := DecodeMessageReplyHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field reply_to: %w", )
		}
		.ReplyTo = 
	}
	if .Flags.Has(7) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field entities: %w", )
		}

		if  > 0 {
			.Entities = make([]MessageEntityClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageEntity()
			if  != nil {
				return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field entities: %w", )
			}
			.Entities = append(.Entities, )
		}
	}
	if .Flags.Has(25) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortChatMessage#4d6deea5: field ttl_period: %w", )
		}
		.TTLPeriod = 
	}
	return nil
}

// SetOut sets value of Out conditional field.
func ( *UpdateShortChatMessage) ( bool) {
	if  {
		.Flags.Set(1)
		.Out = true
	} else {
		.Flags.Unset(1)
		.Out = false
	}
}

// GetOut returns value of Out conditional field.
func ( *UpdateShortChatMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetMentioned sets value of Mentioned conditional field.
func ( *UpdateShortChatMessage) ( bool) {
	if  {
		.Flags.Set(4)
		.Mentioned = true
	} else {
		.Flags.Unset(4)
		.Mentioned = false
	}
}

// GetMentioned returns value of Mentioned conditional field.
func ( *UpdateShortChatMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(4)
}

// SetMediaUnread sets value of MediaUnread conditional field.
func ( *UpdateShortChatMessage) ( bool) {
	if  {
		.Flags.Set(5)
		.MediaUnread = true
	} else {
		.Flags.Unset(5)
		.MediaUnread = false
	}
}

// GetMediaUnread returns value of MediaUnread conditional field.
func ( *UpdateShortChatMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(5)
}

// SetSilent sets value of Silent conditional field.
func ( *UpdateShortChatMessage) ( bool) {
	if  {
		.Flags.Set(13)
		.Silent = true
	} else {
		.Flags.Unset(13)
		.Silent = false
	}
}

// GetSilent returns value of Silent conditional field.
func ( *UpdateShortChatMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(13)
}

// GetID returns value of ID field.
func ( *UpdateShortChatMessage) () ( int) {
	if  == nil {
		return
	}
	return .ID
}

// GetFromID returns value of FromID field.
func ( *UpdateShortChatMessage) () ( int64) {
	if  == nil {
		return
	}
	return .FromID
}

// GetChatID returns value of ChatID field.
func ( *UpdateShortChatMessage) () ( int64) {
	if  == nil {
		return
	}
	return .ChatID
}

// GetMessage returns value of Message field.
func ( *UpdateShortChatMessage) () ( string) {
	if  == nil {
		return
	}
	return .Message
}

// GetPts returns value of Pts field.
func ( *UpdateShortChatMessage) () ( int) {
	if  == nil {
		return
	}
	return .Pts
}

// GetPtsCount returns value of PtsCount field.
func ( *UpdateShortChatMessage) () ( int) {
	if  == nil {
		return
	}
	return .PtsCount
}

// GetDate returns value of Date field.
func ( *UpdateShortChatMessage) () ( int) {
	if  == nil {
		return
	}
	return .Date
}

// SetFwdFrom sets value of FwdFrom conditional field.
func ( *UpdateShortChatMessage) ( MessageFwdHeader) {
	.Flags.Set(2)
	.FwdFrom = 
}

// GetFwdFrom returns value of FwdFrom conditional field and
// boolean which is true if field was set.
func ( *UpdateShortChatMessage) () ( MessageFwdHeader,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .FwdFrom, true
}

// SetViaBotID sets value of ViaBotID conditional field.
func ( *UpdateShortChatMessage) ( int64) {
	.Flags.Set(11)
	.ViaBotID = 
}

// GetViaBotID returns value of ViaBotID conditional field and
// boolean which is true if field was set.
func ( *UpdateShortChatMessage) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(11) {
		return , false
	}
	return .ViaBotID, true
}

// SetReplyTo sets value of ReplyTo conditional field.
func ( *UpdateShortChatMessage) ( MessageReplyHeaderClass) {
	.Flags.Set(3)
	.ReplyTo = 
}

// GetReplyTo returns value of ReplyTo conditional field and
// boolean which is true if field was set.
func ( *UpdateShortChatMessage) () ( MessageReplyHeaderClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .ReplyTo, true
}

// SetEntities sets value of Entities conditional field.
func ( *UpdateShortChatMessage) ( []MessageEntityClass) {
	.Flags.Set(7)
	.Entities = 
}

// GetEntities returns value of Entities conditional field and
// boolean which is true if field was set.
func ( *UpdateShortChatMessage) () ( []MessageEntityClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(7) {
		return , false
	}
	return .Entities, true
}

// SetTTLPeriod sets value of TTLPeriod conditional field.
func ( *UpdateShortChatMessage) ( int) {
	.Flags.Set(25)
	.TTLPeriod = 
}

// GetTTLPeriod returns value of TTLPeriod conditional field and
// boolean which is true if field was set.
func ( *UpdateShortChatMessage) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(25) {
		return , false
	}
	return .TTLPeriod, true
}

// MapEntities returns field Entities wrapped in MessageEntityClassArray helper.
func ( *UpdateShortChatMessage) () ( MessageEntityClassArray,  bool) {
	if !.Flags.Has(7) {
		return , false
	}
	return MessageEntityClassArray(.Entities), true
}

// UpdateShort represents TL type `updateShort#78d4dec1`.
// Shortened constructor containing info on one update not requiring auxiliary data
//
// See https://core.telegram.org/constructor/updateShort for reference.
type UpdateShort struct {
	// Update
	Update UpdateClass
	// Date of event
	Date int
}

// UpdateShortTypeID is TL type id of UpdateShort.
const UpdateShortTypeID = 0x78d4dec1

// construct implements constructor of UpdatesClass.
func ( UpdateShort) () UpdatesClass { return & }

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

	_ UpdatesClass = &UpdateShort{}
)

func ( *UpdateShort) () bool {
	if  == nil {
		return true
	}
	if !(.Update == nil) {
		return false
	}
	if !(.Date == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateShort from given interface.
func ( *UpdateShort) ( interface {
	() ( UpdateClass)
	() ( int)
}) {
	.Update = .()
	.Date = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateShort) () tdp.Type {
	 := tdp.Type{
		Name: "updateShort",
		ID:   UpdateShortTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Update",
			SchemaName: "update",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateShort) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateShort#78d4dec1 as nil")
	}
	.PutID(UpdateShortTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateShort) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateShort#78d4dec1 as nil")
	}
	if .Update == nil {
		return fmt.Errorf("unable to encode updateShort#78d4dec1: field update is nil")
	}
	if  := .Update.Encode();  != nil {
		return fmt.Errorf("unable to encode updateShort#78d4dec1: field update: %w", )
	}
	.PutInt(.Date)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateShort) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateShort#78d4dec1 to nil")
	}
	{
		,  := DecodeUpdate()
		if  != nil {
			return fmt.Errorf("unable to decode updateShort#78d4dec1: field update: %w", )
		}
		.Update = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShort#78d4dec1: field date: %w", )
		}
		.Date = 
	}
	return nil
}

// GetUpdate returns value of Update field.
func ( *UpdateShort) () ( UpdateClass) {
	if  == nil {
		return
	}
	return .Update
}

// GetDate returns value of Date field.
func ( *UpdateShort) () ( int) {
	if  == nil {
		return
	}
	return .Date
}

// UpdatesCombined represents TL type `updatesCombined#725b04c3`.
// Constructor for a group of updates.
//
// See https://core.telegram.org/constructor/updatesCombined for reference.
type UpdatesCombined struct {
	// List of updates
	Updates []UpdateClass
	// List of users mentioned in updates
	Users []UserClass
	// List of chats mentioned in updates
	Chats []ChatClass
	// Current date
	Date int
	// Value seq for the earliest update in a group
	SeqStart int
	// Value seq for the latest update in a group
	Seq int
}

// UpdatesCombinedTypeID is TL type id of UpdatesCombined.
const UpdatesCombinedTypeID = 0x725b04c3

// construct implements constructor of UpdatesClass.
func ( UpdatesCombined) () UpdatesClass { return & }

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

	_ UpdatesClass = &UpdatesCombined{}
)

func ( *UpdatesCombined) () bool {
	if  == nil {
		return true
	}
	if !(.Updates == nil) {
		return false
	}
	if !(.Users == nil) {
		return false
	}
	if !(.Chats == nil) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.SeqStart == 0) {
		return false
	}
	if !(.Seq == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatesCombined from given interface.
func ( *UpdatesCombined) ( interface {
	() ( []UpdateClass)
	() ( []UserClass)
	() ( []ChatClass)
	() ( int)
	() ( int)
	() ( int)
}) {
	.Updates = .()
	.Users = .()
	.Chats = .()
	.Date = .()
	.SeqStart = .()
	.Seq = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatesCombined) () tdp.Type {
	 := tdp.Type{
		Name: "updatesCombined",
		ID:   UpdatesCombinedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Updates",
			SchemaName: "updates",
		},
		{
			Name:       "Users",
			SchemaName: "users",
		},
		{
			Name:       "Chats",
			SchemaName: "chats",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "SeqStart",
			SchemaName: "seq_start",
		},
		{
			Name:       "Seq",
			SchemaName: "seq",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatesCombined) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatesCombined#725b04c3 as nil")
	}
	.PutID(UpdatesCombinedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatesCombined) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatesCombined#725b04c3 as nil")
	}
	.PutVectorHeader(len(.Updates))
	for ,  := range .Updates {
		if  == nil {
			return fmt.Errorf("unable to encode updatesCombined#725b04c3: field updates element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updatesCombined#725b04c3: field updates element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		if  == nil {
			return fmt.Errorf("unable to encode updatesCombined#725b04c3: field users element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updatesCombined#725b04c3: field users element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Chats))
	for ,  := range .Chats {
		if  == nil {
			return fmt.Errorf("unable to encode updatesCombined#725b04c3: field chats element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updatesCombined#725b04c3: field chats element with index %d: %w", , )
		}
	}
	.PutInt(.Date)
	.PutInt(.SeqStart)
	.PutInt(.Seq)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatesCombined) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatesCombined#725b04c3 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatesCombined#725b04c3: field updates: %w", )
		}

		if  > 0 {
			.Updates = make([]UpdateClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeUpdate()
			if  != nil {
				return fmt.Errorf("unable to decode updatesCombined#725b04c3: field updates: %w", )
			}
			.Updates = append(.Updates, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatesCombined#725b04c3: field users: %w", )
		}

		if  > 0 {
			.Users = make([]UserClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeUser()
			if  != nil {
				return fmt.Errorf("unable to decode updatesCombined#725b04c3: field users: %w", )
			}
			.Users = append(.Users, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatesCombined#725b04c3: field chats: %w", )
		}

		if  > 0 {
			.Chats = make([]ChatClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeChat()
			if  != nil {
				return fmt.Errorf("unable to decode updatesCombined#725b04c3: field chats: %w", )
			}
			.Chats = append(.Chats, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatesCombined#725b04c3: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatesCombined#725b04c3: field seq_start: %w", )
		}
		.SeqStart = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatesCombined#725b04c3: field seq: %w", )
		}
		.Seq = 
	}
	return nil
}

// GetUpdates returns value of Updates field.
func ( *UpdatesCombined) () ( []UpdateClass) {
	if  == nil {
		return
	}
	return .Updates
}

// GetUsers returns value of Users field.
func ( *UpdatesCombined) () ( []UserClass) {
	if  == nil {
		return
	}
	return .Users
}

// GetChats returns value of Chats field.
func ( *UpdatesCombined) () ( []ChatClass) {
	if  == nil {
		return
	}
	return .Chats
}

// GetDate returns value of Date field.
func ( *UpdatesCombined) () ( int) {
	if  == nil {
		return
	}
	return .Date
}

// GetSeqStart returns value of SeqStart field.
func ( *UpdatesCombined) () ( int) {
	if  == nil {
		return
	}
	return .SeqStart
}

// GetSeq returns value of Seq field.
func ( *UpdatesCombined) () ( int) {
	if  == nil {
		return
	}
	return .Seq
}

// MapUpdates returns field Updates wrapped in UpdateClassArray helper.
func ( *UpdatesCombined) () ( UpdateClassArray) {
	return UpdateClassArray(.Updates)
}

// MapUsers returns field Users wrapped in UserClassArray helper.
func ( *UpdatesCombined) () ( UserClassArray) {
	return UserClassArray(.Users)
}

// MapChats returns field Chats wrapped in ChatClassArray helper.
func ( *UpdatesCombined) () ( ChatClassArray) {
	return ChatClassArray(.Chats)
}

// Updates represents TL type `updates#74ae4240`.
//
// See https://core.telegram.org/constructor/updates for reference.
type Updates struct {
	// Updates field of Updates.
	Updates []UpdateClass
	// Users field of Updates.
	Users []UserClass
	// Chats field of Updates.
	Chats []ChatClass
	// Date field of Updates.
	Date int
	// Seq field of Updates.
	Seq int
}

// UpdatesTypeID is TL type id of Updates.
const UpdatesTypeID = 0x74ae4240

// construct implements constructor of UpdatesClass.
func ( Updates) () UpdatesClass { return & }

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

	_ UpdatesClass = &Updates{}
)

func ( *Updates) () bool {
	if  == nil {
		return true
	}
	if !(.Updates == nil) {
		return false
	}
	if !(.Users == nil) {
		return false
	}
	if !(.Chats == nil) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Seq == 0) {
		return false
	}

	return true
}

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

// FillFrom fills Updates from given interface.
func ( *Updates) ( interface {
	() ( []UpdateClass)
	() ( []UserClass)
	() ( []ChatClass)
	() ( int)
	() ( int)
}) {
	.Updates = .()
	.Users = .()
	.Chats = .()
	.Date = .()
	.Seq = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *Updates) () tdp.Type {
	 := tdp.Type{
		Name: "updates",
		ID:   UpdatesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Updates",
			SchemaName: "updates",
		},
		{
			Name:       "Users",
			SchemaName: "users",
		},
		{
			Name:       "Chats",
			SchemaName: "chats",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "Seq",
			SchemaName: "seq",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *Updates) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updates#74ae4240 as nil")
	}
	.PutID(UpdatesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *Updates) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updates#74ae4240 as nil")
	}
	.PutVectorHeader(len(.Updates))
	for ,  := range .Updates {
		if  == nil {
			return fmt.Errorf("unable to encode updates#74ae4240: field updates element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updates#74ae4240: field updates element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		if  == nil {
			return fmt.Errorf("unable to encode updates#74ae4240: field users element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updates#74ae4240: field users element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Chats))
	for ,  := range .Chats {
		if  == nil {
			return fmt.Errorf("unable to encode updates#74ae4240: field chats element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updates#74ae4240: field chats element with index %d: %w", , )
		}
	}
	.PutInt(.Date)
	.PutInt(.Seq)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *Updates) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updates#74ae4240 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updates#74ae4240: field updates: %w", )
		}

		if  > 0 {
			.Updates = make([]UpdateClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeUpdate()
			if  != nil {
				return fmt.Errorf("unable to decode updates#74ae4240: field updates: %w", )
			}
			.Updates = append(.Updates, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updates#74ae4240: field users: %w", )
		}

		if  > 0 {
			.Users = make([]UserClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeUser()
			if  != nil {
				return fmt.Errorf("unable to decode updates#74ae4240: field users: %w", )
			}
			.Users = append(.Users, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updates#74ae4240: field chats: %w", )
		}

		if  > 0 {
			.Chats = make([]ChatClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeChat()
			if  != nil {
				return fmt.Errorf("unable to decode updates#74ae4240: field chats: %w", )
			}
			.Chats = append(.Chats, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updates#74ae4240: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updates#74ae4240: field seq: %w", )
		}
		.Seq = 
	}
	return nil
}

// GetUpdates returns value of Updates field.
func ( *Updates) () ( []UpdateClass) {
	if  == nil {
		return
	}
	return .Updates
}

// GetUsers returns value of Users field.
func ( *Updates) () ( []UserClass) {
	if  == nil {
		return
	}
	return .Users
}

// GetChats returns value of Chats field.
func ( *Updates) () ( []ChatClass) {
	if  == nil {
		return
	}
	return .Chats
}

// GetDate returns value of Date field.
func ( *Updates) () ( int) {
	if  == nil {
		return
	}
	return .Date
}

// GetSeq returns value of Seq field.
func ( *Updates) () ( int) {
	if  == nil {
		return
	}
	return .Seq
}

// MapUpdates returns field Updates wrapped in UpdateClassArray helper.
func ( *Updates) () ( UpdateClassArray) {
	return UpdateClassArray(.Updates)
}

// MapUsers returns field Users wrapped in UserClassArray helper.
func ( *Updates) () ( UserClassArray) {
	return UserClassArray(.Users)
}

// MapChats returns field Chats wrapped in ChatClassArray helper.
func ( *Updates) () ( ChatClassArray) {
	return ChatClassArray(.Chats)
}

// UpdateShortSentMessage represents TL type `updateShortSentMessage#9015e101`.
// Shortened constructor containing info on one outgoing message to a contact (the
// destination chat has to be extracted from the method call that returned this object).
//
// See https://core.telegram.org/constructor/updateShortSentMessage for reference.
type UpdateShortSentMessage struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the message is outgoing
	Out bool
	// ID of the sent message
	ID int
	// PTS¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// PTS count¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
	// date¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Date int
	// Attached media
	//
	// Use SetMedia and GetMedia helpers.
	Media MessageMediaClass
	// Entities¹ for styled text
	//
	// Links:
	//  1) https://core.telegram.org/api/entities
	//
	// Use SetEntities and GetEntities helpers.
	Entities []MessageEntityClass
	// Time To Live of the message, once message.date+message.ttl_period === time(), the
	// message will be deleted on the server, and must be deleted locally as well.
	//
	// Use SetTTLPeriod and GetTTLPeriod helpers.
	TTLPeriod int
}

// UpdateShortSentMessageTypeID is TL type id of UpdateShortSentMessage.
const UpdateShortSentMessageTypeID = 0x9015e101

// construct implements constructor of UpdatesClass.
func ( UpdateShortSentMessage) () UpdatesClass { return & }

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

	_ UpdatesClass = &UpdateShortSentMessage{}
)

func ( *UpdateShortSentMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Out == false) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Media == nil) {
		return false
	}
	if !(.Entities == nil) {
		return false
	}
	if !(.TTLPeriod == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateShortSentMessage from given interface.
func ( *UpdateShortSentMessage) ( interface {
	() ( bool)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( MessageMediaClass,  bool)
	() ( []MessageEntityClass,  bool)
	() ( int,  bool)
}) {
	.Out = .()
	.ID = .()
	.Pts = .()
	.PtsCount = .()
	.Date = .()
	if ,  := .();  {
		.Media = 
	}

	if ,  := .();  {
		.Entities = 
	}

	if ,  := .();  {
		.TTLPeriod = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateShortSentMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateShortSentMessage",
		ID:   UpdateShortSentMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Out",
			SchemaName: "out",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "Media",
			SchemaName: "media",
			Null:       !.Flags.Has(9),
		},
		{
			Name:       "Entities",
			SchemaName: "entities",
			Null:       !.Flags.Has(7),
		},
		{
			Name:       "TTLPeriod",
			SchemaName: "ttl_period",
			Null:       !.Flags.Has(25),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateShortSentMessage) () {
	if !(.Out == false) {
		.Flags.Set(1)
	}
	if !(.Media == nil) {
		.Flags.Set(9)
	}
	if !(.Entities == nil) {
		.Flags.Set(7)
	}
	if !(.TTLPeriod == 0) {
		.Flags.Set(25)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateShortSentMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateShortSentMessage#9015e101 as nil")
	}
	.PutID(UpdateShortSentMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateShortSentMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateShortSentMessage#9015e101 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateShortSentMessage#9015e101: field flags: %w", )
	}
	.PutInt(.ID)
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	.PutInt(.Date)
	if .Flags.Has(9) {
		if .Media == nil {
			return fmt.Errorf("unable to encode updateShortSentMessage#9015e101: field media is nil")
		}
		if  := .Media.Encode();  != nil {
			return fmt.Errorf("unable to encode updateShortSentMessage#9015e101: field media: %w", )
		}
	}
	if .Flags.Has(7) {
		.PutVectorHeader(len(.Entities))
		for ,  := range .Entities {
			if  == nil {
				return fmt.Errorf("unable to encode updateShortSentMessage#9015e101: field entities element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode updateShortSentMessage#9015e101: field entities element with index %d: %w", , )
			}
		}
	}
	if .Flags.Has(25) {
		.PutInt(.TTLPeriod)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateShortSentMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateShortSentMessage#9015e101 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field flags: %w", )
		}
	}
	.Out = .Flags.Has(1)
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field pts_count: %w", )
		}
		.PtsCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field date: %w", )
		}
		.Date = 
	}
	if .Flags.Has(9) {
		,  := DecodeMessageMedia()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field media: %w", )
		}
		.Media = 
	}
	if .Flags.Has(7) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field entities: %w", )
		}

		if  > 0 {
			.Entities = make([]MessageEntityClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageEntity()
			if  != nil {
				return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field entities: %w", )
			}
			.Entities = append(.Entities, )
		}
	}
	if .Flags.Has(25) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateShortSentMessage#9015e101: field ttl_period: %w", )
		}
		.TTLPeriod = 
	}
	return nil
}

// SetOut sets value of Out conditional field.
func ( *UpdateShortSentMessage) ( bool) {
	if  {
		.Flags.Set(1)
		.Out = true
	} else {
		.Flags.Unset(1)
		.Out = false
	}
}

// GetOut returns value of Out conditional field.
func ( *UpdateShortSentMessage) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetID returns value of ID field.
func ( *UpdateShortSentMessage) () ( int) {
	if  == nil {
		return
	}
	return .ID
}

// GetPts returns value of Pts field.
func ( *UpdateShortSentMessage) () ( int) {
	if  == nil {
		return
	}
	return .Pts
}

// GetPtsCount returns value of PtsCount field.
func ( *UpdateShortSentMessage) () ( int) {
	if  == nil {
		return
	}
	return .PtsCount
}

// GetDate returns value of Date field.
func ( *UpdateShortSentMessage) () ( int) {
	if  == nil {
		return
	}
	return .Date
}

// SetMedia sets value of Media conditional field.
func ( *UpdateShortSentMessage) ( MessageMediaClass) {
	.Flags.Set(9)
	.Media = 
}

// GetMedia returns value of Media conditional field and
// boolean which is true if field was set.
func ( *UpdateShortSentMessage) () ( MessageMediaClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(9) {
		return , false
	}
	return .Media, true
}

// SetEntities sets value of Entities conditional field.
func ( *UpdateShortSentMessage) ( []MessageEntityClass) {
	.Flags.Set(7)
	.Entities = 
}

// GetEntities returns value of Entities conditional field and
// boolean which is true if field was set.
func ( *UpdateShortSentMessage) () ( []MessageEntityClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(7) {
		return , false
	}
	return .Entities, true
}

// SetTTLPeriod sets value of TTLPeriod conditional field.
func ( *UpdateShortSentMessage) ( int) {
	.Flags.Set(25)
	.TTLPeriod = 
}

// GetTTLPeriod returns value of TTLPeriod conditional field and
// boolean which is true if field was set.
func ( *UpdateShortSentMessage) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(25) {
		return , false
	}
	return .TTLPeriod, true
}

// MapEntities returns field Entities wrapped in MessageEntityClassArray helper.
func ( *UpdateShortSentMessage) () ( MessageEntityClassArray,  bool) {
	if !.Flags.Has(7) {
		return , false
	}
	return MessageEntityClassArray(.Entities), true
}

// UpdatesClassName is schema name of UpdatesClass.
const UpdatesClassName = "Updates"

// UpdatesClass represents Updates generic type.
//
// See https://core.telegram.org/type/Updates for reference.
//
// Example:
//
//	g, err := tg.DecodeUpdates(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.UpdatesTooLong: // updatesTooLong#e317af7e
//	case *tg.UpdateShortMessage: // updateShortMessage#313bc7f8
//	case *tg.UpdateShortChatMessage: // updateShortChatMessage#4d6deea5
//	case *tg.UpdateShort: // updateShort#78d4dec1
//	case *tg.UpdatesCombined: // updatesCombined#725b04c3
//	case *tg.Updates: // updates#74ae4240
//	case *tg.UpdateShortSentMessage: // updateShortSentMessage#9015e101
//	default: panic(v)
//	}
type UpdatesClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() UpdatesClass

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

// DecodeUpdates implements binary de-serialization for UpdatesClass.
func ( *bin.Buffer) (UpdatesClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case UpdatesTooLongTypeID:
		// Decoding updatesTooLong#e317af7e.
		 := UpdatesTooLong{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdatesClass: %w", )
		}
		return &, nil
	case UpdateShortMessageTypeID:
		// Decoding updateShortMessage#313bc7f8.
		 := UpdateShortMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdatesClass: %w", )
		}
		return &, nil
	case UpdateShortChatMessageTypeID:
		// Decoding updateShortChatMessage#4d6deea5.
		 := UpdateShortChatMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdatesClass: %w", )
		}
		return &, nil
	case UpdateShortTypeID:
		// Decoding updateShort#78d4dec1.
		 := UpdateShort{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdatesClass: %w", )
		}
		return &, nil
	case UpdatesCombinedTypeID:
		// Decoding updatesCombined#725b04c3.
		 := UpdatesCombined{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdatesClass: %w", )
		}
		return &, nil
	case UpdatesTypeID:
		// Decoding updates#74ae4240.
		 := Updates{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdatesClass: %w", )
		}
		return &, nil
	case UpdateShortSentMessageTypeID:
		// Decoding updateShortSentMessage#9015e101.
		 := UpdateShortSentMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdatesClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode UpdatesClass: %w", bin.NewUnexpectedID())
	}
}

// Updates boxes the UpdatesClass providing a helper.
type UpdatesBox struct {
	Updates UpdatesClass
}

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

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