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

// UpdateNewMessage represents TL type `updateNewMessage#1f2b0afd`.
// New message in a private chat or in a basic group¹.
//
// Links:
//  1. https://core.telegram.org/api/channel#basic-groups
//
// See https://core.telegram.org/constructor/updateNewMessage for reference.
type UpdateNewMessage struct {
	// Message
	Message MessageClass
	// New quantity of actions in a message box
	Pts int
	// Number of generated events
	PtsCount int
}

// UpdateNewMessageTypeID is TL type id of UpdateNewMessage.
const UpdateNewMessageTypeID = 0x1f2b0afd

// construct implements constructor of UpdateClass.
func ( UpdateNewMessage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateNewMessage{}
)

func ( *UpdateNewMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Message == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateNewMessage from given interface.
func ( *UpdateNewMessage) ( interface {
	() ( MessageClass)
	() ( int)
	() ( int)
}) {
	.Message = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateNewMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewMessage",
		ID:   UpdateNewMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateNewMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewMessage#1f2b0afd as nil")
	}
	.PutID(UpdateNewMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewMessage#1f2b0afd as nil")
	}
	if .Message == nil {
		return fmt.Errorf("unable to encode updateNewMessage#1f2b0afd: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewMessage#1f2b0afd: field message: %w", )
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewMessage#1f2b0afd to nil")
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewMessage#1f2b0afd: field message: %w", )
		}
		.Message = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewMessage#1f2b0afd: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewMessage#1f2b0afd: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

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

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

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

// UpdateMessageID represents TL type `updateMessageID#4e90bfd6`.
// Sent message with random_id client identifier was assigned an identifier.
//
// See https://core.telegram.org/constructor/updateMessageID for reference.
type UpdateMessageID struct {
	// id identifier of a respective Message¹
	//
	// Links:
	//  1) https://core.telegram.org/type/Message
	ID int
	// Previously transferred client random_id identifier
	RandomID int64
}

// UpdateMessageIDTypeID is TL type id of UpdateMessageID.
const UpdateMessageIDTypeID = 0x4e90bfd6

// construct implements constructor of UpdateClass.
func ( UpdateMessageID) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateMessageID{}
)

func ( *UpdateMessageID) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.RandomID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateMessageID from given interface.
func ( *UpdateMessageID) ( interface {
	() ( int)
	() ( int64)
}) {
	.ID = .()
	.RandomID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateMessageID) () tdp.Type {
	 := tdp.Type{
		Name: "updateMessageID",
		ID:   UpdateMessageIDTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "RandomID",
			SchemaName: "random_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateMessageID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageID#4e90bfd6 as nil")
	}
	.PutID(UpdateMessageIDTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessageID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageID#4e90bfd6 as nil")
	}
	.PutInt(.ID)
	.PutLong(.RandomID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessageID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessageID#4e90bfd6 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageID#4e90bfd6: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageID#4e90bfd6: field random_id: %w", )
		}
		.RandomID = 
	}
	return nil
}

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

// GetRandomID returns value of RandomID field.
func ( *UpdateMessageID) () ( int64) {
	if  == nil {
		return
	}
	return .RandomID
}

// UpdateDeleteMessages represents TL type `updateDeleteMessages#a20db0e5`.
// Messages were deleted.
//
// See https://core.telegram.org/constructor/updateDeleteMessages for reference.
type UpdateDeleteMessages struct {
	// List of identifiers of deleted messages
	Messages []int
	// New quality of actions in a message box
	Pts int
	// Number of generated events¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateDeleteMessagesTypeID is TL type id of UpdateDeleteMessages.
const UpdateDeleteMessagesTypeID = 0xa20db0e5

// construct implements constructor of UpdateClass.
func ( UpdateDeleteMessages) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDeleteMessages{}
)

func ( *UpdateDeleteMessages) () bool {
	if  == nil {
		return true
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDeleteMessages from given interface.
func ( *UpdateDeleteMessages) ( interface {
	() ( []int)
	() ( int)
	() ( int)
}) {
	.Messages = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDeleteMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updateDeleteMessages",
		ID:   UpdateDeleteMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateDeleteMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteMessages#a20db0e5 as nil")
	}
	.PutID(UpdateDeleteMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDeleteMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteMessages#a20db0e5 as nil")
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

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

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateDeleteMessages#a20db0e5: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteMessages#a20db0e5: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteMessages#a20db0e5: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// GetMessages returns value of Messages field.
func ( *UpdateDeleteMessages) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

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

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

// UpdateUserTyping represents TL type `updateUserTyping#2a17bf5c`.
// The user is preparing a message; typing, recording, uploading, etc. This update is
// valid for 6 seconds. If no further updates of this kind are received after 6 seconds,
// it should be considered that the user stopped doing whatever they were doing
//
// See https://core.telegram.org/constructor/updateUserTyping for reference.
type UpdateUserTyping struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// User id
	UserID int64
	// If set, this notification was sent within a bot forum topic »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/forum#bot-forums
	//
	// Use SetTopMsgID and GetTopMsgID helpers.
	TopMsgID int
	// Action type
	Action SendMessageActionClass
}

// UpdateUserTypingTypeID is TL type id of UpdateUserTyping.
const UpdateUserTypingTypeID = 0x2a17bf5c

// construct implements constructor of UpdateClass.
func ( UpdateUserTyping) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateUserTyping{}
)

func ( *UpdateUserTyping) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.Action == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateUserTyping from given interface.
func ( *UpdateUserTyping) ( interface {
	() ( int64)
	() ( int,  bool)
	() ( SendMessageActionClass)
}) {
	.UserID = .()
	if ,  := .();  {
		.TopMsgID = 
	}

	.Action = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateUserTyping) () tdp.Type {
	 := tdp.Type{
		Name: "updateUserTyping",
		ID:   UpdateUserTypingTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Action",
			SchemaName: "action",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserTyping#2a17bf5c as nil")
	}
	.PutID(UpdateUserTypingTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserTyping#2a17bf5c as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateUserTyping#2a17bf5c: field flags: %w", )
	}
	.PutLong(.UserID)
	if .Flags.Has(0) {
		.PutInt(.TopMsgID)
	}
	if .Action == nil {
		return fmt.Errorf("unable to encode updateUserTyping#2a17bf5c: field action is nil")
	}
	if  := .Action.Encode();  != nil {
		return fmt.Errorf("unable to encode updateUserTyping#2a17bf5c: field action: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateUserTyping#2a17bf5c to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateUserTyping#2a17bf5c: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserTyping#2a17bf5c: field user_id: %w", )
		}
		.UserID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserTyping#2a17bf5c: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		,  := DecodeSendMessageAction()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserTyping#2a17bf5c: field action: %w", )
		}
		.Action = 
	}
	return nil
}

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

// SetTopMsgID sets value of TopMsgID conditional field.
func ( *UpdateUserTyping) ( int) {
	.Flags.Set(0)
	.TopMsgID = 
}

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

// GetAction returns value of Action field.
func ( *UpdateUserTyping) () ( SendMessageActionClass) {
	if  == nil {
		return
	}
	return .Action
}

// UpdateChatUserTyping represents TL type `updateChatUserTyping#83487af0`.
// The user is preparing a message in a group; typing, recording, uploading, etc. This
// update is valid for 6 seconds. If no further updates of this kind are received after 6
// seconds, it should be considered that the user stopped doing whatever they were doing
//
// See https://core.telegram.org/constructor/updateChatUserTyping for reference.
type UpdateChatUserTyping struct {
	// Group id
	ChatID int64
	// Peer that started typing (can be the chat itself, in case of anonymous admins).
	FromID PeerClass
	// Type of action
	Action SendMessageActionClass
}

// UpdateChatUserTypingTypeID is TL type id of UpdateChatUserTyping.
const UpdateChatUserTypingTypeID = 0x83487af0

// construct implements constructor of UpdateClass.
func ( UpdateChatUserTyping) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChatUserTyping{}
)

func ( *UpdateChatUserTyping) () bool {
	if  == nil {
		return true
	}
	if !(.ChatID == 0) {
		return false
	}
	if !(.FromID == nil) {
		return false
	}
	if !(.Action == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChatUserTyping from given interface.
func ( *UpdateChatUserTyping) ( interface {
	() ( int64)
	() ( PeerClass)
	() ( SendMessageActionClass)
}) {
	.ChatID = .()
	.FromID = .()
	.Action = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChatUserTyping) () tdp.Type {
	 := tdp.Type{
		Name: "updateChatUserTyping",
		ID:   UpdateChatUserTypingTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "FromID",
			SchemaName: "from_id",
		},
		{
			Name:       "Action",
			SchemaName: "action",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChatUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatUserTyping#83487af0 as nil")
	}
	.PutID(UpdateChatUserTypingTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChatUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatUserTyping#83487af0 as nil")
	}
	.PutLong(.ChatID)
	if .FromID == nil {
		return fmt.Errorf("unable to encode updateChatUserTyping#83487af0: field from_id is nil")
	}
	if  := .FromID.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChatUserTyping#83487af0: field from_id: %w", )
	}
	if .Action == nil {
		return fmt.Errorf("unable to encode updateChatUserTyping#83487af0: field action is nil")
	}
	if  := .Action.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChatUserTyping#83487af0: field action: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChatUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatUserTyping#83487af0 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatUserTyping#83487af0: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatUserTyping#83487af0: field from_id: %w", )
		}
		.FromID = 
	}
	{
		,  := DecodeSendMessageAction()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatUserTyping#83487af0: field action: %w", )
		}
		.Action = 
	}
	return nil
}

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

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

// GetAction returns value of Action field.
func ( *UpdateChatUserTyping) () ( SendMessageActionClass) {
	if  == nil {
		return
	}
	return .Action
}

// UpdateChatParticipants represents TL type `updateChatParticipants#7761198`.
// The participants of a basic group »¹ changed.
//
// Links:
//  1. https://core.telegram.org/api/channel#basic-groups
//
// See https://core.telegram.org/constructor/updateChatParticipants for reference.
type UpdateChatParticipants struct {
	// Updated chat participants (also contains the version used to deduplicate/update
	// outdated chat information as specified here »¹).
	//
	// Links:
	//  1) https://core.telegram.org/api/peers#basic-group-updates
	Participants ChatParticipantsClass
}

// UpdateChatParticipantsTypeID is TL type id of UpdateChatParticipants.
const UpdateChatParticipantsTypeID = 0x7761198

// construct implements constructor of UpdateClass.
func ( UpdateChatParticipants) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChatParticipants{}
)

func ( *UpdateChatParticipants) () bool {
	if  == nil {
		return true
	}
	if !(.Participants == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChatParticipants from given interface.
func ( *UpdateChatParticipants) ( interface {
	() ( ChatParticipantsClass)
}) {
	.Participants = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChatParticipants) () tdp.Type {
	 := tdp.Type{
		Name: "updateChatParticipants",
		ID:   UpdateChatParticipantsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Participants",
			SchemaName: "participants",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChatParticipants) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipants#7761198 as nil")
	}
	.PutID(UpdateChatParticipantsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChatParticipants) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipants#7761198 as nil")
	}
	if .Participants == nil {
		return fmt.Errorf("unable to encode updateChatParticipants#7761198: field participants is nil")
	}
	if  := .Participants.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChatParticipants#7761198: field participants: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChatParticipants) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatParticipants#7761198 to nil")
	}
	{
		,  := DecodeChatParticipants()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipants#7761198: field participants: %w", )
		}
		.Participants = 
	}
	return nil
}

// GetParticipants returns value of Participants field.
func ( *UpdateChatParticipants) () ( ChatParticipantsClass) {
	if  == nil {
		return
	}
	return .Participants
}

// UpdateUserStatus represents TL type `updateUserStatus#e5bdf8de`.
// Contact status update.
//
// See https://core.telegram.org/constructor/updateUserStatus for reference.
type UpdateUserStatus struct {
	// User identifier
	UserID int64
	// New status
	Status UserStatusClass
}

// UpdateUserStatusTypeID is TL type id of UpdateUserStatus.
const UpdateUserStatusTypeID = 0xe5bdf8de

// construct implements constructor of UpdateClass.
func ( UpdateUserStatus) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateUserStatus{}
)

func ( *UpdateUserStatus) () bool {
	if  == nil {
		return true
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Status == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateUserStatus from given interface.
func ( *UpdateUserStatus) ( interface {
	() ( int64)
	() ( UserStatusClass)
}) {
	.UserID = .()
	.Status = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateUserStatus) () tdp.Type {
	 := tdp.Type{
		Name: "updateUserStatus",
		ID:   UpdateUserStatusTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Status",
			SchemaName: "status",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateUserStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserStatus#e5bdf8de as nil")
	}
	.PutID(UpdateUserStatusTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateUserStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserStatus#e5bdf8de as nil")
	}
	.PutLong(.UserID)
	if .Status == nil {
		return fmt.Errorf("unable to encode updateUserStatus#e5bdf8de: field status is nil")
	}
	if  := .Status.Encode();  != nil {
		return fmt.Errorf("unable to encode updateUserStatus#e5bdf8de: field status: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateUserStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateUserStatus#e5bdf8de to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserStatus#e5bdf8de: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := DecodeUserStatus()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserStatus#e5bdf8de: field status: %w", )
		}
		.Status = 
	}
	return nil
}

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

// GetStatus returns value of Status field.
func ( *UpdateUserStatus) () ( UserStatusClass) {
	if  == nil {
		return
	}
	return .Status
}

// UpdateUserName represents TL type `updateUserName#a7848924`.
// Changes the user's first name, last name and username.
//
// See https://core.telegram.org/constructor/updateUserName for reference.
type UpdateUserName struct {
	// User identifier
	UserID int64
	// New first name. Corresponds to the new value of real_first_name field of the
	// userFull¹ constructor.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/userFull
	FirstName string
	// New last name. Corresponds to the new value of real_last_name field of the userFull¹
	// constructor.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/userFull
	LastName string
	// Usernames.
	Usernames []Username
}

// UpdateUserNameTypeID is TL type id of UpdateUserName.
const UpdateUserNameTypeID = 0xa7848924

// construct implements constructor of UpdateClass.
func ( UpdateUserName) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateUserName{}
)

func ( *UpdateUserName) () bool {
	if  == nil {
		return true
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.FirstName == "") {
		return false
	}
	if !(.LastName == "") {
		return false
	}
	if !(.Usernames == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateUserName from given interface.
func ( *UpdateUserName) ( interface {
	() ( int64)
	() ( string)
	() ( string)
	() ( []Username)
}) {
	.UserID = .()
	.FirstName = .()
	.LastName = .()
	.Usernames = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateUserName) () tdp.Type {
	 := tdp.Type{
		Name: "updateUserName",
		ID:   UpdateUserNameTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "FirstName",
			SchemaName: "first_name",
		},
		{
			Name:       "LastName",
			SchemaName: "last_name",
		},
		{
			Name:       "Usernames",
			SchemaName: "usernames",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateUserName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserName#a7848924 as nil")
	}
	.PutID(UpdateUserNameTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateUserName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserName#a7848924 as nil")
	}
	.PutLong(.UserID)
	.PutString(.FirstName)
	.PutString(.LastName)
	.PutVectorHeader(len(.Usernames))
	for ,  := range .Usernames {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateUserName#a7848924: field usernames element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateUserName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateUserName#a7848924 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserName#a7848924: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserName#a7848924: field first_name: %w", )
		}
		.FirstName = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserName#a7848924: field last_name: %w", )
		}
		.LastName = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserName#a7848924: field usernames: %w", )
		}

		if  > 0 {
			.Usernames = make([]Username, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  Username
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode updateUserName#a7848924: field usernames: %w", )
			}
			.Usernames = append(.Usernames, )
		}
	}
	return nil
}

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

// GetFirstName returns value of FirstName field.
func ( *UpdateUserName) () ( string) {
	if  == nil {
		return
	}
	return .FirstName
}

// GetLastName returns value of LastName field.
func ( *UpdateUserName) () ( string) {
	if  == nil {
		return
	}
	return .LastName
}

// GetUsernames returns value of Usernames field.
func ( *UpdateUserName) () ( []Username) {
	if  == nil {
		return
	}
	return .Usernames
}

// UpdateNewAuthorization represents TL type `updateNewAuthorization#8951abef`.
// A new session logged into the current user's account through an unknown device.
//
// See https://core.telegram.org/constructor/updateNewAuthorization for reference.
type UpdateNewAuthorization struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the session is unconfirmed, see here »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/auth#confirming-login
	Unconfirmed bool
	// Hash used for caching, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int64
	// Authorization date
	//
	// Use SetDate and GetDate helpers.
	Date int
	// Name of device, for example Android
	//
	// Use SetDevice and GetDevice helpers.
	Device string
	// Location, for example USA, NY (IP=1.2.3.4)
	//
	// Use SetLocation and GetLocation helpers.
	Location string
}

// UpdateNewAuthorizationTypeID is TL type id of UpdateNewAuthorization.
const UpdateNewAuthorizationTypeID = 0x8951abef

// construct implements constructor of UpdateClass.
func ( UpdateNewAuthorization) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateNewAuthorization{}
)

func ( *UpdateNewAuthorization) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Unconfirmed == false) {
		return false
	}
	if !(.Hash == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Device == "") {
		return false
	}
	if !(.Location == "") {
		return false
	}

	return true
}

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

// FillFrom fills UpdateNewAuthorization from given interface.
func ( *UpdateNewAuthorization) ( interface {
	() ( bool)
	() ( int64)
	() ( int,  bool)
	() ( string,  bool)
	() ( string,  bool)
}) {
	.Unconfirmed = .()
	.Hash = .()
	if ,  := .();  {
		.Date = 
	}

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateNewAuthorization) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewAuthorization",
		ID:   UpdateNewAuthorizationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Unconfirmed",
			SchemaName: "unconfirmed",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
		{
			Name:       "Date",
			SchemaName: "date",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Device",
			SchemaName: "device",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Location",
			SchemaName: "location",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateNewAuthorization) () {
	if !(.Unconfirmed == false) {
		.Flags.Set(0)
	}
	if !(.Date == 0) {
		.Flags.Set(0)
	}
	if !(.Device == "") {
		.Flags.Set(0)
	}
	if !(.Location == "") {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateNewAuthorization) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewAuthorization#8951abef as nil")
	}
	.PutID(UpdateNewAuthorizationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewAuthorization) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewAuthorization#8951abef as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewAuthorization#8951abef: field flags: %w", )
	}
	.PutLong(.Hash)
	if .Flags.Has(0) {
		.PutInt(.Date)
	}
	if .Flags.Has(0) {
		.PutString(.Device)
	}
	if .Flags.Has(0) {
		.PutString(.Location)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewAuthorization) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewAuthorization#8951abef to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateNewAuthorization#8951abef: field flags: %w", )
		}
	}
	.Unconfirmed = .Flags.Has(0)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewAuthorization#8951abef: field hash: %w", )
		}
		.Hash = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewAuthorization#8951abef: field date: %w", )
		}
		.Date = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewAuthorization#8951abef: field device: %w", )
		}
		.Device = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewAuthorization#8951abef: field location: %w", )
		}
		.Location = 
	}
	return nil
}

// SetUnconfirmed sets value of Unconfirmed conditional field.
func ( *UpdateNewAuthorization) ( bool) {
	if  {
		.Flags.Set(0)
		.Unconfirmed = true
	} else {
		.Flags.Unset(0)
		.Unconfirmed = false
	}
}

// GetUnconfirmed returns value of Unconfirmed conditional field.
func ( *UpdateNewAuthorization) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

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

// SetDate sets value of Date conditional field.
func ( *UpdateNewAuthorization) ( int) {
	.Flags.Set(0)
	.Date = 
}

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

// SetDevice sets value of Device conditional field.
func ( *UpdateNewAuthorization) ( string) {
	.Flags.Set(0)
	.Device = 
}

// GetDevice returns value of Device conditional field and
// boolean which is true if field was set.
func ( *UpdateNewAuthorization) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Device, true
}

// SetLocation sets value of Location conditional field.
func ( *UpdateNewAuthorization) ( string) {
	.Flags.Set(0)
	.Location = 
}

// GetLocation returns value of Location conditional field and
// boolean which is true if field was set.
func ( *UpdateNewAuthorization) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Location, true
}

// UpdateNewEncryptedMessage represents TL type `updateNewEncryptedMessage#12bcbd9a`.
// New encrypted message.
//
// See https://core.telegram.org/constructor/updateNewEncryptedMessage for reference.
type UpdateNewEncryptedMessage struct {
	// Message
	Message EncryptedMessageClass
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateNewEncryptedMessageTypeID is TL type id of UpdateNewEncryptedMessage.
const UpdateNewEncryptedMessageTypeID = 0x12bcbd9a

// construct implements constructor of UpdateClass.
func ( UpdateNewEncryptedMessage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateNewEncryptedMessage{}
)

func ( *UpdateNewEncryptedMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Message == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateNewEncryptedMessage from given interface.
func ( *UpdateNewEncryptedMessage) ( interface {
	() ( EncryptedMessageClass)
	() ( int)
}) {
	.Message = .()
	.Qts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateNewEncryptedMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewEncryptedMessage",
		ID:   UpdateNewEncryptedMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateNewEncryptedMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewEncryptedMessage#12bcbd9a as nil")
	}
	.PutID(UpdateNewEncryptedMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewEncryptedMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewEncryptedMessage#12bcbd9a as nil")
	}
	if .Message == nil {
		return fmt.Errorf("unable to encode updateNewEncryptedMessage#12bcbd9a: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewEncryptedMessage#12bcbd9a: field message: %w", )
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewEncryptedMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewEncryptedMessage#12bcbd9a to nil")
	}
	{
		,  := DecodeEncryptedMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewEncryptedMessage#12bcbd9a: field message: %w", )
		}
		.Message = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewEncryptedMessage#12bcbd9a: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

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

// GetQts returns value of Qts field.
func ( *UpdateNewEncryptedMessage) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateEncryptedChatTyping represents TL type `updateEncryptedChatTyping#1710f156`.
// Interlocutor is typing a message in an encrypted chat. Update period is 6 second. If
// upon this time there is no repeated update, it shall be considered that the
// interlocutor stopped typing.
//
// See https://core.telegram.org/constructor/updateEncryptedChatTyping for reference.
type UpdateEncryptedChatTyping struct {
	// Chat ID
	ChatID int
}

// UpdateEncryptedChatTypingTypeID is TL type id of UpdateEncryptedChatTyping.
const UpdateEncryptedChatTypingTypeID = 0x1710f156

// construct implements constructor of UpdateClass.
func ( UpdateEncryptedChatTyping) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateEncryptedChatTyping{}
)

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

	return true
}

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

// FillFrom fills UpdateEncryptedChatTyping from given interface.
func ( *UpdateEncryptedChatTyping) ( interface {
	() ( int)
}) {
	.ChatID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateEncryptedChatTyping) () tdp.Type {
	 := tdp.Type{
		Name: "updateEncryptedChatTyping",
		ID:   UpdateEncryptedChatTypingTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateEncryptedChatTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEncryptedChatTyping#1710f156 as nil")
	}
	.PutID(UpdateEncryptedChatTypingTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateEncryptedChatTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEncryptedChatTyping#1710f156 as nil")
	}
	.PutInt(.ChatID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateEncryptedChatTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateEncryptedChatTyping#1710f156 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEncryptedChatTyping#1710f156: field chat_id: %w", )
		}
		.ChatID = 
	}
	return nil
}

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

// UpdateEncryption represents TL type `updateEncryption#b4a2e88d`.
// Change of state in an encrypted chat.
//
// See https://core.telegram.org/constructor/updateEncryption for reference.
type UpdateEncryption struct {
	// Encrypted chat
	Chat EncryptedChatClass
	// Date of change
	Date int
}

// UpdateEncryptionTypeID is TL type id of UpdateEncryption.
const UpdateEncryptionTypeID = 0xb4a2e88d

// construct implements constructor of UpdateClass.
func ( UpdateEncryption) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateEncryption{}
)

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

	return true
}

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

// FillFrom fills UpdateEncryption from given interface.
func ( *UpdateEncryption) ( interface {
	() ( EncryptedChatClass)
	() ( int)
}) {
	.Chat = .()
	.Date = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateEncryption) () tdp.Type {
	 := tdp.Type{
		Name: "updateEncryption",
		ID:   UpdateEncryptionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Chat",
			SchemaName: "chat",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateEncryption) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEncryption#b4a2e88d as nil")
	}
	.PutID(UpdateEncryptionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateEncryption) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEncryption#b4a2e88d as nil")
	}
	if .Chat == nil {
		return fmt.Errorf("unable to encode updateEncryption#b4a2e88d: field chat is nil")
	}
	if  := .Chat.Encode();  != nil {
		return fmt.Errorf("unable to encode updateEncryption#b4a2e88d: field chat: %w", )
	}
	.PutInt(.Date)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateEncryption) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateEncryption#b4a2e88d to nil")
	}
	{
		,  := DecodeEncryptedChat()
		if  != nil {
			return fmt.Errorf("unable to decode updateEncryption#b4a2e88d: field chat: %w", )
		}
		.Chat = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEncryption#b4a2e88d: field date: %w", )
		}
		.Date = 
	}
	return nil
}

// GetChat returns value of Chat field.
func ( *UpdateEncryption) () ( EncryptedChatClass) {
	if  == nil {
		return
	}
	return .Chat
}

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

// UpdateEncryptedMessagesRead represents TL type `updateEncryptedMessagesRead#38fe25b7`.
// Communication history in an encrypted chat was marked as read.
//
// See https://core.telegram.org/constructor/updateEncryptedMessagesRead for reference.
type UpdateEncryptedMessagesRead struct {
	// Chat ID
	ChatID int
	// Maximum value of data for read messages
	MaxDate int
	// Time when messages were read
	Date int
}

// UpdateEncryptedMessagesReadTypeID is TL type id of UpdateEncryptedMessagesRead.
const UpdateEncryptedMessagesReadTypeID = 0x38fe25b7

// construct implements constructor of UpdateClass.
func ( UpdateEncryptedMessagesRead) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateEncryptedMessagesRead{}
)

func ( *UpdateEncryptedMessagesRead) () bool {
	if  == nil {
		return true
	}
	if !(.ChatID == 0) {
		return false
	}
	if !(.MaxDate == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateEncryptedMessagesRead from given interface.
func ( *UpdateEncryptedMessagesRead) ( interface {
	() ( int)
	() ( int)
	() ( int)
}) {
	.ChatID = .()
	.MaxDate = .()
	.Date = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateEncryptedMessagesRead) () tdp.Type {
	 := tdp.Type{
		Name: "updateEncryptedMessagesRead",
		ID:   UpdateEncryptedMessagesReadTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "MaxDate",
			SchemaName: "max_date",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateEncryptedMessagesRead) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEncryptedMessagesRead#38fe25b7 as nil")
	}
	.PutID(UpdateEncryptedMessagesReadTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateEncryptedMessagesRead) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEncryptedMessagesRead#38fe25b7 as nil")
	}
	.PutInt(.ChatID)
	.PutInt(.MaxDate)
	.PutInt(.Date)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateEncryptedMessagesRead) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateEncryptedMessagesRead#38fe25b7 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEncryptedMessagesRead#38fe25b7: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEncryptedMessagesRead#38fe25b7: field max_date: %w", )
		}
		.MaxDate = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEncryptedMessagesRead#38fe25b7: field date: %w", )
		}
		.Date = 
	}
	return nil
}

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

// GetMaxDate returns value of MaxDate field.
func ( *UpdateEncryptedMessagesRead) () ( int) {
	if  == nil {
		return
	}
	return .MaxDate
}

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

// UpdateChatParticipantAdd represents TL type `updateChatParticipantAdd#3dda5451`.
// New group member.
//
// See https://core.telegram.org/constructor/updateChatParticipantAdd for reference.
type UpdateChatParticipantAdd struct {
	// Group ID
	ChatID int64
	// ID of the new member
	UserID int64
	// ID of the user, who added member to the group
	InviterID int64
	// When was the participant added
	Date int
	// Used similarly to pts values to deduplicate/update outdated chat information as
	// specified here »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/peers#basic-group-updates
	Version int
}

// UpdateChatParticipantAddTypeID is TL type id of UpdateChatParticipantAdd.
const UpdateChatParticipantAddTypeID = 0x3dda5451

// construct implements constructor of UpdateClass.
func ( UpdateChatParticipantAdd) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChatParticipantAdd{}
)

func ( *UpdateChatParticipantAdd) () bool {
	if  == nil {
		return true
	}
	if !(.ChatID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.InviterID == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Version == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChatParticipantAdd from given interface.
func ( *UpdateChatParticipantAdd) ( interface {
	() ( int64)
	() ( int64)
	() ( int64)
	() ( int)
	() ( int)
}) {
	.ChatID = .()
	.UserID = .()
	.InviterID = .()
	.Date = .()
	.Version = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChatParticipantAdd) () tdp.Type {
	 := tdp.Type{
		Name: "updateChatParticipantAdd",
		ID:   UpdateChatParticipantAddTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "InviterID",
			SchemaName: "inviter_id",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "Version",
			SchemaName: "version",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChatParticipantAdd) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipantAdd#3dda5451 as nil")
	}
	.PutID(UpdateChatParticipantAddTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChatParticipantAdd) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipantAdd#3dda5451 as nil")
	}
	.PutLong(.ChatID)
	.PutLong(.UserID)
	.PutLong(.InviterID)
	.PutInt(.Date)
	.PutInt(.Version)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChatParticipantAdd) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatParticipantAdd#3dda5451 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field inviter_id: %w", )
		}
		.InviterID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdd#3dda5451: field version: %w", )
		}
		.Version = 
	}
	return nil
}

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

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

// GetInviterID returns value of InviterID field.
func ( *UpdateChatParticipantAdd) () ( int64) {
	if  == nil {
		return
	}
	return .InviterID
}

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

// GetVersion returns value of Version field.
func ( *UpdateChatParticipantAdd) () ( int) {
	if  == nil {
		return
	}
	return .Version
}

// UpdateChatParticipantDelete represents TL type `updateChatParticipantDelete#e32f3d77`.
// A member has left the basic group¹.
//
// Links:
//  1. https://core.telegram.org/api/channel#basic-groups
//
// See https://core.telegram.org/constructor/updateChatParticipantDelete for reference.
type UpdateChatParticipantDelete struct {
	// Group ID
	ChatID int64
	// ID of the user
	UserID int64
	// Used similarly to pts values to deduplicate/update outdated chat information as
	// specified here »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/peers#basic-group-updates
	Version int
}

// UpdateChatParticipantDeleteTypeID is TL type id of UpdateChatParticipantDelete.
const UpdateChatParticipantDeleteTypeID = 0xe32f3d77

// construct implements constructor of UpdateClass.
func ( UpdateChatParticipantDelete) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChatParticipantDelete{}
)

func ( *UpdateChatParticipantDelete) () bool {
	if  == nil {
		return true
	}
	if !(.ChatID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Version == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChatParticipantDelete from given interface.
func ( *UpdateChatParticipantDelete) ( interface {
	() ( int64)
	() ( int64)
	() ( int)
}) {
	.ChatID = .()
	.UserID = .()
	.Version = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChatParticipantDelete) () tdp.Type {
	 := tdp.Type{
		Name: "updateChatParticipantDelete",
		ID:   UpdateChatParticipantDeleteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Version",
			SchemaName: "version",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChatParticipantDelete) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipantDelete#e32f3d77 as nil")
	}
	.PutID(UpdateChatParticipantDeleteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChatParticipantDelete) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipantDelete#e32f3d77 as nil")
	}
	.PutLong(.ChatID)
	.PutLong(.UserID)
	.PutInt(.Version)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChatParticipantDelete) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatParticipantDelete#e32f3d77 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantDelete#e32f3d77: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantDelete#e32f3d77: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantDelete#e32f3d77: field version: %w", )
		}
		.Version = 
	}
	return nil
}

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

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

// GetVersion returns value of Version field.
func ( *UpdateChatParticipantDelete) () ( int) {
	if  == nil {
		return
	}
	return .Version
}

// UpdateDCOptions represents TL type `updateDcOptions#8e5e9873`.
// Changes in the data center configuration options.
//
// See https://core.telegram.org/constructor/updateDcOptions for reference.
type UpdateDCOptions struct {
	// New connection options
	DCOptions []DCOption
}

// UpdateDCOptionsTypeID is TL type id of UpdateDCOptions.
const UpdateDCOptionsTypeID = 0x8e5e9873

// construct implements constructor of UpdateClass.
func ( UpdateDCOptions) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDCOptions{}
)

func ( *UpdateDCOptions) () bool {
	if  == nil {
		return true
	}
	if !(.DCOptions == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDCOptions from given interface.
func ( *UpdateDCOptions) ( interface {
	() ( []DCOption)
}) {
	.DCOptions = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDCOptions) () tdp.Type {
	 := tdp.Type{
		Name: "updateDcOptions",
		ID:   UpdateDCOptionsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "DCOptions",
			SchemaName: "dc_options",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateDCOptions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDcOptions#8e5e9873 as nil")
	}
	.PutID(UpdateDCOptionsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDCOptions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDcOptions#8e5e9873 as nil")
	}
	.PutVectorHeader(len(.DCOptions))
	for ,  := range .DCOptions {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateDcOptions#8e5e9873: field dc_options element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDCOptions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDcOptions#8e5e9873 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateDcOptions#8e5e9873: field dc_options: %w", )
		}

		if  > 0 {
			.DCOptions = make([]DCOption, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  DCOption
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode updateDcOptions#8e5e9873: field dc_options: %w", )
			}
			.DCOptions = append(.DCOptions, )
		}
	}
	return nil
}

// GetDCOptions returns value of DCOptions field.
func ( *UpdateDCOptions) () ( []DCOption) {
	if  == nil {
		return
	}
	return .DCOptions
}

// UpdateNotifySettings represents TL type `updateNotifySettings#bec268ef`.
// Changes in notification settings.
//
// See https://core.telegram.org/constructor/updateNotifySettings for reference.
type UpdateNotifySettings struct {
	// Notification source
	Peer NotifyPeerClass
	// New notification settings
	NotifySettings PeerNotifySettings
}

// UpdateNotifySettingsTypeID is TL type id of UpdateNotifySettings.
const UpdateNotifySettingsTypeID = 0xbec268ef

// construct implements constructor of UpdateClass.
func ( UpdateNotifySettings) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateNotifySettings{}
)

func ( *UpdateNotifySettings) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.NotifySettings.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateNotifySettings from given interface.
func ( *UpdateNotifySettings) ( interface {
	() ( NotifyPeerClass)
	() ( PeerNotifySettings)
}) {
	.Peer = .()
	.NotifySettings = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateNotifySettings) () tdp.Type {
	 := tdp.Type{
		Name: "updateNotifySettings",
		ID:   UpdateNotifySettingsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "NotifySettings",
			SchemaName: "notify_settings",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateNotifySettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNotifySettings#bec268ef as nil")
	}
	.PutID(UpdateNotifySettingsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNotifySettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNotifySettings#bec268ef as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateNotifySettings#bec268ef: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNotifySettings#bec268ef: field peer: %w", )
	}
	if  := .NotifySettings.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNotifySettings#bec268ef: field notify_settings: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNotifySettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNotifySettings#bec268ef to nil")
	}
	{
		,  := DecodeNotifyPeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateNotifySettings#bec268ef: field peer: %w", )
		}
		.Peer = 
	}
	{
		if  := .NotifySettings.Decode();  != nil {
			return fmt.Errorf("unable to decode updateNotifySettings#bec268ef: field notify_settings: %w", )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateNotifySettings) () ( NotifyPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetNotifySettings returns value of NotifySettings field.
func ( *UpdateNotifySettings) () ( PeerNotifySettings) {
	if  == nil {
		return
	}
	return .NotifySettings
}

// UpdateServiceNotification represents TL type `updateServiceNotification#ebe46819`.
// A service message for the user.
// The app must show the message to the user upon receiving this update. In case the
// popup parameter was passed, the text message must be displayed in a popup alert
// immediately upon receipt. It is recommended to handle the text as you would an
// ordinary message in terms of highlighting links, etc. The message must also be stored
// locally as part of the message history with the user id 777000 (Telegram
// Notifications).
//
// See https://core.telegram.org/constructor/updateServiceNotification for reference.
type UpdateServiceNotification struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, the message must be displayed in a popup.
	Popup bool
	// If set, any eventual webpage preview will be shown on top of the message instead of at
	// the bottom.
	InvertMedia bool
	// When was the notification receivedThe message must also be stored locally as part of
	// the message history with the user id 777000 (Telegram Notifications).
	//
	// Use SetInboxDate and GetInboxDate helpers.
	InboxDate int
	// String, identical in format and contents to the type¹ field in API errors. Describes
	// type of service message. It is acceptable to ignore repeated messages of the same type
	// within a short period of time (15 minutes).
	//
	// Links:
	//  1) https://core.telegram.org/api/errors#error-type
	Type string
	// Message text
	Message string
	// Media content (optional)
	Media MessageMediaClass
	// Message entities for styled text¹
	//
	// Links:
	//  1) https://core.telegram.org/api/entities
	Entities []MessageEntityClass
}

// UpdateServiceNotificationTypeID is TL type id of UpdateServiceNotification.
const UpdateServiceNotificationTypeID = 0xebe46819

// construct implements constructor of UpdateClass.
func ( UpdateServiceNotification) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateServiceNotification{}
)

func ( *UpdateServiceNotification) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Popup == false) {
		return false
	}
	if !(.InvertMedia == false) {
		return false
	}
	if !(.InboxDate == 0) {
		return false
	}
	if !(.Type == "") {
		return false
	}
	if !(.Message == "") {
		return false
	}
	if !(.Media == nil) {
		return false
	}
	if !(.Entities == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateServiceNotification from given interface.
func ( *UpdateServiceNotification) ( interface {
	() ( bool)
	() ( bool)
	() ( int,  bool)
	() ( string)
	() ( string)
	() ( MessageMediaClass)
	() ( []MessageEntityClass)
}) {
	.Popup = .()
	.InvertMedia = .()
	if ,  := .();  {
		.InboxDate = 
	}

	.Type = .()
	.Message = .()
	.Media = .()
	.Entities = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateServiceNotification) () tdp.Type {
	 := tdp.Type{
		Name: "updateServiceNotification",
		ID:   UpdateServiceNotificationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Popup",
			SchemaName: "popup",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "InvertMedia",
			SchemaName: "invert_media",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "InboxDate",
			SchemaName: "inbox_date",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Type",
			SchemaName: "type",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Media",
			SchemaName: "media",
		},
		{
			Name:       "Entities",
			SchemaName: "entities",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateServiceNotification) () {
	if !(.Popup == false) {
		.Flags.Set(0)
	}
	if !(.InvertMedia == false) {
		.Flags.Set(2)
	}
	if !(.InboxDate == 0) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateServiceNotification) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateServiceNotification#ebe46819 as nil")
	}
	.PutID(UpdateServiceNotificationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateServiceNotification) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateServiceNotification#ebe46819 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateServiceNotification#ebe46819: field flags: %w", )
	}
	if .Flags.Has(1) {
		.PutInt(.InboxDate)
	}
	.PutString(.Type)
	.PutString(.Message)
	if .Media == nil {
		return fmt.Errorf("unable to encode updateServiceNotification#ebe46819: field media is nil")
	}
	if  := .Media.Encode();  != nil {
		return fmt.Errorf("unable to encode updateServiceNotification#ebe46819: field media: %w", )
	}
	.PutVectorHeader(len(.Entities))
	for ,  := range .Entities {
		if  == nil {
			return fmt.Errorf("unable to encode updateServiceNotification#ebe46819: field entities element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateServiceNotification#ebe46819: field entities element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateServiceNotification) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateServiceNotification#ebe46819 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateServiceNotification#ebe46819: field flags: %w", )
		}
	}
	.Popup = .Flags.Has(0)
	.InvertMedia = .Flags.Has(2)
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateServiceNotification#ebe46819: field inbox_date: %w", )
		}
		.InboxDate = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateServiceNotification#ebe46819: field type: %w", )
		}
		.Type = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateServiceNotification#ebe46819: field message: %w", )
		}
		.Message = 
	}
	{
		,  := DecodeMessageMedia()
		if  != nil {
			return fmt.Errorf("unable to decode updateServiceNotification#ebe46819: field media: %w", )
		}
		.Media = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateServiceNotification#ebe46819: field entities: %w", )
		}

		if  > 0 {
			.Entities = make([]MessageEntityClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageEntity()
			if  != nil {
				return fmt.Errorf("unable to decode updateServiceNotification#ebe46819: field entities: %w", )
			}
			.Entities = append(.Entities, )
		}
	}
	return nil
}

// SetPopup sets value of Popup conditional field.
func ( *UpdateServiceNotification) ( bool) {
	if  {
		.Flags.Set(0)
		.Popup = true
	} else {
		.Flags.Unset(0)
		.Popup = false
	}
}

// GetPopup returns value of Popup conditional field.
func ( *UpdateServiceNotification) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetInvertMedia sets value of InvertMedia conditional field.
func ( *UpdateServiceNotification) ( bool) {
	if  {
		.Flags.Set(2)
		.InvertMedia = true
	} else {
		.Flags.Unset(2)
		.InvertMedia = false
	}
}

// GetInvertMedia returns value of InvertMedia conditional field.
func ( *UpdateServiceNotification) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetInboxDate sets value of InboxDate conditional field.
func ( *UpdateServiceNotification) ( int) {
	.Flags.Set(1)
	.InboxDate = 
}

// GetInboxDate returns value of InboxDate conditional field and
// boolean which is true if field was set.
func ( *UpdateServiceNotification) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .InboxDate, true
}

// GetType returns value of Type field.
func ( *UpdateServiceNotification) () ( string) {
	if  == nil {
		return
	}
	return .Type
}

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

// GetMedia returns value of Media field.
func ( *UpdateServiceNotification) () ( MessageMediaClass) {
	if  == nil {
		return
	}
	return .Media
}

// GetEntities returns value of Entities field.
func ( *UpdateServiceNotification) () ( []MessageEntityClass) {
	if  == nil {
		return
	}
	return .Entities
}

// MapEntities returns field Entities wrapped in MessageEntityClassArray helper.
func ( *UpdateServiceNotification) () ( MessageEntityClassArray) {
	return MessageEntityClassArray(.Entities)
}

// UpdatePrivacy represents TL type `updatePrivacy#ee3b272a`.
// Privacy rules were changed
//
// See https://core.telegram.org/constructor/updatePrivacy for reference.
type UpdatePrivacy struct {
	// Peers to which the privacy rules apply
	Key PrivacyKeyClass
	// New privacy rules
	Rules []PrivacyRuleClass
}

// UpdatePrivacyTypeID is TL type id of UpdatePrivacy.
const UpdatePrivacyTypeID = 0xee3b272a

// construct implements constructor of UpdateClass.
func ( UpdatePrivacy) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePrivacy{}
)

func ( *UpdatePrivacy) () bool {
	if  == nil {
		return true
	}
	if !(.Key == nil) {
		return false
	}
	if !(.Rules == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePrivacy from given interface.
func ( *UpdatePrivacy) ( interface {
	() ( PrivacyKeyClass)
	() ( []PrivacyRuleClass)
}) {
	.Key = .()
	.Rules = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePrivacy) () tdp.Type {
	 := tdp.Type{
		Name: "updatePrivacy",
		ID:   UpdatePrivacyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Key",
			SchemaName: "key",
		},
		{
			Name:       "Rules",
			SchemaName: "rules",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatePrivacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePrivacy#ee3b272a as nil")
	}
	.PutID(UpdatePrivacyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePrivacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePrivacy#ee3b272a as nil")
	}
	if .Key == nil {
		return fmt.Errorf("unable to encode updatePrivacy#ee3b272a: field key is nil")
	}
	if  := .Key.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePrivacy#ee3b272a: field key: %w", )
	}
	.PutVectorHeader(len(.Rules))
	for ,  := range .Rules {
		if  == nil {
			return fmt.Errorf("unable to encode updatePrivacy#ee3b272a: field rules element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updatePrivacy#ee3b272a: field rules element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePrivacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePrivacy#ee3b272a to nil")
	}
	{
		,  := DecodePrivacyKey()
		if  != nil {
			return fmt.Errorf("unable to decode updatePrivacy#ee3b272a: field key: %w", )
		}
		.Key = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatePrivacy#ee3b272a: field rules: %w", )
		}

		if  > 0 {
			.Rules = make([]PrivacyRuleClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePrivacyRule()
			if  != nil {
				return fmt.Errorf("unable to decode updatePrivacy#ee3b272a: field rules: %w", )
			}
			.Rules = append(.Rules, )
		}
	}
	return nil
}

// GetKey returns value of Key field.
func ( *UpdatePrivacy) () ( PrivacyKeyClass) {
	if  == nil {
		return
	}
	return .Key
}

// GetRules returns value of Rules field.
func ( *UpdatePrivacy) () ( []PrivacyRuleClass) {
	if  == nil {
		return
	}
	return .Rules
}

// MapRules returns field Rules wrapped in PrivacyRuleClassArray helper.
func ( *UpdatePrivacy) () ( PrivacyRuleClassArray) {
	return PrivacyRuleClassArray(.Rules)
}

// UpdateUserPhone represents TL type `updateUserPhone#5492a13`.
// A user's phone number was changed
//
// See https://core.telegram.org/constructor/updateUserPhone for reference.
type UpdateUserPhone struct {
	// User ID
	UserID int64
	// New phone number
	Phone string
}

// UpdateUserPhoneTypeID is TL type id of UpdateUserPhone.
const UpdateUserPhoneTypeID = 0x5492a13

// construct implements constructor of UpdateClass.
func ( UpdateUserPhone) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateUserPhone{}
)

func ( *UpdateUserPhone) () bool {
	if  == nil {
		return true
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Phone == "") {
		return false
	}

	return true
}

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

// FillFrom fills UpdateUserPhone from given interface.
func ( *UpdateUserPhone) ( interface {
	() ( int64)
	() ( string)
}) {
	.UserID = .()
	.Phone = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateUserPhone) () tdp.Type {
	 := tdp.Type{
		Name: "updateUserPhone",
		ID:   UpdateUserPhoneTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Phone",
			SchemaName: "phone",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateUserPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserPhone#5492a13 as nil")
	}
	.PutID(UpdateUserPhoneTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateUserPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserPhone#5492a13 as nil")
	}
	.PutLong(.UserID)
	.PutString(.Phone)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateUserPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateUserPhone#5492a13 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserPhone#5492a13: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserPhone#5492a13: field phone: %w", )
		}
		.Phone = 
	}
	return nil
}

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

// GetPhone returns value of Phone field.
func ( *UpdateUserPhone) () ( string) {
	if  == nil {
		return
	}
	return .Phone
}

// UpdateReadHistoryInbox represents TL type `updateReadHistoryInbox#9e84bc99`.
// Incoming messages were read
//
// See https://core.telegram.org/constructor/updateReadHistoryInbox for reference.
type UpdateReadHistoryInbox struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Peer folder ID, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/folders#peer-folders
	//
	// Use SetFolderID and GetFolderID helpers.
	FolderID int
	// Peer
	Peer PeerClass
	// If set, the messages were read only within the specified bot forum topic »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/forum#bot-forums
	//
	// Use SetTopMsgID and GetTopMsgID helpers.
	TopMsgID int
	// Maximum ID of messages read
	MaxID int
	// Number of messages that are still unread
	StillUnreadCount int
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateReadHistoryInboxTypeID is TL type id of UpdateReadHistoryInbox.
const UpdateReadHistoryInboxTypeID = 0x9e84bc99

// construct implements constructor of UpdateClass.
func ( UpdateReadHistoryInbox) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadHistoryInbox{}
)

func ( *UpdateReadHistoryInbox) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.FolderID == 0) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.MaxID == 0) {
		return false
	}
	if !(.StillUnreadCount == 0) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateReadHistoryInbox from given interface.
func ( *UpdateReadHistoryInbox) ( interface {
	() ( int,  bool)
	() ( PeerClass)
	() ( int,  bool)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
}) {
	if ,  := .();  {
		.FolderID = 
	}

	.Peer = .()
	if ,  := .();  {
		.TopMsgID = 
	}

	.MaxID = .()
	.StillUnreadCount = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateReadHistoryInbox) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadHistoryInbox",
		ID:   UpdateReadHistoryInboxTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "FolderID",
			SchemaName: "folder_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "MaxID",
			SchemaName: "max_id",
		},
		{
			Name:       "StillUnreadCount",
			SchemaName: "still_unread_count",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateReadHistoryInbox) () {
	if !(.FolderID == 0) {
		.Flags.Set(0)
	}
	if !(.TopMsgID == 0) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateReadHistoryInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadHistoryInbox#9e84bc99 as nil")
	}
	.PutID(UpdateReadHistoryInboxTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadHistoryInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadHistoryInbox#9e84bc99 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadHistoryInbox#9e84bc99: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutInt(.FolderID)
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateReadHistoryInbox#9e84bc99: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadHistoryInbox#9e84bc99: field peer: %w", )
	}
	if .Flags.Has(1) {
		.PutInt(.TopMsgID)
	}
	.PutInt(.MaxID)
	.PutInt(.StillUnreadCount)
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadHistoryInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadHistoryInbox#9e84bc99 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9e84bc99: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9e84bc99: field folder_id: %w", )
		}
		.FolderID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9e84bc99: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9e84bc99: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9e84bc99: field max_id: %w", )
		}
		.MaxID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9e84bc99: field still_unread_count: %w", )
		}
		.StillUnreadCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9e84bc99: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9e84bc99: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// SetFolderID sets value of FolderID conditional field.
func ( *UpdateReadHistoryInbox) ( int) {
	.Flags.Set(0)
	.FolderID = 
}

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

// GetPeer returns value of Peer field.
func ( *UpdateReadHistoryInbox) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// SetTopMsgID sets value of TopMsgID conditional field.
func ( *UpdateReadHistoryInbox) ( int) {
	.Flags.Set(1)
	.TopMsgID = 
}

// GetTopMsgID returns value of TopMsgID conditional field and
// boolean which is true if field was set.
func ( *UpdateReadHistoryInbox) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .TopMsgID, true
}

// GetMaxID returns value of MaxID field.
func ( *UpdateReadHistoryInbox) () ( int) {
	if  == nil {
		return
	}
	return .MaxID
}

// GetStillUnreadCount returns value of StillUnreadCount field.
func ( *UpdateReadHistoryInbox) () ( int) {
	if  == nil {
		return
	}
	return .StillUnreadCount
}

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

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

// UpdateReadHistoryOutbox represents TL type `updateReadHistoryOutbox#2f2f21bf`.
// Outgoing messages were read
//
// See https://core.telegram.org/constructor/updateReadHistoryOutbox for reference.
type UpdateReadHistoryOutbox struct {
	// Peer
	Peer PeerClass
	// Maximum ID of read outgoing messages
	MaxID int
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateReadHistoryOutboxTypeID is TL type id of UpdateReadHistoryOutbox.
const UpdateReadHistoryOutboxTypeID = 0x2f2f21bf

// construct implements constructor of UpdateClass.
func ( UpdateReadHistoryOutbox) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadHistoryOutbox{}
)

func ( *UpdateReadHistoryOutbox) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MaxID == 0) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateReadHistoryOutbox from given interface.
func ( *UpdateReadHistoryOutbox) ( interface {
	() ( PeerClass)
	() ( int)
	() ( int)
	() ( int)
}) {
	.Peer = .()
	.MaxID = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateReadHistoryOutbox) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadHistoryOutbox",
		ID:   UpdateReadHistoryOutboxTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MaxID",
			SchemaName: "max_id",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateReadHistoryOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadHistoryOutbox#2f2f21bf as nil")
	}
	.PutID(UpdateReadHistoryOutboxTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadHistoryOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadHistoryOutbox#2f2f21bf as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateReadHistoryOutbox#2f2f21bf: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadHistoryOutbox#2f2f21bf: field peer: %w", )
	}
	.PutInt(.MaxID)
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadHistoryOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadHistoryOutbox#2f2f21bf to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryOutbox#2f2f21bf: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryOutbox#2f2f21bf: field max_id: %w", )
		}
		.MaxID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryOutbox#2f2f21bf: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryOutbox#2f2f21bf: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateReadHistoryOutbox) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMaxID returns value of MaxID field.
func ( *UpdateReadHistoryOutbox) () ( int) {
	if  == nil {
		return
	}
	return .MaxID
}

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

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

// UpdateWebPage represents TL type `updateWebPage#7f891213`.
// An instant view¹ webpage preview was generated
//
// Links:
//  1. https://instantview.telegram.org
//
// See https://core.telegram.org/constructor/updateWebPage for reference.
type UpdateWebPage struct {
	// Webpage preview
	Webpage WebPageClass
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateWebPageTypeID is TL type id of UpdateWebPage.
const UpdateWebPageTypeID = 0x7f891213

// construct implements constructor of UpdateClass.
func ( UpdateWebPage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateWebPage{}
)

func ( *UpdateWebPage) () bool {
	if  == nil {
		return true
	}
	if !(.Webpage == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateWebPage from given interface.
func ( *UpdateWebPage) ( interface {
	() ( WebPageClass)
	() ( int)
	() ( int)
}) {
	.Webpage = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateWebPage) () tdp.Type {
	 := tdp.Type{
		Name: "updateWebPage",
		ID:   UpdateWebPageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Webpage",
			SchemaName: "webpage",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateWebPage#7f891213 as nil")
	}
	.PutID(UpdateWebPageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateWebPage#7f891213 as nil")
	}
	if .Webpage == nil {
		return fmt.Errorf("unable to encode updateWebPage#7f891213: field webpage is nil")
	}
	if  := .Webpage.Encode();  != nil {
		return fmt.Errorf("unable to encode updateWebPage#7f891213: field webpage: %w", )
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateWebPage#7f891213 to nil")
	}
	{
		,  := DecodeWebPage()
		if  != nil {
			return fmt.Errorf("unable to decode updateWebPage#7f891213: field webpage: %w", )
		}
		.Webpage = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateWebPage#7f891213: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateWebPage#7f891213: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// GetWebpage returns value of Webpage field.
func ( *UpdateWebPage) () ( WebPageClass) {
	if  == nil {
		return
	}
	return .Webpage
}

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

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

// UpdateReadMessagesContents represents TL type `updateReadMessagesContents#f8227181`.
// Contents of messages in the common message box¹ were read (emitted specifically for
// messages like voice messages or video, only once the media is watched and marked as
// read using messages.readMessageContents²).
//
// Links:
//  1. https://core.telegram.org/api/updates
//  2. https://core.telegram.org/method/messages.readMessageContents
//
// See https://core.telegram.org/constructor/updateReadMessagesContents for reference.
type UpdateReadMessagesContents struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// IDs of read messages
	Messages []int
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
	// When was the last message in messages marked as read.
	//
	// Use SetDate and GetDate helpers.
	Date int
}

// UpdateReadMessagesContentsTypeID is TL type id of UpdateReadMessagesContents.
const UpdateReadMessagesContentsTypeID = 0xf8227181

// construct implements constructor of UpdateClass.
func ( UpdateReadMessagesContents) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadMessagesContents{}
)

func ( *UpdateReadMessagesContents) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateReadMessagesContents from given interface.
func ( *UpdateReadMessagesContents) ( interface {
	() ( []int)
	() ( int)
	() ( int)
	() ( int,  bool)
}) {
	.Messages = .()
	.Pts = .()
	.PtsCount = .()
	if ,  := .();  {
		.Date = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateReadMessagesContents) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadMessagesContents",
		ID:   UpdateReadMessagesContentsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
		{
			Name:       "Date",
			SchemaName: "date",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadMessagesContents#f8227181 as nil")
	}
	.PutID(UpdateReadMessagesContentsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadMessagesContents#f8227181 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadMessagesContents#f8227181: field flags: %w", )
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	if .Flags.Has(0) {
		.PutInt(.Date)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadMessagesContents#f8227181 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateReadMessagesContents#f8227181: field flags: %w", )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMessagesContents#f8227181: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateReadMessagesContents#f8227181: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMessagesContents#f8227181: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMessagesContents#f8227181: field pts_count: %w", )
		}
		.PtsCount = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMessagesContents#f8227181: field date: %w", )
		}
		.Date = 
	}
	return nil
}

// GetMessages returns value of Messages field.
func ( *UpdateReadMessagesContents) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

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

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

// SetDate sets value of Date conditional field.
func ( *UpdateReadMessagesContents) ( int) {
	.Flags.Set(0)
	.Date = 
}

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

// UpdateChannelTooLong represents TL type `updateChannelTooLong#108d941f`.
// There are new updates in the specified channel, the client must fetch them manually by
// invoking updates.getChannelDifference¹ as specified in the documentation »².
// If the channel's PTS isn't currently stored in the database (i.e. we joined this
// channel on another client while the current client was offline), start fetching from
// the specified pts.
// Does not necessarily indicate the channel message box size limit was reached¹, it
// simply indicates that the number of queued updates in a message box is too large to be
// delivered passively through the socket.
//
// Links:
//  1. https://core.telegram.org/method/updates.getChannelDifference
//  2. https://core.telegram.org/api/updates
//  3. https://core.telegram.org/api/updates#recovering-gaps-for-very-old-messages
//
// See https://core.telegram.org/constructor/updateChannelTooLong for reference.
type UpdateChannelTooLong struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// The channel
	ChannelID int64
	// The PTS¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	//
	// Use SetPts and GetPts helpers.
	Pts int
}

// UpdateChannelTooLongTypeID is TL type id of UpdateChannelTooLong.
const UpdateChannelTooLongTypeID = 0x108d941f

// construct implements constructor of UpdateClass.
func ( UpdateChannelTooLong) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelTooLong{}
)

func ( *UpdateChannelTooLong) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelTooLong from given interface.
func ( *UpdateChannelTooLong) ( interface {
	() ( int64)
	() ( int,  bool)
}) {
	.ChannelID = .()
	if ,  := .();  {
		.Pts = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelTooLong) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelTooLong",
		ID:   UpdateChannelTooLongTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateChannelTooLong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelTooLong#108d941f as nil")
	}
	.PutID(UpdateChannelTooLongTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelTooLong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelTooLong#108d941f to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChannelTooLong#108d941f: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelTooLong#108d941f: field channel_id: %w", )
		}
		.ChannelID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelTooLong#108d941f: field pts: %w", )
		}
		.Pts = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelTooLong) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// SetPts sets value of Pts conditional field.
func ( *UpdateChannelTooLong) ( int) {
	.Flags.Set(0)
	.Pts = 
}

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

// UpdateChannel represents TL type `updateChannel#635b4c09`.
// Channel/supergroup (channel¹ and/or channelFull²) information was updated.
// This update can only be received through getDifference or in
// updates¹/updatesCombined² constructors, so it will always come bundled with the
// updated channel³, that should be applied as usual »⁴, without re-fetching the info
// manually.
// However, full peer information will not come bundled in updates, so the full peer
// cache (channelFull¹) must be invalidated for channel_id when receiving this update.
//
// Links:
//  1. https://core.telegram.org/constructor/channel
//  2. https://core.telegram.org/constructor/channelFull
//  3. https://core.telegram.org/constructor/updates
//  4. https://core.telegram.org/constructor/updatesCombined
//  5. https://core.telegram.org/constructor/channel
//  6. https://core.telegram.org/api/peers
//  7. https://core.telegram.org/constructor/channelFull
//
// See https://core.telegram.org/constructor/updateChannel for reference.
type UpdateChannel struct {
	// Channel ID
	ChannelID int64
}

// UpdateChannelTypeID is TL type id of UpdateChannel.
const UpdateChannelTypeID = 0x635b4c09

// construct implements constructor of UpdateClass.
func ( UpdateChannel) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannel{}
)

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

	return true
}

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

// FillFrom fills UpdateChannel from given interface.
func ( *UpdateChannel) ( interface {
	() ( int64)
}) {
	.ChannelID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannel) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannel",
		ID:   UpdateChannelTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChannel) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannel#635b4c09 as nil")
	}
	.PutID(UpdateChannelTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannel) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannel#635b4c09 as nil")
	}
	.PutLong(.ChannelID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannel) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannel#635b4c09 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannel#635b4c09: field channel_id: %w", )
		}
		.ChannelID = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannel) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// UpdateNewChannelMessage represents TL type `updateNewChannelMessage#62ba04d9`.
// A new message was sent in a channel/supergroup¹
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateNewChannelMessage for reference.
type UpdateNewChannelMessage struct {
	// New message
	Message MessageClass
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateNewChannelMessageTypeID is TL type id of UpdateNewChannelMessage.
const UpdateNewChannelMessageTypeID = 0x62ba04d9

// construct implements constructor of UpdateClass.
func ( UpdateNewChannelMessage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateNewChannelMessage{}
)

func ( *UpdateNewChannelMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Message == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateNewChannelMessage from given interface.
func ( *UpdateNewChannelMessage) ( interface {
	() ( MessageClass)
	() ( int)
	() ( int)
}) {
	.Message = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateNewChannelMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewChannelMessage",
		ID:   UpdateNewChannelMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateNewChannelMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewChannelMessage#62ba04d9 as nil")
	}
	.PutID(UpdateNewChannelMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewChannelMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewChannelMessage#62ba04d9 as nil")
	}
	if .Message == nil {
		return fmt.Errorf("unable to encode updateNewChannelMessage#62ba04d9: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewChannelMessage#62ba04d9: field message: %w", )
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewChannelMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewChannelMessage#62ba04d9 to nil")
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewChannelMessage#62ba04d9: field message: %w", )
		}
		.Message = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewChannelMessage#62ba04d9: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewChannelMessage#62ba04d9: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

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

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

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

// UpdateReadChannelInbox represents TL type `updateReadChannelInbox#922e6e10`.
// Incoming messages in a channel/supergroup¹ were read
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateReadChannelInbox for reference.
type UpdateReadChannelInbox struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Peer folder ID, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/folders#peer-folders
	//
	// Use SetFolderID and GetFolderID helpers.
	FolderID int
	// Channel/supergroup ID
	ChannelID int64
	// Position up to which all incoming messages are read.
	MaxID int
	// Count of messages weren't read yet
	StillUnreadCount int
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
}

// UpdateReadChannelInboxTypeID is TL type id of UpdateReadChannelInbox.
const UpdateReadChannelInboxTypeID = 0x922e6e10

// construct implements constructor of UpdateClass.
func ( UpdateReadChannelInbox) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadChannelInbox{}
)

func ( *UpdateReadChannelInbox) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.FolderID == 0) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.MaxID == 0) {
		return false
	}
	if !(.StillUnreadCount == 0) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}

	return true
}

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

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

	.ChannelID = .()
	.MaxID = .()
	.StillUnreadCount = .()
	.Pts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateReadChannelInbox) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadChannelInbox",
		ID:   UpdateReadChannelInboxTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "FolderID",
			SchemaName: "folder_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "MaxID",
			SchemaName: "max_id",
		},
		{
			Name:       "StillUnreadCount",
			SchemaName: "still_unread_count",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateReadChannelInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadChannelInbox#922e6e10 as nil")
	}
	.PutID(UpdateReadChannelInboxTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadChannelInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadChannelInbox#922e6e10 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadChannelInbox#922e6e10: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutInt(.FolderID)
	}
	.PutLong(.ChannelID)
	.PutInt(.MaxID)
	.PutInt(.StillUnreadCount)
	.PutInt(.Pts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadChannelInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadChannelInbox#922e6e10 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field folder_id: %w", )
		}
		.FolderID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field max_id: %w", )
		}
		.MaxID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field still_unread_count: %w", )
		}
		.StillUnreadCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelInbox#922e6e10: field pts: %w", )
		}
		.Pts = 
	}
	return nil
}

// SetFolderID sets value of FolderID conditional field.
func ( *UpdateReadChannelInbox) ( int) {
	.Flags.Set(0)
	.FolderID = 
}

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

// GetChannelID returns value of ChannelID field.
func ( *UpdateReadChannelInbox) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetMaxID returns value of MaxID field.
func ( *UpdateReadChannelInbox) () ( int) {
	if  == nil {
		return
	}
	return .MaxID
}

// GetStillUnreadCount returns value of StillUnreadCount field.
func ( *UpdateReadChannelInbox) () ( int) {
	if  == nil {
		return
	}
	return .StillUnreadCount
}

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

// UpdateDeleteChannelMessages represents TL type `updateDeleteChannelMessages#c32d5b12`.
// Some messages in a supergroup/channel¹ were deleted
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateDeleteChannelMessages for reference.
type UpdateDeleteChannelMessages struct {
	// Channel ID
	ChannelID int64
	// IDs of messages that were deleted
	Messages []int
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateDeleteChannelMessagesTypeID is TL type id of UpdateDeleteChannelMessages.
const UpdateDeleteChannelMessagesTypeID = 0xc32d5b12

// construct implements constructor of UpdateClass.
func ( UpdateDeleteChannelMessages) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDeleteChannelMessages{}
)

func ( *UpdateDeleteChannelMessages) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDeleteChannelMessages from given interface.
func ( *UpdateDeleteChannelMessages) ( interface {
	() ( int64)
	() ( []int)
	() ( int)
	() ( int)
}) {
	.ChannelID = .()
	.Messages = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDeleteChannelMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updateDeleteChannelMessages",
		ID:   UpdateDeleteChannelMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateDeleteChannelMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteChannelMessages#c32d5b12 as nil")
	}
	.PutID(UpdateDeleteChannelMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDeleteChannelMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteChannelMessages#c32d5b12 as nil")
	}
	.PutLong(.ChannelID)
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDeleteChannelMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteChannelMessages#c32d5b12 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteChannelMessages#c32d5b12: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateDeleteChannelMessages) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetMessages returns value of Messages field.
func ( *UpdateDeleteChannelMessages) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

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

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

// UpdateChannelMessageViews represents TL type `updateChannelMessageViews#f226ac08`.
// The view counter of a message in a channel has changed
//
// See https://core.telegram.org/constructor/updateChannelMessageViews for reference.
type UpdateChannelMessageViews struct {
	// Channel ID
	ChannelID int64
	// ID of the message
	ID int
	// New view counter
	Views int
}

// UpdateChannelMessageViewsTypeID is TL type id of UpdateChannelMessageViews.
const UpdateChannelMessageViewsTypeID = 0xf226ac08

// construct implements constructor of UpdateClass.
func ( UpdateChannelMessageViews) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelMessageViews{}
)

func ( *UpdateChannelMessageViews) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.Views == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelMessageViews from given interface.
func ( *UpdateChannelMessageViews) ( interface {
	() ( int64)
	() ( int)
	() ( int)
}) {
	.ChannelID = .()
	.ID = .()
	.Views = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelMessageViews) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelMessageViews",
		ID:   UpdateChannelMessageViewsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "Views",
			SchemaName: "views",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChannelMessageViews) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelMessageViews#f226ac08 as nil")
	}
	.PutID(UpdateChannelMessageViewsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelMessageViews) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelMessageViews#f226ac08 as nil")
	}
	.PutLong(.ChannelID)
	.PutInt(.ID)
	.PutInt(.Views)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelMessageViews) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelMessageViews#f226ac08 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelMessageViews#f226ac08: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelMessageViews#f226ac08: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelMessageViews#f226ac08: field views: %w", )
		}
		.Views = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelMessageViews) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

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

// GetViews returns value of Views field.
func ( *UpdateChannelMessageViews) () ( int) {
	if  == nil {
		return
	}
	return .Views
}

// UpdateChatParticipantAdmin represents TL type `updateChatParticipantAdmin#d7ca61a2`.
// Admin permissions of a user in a basic group¹ were changed
//
// Links:
//  1. https://core.telegram.org/api/channel#basic-groups
//
// See https://core.telegram.org/constructor/updateChatParticipantAdmin for reference.
type UpdateChatParticipantAdmin struct {
	// Chat ID
	ChatID int64
	// ID of the (de)admined user
	UserID int64
	// Whether the user was rendered admin
	IsAdmin bool
	// Used similarly to pts values to deduplicate/update outdated chat information as
	// specified here »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/peers#basic-group-updates
	Version int
}

// UpdateChatParticipantAdminTypeID is TL type id of UpdateChatParticipantAdmin.
const UpdateChatParticipantAdminTypeID = 0xd7ca61a2

// construct implements constructor of UpdateClass.
func ( UpdateChatParticipantAdmin) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChatParticipantAdmin{}
)

func ( *UpdateChatParticipantAdmin) () bool {
	if  == nil {
		return true
	}
	if !(.ChatID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.IsAdmin == false) {
		return false
	}
	if !(.Version == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChatParticipantAdmin from given interface.
func ( *UpdateChatParticipantAdmin) ( interface {
	() ( int64)
	() ( int64)
	() ( bool)
	() ( int)
}) {
	.ChatID = .()
	.UserID = .()
	.IsAdmin = .()
	.Version = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChatParticipantAdmin) () tdp.Type {
	 := tdp.Type{
		Name: "updateChatParticipantAdmin",
		ID:   UpdateChatParticipantAdminTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "IsAdmin",
			SchemaName: "is_admin",
		},
		{
			Name:       "Version",
			SchemaName: "version",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChatParticipantAdmin) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipantAdmin#d7ca61a2 as nil")
	}
	.PutID(UpdateChatParticipantAdminTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChatParticipantAdmin) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipantAdmin#d7ca61a2 as nil")
	}
	.PutLong(.ChatID)
	.PutLong(.UserID)
	.PutBool(.IsAdmin)
	.PutInt(.Version)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChatParticipantAdmin) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatParticipantAdmin#d7ca61a2 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: field is_admin: %w", )
		}
		.IsAdmin = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantAdmin#d7ca61a2: field version: %w", )
		}
		.Version = 
	}
	return nil
}

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

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

// GetIsAdmin returns value of IsAdmin field.
func ( *UpdateChatParticipantAdmin) () ( bool) {
	if  == nil {
		return
	}
	return .IsAdmin
}

// GetVersion returns value of Version field.
func ( *UpdateChatParticipantAdmin) () ( int) {
	if  == nil {
		return
	}
	return .Version
}

// UpdateNewStickerSet represents TL type `updateNewStickerSet#688a30aa`.
// A new stickerset was installed
//
// See https://core.telegram.org/constructor/updateNewStickerSet for reference.
type UpdateNewStickerSet struct {
	// The installed stickerset
	Stickerset MessagesStickerSetClass
}

// UpdateNewStickerSetTypeID is TL type id of UpdateNewStickerSet.
const UpdateNewStickerSetTypeID = 0x688a30aa

// construct implements constructor of UpdateClass.
func ( UpdateNewStickerSet) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateNewStickerSet{}
)

func ( *UpdateNewStickerSet) () bool {
	if  == nil {
		return true
	}
	if !(.Stickerset == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateNewStickerSet from given interface.
func ( *UpdateNewStickerSet) ( interface {
	() ( MessagesStickerSetClass)
}) {
	.Stickerset = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateNewStickerSet) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewStickerSet",
		ID:   UpdateNewStickerSetTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Stickerset",
			SchemaName: "stickerset",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateNewStickerSet) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewStickerSet#688a30aa as nil")
	}
	.PutID(UpdateNewStickerSetTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewStickerSet) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewStickerSet#688a30aa as nil")
	}
	if .Stickerset == nil {
		return fmt.Errorf("unable to encode updateNewStickerSet#688a30aa: field stickerset is nil")
	}
	if  := .Stickerset.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewStickerSet#688a30aa: field stickerset: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewStickerSet) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewStickerSet#688a30aa to nil")
	}
	{
		,  := DecodeMessagesStickerSet()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewStickerSet#688a30aa: field stickerset: %w", )
		}
		.Stickerset = 
	}
	return nil
}

// GetStickerset returns value of Stickerset field.
func ( *UpdateNewStickerSet) () ( MessagesStickerSetClass) {
	if  == nil {
		return
	}
	return .Stickerset
}

// UpdateStickerSetsOrder represents TL type `updateStickerSetsOrder#bb2d201`.
// The order of stickersets was changed
//
// See https://core.telegram.org/constructor/updateStickerSetsOrder for reference.
type UpdateStickerSetsOrder struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the updated stickers are mask stickers
	Masks bool
	// Whether the updated stickers are custom emoji stickers
	Emojis bool
	// New sticker order by sticker ID
	Order []int64
}

// UpdateStickerSetsOrderTypeID is TL type id of UpdateStickerSetsOrder.
const UpdateStickerSetsOrderTypeID = 0xbb2d201

// construct implements constructor of UpdateClass.
func ( UpdateStickerSetsOrder) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateStickerSetsOrder{}
)

func ( *UpdateStickerSetsOrder) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Masks == false) {
		return false
	}
	if !(.Emojis == false) {
		return false
	}
	if !(.Order == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateStickerSetsOrder from given interface.
func ( *UpdateStickerSetsOrder) ( interface {
	() ( bool)
	() ( bool)
	() ( []int64)
}) {
	.Masks = .()
	.Emojis = .()
	.Order = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateStickerSetsOrder) () tdp.Type {
	 := tdp.Type{
		Name: "updateStickerSetsOrder",
		ID:   UpdateStickerSetsOrderTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Masks",
			SchemaName: "masks",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Emojis",
			SchemaName: "emojis",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Order",
			SchemaName: "order",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateStickerSetsOrder) () {
	if !(.Masks == false) {
		.Flags.Set(0)
	}
	if !(.Emojis == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateStickerSetsOrder) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStickerSetsOrder#bb2d201 as nil")
	}
	.PutID(UpdateStickerSetsOrderTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStickerSetsOrder) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStickerSetsOrder#bb2d201 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStickerSetsOrder#bb2d201: field flags: %w", )
	}
	.PutVectorHeader(len(.Order))
	for ,  := range .Order {
		.PutLong()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStickerSetsOrder) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStickerSetsOrder#bb2d201 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateStickerSetsOrder#bb2d201: field flags: %w", )
		}
	}
	.Masks = .Flags.Has(0)
	.Emojis = .Flags.Has(1)
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateStickerSetsOrder#bb2d201: field order: %w", )
		}

		if  > 0 {
			.Order = make([]int64, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Long()
			if  != nil {
				return fmt.Errorf("unable to decode updateStickerSetsOrder#bb2d201: field order: %w", )
			}
			.Order = append(.Order, )
		}
	}
	return nil
}

// SetMasks sets value of Masks conditional field.
func ( *UpdateStickerSetsOrder) ( bool) {
	if  {
		.Flags.Set(0)
		.Masks = true
	} else {
		.Flags.Unset(0)
		.Masks = false
	}
}

// GetMasks returns value of Masks conditional field.
func ( *UpdateStickerSetsOrder) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetEmojis sets value of Emojis conditional field.
func ( *UpdateStickerSetsOrder) ( bool) {
	if  {
		.Flags.Set(1)
		.Emojis = true
	} else {
		.Flags.Unset(1)
		.Emojis = false
	}
}

// GetEmojis returns value of Emojis conditional field.
func ( *UpdateStickerSetsOrder) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetOrder returns value of Order field.
func ( *UpdateStickerSetsOrder) () ( []int64) {
	if  == nil {
		return
	}
	return .Order
}

// UpdateStickerSets represents TL type `updateStickerSets#31c24808`.
// Installed stickersets have changed, the client should refetch them as described in the
// docs¹.
//
// Links:
//  1. https://core.telegram.org/api/stickers#installing-stickersets
//
// See https://core.telegram.org/constructor/updateStickerSets for reference.
type UpdateStickerSets struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether mask stickersets have changed
	Masks bool
	// Whether the list of installed custom emoji stickersets¹ has changed
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	Emojis bool
}

// UpdateStickerSetsTypeID is TL type id of UpdateStickerSets.
const UpdateStickerSetsTypeID = 0x31c24808

// construct implements constructor of UpdateClass.
func ( UpdateStickerSets) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateStickerSets{}
)

func ( *UpdateStickerSets) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Masks == false) {
		return false
	}
	if !(.Emojis == false) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateStickerSets from given interface.
func ( *UpdateStickerSets) ( interface {
	() ( bool)
	() ( bool)
}) {
	.Masks = .()
	.Emojis = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateStickerSets) () tdp.Type {
	 := tdp.Type{
		Name: "updateStickerSets",
		ID:   UpdateStickerSetsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Masks",
			SchemaName: "masks",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Emojis",
			SchemaName: "emojis",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateStickerSets) () {
	if !(.Masks == false) {
		.Flags.Set(0)
	}
	if !(.Emojis == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateStickerSets) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStickerSets#31c24808 as nil")
	}
	.PutID(UpdateStickerSetsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStickerSets) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStickerSets#31c24808 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStickerSets#31c24808: field flags: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStickerSets) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStickerSets#31c24808 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateStickerSets#31c24808: field flags: %w", )
		}
	}
	.Masks = .Flags.Has(0)
	.Emojis = .Flags.Has(1)
	return nil
}

// SetMasks sets value of Masks conditional field.
func ( *UpdateStickerSets) ( bool) {
	if  {
		.Flags.Set(0)
		.Masks = true
	} else {
		.Flags.Unset(0)
		.Masks = false
	}
}

// GetMasks returns value of Masks conditional field.
func ( *UpdateStickerSets) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetEmojis sets value of Emojis conditional field.
func ( *UpdateStickerSets) ( bool) {
	if  {
		.Flags.Set(1)
		.Emojis = true
	} else {
		.Flags.Unset(1)
		.Emojis = false
	}
}

// GetEmojis returns value of Emojis conditional field.
func ( *UpdateStickerSets) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// UpdateSavedGifs represents TL type `updateSavedGifs#9375341e`.
// The saved gif list has changed, the client should refetch it using messages
// getSavedGifs¹
//
// Links:
//  1. https://core.telegram.org/method/messages.getSavedGifs
//
// See https://core.telegram.org/constructor/updateSavedGifs for reference.
type UpdateSavedGifs struct {
}

// UpdateSavedGifsTypeID is TL type id of UpdateSavedGifs.
const UpdateSavedGifsTypeID = 0x9375341e

// construct implements constructor of UpdateClass.
func ( UpdateSavedGifs) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateSavedGifs{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateSavedGifs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSavedGifs#9375341e as nil")
	}
	.PutID(UpdateSavedGifsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateSavedGifs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSavedGifs#9375341e as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateSavedGifs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateSavedGifs#9375341e to nil")
	}
	return nil
}

// UpdateBotInlineQuery represents TL type `updateBotInlineQuery#496f379c`.
// An incoming inline query
//
// See https://core.telegram.org/constructor/updateBotInlineQuery for reference.
type UpdateBotInlineQuery struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Query ID
	QueryID int64
	// User that sent the query
	UserID int64
	// Text of query
	Query string
	// Attached geolocation
	//
	// Use SetGeo and GetGeo helpers.
	Geo GeoPointClass
	// Type of the chat from which the inline query was sent.
	//
	// Use SetPeerType and GetPeerType helpers.
	PeerType InlineQueryPeerTypeClass
	// Offset to navigate through results
	Offset string
}

// UpdateBotInlineQueryTypeID is TL type id of UpdateBotInlineQuery.
const UpdateBotInlineQueryTypeID = 0x496f379c

// construct implements constructor of UpdateClass.
func ( UpdateBotInlineQuery) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotInlineQuery{}
)

func ( *UpdateBotInlineQuery) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Query == "") {
		return false
	}
	if !(.Geo == nil) {
		return false
	}
	if !(.PeerType == nil) {
		return false
	}
	if !(.Offset == "") {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotInlineQuery from given interface.
func ( *UpdateBotInlineQuery) ( interface {
	() ( int64)
	() ( int64)
	() ( string)
	() ( GeoPointClass,  bool)
	() ( InlineQueryPeerTypeClass,  bool)
	() ( string)
}) {
	.QueryID = .()
	.UserID = .()
	.Query = .()
	if ,  := .();  {
		.Geo = 
	}

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

	.Offset = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotInlineQuery) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotInlineQuery",
		ID:   UpdateBotInlineQueryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Query",
			SchemaName: "query",
		},
		{
			Name:       "Geo",
			SchemaName: "geo",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "PeerType",
			SchemaName: "peer_type",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateBotInlineQuery) () {
	if !(.Geo == nil) {
		.Flags.Set(0)
	}
	if !(.PeerType == nil) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateBotInlineQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotInlineQuery#496f379c as nil")
	}
	.PutID(UpdateBotInlineQueryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotInlineQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotInlineQuery#496f379c as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field flags: %w", )
	}
	.PutLong(.QueryID)
	.PutLong(.UserID)
	.PutString(.Query)
	if .Flags.Has(0) {
		if .Geo == nil {
			return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field geo is nil")
		}
		if  := .Geo.Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field geo: %w", )
		}
	}
	if .Flags.Has(1) {
		if .PeerType == nil {
			return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field peer_type is nil")
		}
		if  := .PeerType.Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotInlineQuery#496f379c: field peer_type: %w", )
		}
	}
	.PutString(.Offset)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotInlineQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotInlineQuery#496f379c to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field query: %w", )
		}
		.Query = 
	}
	if .Flags.Has(0) {
		,  := DecodeGeoPoint()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field geo: %w", )
		}
		.Geo = 
	}
	if .Flags.Has(1) {
		,  := DecodeInlineQueryPeerType()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field peer_type: %w", )
		}
		.PeerType = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineQuery#496f379c: field offset: %w", )
		}
		.Offset = 
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateBotInlineQuery) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

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

// GetQuery returns value of Query field.
func ( *UpdateBotInlineQuery) () ( string) {
	if  == nil {
		return
	}
	return .Query
}

// SetGeo sets value of Geo conditional field.
func ( *UpdateBotInlineQuery) ( GeoPointClass) {
	.Flags.Set(0)
	.Geo = 
}

// GetGeo returns value of Geo conditional field and
// boolean which is true if field was set.
func ( *UpdateBotInlineQuery) () ( GeoPointClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Geo, true
}

// SetPeerType sets value of PeerType conditional field.
func ( *UpdateBotInlineQuery) ( InlineQueryPeerTypeClass) {
	.Flags.Set(1)
	.PeerType = 
}

// GetPeerType returns value of PeerType conditional field and
// boolean which is true if field was set.
func ( *UpdateBotInlineQuery) () ( InlineQueryPeerTypeClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .PeerType, true
}

// GetOffset returns value of Offset field.
func ( *UpdateBotInlineQuery) () ( string) {
	if  == nil {
		return
	}
	return .Offset
}

// UpdateBotInlineSend represents TL type `updateBotInlineSend#12f12a07`.
// The result of an inline query that was chosen by a user and sent to their chat partner
// Please see our documentation on the feedback collecting¹ for details on how to
// enable these updates for your bot.
//
// Links:
//  1. https://core.telegram.org/bots/inline#collecting-feedback
//
// See https://core.telegram.org/constructor/updateBotInlineSend for reference.
type UpdateBotInlineSend struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// The user that chose the result
	UserID int64
	// The query that was used to obtain the result
	Query string
	// Optional. Sender location, only for bots that require user location
	//
	// Use SetGeo and GetGeo helpers.
	Geo GeoPointClass
	// The unique identifier for the result that was chosen
	ID string
	// Identifier of the sent inline message. Available only if there is an inline keyboard
	// attached to the message. Will be also received in callback queries and can be used to
	// edit the message.
	//
	// Use SetMsgID and GetMsgID helpers.
	MsgID InputBotInlineMessageIDClass
}

// UpdateBotInlineSendTypeID is TL type id of UpdateBotInlineSend.
const UpdateBotInlineSendTypeID = 0x12f12a07

// construct implements constructor of UpdateClass.
func ( UpdateBotInlineSend) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotInlineSend{}
)

func ( *UpdateBotInlineSend) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Query == "") {
		return false
	}
	if !(.Geo == nil) {
		return false
	}
	if !(.ID == "") {
		return false
	}
	if !(.MsgID == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotInlineSend from given interface.
func ( *UpdateBotInlineSend) ( interface {
	() ( int64)
	() ( string)
	() ( GeoPointClass,  bool)
	() ( string)
	() ( InputBotInlineMessageIDClass,  bool)
}) {
	.UserID = .()
	.Query = .()
	if ,  := .();  {
		.Geo = 
	}

	.ID = .()
	if ,  := .();  {
		.MsgID = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotInlineSend) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotInlineSend",
		ID:   UpdateBotInlineSendTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Query",
			SchemaName: "query",
		},
		{
			Name:       "Geo",
			SchemaName: "geo",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateBotInlineSend) () {
	if !(.Geo == nil) {
		.Flags.Set(0)
	}
	if !(.MsgID == nil) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateBotInlineSend) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotInlineSend#12f12a07 as nil")
	}
	.PutID(UpdateBotInlineSendTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotInlineSend) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotInlineSend#12f12a07 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field flags: %w", )
	}
	.PutLong(.UserID)
	.PutString(.Query)
	if .Flags.Has(0) {
		if .Geo == nil {
			return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field geo is nil")
		}
		if  := .Geo.Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field geo: %w", )
		}
	}
	.PutString(.ID)
	if .Flags.Has(1) {
		if .MsgID == nil {
			return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field msg_id is nil")
		}
		if  := .MsgID.Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotInlineSend#12f12a07: field msg_id: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotInlineSend) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotInlineSend#12f12a07 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field query: %w", )
		}
		.Query = 
	}
	if .Flags.Has(0) {
		,  := DecodeGeoPoint()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field geo: %w", )
		}
		.Geo = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field id: %w", )
		}
		.ID = 
	}
	if .Flags.Has(1) {
		,  := DecodeInputBotInlineMessageID()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotInlineSend#12f12a07: field msg_id: %w", )
		}
		.MsgID = 
	}
	return nil
}

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

// GetQuery returns value of Query field.
func ( *UpdateBotInlineSend) () ( string) {
	if  == nil {
		return
	}
	return .Query
}

// SetGeo sets value of Geo conditional field.
func ( *UpdateBotInlineSend) ( GeoPointClass) {
	.Flags.Set(0)
	.Geo = 
}

// GetGeo returns value of Geo conditional field and
// boolean which is true if field was set.
func ( *UpdateBotInlineSend) () ( GeoPointClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Geo, true
}

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

// SetMsgID sets value of MsgID conditional field.
func ( *UpdateBotInlineSend) ( InputBotInlineMessageIDClass) {
	.Flags.Set(1)
	.MsgID = 
}

// GetMsgID returns value of MsgID conditional field and
// boolean which is true if field was set.
func ( *UpdateBotInlineSend) () ( InputBotInlineMessageIDClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .MsgID, true
}

// UpdateEditChannelMessage represents TL type `updateEditChannelMessage#1b3f4df7`.
// A message was edited in a channel/supergroup¹
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateEditChannelMessage for reference.
type UpdateEditChannelMessage struct {
	// The new message
	Message MessageClass
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateEditChannelMessageTypeID is TL type id of UpdateEditChannelMessage.
const UpdateEditChannelMessageTypeID = 0x1b3f4df7

// construct implements constructor of UpdateClass.
func ( UpdateEditChannelMessage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateEditChannelMessage{}
)

func ( *UpdateEditChannelMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Message == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateEditChannelMessage from given interface.
func ( *UpdateEditChannelMessage) ( interface {
	() ( MessageClass)
	() ( int)
	() ( int)
}) {
	.Message = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateEditChannelMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateEditChannelMessage",
		ID:   UpdateEditChannelMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateEditChannelMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEditChannelMessage#1b3f4df7 as nil")
	}
	.PutID(UpdateEditChannelMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateEditChannelMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEditChannelMessage#1b3f4df7 as nil")
	}
	if .Message == nil {
		return fmt.Errorf("unable to encode updateEditChannelMessage#1b3f4df7: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateEditChannelMessage#1b3f4df7: field message: %w", )
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateEditChannelMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateEditChannelMessage#1b3f4df7 to nil")
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateEditChannelMessage#1b3f4df7: field message: %w", )
		}
		.Message = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEditChannelMessage#1b3f4df7: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEditChannelMessage#1b3f4df7: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

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

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

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

// UpdateBotCallbackQuery represents TL type `updateBotCallbackQuery#b9cfc48d`.
// A callback button was pressed, and the button data was sent to the bot that created
// the button
//
// See https://core.telegram.org/constructor/updateBotCallbackQuery for reference.
type UpdateBotCallbackQuery struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Query ID
	QueryID int64
	// ID of the user that pressed the button
	UserID int64
	// Chat where the inline keyboard was sent
	Peer PeerClass
	// Message ID
	MsgID int
	// Global identifier, uniquely corresponding to the chat to which the message with the
	// callback button was sent. Useful for high scores in games.
	ChatInstance int64
	// Callback data
	//
	// Use SetData and GetData helpers.
	Data []byte
	// Short name of a Game to be returned, serves as the unique identifier for the game
	//
	// Use SetGameShortName and GetGameShortName helpers.
	GameShortName string
}

// UpdateBotCallbackQueryTypeID is TL type id of UpdateBotCallbackQuery.
const UpdateBotCallbackQueryTypeID = 0xb9cfc48d

// construct implements constructor of UpdateClass.
func ( UpdateBotCallbackQuery) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotCallbackQuery{}
)

func ( *UpdateBotCallbackQuery) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.ChatInstance == 0) {
		return false
	}
	if !(.Data == nil) {
		return false
	}
	if !(.GameShortName == "") {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotCallbackQuery from given interface.
func ( *UpdateBotCallbackQuery) ( interface {
	() ( int64)
	() ( int64)
	() ( PeerClass)
	() ( int)
	() ( int64)
	() ( []byte,  bool)
	() ( string,  bool)
}) {
	.QueryID = .()
	.UserID = .()
	.Peer = .()
	.MsgID = .()
	.ChatInstance = .()
	if ,  := .();  {
		.Data = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotCallbackQuery) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotCallbackQuery",
		ID:   UpdateBotCallbackQueryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "ChatInstance",
			SchemaName: "chat_instance",
		},
		{
			Name:       "Data",
			SchemaName: "data",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "GameShortName",
			SchemaName: "game_short_name",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateBotCallbackQuery) () {
	if !(.Data == nil) {
		.Flags.Set(0)
	}
	if !(.GameShortName == "") {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotCallbackQuery#b9cfc48d as nil")
	}
	.PutID(UpdateBotCallbackQueryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotCallbackQuery#b9cfc48d as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotCallbackQuery#b9cfc48d: field flags: %w", )
	}
	.PutLong(.QueryID)
	.PutLong(.UserID)
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateBotCallbackQuery#b9cfc48d: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotCallbackQuery#b9cfc48d: field peer: %w", )
	}
	.PutInt(.MsgID)
	.PutLong(.ChatInstance)
	if .Flags.Has(0) {
		.PutBytes(.Data)
	}
	if .Flags.Has(1) {
		.PutString(.GameShortName)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotCallbackQuery#b9cfc48d to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field chat_instance: %w", )
		}
		.ChatInstance = 
	}
	if .Flags.Has(0) {
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field data: %w", )
		}
		.Data = 
	}
	if .Flags.Has(1) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCallbackQuery#b9cfc48d: field game_short_name: %w", )
		}
		.GameShortName = 
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateBotCallbackQuery) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

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

// GetPeer returns value of Peer field.
func ( *UpdateBotCallbackQuery) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMsgID returns value of MsgID field.
func ( *UpdateBotCallbackQuery) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

// GetChatInstance returns value of ChatInstance field.
func ( *UpdateBotCallbackQuery) () ( int64) {
	if  == nil {
		return
	}
	return .ChatInstance
}

// SetData sets value of Data conditional field.
func ( *UpdateBotCallbackQuery) ( []byte) {
	.Flags.Set(0)
	.Data = 
}

// GetData returns value of Data conditional field and
// boolean which is true if field was set.
func ( *UpdateBotCallbackQuery) () ( []byte,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Data, true
}

// SetGameShortName sets value of GameShortName conditional field.
func ( *UpdateBotCallbackQuery) ( string) {
	.Flags.Set(1)
	.GameShortName = 
}

// GetGameShortName returns value of GameShortName conditional field and
// boolean which is true if field was set.
func ( *UpdateBotCallbackQuery) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .GameShortName, true
}

// UpdateEditMessage represents TL type `updateEditMessage#e40370a3`.
// A message was edited
//
// See https://core.telegram.org/constructor/updateEditMessage for reference.
type UpdateEditMessage struct {
	// The new edited message
	Message MessageClass
	// PTS¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// PTS count¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateEditMessageTypeID is TL type id of UpdateEditMessage.
const UpdateEditMessageTypeID = 0xe40370a3

// construct implements constructor of UpdateClass.
func ( UpdateEditMessage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateEditMessage{}
)

func ( *UpdateEditMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Message == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateEditMessage from given interface.
func ( *UpdateEditMessage) ( interface {
	() ( MessageClass)
	() ( int)
	() ( int)
}) {
	.Message = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateEditMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateEditMessage",
		ID:   UpdateEditMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateEditMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEditMessage#e40370a3 as nil")
	}
	.PutID(UpdateEditMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateEditMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEditMessage#e40370a3 as nil")
	}
	if .Message == nil {
		return fmt.Errorf("unable to encode updateEditMessage#e40370a3: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateEditMessage#e40370a3: field message: %w", )
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateEditMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateEditMessage#e40370a3 to nil")
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateEditMessage#e40370a3: field message: %w", )
		}
		.Message = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEditMessage#e40370a3: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateEditMessage#e40370a3: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

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

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

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

// UpdateInlineBotCallbackQuery represents TL type `updateInlineBotCallbackQuery#691e9052`.
// This notification is received by bots when a button is pressed
//
// See https://core.telegram.org/constructor/updateInlineBotCallbackQuery for reference.
type UpdateInlineBotCallbackQuery struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Query ID
	QueryID int64
	// ID of the user that pressed the button
	UserID int64
	// ID of the inline message with the button
	MsgID InputBotInlineMessageIDClass
	// Global identifier, uniquely corresponding to the chat to which the message with the
	// callback button was sent. Useful for high scores in games.
	ChatInstance int64
	// Data associated with the callback button. Be aware that a bad client can send
	// arbitrary data in this field.
	//
	// Use SetData and GetData helpers.
	Data []byte
	// Short name of a Game to be returned, serves as the unique identifier for the game
	//
	// Use SetGameShortName and GetGameShortName helpers.
	GameShortName string
}

// UpdateInlineBotCallbackQueryTypeID is TL type id of UpdateInlineBotCallbackQuery.
const UpdateInlineBotCallbackQueryTypeID = 0x691e9052

// construct implements constructor of UpdateClass.
func ( UpdateInlineBotCallbackQuery) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateInlineBotCallbackQuery{}
)

func ( *UpdateInlineBotCallbackQuery) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.MsgID == nil) {
		return false
	}
	if !(.ChatInstance == 0) {
		return false
	}
	if !(.Data == nil) {
		return false
	}
	if !(.GameShortName == "") {
		return false
	}

	return true
}

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

// FillFrom fills UpdateInlineBotCallbackQuery from given interface.
func ( *UpdateInlineBotCallbackQuery) ( interface {
	() ( int64)
	() ( int64)
	() ( InputBotInlineMessageIDClass)
	() ( int64)
	() ( []byte,  bool)
	() ( string,  bool)
}) {
	.QueryID = .()
	.UserID = .()
	.MsgID = .()
	.ChatInstance = .()
	if ,  := .();  {
		.Data = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateInlineBotCallbackQuery) () tdp.Type {
	 := tdp.Type{
		Name: "updateInlineBotCallbackQuery",
		ID:   UpdateInlineBotCallbackQueryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "ChatInstance",
			SchemaName: "chat_instance",
		},
		{
			Name:       "Data",
			SchemaName: "data",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "GameShortName",
			SchemaName: "game_short_name",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateInlineBotCallbackQuery) () {
	if !(.Data == nil) {
		.Flags.Set(0)
	}
	if !(.GameShortName == "") {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateInlineBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateInlineBotCallbackQuery#691e9052 as nil")
	}
	.PutID(UpdateInlineBotCallbackQueryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateInlineBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateInlineBotCallbackQuery#691e9052 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateInlineBotCallbackQuery#691e9052: field flags: %w", )
	}
	.PutLong(.QueryID)
	.PutLong(.UserID)
	if .MsgID == nil {
		return fmt.Errorf("unable to encode updateInlineBotCallbackQuery#691e9052: field msg_id is nil")
	}
	if  := .MsgID.Encode();  != nil {
		return fmt.Errorf("unable to encode updateInlineBotCallbackQuery#691e9052: field msg_id: %w", )
	}
	.PutLong(.ChatInstance)
	if .Flags.Has(0) {
		.PutBytes(.Data)
	}
	if .Flags.Has(1) {
		.PutString(.GameShortName)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateInlineBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateInlineBotCallbackQuery#691e9052 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := DecodeInputBotInlineMessageID()
		if  != nil {
			return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field chat_instance: %w", )
		}
		.ChatInstance = 
	}
	if .Flags.Has(0) {
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field data: %w", )
		}
		.Data = 
	}
	if .Flags.Has(1) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateInlineBotCallbackQuery#691e9052: field game_short_name: %w", )
		}
		.GameShortName = 
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateInlineBotCallbackQuery) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

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

// GetMsgID returns value of MsgID field.
func ( *UpdateInlineBotCallbackQuery) () ( InputBotInlineMessageIDClass) {
	if  == nil {
		return
	}
	return .MsgID
}

// GetChatInstance returns value of ChatInstance field.
func ( *UpdateInlineBotCallbackQuery) () ( int64) {
	if  == nil {
		return
	}
	return .ChatInstance
}

// SetData sets value of Data conditional field.
func ( *UpdateInlineBotCallbackQuery) ( []byte) {
	.Flags.Set(0)
	.Data = 
}

// GetData returns value of Data conditional field and
// boolean which is true if field was set.
func ( *UpdateInlineBotCallbackQuery) () ( []byte,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Data, true
}

// SetGameShortName sets value of GameShortName conditional field.
func ( *UpdateInlineBotCallbackQuery) ( string) {
	.Flags.Set(1)
	.GameShortName = 
}

// GetGameShortName returns value of GameShortName conditional field and
// boolean which is true if field was set.
func ( *UpdateInlineBotCallbackQuery) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .GameShortName, true
}

// UpdateReadChannelOutbox represents TL type `updateReadChannelOutbox#b75f99a9`.
// Outgoing messages in a channel/supergroup¹ were read
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateReadChannelOutbox for reference.
type UpdateReadChannelOutbox struct {
	// Channel/supergroup ID
	ChannelID int64
	// Position up to which all outgoing messages are read.
	MaxID int
}

// UpdateReadChannelOutboxTypeID is TL type id of UpdateReadChannelOutbox.
const UpdateReadChannelOutboxTypeID = 0xb75f99a9

// construct implements constructor of UpdateClass.
func ( UpdateReadChannelOutbox) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadChannelOutbox{}
)

func ( *UpdateReadChannelOutbox) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.MaxID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateReadChannelOutbox from given interface.
func ( *UpdateReadChannelOutbox) ( interface {
	() ( int64)
	() ( int)
}) {
	.ChannelID = .()
	.MaxID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateReadChannelOutbox) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadChannelOutbox",
		ID:   UpdateReadChannelOutboxTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "MaxID",
			SchemaName: "max_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateReadChannelOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadChannelOutbox#b75f99a9 as nil")
	}
	.PutID(UpdateReadChannelOutboxTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadChannelOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadChannelOutbox#b75f99a9 as nil")
	}
	.PutLong(.ChannelID)
	.PutInt(.MaxID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadChannelOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadChannelOutbox#b75f99a9 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelOutbox#b75f99a9: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelOutbox#b75f99a9: field max_id: %w", )
		}
		.MaxID = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateReadChannelOutbox) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetMaxID returns value of MaxID field.
func ( *UpdateReadChannelOutbox) () ( int) {
	if  == nil {
		return
	}
	return .MaxID
}

// UpdateDraftMessage represents TL type `updateDraftMessage#edfc111e`.
// Notifies a change of a message draft¹.
//
// Links:
//  1. https://core.telegram.org/api/drafts
//
// See https://core.telegram.org/constructor/updateDraftMessage for reference.
type UpdateDraftMessage struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// The peer to which the draft is associated
	Peer PeerClass
	// ID of the forum topic¹ to which the draft is associated
	//
	// Links:
	//  1) https://core.telegram.org/api/forum#forum-topics
	//
	// Use SetTopMsgID and GetTopMsgID helpers.
	TopMsgID int
	// If set, the draft is related to the specified monoforum topic ID »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/monoforum
	//
	// Use SetSavedPeerID and GetSavedPeerID helpers.
	SavedPeerID PeerClass
	// The draft
	Draft DraftMessageClass
}

// UpdateDraftMessageTypeID is TL type id of UpdateDraftMessage.
const UpdateDraftMessageTypeID = 0xedfc111e

// construct implements constructor of UpdateClass.
func ( UpdateDraftMessage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDraftMessage{}
)

func ( *UpdateDraftMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.SavedPeerID == nil) {
		return false
	}
	if !(.Draft == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDraftMessage from given interface.
func ( *UpdateDraftMessage) ( interface {
	() ( PeerClass)
	() ( int,  bool)
	() ( PeerClass,  bool)
	() ( DraftMessageClass)
}) {
	.Peer = .()
	if ,  := .();  {
		.TopMsgID = 
	}

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

	.Draft = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDraftMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateDraftMessage",
		ID:   UpdateDraftMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "SavedPeerID",
			SchemaName: "saved_peer_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Draft",
			SchemaName: "draft",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateDraftMessage) () {
	if !(.TopMsgID == 0) {
		.Flags.Set(0)
	}
	if !(.SavedPeerID == nil) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateDraftMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDraftMessage#edfc111e as nil")
	}
	.PutID(UpdateDraftMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDraftMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDraftMessage#edfc111e as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDraftMessage#edfc111e: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateDraftMessage#edfc111e: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDraftMessage#edfc111e: field peer: %w", )
	}
	if .Flags.Has(0) {
		.PutInt(.TopMsgID)
	}
	if .Flags.Has(1) {
		if .SavedPeerID == nil {
			return fmt.Errorf("unable to encode updateDraftMessage#edfc111e: field saved_peer_id is nil")
		}
		if  := .SavedPeerID.Encode();  != nil {
			return fmt.Errorf("unable to encode updateDraftMessage#edfc111e: field saved_peer_id: %w", )
		}
	}
	if .Draft == nil {
		return fmt.Errorf("unable to encode updateDraftMessage#edfc111e: field draft is nil")
	}
	if  := .Draft.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDraftMessage#edfc111e: field draft: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDraftMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDraftMessage#edfc111e to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#edfc111e: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#edfc111e: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#edfc111e: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	if .Flags.Has(1) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#edfc111e: field saved_peer_id: %w", )
		}
		.SavedPeerID = 
	}
	{
		,  := DecodeDraftMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#edfc111e: field draft: %w", )
		}
		.Draft = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateDraftMessage) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// SetTopMsgID sets value of TopMsgID conditional field.
func ( *UpdateDraftMessage) ( int) {
	.Flags.Set(0)
	.TopMsgID = 
}

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

// SetSavedPeerID sets value of SavedPeerID conditional field.
func ( *UpdateDraftMessage) ( PeerClass) {
	.Flags.Set(1)
	.SavedPeerID = 
}

// GetSavedPeerID returns value of SavedPeerID conditional field and
// boolean which is true if field was set.
func ( *UpdateDraftMessage) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .SavedPeerID, true
}

// GetDraft returns value of Draft field.
func ( *UpdateDraftMessage) () ( DraftMessageClass) {
	if  == nil {
		return
	}
	return .Draft
}

// UpdateReadFeaturedStickers represents TL type `updateReadFeaturedStickers#571d2742`.
// Some featured stickers were marked as read
//
// See https://core.telegram.org/constructor/updateReadFeaturedStickers for reference.
type UpdateReadFeaturedStickers struct {
}

// UpdateReadFeaturedStickersTypeID is TL type id of UpdateReadFeaturedStickers.
const UpdateReadFeaturedStickersTypeID = 0x571d2742

// construct implements constructor of UpdateClass.
func ( UpdateReadFeaturedStickers) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadFeaturedStickers{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateReadFeaturedStickers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadFeaturedStickers#571d2742 as nil")
	}
	.PutID(UpdateReadFeaturedStickersTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadFeaturedStickers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadFeaturedStickers#571d2742 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadFeaturedStickers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadFeaturedStickers#571d2742 to nil")
	}
	return nil
}

// UpdateRecentStickers represents TL type `updateRecentStickers#9a422c20`.
// The recent sticker list was updated
//
// See https://core.telegram.org/constructor/updateRecentStickers for reference.
type UpdateRecentStickers struct {
}

// UpdateRecentStickersTypeID is TL type id of UpdateRecentStickers.
const UpdateRecentStickersTypeID = 0x9a422c20

// construct implements constructor of UpdateClass.
func ( UpdateRecentStickers) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateRecentStickers{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateRecentStickers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateRecentStickers#9a422c20 as nil")
	}
	.PutID(UpdateRecentStickersTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateRecentStickers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateRecentStickers#9a422c20 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateRecentStickers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateRecentStickers#9a422c20 to nil")
	}
	return nil
}

// UpdateConfig represents TL type `updateConfig#a229dd06`.
// The server-side configuration has changed; the client should re-fetch the config using
// help.getConfig¹ and help.getAppConfig².
//
// Links:
//  1. https://core.telegram.org/method/help.getConfig
//  2. https://core.telegram.org/method/help.getAppConfig
//
// See https://core.telegram.org/constructor/updateConfig for reference.
type UpdateConfig struct {
}

// UpdateConfigTypeID is TL type id of UpdateConfig.
const UpdateConfigTypeID = 0xa229dd06

// construct implements constructor of UpdateClass.
func ( UpdateConfig) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateConfig{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateConfig) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateConfig#a229dd06 as nil")
	}
	.PutID(UpdateConfigTypeID)
	return .EncodeBare()
}

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

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

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

// UpdatePtsChanged represents TL type `updatePtsChanged#3354678f`.
// Common message box sequence PTS¹ has changed, state has to be refetched using updates
// getState²
//
// Links:
//  1. https://core.telegram.org/api/updates
//  2. https://core.telegram.org/api/updates#fetching-state
//
// See https://core.telegram.org/constructor/updatePtsChanged for reference.
type UpdatePtsChanged struct {
}

// UpdatePtsChangedTypeID is TL type id of UpdatePtsChanged.
const UpdatePtsChangedTypeID = 0x3354678f

// construct implements constructor of UpdateClass.
func ( UpdatePtsChanged) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePtsChanged{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdatePtsChanged) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePtsChanged#3354678f as nil")
	}
	.PutID(UpdatePtsChangedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePtsChanged) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePtsChanged#3354678f as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePtsChanged) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePtsChanged#3354678f to nil")
	}
	return nil
}

// UpdateChannelWebPage represents TL type `updateChannelWebPage#2f2ba99f`.
// A webpage preview of a link in a channel/supergroup¹ message was generated
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateChannelWebPage for reference.
type UpdateChannelWebPage struct {
	// Channel/supergroup¹ ID
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	ChannelID int64
	// Generated webpage preview
	Webpage WebPageClass
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateChannelWebPageTypeID is TL type id of UpdateChannelWebPage.
const UpdateChannelWebPageTypeID = 0x2f2ba99f

// construct implements constructor of UpdateClass.
func ( UpdateChannelWebPage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelWebPage{}
)

func ( *UpdateChannelWebPage) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.Webpage == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelWebPage from given interface.
func ( *UpdateChannelWebPage) ( interface {
	() ( int64)
	() ( WebPageClass)
	() ( int)
	() ( int)
}) {
	.ChannelID = .()
	.Webpage = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelWebPage) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelWebPage",
		ID:   UpdateChannelWebPageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "Webpage",
			SchemaName: "webpage",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChannelWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelWebPage#2f2ba99f as nil")
	}
	.PutID(UpdateChannelWebPageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelWebPage#2f2ba99f as nil")
	}
	.PutLong(.ChannelID)
	if .Webpage == nil {
		return fmt.Errorf("unable to encode updateChannelWebPage#2f2ba99f: field webpage is nil")
	}
	if  := .Webpage.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChannelWebPage#2f2ba99f: field webpage: %w", )
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelWebPage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelWebPage#2f2ba99f to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := DecodeWebPage()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: field webpage: %w", )
		}
		.Webpage = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelWebPage#2f2ba99f: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelWebPage) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetWebpage returns value of Webpage field.
func ( *UpdateChannelWebPage) () ( WebPageClass) {
	if  == nil {
		return
	}
	return .Webpage
}

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

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

// UpdateDialogPinned represents TL type `updateDialogPinned#6e6fe51c`.
// A dialog was pinned/unpinned
//
// See https://core.telegram.org/constructor/updateDialogPinned for reference.
type UpdateDialogPinned struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the dialog was pinned
	Pinned bool
	// Peer folder ID, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/folders#peer-folders
	//
	// Use SetFolderID and GetFolderID helpers.
	FolderID int
	// The dialog
	Peer DialogPeerClass
}

// UpdateDialogPinnedTypeID is TL type id of UpdateDialogPinned.
const UpdateDialogPinnedTypeID = 0x6e6fe51c

// construct implements constructor of UpdateClass.
func ( UpdateDialogPinned) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDialogPinned{}
)

func ( *UpdateDialogPinned) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Pinned == false) {
		return false
	}
	if !(.FolderID == 0) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDialogPinned from given interface.
func ( *UpdateDialogPinned) ( interface {
	() ( bool)
	() ( int,  bool)
	() ( DialogPeerClass)
}) {
	.Pinned = .()
	if ,  := .();  {
		.FolderID = 
	}

	.Peer = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDialogPinned) () tdp.Type {
	 := tdp.Type{
		Name: "updateDialogPinned",
		ID:   UpdateDialogPinnedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Pinned",
			SchemaName: "pinned",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "FolderID",
			SchemaName: "folder_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateDialogPinned) () {
	if !(.Pinned == false) {
		.Flags.Set(0)
	}
	if !(.FolderID == 0) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateDialogPinned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogPinned#6e6fe51c as nil")
	}
	.PutID(UpdateDialogPinnedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDialogPinned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogPinned#6e6fe51c as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDialogPinned#6e6fe51c: field flags: %w", )
	}
	if .Flags.Has(1) {
		.PutInt(.FolderID)
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateDialogPinned#6e6fe51c: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDialogPinned#6e6fe51c: field peer: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDialogPinned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDialogPinned#6e6fe51c to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateDialogPinned#6e6fe51c: field flags: %w", )
		}
	}
	.Pinned = .Flags.Has(0)
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDialogPinned#6e6fe51c: field folder_id: %w", )
		}
		.FolderID = 
	}
	{
		,  := DecodeDialogPeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDialogPinned#6e6fe51c: field peer: %w", )
		}
		.Peer = 
	}
	return nil
}

// SetPinned sets value of Pinned conditional field.
func ( *UpdateDialogPinned) ( bool) {
	if  {
		.Flags.Set(0)
		.Pinned = true
	} else {
		.Flags.Unset(0)
		.Pinned = false
	}
}

// GetPinned returns value of Pinned conditional field.
func ( *UpdateDialogPinned) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetFolderID sets value of FolderID conditional field.
func ( *UpdateDialogPinned) ( int) {
	.Flags.Set(1)
	.FolderID = 
}

// GetFolderID returns value of FolderID conditional field and
// boolean which is true if field was set.
func ( *UpdateDialogPinned) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .FolderID, true
}

// GetPeer returns value of Peer field.
func ( *UpdateDialogPinned) () ( DialogPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// UpdatePinnedDialogs represents TL type `updatePinnedDialogs#fa0f3ca2`.
// Pinned dialogs were updated
//
// See https://core.telegram.org/constructor/updatePinnedDialogs for reference.
type UpdatePinnedDialogs struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Peer folder ID, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/folders#peer-folders
	//
	// Use SetFolderID and GetFolderID helpers.
	FolderID int
	// New order of pinned dialogs
	//
	// Use SetOrder and GetOrder helpers.
	Order []DialogPeerClass
}

// UpdatePinnedDialogsTypeID is TL type id of UpdatePinnedDialogs.
const UpdatePinnedDialogsTypeID = 0xfa0f3ca2

// construct implements constructor of UpdateClass.
func ( UpdatePinnedDialogs) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePinnedDialogs{}
)

func ( *UpdatePinnedDialogs) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.FolderID == 0) {
		return false
	}
	if !(.Order == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePinnedDialogs from given interface.
func ( *UpdatePinnedDialogs) ( interface {
	() ( int,  bool)
	() ( []DialogPeerClass,  bool)
}) {
	if ,  := .();  {
		.FolderID = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePinnedDialogs) () tdp.Type {
	 := tdp.Type{
		Name: "updatePinnedDialogs",
		ID:   UpdatePinnedDialogsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "FolderID",
			SchemaName: "folder_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Order",
			SchemaName: "order",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdatePinnedDialogs) () {
	if !(.FolderID == 0) {
		.Flags.Set(1)
	}
	if !(.Order == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdatePinnedDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedDialogs#fa0f3ca2 as nil")
	}
	.PutID(UpdatePinnedDialogsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePinnedDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedDialogs#fa0f3ca2 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedDialogs#fa0f3ca2: field flags: %w", )
	}
	if .Flags.Has(1) {
		.PutInt(.FolderID)
	}
	if .Flags.Has(0) {
		.PutVectorHeader(len(.Order))
		for ,  := range .Order {
			if  == nil {
				return fmt.Errorf("unable to encode updatePinnedDialogs#fa0f3ca2: field order element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode updatePinnedDialogs#fa0f3ca2: field order element with index %d: %w", , )
			}
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePinnedDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePinnedDialogs#fa0f3ca2 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePinnedDialogs#fa0f3ca2: field flags: %w", )
		}
	}
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedDialogs#fa0f3ca2: field folder_id: %w", )
		}
		.FolderID = 
	}
	if .Flags.Has(0) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedDialogs#fa0f3ca2: field order: %w", )
		}

		if  > 0 {
			.Order = make([]DialogPeerClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeDialogPeer()
			if  != nil {
				return fmt.Errorf("unable to decode updatePinnedDialogs#fa0f3ca2: field order: %w", )
			}
			.Order = append(.Order, )
		}
	}
	return nil
}

// SetFolderID sets value of FolderID conditional field.
func ( *UpdatePinnedDialogs) ( int) {
	.Flags.Set(1)
	.FolderID = 
}

// GetFolderID returns value of FolderID conditional field and
// boolean which is true if field was set.
func ( *UpdatePinnedDialogs) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .FolderID, true
}

// SetOrder sets value of Order conditional field.
func ( *UpdatePinnedDialogs) ( []DialogPeerClass) {
	.Flags.Set(0)
	.Order = 
}

// GetOrder returns value of Order conditional field and
// boolean which is true if field was set.
func ( *UpdatePinnedDialogs) () ( []DialogPeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Order, true
}

// MapOrder returns field Order wrapped in DialogPeerClassArray helper.
func ( *UpdatePinnedDialogs) () ( DialogPeerClassArray,  bool) {
	if !.Flags.Has(0) {
		return , false
	}
	return DialogPeerClassArray(.Order), true
}

// UpdateBotWebhookJSON represents TL type `updateBotWebhookJSON#8317c0c3`.
// A new incoming event; for bots only
//
// See https://core.telegram.org/constructor/updateBotWebhookJSON for reference.
type UpdateBotWebhookJSON struct {
	// The event
	Data DataJSON
}

// UpdateBotWebhookJSONTypeID is TL type id of UpdateBotWebhookJSON.
const UpdateBotWebhookJSONTypeID = 0x8317c0c3

// construct implements constructor of UpdateClass.
func ( UpdateBotWebhookJSON) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotWebhookJSON{}
)

func ( *UpdateBotWebhookJSON) () bool {
	if  == nil {
		return true
	}
	if !(.Data.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotWebhookJSON from given interface.
func ( *UpdateBotWebhookJSON) ( interface {
	() ( DataJSON)
}) {
	.Data = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotWebhookJSON) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotWebhookJSON",
		ID:   UpdateBotWebhookJSONTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Data",
			SchemaName: "data",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotWebhookJSON) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotWebhookJSON#8317c0c3 as nil")
	}
	.PutID(UpdateBotWebhookJSONTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotWebhookJSON) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotWebhookJSON#8317c0c3 as nil")
	}
	if  := .Data.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotWebhookJSON#8317c0c3: field data: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotWebhookJSON) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotWebhookJSON#8317c0c3 to nil")
	}
	{
		if  := .Data.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotWebhookJSON#8317c0c3: field data: %w", )
		}
	}
	return nil
}

// GetData returns value of Data field.
func ( *UpdateBotWebhookJSON) () ( DataJSON) {
	if  == nil {
		return
	}
	return .Data
}

// UpdateBotWebhookJSONQuery represents TL type `updateBotWebhookJSONQuery#9b9240a6`.
// A new incoming query; for bots only
//
// See https://core.telegram.org/constructor/updateBotWebhookJSONQuery for reference.
type UpdateBotWebhookJSONQuery struct {
	// Query identifier
	QueryID int64
	// Query data
	Data DataJSON
	// Query timeout
	Timeout int
}

// UpdateBotWebhookJSONQueryTypeID is TL type id of UpdateBotWebhookJSONQuery.
const UpdateBotWebhookJSONQueryTypeID = 0x9b9240a6

// construct implements constructor of UpdateClass.
func ( UpdateBotWebhookJSONQuery) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotWebhookJSONQuery{}
)

func ( *UpdateBotWebhookJSONQuery) () bool {
	if  == nil {
		return true
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.Data.Zero()) {
		return false
	}
	if !(.Timeout == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotWebhookJSONQuery from given interface.
func ( *UpdateBotWebhookJSONQuery) ( interface {
	() ( int64)
	() ( DataJSON)
	() ( int)
}) {
	.QueryID = .()
	.Data = .()
	.Timeout = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotWebhookJSONQuery) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotWebhookJSONQuery",
		ID:   UpdateBotWebhookJSONQueryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "Data",
			SchemaName: "data",
		},
		{
			Name:       "Timeout",
			SchemaName: "timeout",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotWebhookJSONQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotWebhookJSONQuery#9b9240a6 as nil")
	}
	.PutID(UpdateBotWebhookJSONQueryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotWebhookJSONQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotWebhookJSONQuery#9b9240a6 as nil")
	}
	.PutLong(.QueryID)
	if  := .Data.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotWebhookJSONQuery#9b9240a6: field data: %w", )
	}
	.PutInt(.Timeout)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotWebhookJSONQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotWebhookJSONQuery#9b9240a6 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotWebhookJSONQuery#9b9240a6: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		if  := .Data.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotWebhookJSONQuery#9b9240a6: field data: %w", )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotWebhookJSONQuery#9b9240a6: field timeout: %w", )
		}
		.Timeout = 
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateBotWebhookJSONQuery) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

// GetData returns value of Data field.
func ( *UpdateBotWebhookJSONQuery) () ( DataJSON) {
	if  == nil {
		return
	}
	return .Data
}

// GetTimeout returns value of Timeout field.
func ( *UpdateBotWebhookJSONQuery) () ( int) {
	if  == nil {
		return
	}
	return .Timeout
}

// UpdateBotShippingQuery represents TL type `updateBotShippingQuery#b5aefd7d`.
// This object contains information about an incoming shipping query.
//
// See https://core.telegram.org/constructor/updateBotShippingQuery for reference.
type UpdateBotShippingQuery struct {
	// Unique query identifier
	QueryID int64
	// User who sent the query
	UserID int64
	// Bot specified invoice payload
	Payload []byte
	// User specified shipping address
	ShippingAddress PostAddress
}

// UpdateBotShippingQueryTypeID is TL type id of UpdateBotShippingQuery.
const UpdateBotShippingQueryTypeID = 0xb5aefd7d

// construct implements constructor of UpdateClass.
func ( UpdateBotShippingQuery) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotShippingQuery{}
)

func ( *UpdateBotShippingQuery) () bool {
	if  == nil {
		return true
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Payload == nil) {
		return false
	}
	if !(.ShippingAddress.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotShippingQuery from given interface.
func ( *UpdateBotShippingQuery) ( interface {
	() ( int64)
	() ( int64)
	() ( []byte)
	() ( PostAddress)
}) {
	.QueryID = .()
	.UserID = .()
	.Payload = .()
	.ShippingAddress = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotShippingQuery) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotShippingQuery",
		ID:   UpdateBotShippingQueryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Payload",
			SchemaName: "payload",
		},
		{
			Name:       "ShippingAddress",
			SchemaName: "shipping_address",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotShippingQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotShippingQuery#b5aefd7d as nil")
	}
	.PutID(UpdateBotShippingQueryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotShippingQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotShippingQuery#b5aefd7d as nil")
	}
	.PutLong(.QueryID)
	.PutLong(.UserID)
	.PutBytes(.Payload)
	if  := .ShippingAddress.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotShippingQuery#b5aefd7d: field shipping_address: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotShippingQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotShippingQuery#b5aefd7d to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: field payload: %w", )
		}
		.Payload = 
	}
	{
		if  := .ShippingAddress.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotShippingQuery#b5aefd7d: field shipping_address: %w", )
		}
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateBotShippingQuery) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

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

// GetPayload returns value of Payload field.
func ( *UpdateBotShippingQuery) () ( []byte) {
	if  == nil {
		return
	}
	return .Payload
}

// GetShippingAddress returns value of ShippingAddress field.
func ( *UpdateBotShippingQuery) () ( PostAddress) {
	if  == nil {
		return
	}
	return .ShippingAddress
}

// UpdateBotPrecheckoutQuery represents TL type `updateBotPrecheckoutQuery#8caa9a96`.
// This object contains information about an incoming pre-checkout query.
//
// See https://core.telegram.org/constructor/updateBotPrecheckoutQuery for reference.
type UpdateBotPrecheckoutQuery struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Unique query identifier
	QueryID int64
	// User who sent the query
	UserID int64
	// Bot specified invoice payload
	Payload []byte
	// Order info provided by the user
	//
	// Use SetInfo and GetInfo helpers.
	Info PaymentRequestedInfo
	// Identifier of the shipping option chosen by the user
	//
	// Use SetShippingOptionID and GetShippingOptionID helpers.
	ShippingOptionID string
	// Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars².
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	//  2) https://core.telegram.org/api/stars
	Currency string
	// Total amount in the smallest units of the currency (integer, not float/double). For
	// example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in
	// currencies.json¹, it shows the number of digits past the decimal point for each
	// currency (2 for the majority of currencies).
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments/currencies.json
	TotalAmount int64
}

// UpdateBotPrecheckoutQueryTypeID is TL type id of UpdateBotPrecheckoutQuery.
const UpdateBotPrecheckoutQueryTypeID = 0x8caa9a96

// construct implements constructor of UpdateClass.
func ( UpdateBotPrecheckoutQuery) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotPrecheckoutQuery{}
)

func ( *UpdateBotPrecheckoutQuery) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Payload == nil) {
		return false
	}
	if !(.Info.Zero()) {
		return false
	}
	if !(.ShippingOptionID == "") {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.TotalAmount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotPrecheckoutQuery from given interface.
func ( *UpdateBotPrecheckoutQuery) ( interface {
	() ( int64)
	() ( int64)
	() ( []byte)
	() ( PaymentRequestedInfo,  bool)
	() ( string,  bool)
	() ( string)
	() ( int64)
}) {
	.QueryID = .()
	.UserID = .()
	.Payload = .()
	if ,  := .();  {
		.Info = 
	}

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

	.Currency = .()
	.TotalAmount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotPrecheckoutQuery) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotPrecheckoutQuery",
		ID:   UpdateBotPrecheckoutQueryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Payload",
			SchemaName: "payload",
		},
		{
			Name:       "Info",
			SchemaName: "info",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "ShippingOptionID",
			SchemaName: "shipping_option_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Currency",
			SchemaName: "currency",
		},
		{
			Name:       "TotalAmount",
			SchemaName: "total_amount",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateBotPrecheckoutQuery) () {
	if !(.Info.Zero()) {
		.Flags.Set(0)
	}
	if !(.ShippingOptionID == "") {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateBotPrecheckoutQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotPrecheckoutQuery#8caa9a96 as nil")
	}
	.PutID(UpdateBotPrecheckoutQueryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotPrecheckoutQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotPrecheckoutQuery#8caa9a96 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotPrecheckoutQuery#8caa9a96: field flags: %w", )
	}
	.PutLong(.QueryID)
	.PutLong(.UserID)
	.PutBytes(.Payload)
	if .Flags.Has(0) {
		if  := .Info.Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotPrecheckoutQuery#8caa9a96: field info: %w", )
		}
	}
	if .Flags.Has(1) {
		.PutString(.ShippingOptionID)
	}
	.PutString(.Currency)
	.PutLong(.TotalAmount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotPrecheckoutQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotPrecheckoutQuery#8caa9a96 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field payload: %w", )
		}
		.Payload = 
	}
	if .Flags.Has(0) {
		if  := .Info.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field info: %w", )
		}
	}
	if .Flags.Has(1) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field shipping_option_id: %w", )
		}
		.ShippingOptionID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPrecheckoutQuery#8caa9a96: field total_amount: %w", )
		}
		.TotalAmount = 
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateBotPrecheckoutQuery) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

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

// GetPayload returns value of Payload field.
func ( *UpdateBotPrecheckoutQuery) () ( []byte) {
	if  == nil {
		return
	}
	return .Payload
}

// SetInfo sets value of Info conditional field.
func ( *UpdateBotPrecheckoutQuery) ( PaymentRequestedInfo) {
	.Flags.Set(0)
	.Info = 
}

// GetInfo returns value of Info conditional field and
// boolean which is true if field was set.
func ( *UpdateBotPrecheckoutQuery) () ( PaymentRequestedInfo,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Info, true
}

// SetShippingOptionID sets value of ShippingOptionID conditional field.
func ( *UpdateBotPrecheckoutQuery) ( string) {
	.Flags.Set(1)
	.ShippingOptionID = 
}

// GetShippingOptionID returns value of ShippingOptionID conditional field and
// boolean which is true if field was set.
func ( *UpdateBotPrecheckoutQuery) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .ShippingOptionID, true
}

// GetCurrency returns value of Currency field.
func ( *UpdateBotPrecheckoutQuery) () ( string) {
	if  == nil {
		return
	}
	return .Currency
}

// GetTotalAmount returns value of TotalAmount field.
func ( *UpdateBotPrecheckoutQuery) () ( int64) {
	if  == nil {
		return
	}
	return .TotalAmount
}

// UpdatePhoneCall represents TL type `updatePhoneCall#ab0f6b1e`.
// An incoming phone call
//
// See https://core.telegram.org/constructor/updatePhoneCall for reference.
type UpdatePhoneCall struct {
	// Phone call
	PhoneCall PhoneCallClass
}

// UpdatePhoneCallTypeID is TL type id of UpdatePhoneCall.
const UpdatePhoneCallTypeID = 0xab0f6b1e

// construct implements constructor of UpdateClass.
func ( UpdatePhoneCall) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePhoneCall{}
)

func ( *UpdatePhoneCall) () bool {
	if  == nil {
		return true
	}
	if !(.PhoneCall == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePhoneCall from given interface.
func ( *UpdatePhoneCall) ( interface {
	() ( PhoneCallClass)
}) {
	.PhoneCall = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePhoneCall) () tdp.Type {
	 := tdp.Type{
		Name: "updatePhoneCall",
		ID:   UpdatePhoneCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PhoneCall",
			SchemaName: "phone_call",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatePhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePhoneCall#ab0f6b1e as nil")
	}
	.PutID(UpdatePhoneCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePhoneCall#ab0f6b1e as nil")
	}
	if .PhoneCall == nil {
		return fmt.Errorf("unable to encode updatePhoneCall#ab0f6b1e: field phone_call is nil")
	}
	if  := .PhoneCall.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePhoneCall#ab0f6b1e: field phone_call: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePhoneCall#ab0f6b1e to nil")
	}
	{
		,  := DecodePhoneCall()
		if  != nil {
			return fmt.Errorf("unable to decode updatePhoneCall#ab0f6b1e: field phone_call: %w", )
		}
		.PhoneCall = 
	}
	return nil
}

// GetPhoneCall returns value of PhoneCall field.
func ( *UpdatePhoneCall) () ( PhoneCallClass) {
	if  == nil {
		return
	}
	return .PhoneCall
}

// UpdateLangPackTooLong represents TL type `updateLangPackTooLong#46560264`.
// A language pack has changed, the client should manually fetch the changed strings
// using langpack.getDifference¹
//
// Links:
//  1. https://core.telegram.org/method/langpack.getDifference
//
// See https://core.telegram.org/constructor/updateLangPackTooLong for reference.
type UpdateLangPackTooLong struct {
	// Language code
	LangCode string
}

// UpdateLangPackTooLongTypeID is TL type id of UpdateLangPackTooLong.
const UpdateLangPackTooLongTypeID = 0x46560264

// construct implements constructor of UpdateClass.
func ( UpdateLangPackTooLong) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateLangPackTooLong{}
)

func ( *UpdateLangPackTooLong) () bool {
	if  == nil {
		return true
	}
	if !(.LangCode == "") {
		return false
	}

	return true
}

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

// FillFrom fills UpdateLangPackTooLong from given interface.
func ( *UpdateLangPackTooLong) ( interface {
	() ( string)
}) {
	.LangCode = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateLangPackTooLong) () tdp.Type {
	 := tdp.Type{
		Name: "updateLangPackTooLong",
		ID:   UpdateLangPackTooLongTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "LangCode",
			SchemaName: "lang_code",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateLangPackTooLong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateLangPackTooLong#46560264 as nil")
	}
	.PutID(UpdateLangPackTooLongTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateLangPackTooLong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateLangPackTooLong#46560264 as nil")
	}
	.PutString(.LangCode)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateLangPackTooLong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateLangPackTooLong#46560264 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateLangPackTooLong#46560264: field lang_code: %w", )
		}
		.LangCode = 
	}
	return nil
}

// GetLangCode returns value of LangCode field.
func ( *UpdateLangPackTooLong) () ( string) {
	if  == nil {
		return
	}
	return .LangCode
}

// UpdateLangPack represents TL type `updateLangPack#56022f4d`.
// Language pack updated
//
// See https://core.telegram.org/constructor/updateLangPack for reference.
type UpdateLangPack struct {
	// Changed strings
	Difference LangPackDifference
}

// UpdateLangPackTypeID is TL type id of UpdateLangPack.
const UpdateLangPackTypeID = 0x56022f4d

// construct implements constructor of UpdateClass.
func ( UpdateLangPack) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateLangPack{}
)

func ( *UpdateLangPack) () bool {
	if  == nil {
		return true
	}
	if !(.Difference.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateLangPack from given interface.
func ( *UpdateLangPack) ( interface {
	() ( LangPackDifference)
}) {
	.Difference = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateLangPack) () tdp.Type {
	 := tdp.Type{
		Name: "updateLangPack",
		ID:   UpdateLangPackTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Difference",
			SchemaName: "difference",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateLangPack) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateLangPack#56022f4d as nil")
	}
	.PutID(UpdateLangPackTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateLangPack) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateLangPack#56022f4d as nil")
	}
	if  := .Difference.Encode();  != nil {
		return fmt.Errorf("unable to encode updateLangPack#56022f4d: field difference: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateLangPack) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateLangPack#56022f4d to nil")
	}
	{
		if  := .Difference.Decode();  != nil {
			return fmt.Errorf("unable to decode updateLangPack#56022f4d: field difference: %w", )
		}
	}
	return nil
}

// GetDifference returns value of Difference field.
func ( *UpdateLangPack) () ( LangPackDifference) {
	if  == nil {
		return
	}
	return .Difference
}

// UpdateFavedStickers represents TL type `updateFavedStickers#e511996d`.
// The list of favorited stickers was changed, the client should call messages
// getFavedStickers¹ to refetch the new list
//
// Links:
//  1. https://core.telegram.org/method/messages.getFavedStickers
//
// See https://core.telegram.org/constructor/updateFavedStickers for reference.
type UpdateFavedStickers struct {
}

// UpdateFavedStickersTypeID is TL type id of UpdateFavedStickers.
const UpdateFavedStickersTypeID = 0xe511996d

// construct implements constructor of UpdateClass.
func ( UpdateFavedStickers) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateFavedStickers{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateFavedStickers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateFavedStickers#e511996d as nil")
	}
	.PutID(UpdateFavedStickersTypeID)
	return .EncodeBare()
}

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

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

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

// UpdateChannelReadMessagesContents represents TL type `updateChannelReadMessagesContents#25f324f7`.
// The specified channel/supergroup¹ messages were read (emitted specifically for
// messages like voice messages or video, only once the media is watched and marked as
// read using channels.readMessageContents²)
//
// Links:
//  1. https://core.telegram.org/api/channel
//  2. https://core.telegram.org/method/channels.readMessageContents
//
// See https://core.telegram.org/constructor/updateChannelReadMessagesContents for reference.
type UpdateChannelReadMessagesContents struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Channel/supergroup¹ ID
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	ChannelID int64
	// Forum topic ID¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/forum#forum-topics
	//
	// Use SetTopMsgID and GetTopMsgID helpers.
	TopMsgID int
	// If set, the messages were read within the specified monoforum topic »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/monoforum
	//
	// Use SetSavedPeerID and GetSavedPeerID helpers.
	SavedPeerID PeerClass
	// IDs of messages that were read
	Messages []int
}

// UpdateChannelReadMessagesContentsTypeID is TL type id of UpdateChannelReadMessagesContents.
const UpdateChannelReadMessagesContentsTypeID = 0x25f324f7

// construct implements constructor of UpdateClass.
func ( UpdateChannelReadMessagesContents) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelReadMessagesContents{}
)

func ( *UpdateChannelReadMessagesContents) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.SavedPeerID == nil) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelReadMessagesContents from given interface.
func ( *UpdateChannelReadMessagesContents) ( interface {
	() ( int64)
	() ( int,  bool)
	() ( PeerClass,  bool)
	() ( []int)
}) {
	.ChannelID = .()
	if ,  := .();  {
		.TopMsgID = 
	}

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

	.Messages = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelReadMessagesContents) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelReadMessagesContents",
		ID:   UpdateChannelReadMessagesContentsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "SavedPeerID",
			SchemaName: "saved_peer_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateChannelReadMessagesContents) () {
	if !(.TopMsgID == 0) {
		.Flags.Set(0)
	}
	if !(.SavedPeerID == nil) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateChannelReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelReadMessagesContents#25f324f7 as nil")
	}
	.PutID(UpdateChannelReadMessagesContentsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelReadMessagesContents#25f324f7 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChannelReadMessagesContents#25f324f7: field flags: %w", )
	}
	.PutLong(.ChannelID)
	if .Flags.Has(0) {
		.PutInt(.TopMsgID)
	}
	if .Flags.Has(1) {
		if .SavedPeerID == nil {
			return fmt.Errorf("unable to encode updateChannelReadMessagesContents#25f324f7: field saved_peer_id is nil")
		}
		if  := .SavedPeerID.Encode();  != nil {
			return fmt.Errorf("unable to encode updateChannelReadMessagesContents#25f324f7: field saved_peer_id: %w", )
		}
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelReadMessagesContents#25f324f7 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#25f324f7: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#25f324f7: field channel_id: %w", )
		}
		.ChannelID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#25f324f7: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	if .Flags.Has(1) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#25f324f7: field saved_peer_id: %w", )
		}
		.SavedPeerID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#25f324f7: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateChannelReadMessagesContents#25f324f7: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelReadMessagesContents) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// SetTopMsgID sets value of TopMsgID conditional field.
func ( *UpdateChannelReadMessagesContents) ( int) {
	.Flags.Set(0)
	.TopMsgID = 
}

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

// SetSavedPeerID sets value of SavedPeerID conditional field.
func ( *UpdateChannelReadMessagesContents) ( PeerClass) {
	.Flags.Set(1)
	.SavedPeerID = 
}

// GetSavedPeerID returns value of SavedPeerID conditional field and
// boolean which is true if field was set.
func ( *UpdateChannelReadMessagesContents) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .SavedPeerID, true
}

// GetMessages returns value of Messages field.
func ( *UpdateChannelReadMessagesContents) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

// UpdateContactsReset represents TL type `updateContactsReset#7084a7be`.
// All contacts were deleted
//
// See https://core.telegram.org/constructor/updateContactsReset for reference.
type UpdateContactsReset struct {
}

// UpdateContactsResetTypeID is TL type id of UpdateContactsReset.
const UpdateContactsResetTypeID = 0x7084a7be

// construct implements constructor of UpdateClass.
func ( UpdateContactsReset) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateContactsReset{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateContactsReset) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateContactsReset#7084a7be as nil")
	}
	.PutID(UpdateContactsResetTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateContactsReset) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateContactsReset#7084a7be as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateContactsReset) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateContactsReset#7084a7be to nil")
	}
	return nil
}

// UpdateChannelAvailableMessages represents TL type `updateChannelAvailableMessages#b23fc698`.
// The history of a channel/supergroup¹ was hidden.
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateChannelAvailableMessages for reference.
type UpdateChannelAvailableMessages struct {
	// Channel/supergroup ID
	ChannelID int64
	// Identifier of a maximum unavailable message in a channel due to hidden history.
	AvailableMinID int
}

// UpdateChannelAvailableMessagesTypeID is TL type id of UpdateChannelAvailableMessages.
const UpdateChannelAvailableMessagesTypeID = 0xb23fc698

// construct implements constructor of UpdateClass.
func ( UpdateChannelAvailableMessages) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelAvailableMessages{}
)

func ( *UpdateChannelAvailableMessages) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.AvailableMinID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelAvailableMessages from given interface.
func ( *UpdateChannelAvailableMessages) ( interface {
	() ( int64)
	() ( int)
}) {
	.ChannelID = .()
	.AvailableMinID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelAvailableMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelAvailableMessages",
		ID:   UpdateChannelAvailableMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "AvailableMinID",
			SchemaName: "available_min_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChannelAvailableMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelAvailableMessages#b23fc698 as nil")
	}
	.PutID(UpdateChannelAvailableMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelAvailableMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelAvailableMessages#b23fc698 as nil")
	}
	.PutLong(.ChannelID)
	.PutInt(.AvailableMinID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelAvailableMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelAvailableMessages#b23fc698 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelAvailableMessages#b23fc698: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelAvailableMessages#b23fc698: field available_min_id: %w", )
		}
		.AvailableMinID = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelAvailableMessages) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetAvailableMinID returns value of AvailableMinID field.
func ( *UpdateChannelAvailableMessages) () ( int) {
	if  == nil {
		return
	}
	return .AvailableMinID
}

// UpdateDialogUnreadMark represents TL type `updateDialogUnreadMark#b658f23e`.
// The manual unread mark of a chat was changed
//
// See https://core.telegram.org/constructor/updateDialogUnreadMark for reference.
type UpdateDialogUnreadMark struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Was the chat marked or unmarked as read
	Unread bool
	// The dialog
	Peer DialogPeerClass
	// If set, the mark is related to the specified monoforum topic ID »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/monoforum
	//
	// Use SetSavedPeerID and GetSavedPeerID helpers.
	SavedPeerID PeerClass
}

// UpdateDialogUnreadMarkTypeID is TL type id of UpdateDialogUnreadMark.
const UpdateDialogUnreadMarkTypeID = 0xb658f23e

// construct implements constructor of UpdateClass.
func ( UpdateDialogUnreadMark) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDialogUnreadMark{}
)

func ( *UpdateDialogUnreadMark) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Unread == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.SavedPeerID == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDialogUnreadMark from given interface.
func ( *UpdateDialogUnreadMark) ( interface {
	() ( bool)
	() ( DialogPeerClass)
	() ( PeerClass,  bool)
}) {
	.Unread = .()
	.Peer = .()
	if ,  := .();  {
		.SavedPeerID = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDialogUnreadMark) () tdp.Type {
	 := tdp.Type{
		Name: "updateDialogUnreadMark",
		ID:   UpdateDialogUnreadMarkTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Unread",
			SchemaName: "unread",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "SavedPeerID",
			SchemaName: "saved_peer_id",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateDialogUnreadMark) () {
	if !(.Unread == false) {
		.Flags.Set(0)
	}
	if !(.SavedPeerID == nil) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateDialogUnreadMark) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogUnreadMark#b658f23e as nil")
	}
	.PutID(UpdateDialogUnreadMarkTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDialogUnreadMark) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogUnreadMark#b658f23e as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDialogUnreadMark#b658f23e: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateDialogUnreadMark#b658f23e: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDialogUnreadMark#b658f23e: field peer: %w", )
	}
	if .Flags.Has(1) {
		if .SavedPeerID == nil {
			return fmt.Errorf("unable to encode updateDialogUnreadMark#b658f23e: field saved_peer_id is nil")
		}
		if  := .SavedPeerID.Encode();  != nil {
			return fmt.Errorf("unable to encode updateDialogUnreadMark#b658f23e: field saved_peer_id: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDialogUnreadMark) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDialogUnreadMark#b658f23e to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateDialogUnreadMark#b658f23e: field flags: %w", )
		}
	}
	.Unread = .Flags.Has(0)
	{
		,  := DecodeDialogPeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDialogUnreadMark#b658f23e: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(1) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDialogUnreadMark#b658f23e: field saved_peer_id: %w", )
		}
		.SavedPeerID = 
	}
	return nil
}

// SetUnread sets value of Unread conditional field.
func ( *UpdateDialogUnreadMark) ( bool) {
	if  {
		.Flags.Set(0)
		.Unread = true
	} else {
		.Flags.Unset(0)
		.Unread = false
	}
}

// GetUnread returns value of Unread conditional field.
func ( *UpdateDialogUnreadMark) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetPeer returns value of Peer field.
func ( *UpdateDialogUnreadMark) () ( DialogPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// SetSavedPeerID sets value of SavedPeerID conditional field.
func ( *UpdateDialogUnreadMark) ( PeerClass) {
	.Flags.Set(1)
	.SavedPeerID = 
}

// GetSavedPeerID returns value of SavedPeerID conditional field and
// boolean which is true if field was set.
func ( *UpdateDialogUnreadMark) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .SavedPeerID, true
}

// UpdateMessagePoll represents TL type `updateMessagePoll#d64c522b`.
// The results of a poll have changed
//
// See https://core.telegram.org/constructor/updateMessagePoll for reference.
type UpdateMessagePoll struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Peer field of UpdateMessagePoll.
	//
	// Use SetPeer and GetPeer helpers.
	Peer PeerClass
	// MsgID field of UpdateMessagePoll.
	//
	// Use SetMsgID and GetMsgID helpers.
	MsgID int
	// TopMsgID field of UpdateMessagePoll.
	//
	// Use SetTopMsgID and GetTopMsgID helpers.
	TopMsgID int
	// Poll ID
	PollID int64
	// If the server knows the client hasn't cached this poll yet, the poll itself
	//
	// Use SetPoll and GetPoll helpers.
	Poll Poll
	// New poll results
	Results PollResults
}

// UpdateMessagePollTypeID is TL type id of UpdateMessagePoll.
const UpdateMessagePollTypeID = 0xd64c522b

// construct implements constructor of UpdateClass.
func ( UpdateMessagePoll) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateMessagePoll{}
)

func ( *UpdateMessagePoll) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.PollID == 0) {
		return false
	}
	if !(.Poll.Zero()) {
		return false
	}
	if !(.Results.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateMessagePoll from given interface.
func ( *UpdateMessagePoll) ( interface {
	() ( PeerClass,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( int64)
	() ( Poll,  bool)
	() ( PollResults)
}) {
	if ,  := .();  {
		.Peer = 
	}

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

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

	.PollID = .()
	if ,  := .();  {
		.Poll = 
	}

	.Results = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateMessagePoll) () tdp.Type {
	 := tdp.Type{
		Name: "updateMessagePoll",
		ID:   UpdateMessagePollTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "PollID",
			SchemaName: "poll_id",
		},
		{
			Name:       "Poll",
			SchemaName: "poll",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Results",
			SchemaName: "results",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateMessagePoll) () {
	if !(.Peer == nil) {
		.Flags.Set(1)
	}
	if !(.MsgID == 0) {
		.Flags.Set(1)
	}
	if !(.TopMsgID == 0) {
		.Flags.Set(2)
	}
	if !(.Poll.Zero()) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateMessagePoll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessagePoll#d64c522b as nil")
	}
	.PutID(UpdateMessagePollTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessagePoll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessagePoll#d64c522b as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessagePoll#d64c522b: field flags: %w", )
	}
	if .Flags.Has(1) {
		if .Peer == nil {
			return fmt.Errorf("unable to encode updateMessagePoll#d64c522b: field peer is nil")
		}
		if  := .Peer.Encode();  != nil {
			return fmt.Errorf("unable to encode updateMessagePoll#d64c522b: field peer: %w", )
		}
	}
	if .Flags.Has(1) {
		.PutInt(.MsgID)
	}
	if .Flags.Has(2) {
		.PutInt(.TopMsgID)
	}
	.PutLong(.PollID)
	if .Flags.Has(0) {
		if  := .Poll.Encode();  != nil {
			return fmt.Errorf("unable to encode updateMessagePoll#d64c522b: field poll: %w", )
		}
	}
	if  := .Results.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessagePoll#d64c522b: field results: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessagePoll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessagePoll#d64c522b to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#d64c522b: field flags: %w", )
		}
	}
	if .Flags.Has(1) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#d64c522b: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#d64c522b: field msg_id: %w", )
		}
		.MsgID = 
	}
	if .Flags.Has(2) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#d64c522b: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#d64c522b: field poll_id: %w", )
		}
		.PollID = 
	}
	if .Flags.Has(0) {
		if  := .Poll.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#d64c522b: field poll: %w", )
		}
	}
	{
		if  := .Results.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#d64c522b: field results: %w", )
		}
	}
	return nil
}

// SetPeer sets value of Peer conditional field.
func ( *UpdateMessagePoll) ( PeerClass) {
	.Flags.Set(1)
	.Peer = 
}

// GetPeer returns value of Peer conditional field and
// boolean which is true if field was set.
func ( *UpdateMessagePoll) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Peer, true
}

// SetMsgID sets value of MsgID conditional field.
func ( *UpdateMessagePoll) ( int) {
	.Flags.Set(1)
	.MsgID = 
}

// GetMsgID returns value of MsgID conditional field and
// boolean which is true if field was set.
func ( *UpdateMessagePoll) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .MsgID, true
}

// SetTopMsgID sets value of TopMsgID conditional field.
func ( *UpdateMessagePoll) ( int) {
	.Flags.Set(2)
	.TopMsgID = 
}

// GetTopMsgID returns value of TopMsgID conditional field and
// boolean which is true if field was set.
func ( *UpdateMessagePoll) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .TopMsgID, true
}

// GetPollID returns value of PollID field.
func ( *UpdateMessagePoll) () ( int64) {
	if  == nil {
		return
	}
	return .PollID
}

// SetPoll sets value of Poll conditional field.
func ( *UpdateMessagePoll) ( Poll) {
	.Flags.Set(0)
	.Poll = 
}

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

// GetResults returns value of Results field.
func ( *UpdateMessagePoll) () ( PollResults) {
	if  == nil {
		return
	}
	return .Results
}

// UpdateChatDefaultBannedRights represents TL type `updateChatDefaultBannedRights#54c01850`.
// Default banned rights in a basic group¹ were updated
//
// Links:
//  1. https://core.telegram.org/api/channel#basic-groups
//
// See https://core.telegram.org/constructor/updateChatDefaultBannedRights for reference.
type UpdateChatDefaultBannedRights struct {
	// The chat
	Peer PeerClass
	// New default banned rights
	DefaultBannedRights ChatBannedRights
	// Used similarly to pts values to deduplicate/update outdated chat information as
	// specified here »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/peers#basic-group-updates
	Version int
}

// UpdateChatDefaultBannedRightsTypeID is TL type id of UpdateChatDefaultBannedRights.
const UpdateChatDefaultBannedRightsTypeID = 0x54c01850

// construct implements constructor of UpdateClass.
func ( UpdateChatDefaultBannedRights) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChatDefaultBannedRights{}
)

func ( *UpdateChatDefaultBannedRights) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.DefaultBannedRights.Zero()) {
		return false
	}
	if !(.Version == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChatDefaultBannedRights from given interface.
func ( *UpdateChatDefaultBannedRights) ( interface {
	() ( PeerClass)
	() ( ChatBannedRights)
	() ( int)
}) {
	.Peer = .()
	.DefaultBannedRights = .()
	.Version = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChatDefaultBannedRights) () tdp.Type {
	 := tdp.Type{
		Name: "updateChatDefaultBannedRights",
		ID:   UpdateChatDefaultBannedRightsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "DefaultBannedRights",
			SchemaName: "default_banned_rights",
		},
		{
			Name:       "Version",
			SchemaName: "version",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChatDefaultBannedRights) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatDefaultBannedRights#54c01850 as nil")
	}
	.PutID(UpdateChatDefaultBannedRightsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChatDefaultBannedRights) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatDefaultBannedRights#54c01850 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateChatDefaultBannedRights#54c01850: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChatDefaultBannedRights#54c01850: field peer: %w", )
	}
	if  := .DefaultBannedRights.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChatDefaultBannedRights#54c01850: field default_banned_rights: %w", )
	}
	.PutInt(.Version)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChatDefaultBannedRights) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatDefaultBannedRights#54c01850 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatDefaultBannedRights#54c01850: field peer: %w", )
		}
		.Peer = 
	}
	{
		if  := .DefaultBannedRights.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChatDefaultBannedRights#54c01850: field default_banned_rights: %w", )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatDefaultBannedRights#54c01850: field version: %w", )
		}
		.Version = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateChatDefaultBannedRights) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetDefaultBannedRights returns value of DefaultBannedRights field.
func ( *UpdateChatDefaultBannedRights) () ( ChatBannedRights) {
	if  == nil {
		return
	}
	return .DefaultBannedRights
}

// GetVersion returns value of Version field.
func ( *UpdateChatDefaultBannedRights) () ( int) {
	if  == nil {
		return
	}
	return .Version
}

// UpdateFolderPeers represents TL type `updateFolderPeers#19360dc0`.
// The peer list of a peer folder¹ was updated
//
// Links:
//  1. https://core.telegram.org/api/folders#peer-folders
//
// See https://core.telegram.org/constructor/updateFolderPeers for reference.
type UpdateFolderPeers struct {
	// New peer list
	FolderPeers []FolderPeer
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdateFolderPeersTypeID is TL type id of UpdateFolderPeers.
const UpdateFolderPeersTypeID = 0x19360dc0

// construct implements constructor of UpdateClass.
func ( UpdateFolderPeers) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateFolderPeers{}
)

func ( *UpdateFolderPeers) () bool {
	if  == nil {
		return true
	}
	if !(.FolderPeers == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateFolderPeers from given interface.
func ( *UpdateFolderPeers) ( interface {
	() ( []FolderPeer)
	() ( int)
	() ( int)
}) {
	.FolderPeers = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateFolderPeers) () tdp.Type {
	 := tdp.Type{
		Name: "updateFolderPeers",
		ID:   UpdateFolderPeersTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "FolderPeers",
			SchemaName: "folder_peers",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateFolderPeers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateFolderPeers#19360dc0 as nil")
	}
	.PutID(UpdateFolderPeersTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateFolderPeers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateFolderPeers#19360dc0 as nil")
	}
	.PutVectorHeader(len(.FolderPeers))
	for ,  := range .FolderPeers {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateFolderPeers#19360dc0: field folder_peers element with index %d: %w", , )
		}
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateFolderPeers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateFolderPeers#19360dc0 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateFolderPeers#19360dc0: field folder_peers: %w", )
		}

		if  > 0 {
			.FolderPeers = make([]FolderPeer, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  FolderPeer
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode updateFolderPeers#19360dc0: field folder_peers: %w", )
			}
			.FolderPeers = append(.FolderPeers, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateFolderPeers#19360dc0: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateFolderPeers#19360dc0: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// GetFolderPeers returns value of FolderPeers field.
func ( *UpdateFolderPeers) () ( []FolderPeer) {
	if  == nil {
		return
	}
	return .FolderPeers
}

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

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

// UpdatePeerSettings represents TL type `updatePeerSettings#6a7e7366`.
// Settings of a certain peer have changed
//
// See https://core.telegram.org/constructor/updatePeerSettings for reference.
type UpdatePeerSettings struct {
	// The peer
	Peer PeerClass
	// Associated peer settings
	Settings PeerSettings
}

// UpdatePeerSettingsTypeID is TL type id of UpdatePeerSettings.
const UpdatePeerSettingsTypeID = 0x6a7e7366

// construct implements constructor of UpdateClass.
func ( UpdatePeerSettings) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePeerSettings{}
)

func ( *UpdatePeerSettings) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Settings.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePeerSettings from given interface.
func ( *UpdatePeerSettings) ( interface {
	() ( PeerClass)
	() ( PeerSettings)
}) {
	.Peer = .()
	.Settings = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePeerSettings) () tdp.Type {
	 := tdp.Type{
		Name: "updatePeerSettings",
		ID:   UpdatePeerSettingsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Settings",
			SchemaName: "settings",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatePeerSettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerSettings#6a7e7366 as nil")
	}
	.PutID(UpdatePeerSettingsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePeerSettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerSettings#6a7e7366 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updatePeerSettings#6a7e7366: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePeerSettings#6a7e7366: field peer: %w", )
	}
	if  := .Settings.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePeerSettings#6a7e7366: field settings: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePeerSettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePeerSettings#6a7e7366 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updatePeerSettings#6a7e7366: field peer: %w", )
		}
		.Peer = 
	}
	{
		if  := .Settings.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePeerSettings#6a7e7366: field settings: %w", )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdatePeerSettings) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetSettings returns value of Settings field.
func ( *UpdatePeerSettings) () ( PeerSettings) {
	if  == nil {
		return
	}
	return .Settings
}

// UpdatePeerLocated represents TL type `updatePeerLocated#b4afcfb0`.
// List of peers near you was updated
//
// See https://core.telegram.org/constructor/updatePeerLocated for reference.
type UpdatePeerLocated struct {
	// Geolocated peer list update
	Peers []PeerLocatedClass
}

// UpdatePeerLocatedTypeID is TL type id of UpdatePeerLocated.
const UpdatePeerLocatedTypeID = 0xb4afcfb0

// construct implements constructor of UpdateClass.
func ( UpdatePeerLocated) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePeerLocated{}
)

func ( *UpdatePeerLocated) () bool {
	if  == nil {
		return true
	}
	if !(.Peers == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePeerLocated from given interface.
func ( *UpdatePeerLocated) ( interface {
	() ( []PeerLocatedClass)
}) {
	.Peers = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePeerLocated) () tdp.Type {
	 := tdp.Type{
		Name: "updatePeerLocated",
		ID:   UpdatePeerLocatedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peers",
			SchemaName: "peers",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatePeerLocated) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerLocated#b4afcfb0 as nil")
	}
	.PutID(UpdatePeerLocatedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePeerLocated) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerLocated#b4afcfb0 as nil")
	}
	.PutVectorHeader(len(.Peers))
	for ,  := range .Peers {
		if  == nil {
			return fmt.Errorf("unable to encode updatePeerLocated#b4afcfb0: field peers element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updatePeerLocated#b4afcfb0: field peers element with index %d: %w", , )
		}
	}
	return nil
}

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

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

		if  > 0 {
			.Peers = make([]PeerLocatedClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePeerLocated()
			if  != nil {
				return fmt.Errorf("unable to decode updatePeerLocated#b4afcfb0: field peers: %w", )
			}
			.Peers = append(.Peers, )
		}
	}
	return nil
}

// GetPeers returns value of Peers field.
func ( *UpdatePeerLocated) () ( []PeerLocatedClass) {
	if  == nil {
		return
	}
	return .Peers
}

// MapPeers returns field Peers wrapped in PeerLocatedClassArray helper.
func ( *UpdatePeerLocated) () ( PeerLocatedClassArray) {
	return PeerLocatedClassArray(.Peers)
}

// UpdateNewScheduledMessage represents TL type `updateNewScheduledMessage#39a51dfb`.
// A message was added to the schedule queue of a chat¹
//
// Links:
//  1. https://core.telegram.org/api/scheduled-messages
//
// See https://core.telegram.org/constructor/updateNewScheduledMessage for reference.
type UpdateNewScheduledMessage struct {
	// Message
	Message MessageClass
}

// UpdateNewScheduledMessageTypeID is TL type id of UpdateNewScheduledMessage.
const UpdateNewScheduledMessageTypeID = 0x39a51dfb

// construct implements constructor of UpdateClass.
func ( UpdateNewScheduledMessage) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateNewScheduledMessage{}
)

func ( *UpdateNewScheduledMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Message == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateNewScheduledMessage from given interface.
func ( *UpdateNewScheduledMessage) ( interface {
	() ( MessageClass)
}) {
	.Message = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateNewScheduledMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewScheduledMessage",
		ID:   UpdateNewScheduledMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Message",
			SchemaName: "message",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateNewScheduledMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewScheduledMessage#39a51dfb as nil")
	}
	.PutID(UpdateNewScheduledMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewScheduledMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewScheduledMessage#39a51dfb as nil")
	}
	if .Message == nil {
		return fmt.Errorf("unable to encode updateNewScheduledMessage#39a51dfb: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewScheduledMessage#39a51dfb: field message: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewScheduledMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewScheduledMessage#39a51dfb to nil")
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewScheduledMessage#39a51dfb: field message: %w", )
		}
		.Message = 
	}
	return nil
}

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

// UpdateDeleteScheduledMessages represents TL type `updateDeleteScheduledMessages#f2a71983`.
// Some scheduled messages¹ were deleted (or sent) from the schedule queue of a chat
//
// Links:
//  1. https://core.telegram.org/api/scheduled-messages
//
// See https://core.telegram.org/constructor/updateDeleteScheduledMessages for reference.
type UpdateDeleteScheduledMessages struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Peer
	Peer PeerClass
	// Deleted scheduled messages
	Messages []int
	// If set, this update indicates that some scheduled messages were sent (not simply
	// deleted from the schedule queue).  In this case, the messages field will contain the
	// scheduled message IDs for the sent messages (initially returned in
	// updateNewScheduledMessage¹), and sent_messages will contain the real message IDs for
	// the sent messages.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/updateNewScheduledMessage
	//
	// Use SetSentMessages and GetSentMessages helpers.
	SentMessages []int
}

// UpdateDeleteScheduledMessagesTypeID is TL type id of UpdateDeleteScheduledMessages.
const UpdateDeleteScheduledMessagesTypeID = 0xf2a71983

// construct implements constructor of UpdateClass.
func ( UpdateDeleteScheduledMessages) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDeleteScheduledMessages{}
)

func ( *UpdateDeleteScheduledMessages) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.SentMessages == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDeleteScheduledMessages from given interface.
func ( *UpdateDeleteScheduledMessages) ( interface {
	() ( PeerClass)
	() ( []int)
	() ( []int,  bool)
}) {
	.Peer = .()
	.Messages = .()
	if ,  := .();  {
		.SentMessages = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDeleteScheduledMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updateDeleteScheduledMessages",
		ID:   UpdateDeleteScheduledMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "SentMessages",
			SchemaName: "sent_messages",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateDeleteScheduledMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteScheduledMessages#f2a71983 as nil")
	}
	.PutID(UpdateDeleteScheduledMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDeleteScheduledMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteScheduledMessages#f2a71983 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDeleteScheduledMessages#f2a71983: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateDeleteScheduledMessages#f2a71983: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDeleteScheduledMessages#f2a71983: field peer: %w", )
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	if .Flags.Has(0) {
		.PutVectorHeader(len(.SentMessages))
		for ,  := range .SentMessages {
			.PutInt()
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDeleteScheduledMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteScheduledMessages#f2a71983 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateDeleteScheduledMessages#f2a71983: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteScheduledMessages#f2a71983: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteScheduledMessages#f2a71983: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateDeleteScheduledMessages#f2a71983: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	if .Flags.Has(0) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteScheduledMessages#f2a71983: field sent_messages: %w", )
		}

		if  > 0 {
			.SentMessages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateDeleteScheduledMessages#f2a71983: field sent_messages: %w", )
			}
			.SentMessages = append(.SentMessages, )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateDeleteScheduledMessages) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMessages returns value of Messages field.
func ( *UpdateDeleteScheduledMessages) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

// SetSentMessages sets value of SentMessages conditional field.
func ( *UpdateDeleteScheduledMessages) ( []int) {
	.Flags.Set(0)
	.SentMessages = 
}

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

// UpdateTheme represents TL type `updateTheme#8216fba3`.
// A cloud theme was updated
//
// See https://core.telegram.org/constructor/updateTheme for reference.
type UpdateTheme struct {
	// Theme
	Theme Theme
}

// UpdateThemeTypeID is TL type id of UpdateTheme.
const UpdateThemeTypeID = 0x8216fba3

// construct implements constructor of UpdateClass.
func ( UpdateTheme) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateTheme{}
)

func ( *UpdateTheme) () bool {
	if  == nil {
		return true
	}
	if !(.Theme.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateTheme from given interface.
func ( *UpdateTheme) ( interface {
	() ( Theme)
}) {
	.Theme = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateTheme) () tdp.Type {
	 := tdp.Type{
		Name: "updateTheme",
		ID:   UpdateThemeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Theme",
			SchemaName: "theme",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateTheme#8216fba3 as nil")
	}
	.PutID(UpdateThemeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateTheme#8216fba3 as nil")
	}
	if  := .Theme.Encode();  != nil {
		return fmt.Errorf("unable to encode updateTheme#8216fba3: field theme: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateTheme#8216fba3 to nil")
	}
	{
		if  := .Theme.Decode();  != nil {
			return fmt.Errorf("unable to decode updateTheme#8216fba3: field theme: %w", )
		}
	}
	return nil
}

// GetTheme returns value of Theme field.
func ( *UpdateTheme) () ( Theme) {
	if  == nil {
		return
	}
	return .Theme
}

// UpdateGeoLiveViewed represents TL type `updateGeoLiveViewed#871fb939`.
// Live geoposition message was viewed
//
// See https://core.telegram.org/constructor/updateGeoLiveViewed for reference.
type UpdateGeoLiveViewed struct {
	// The user that viewed the live geoposition
	Peer PeerClass
	// Message ID of geoposition message
	MsgID int
}

// UpdateGeoLiveViewedTypeID is TL type id of UpdateGeoLiveViewed.
const UpdateGeoLiveViewedTypeID = 0x871fb939

// construct implements constructor of UpdateClass.
func ( UpdateGeoLiveViewed) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateGeoLiveViewed{}
)

func ( *UpdateGeoLiveViewed) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateGeoLiveViewed from given interface.
func ( *UpdateGeoLiveViewed) ( interface {
	() ( PeerClass)
	() ( int)
}) {
	.Peer = .()
	.MsgID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateGeoLiveViewed) () tdp.Type {
	 := tdp.Type{
		Name: "updateGeoLiveViewed",
		ID:   UpdateGeoLiveViewedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateGeoLiveViewed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGeoLiveViewed#871fb939 as nil")
	}
	.PutID(UpdateGeoLiveViewedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGeoLiveViewed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGeoLiveViewed#871fb939 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateGeoLiveViewed#871fb939: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGeoLiveViewed#871fb939: field peer: %w", )
	}
	.PutInt(.MsgID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateGeoLiveViewed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGeoLiveViewed#871fb939 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateGeoLiveViewed#871fb939: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateGeoLiveViewed#871fb939: field msg_id: %w", )
		}
		.MsgID = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateGeoLiveViewed) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMsgID returns value of MsgID field.
func ( *UpdateGeoLiveViewed) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

// UpdateLoginToken represents TL type `updateLoginToken#564fe691`.
// A login token (for login via QR code) was accepted.
//
// See https://core.telegram.org/constructor/updateLoginToken for reference.
type UpdateLoginToken struct {
}

// UpdateLoginTokenTypeID is TL type id of UpdateLoginToken.
const UpdateLoginTokenTypeID = 0x564fe691

// construct implements constructor of UpdateClass.
func ( UpdateLoginToken) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateLoginToken{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateLoginToken) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateLoginToken#564fe691 as nil")
	}
	.PutID(UpdateLoginTokenTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateLoginToken) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateLoginToken#564fe691 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateLoginToken) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateLoginToken#564fe691 to nil")
	}
	return nil
}

// UpdateMessagePollVote represents TL type `updateMessagePollVote#7699f014`.
// A specific peer has voted in a poll
//
// See https://core.telegram.org/constructor/updateMessagePollVote for reference.
type UpdateMessagePollVote struct {
	// Poll ID
	PollID int64
	// The peer that voted in the poll
	Peer PeerClass
	// Chosen option(s)
	Options [][]byte
	// Positions field of UpdateMessagePollVote.
	Positions []int
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateMessagePollVoteTypeID is TL type id of UpdateMessagePollVote.
const UpdateMessagePollVoteTypeID = 0x7699f014

// construct implements constructor of UpdateClass.
func ( UpdateMessagePollVote) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateMessagePollVote{}
)

func ( *UpdateMessagePollVote) () bool {
	if  == nil {
		return true
	}
	if !(.PollID == 0) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Options == nil) {
		return false
	}
	if !(.Positions == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateMessagePollVote from given interface.
func ( *UpdateMessagePollVote) ( interface {
	() ( int64)
	() ( PeerClass)
	() ( [][]byte)
	() ( []int)
	() ( int)
}) {
	.PollID = .()
	.Peer = .()
	.Options = .()
	.Positions = .()
	.Qts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateMessagePollVote) () tdp.Type {
	 := tdp.Type{
		Name: "updateMessagePollVote",
		ID:   UpdateMessagePollVoteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PollID",
			SchemaName: "poll_id",
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Options",
			SchemaName: "options",
		},
		{
			Name:       "Positions",
			SchemaName: "positions",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateMessagePollVote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessagePollVote#7699f014 as nil")
	}
	.PutID(UpdateMessagePollVoteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessagePollVote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessagePollVote#7699f014 as nil")
	}
	.PutLong(.PollID)
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateMessagePollVote#7699f014: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessagePollVote#7699f014: field peer: %w", )
	}
	.PutVectorHeader(len(.Options))
	for ,  := range .Options {
		.PutBytes()
	}
	.PutVectorHeader(len(.Positions))
	for ,  := range .Positions {
		.PutInt()
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessagePollVote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessagePollVote#7699f014 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#7699f014: field poll_id: %w", )
		}
		.PollID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#7699f014: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#7699f014: field options: %w", )
		}

		if  > 0 {
			.Options = make([][]byte, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Bytes()
			if  != nil {
				return fmt.Errorf("unable to decode updateMessagePollVote#7699f014: field options: %w", )
			}
			.Options = append(.Options, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#7699f014: field positions: %w", )
		}

		if  > 0 {
			.Positions = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateMessagePollVote#7699f014: field positions: %w", )
			}
			.Positions = append(.Positions, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#7699f014: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetPollID returns value of PollID field.
func ( *UpdateMessagePollVote) () ( int64) {
	if  == nil {
		return
	}
	return .PollID
}

// GetPeer returns value of Peer field.
func ( *UpdateMessagePollVote) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetOptions returns value of Options field.
func ( *UpdateMessagePollVote) () ( [][]byte) {
	if  == nil {
		return
	}
	return .Options
}

// GetPositions returns value of Positions field.
func ( *UpdateMessagePollVote) () ( []int) {
	if  == nil {
		return
	}
	return .Positions
}

// GetQts returns value of Qts field.
func ( *UpdateMessagePollVote) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateDialogFilter represents TL type `updateDialogFilter#26ffde7d`.
// A new folder¹ was added
//
// Links:
//  1. https://core.telegram.org/api/folders
//
// See https://core.telegram.org/constructor/updateDialogFilter for reference.
type UpdateDialogFilter struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Folder¹ ID
	//
	// Links:
	//  1) https://core.telegram.org/api/folders
	ID int
	// Folder¹ info
	//
	// Links:
	//  1) https://core.telegram.org/api/folders
	//
	// Use SetFilter and GetFilter helpers.
	Filter DialogFilterClass
}

// UpdateDialogFilterTypeID is TL type id of UpdateDialogFilter.
const UpdateDialogFilterTypeID = 0x26ffde7d

// construct implements constructor of UpdateClass.
func ( UpdateDialogFilter) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDialogFilter{}
)

func ( *UpdateDialogFilter) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.Filter == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDialogFilter from given interface.
func ( *UpdateDialogFilter) ( interface {
	() ( int)
	() ( DialogFilterClass,  bool)
}) {
	.ID = .()
	if ,  := .();  {
		.Filter = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDialogFilter) () tdp.Type {
	 := tdp.Type{
		Name: "updateDialogFilter",
		ID:   UpdateDialogFilterTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "Filter",
			SchemaName: "filter",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateDialogFilter) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogFilter#26ffde7d as nil")
	}
	.PutID(UpdateDialogFilterTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDialogFilter) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogFilter#26ffde7d as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDialogFilter#26ffde7d: field flags: %w", )
	}
	.PutInt(.ID)
	if .Flags.Has(0) {
		if .Filter == nil {
			return fmt.Errorf("unable to encode updateDialogFilter#26ffde7d: field filter is nil")
		}
		if  := .Filter.Encode();  != nil {
			return fmt.Errorf("unable to encode updateDialogFilter#26ffde7d: field filter: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDialogFilter) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDialogFilter#26ffde7d to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateDialogFilter#26ffde7d: field flags: %w", )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDialogFilter#26ffde7d: field id: %w", )
		}
		.ID = 
	}
	if .Flags.Has(0) {
		,  := DecodeDialogFilter()
		if  != nil {
			return fmt.Errorf("unable to decode updateDialogFilter#26ffde7d: field filter: %w", )
		}
		.Filter = 
	}
	return nil
}

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

// SetFilter sets value of Filter conditional field.
func ( *UpdateDialogFilter) ( DialogFilterClass) {
	.Flags.Set(0)
	.Filter = 
}

// GetFilter returns value of Filter conditional field and
// boolean which is true if field was set.
func ( *UpdateDialogFilter) () ( DialogFilterClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Filter, true
}

// UpdateDialogFilterOrder represents TL type `updateDialogFilterOrder#a5d72105`.
// New folder¹ order
//
// Links:
//  1. https://core.telegram.org/api/folders
//
// See https://core.telegram.org/constructor/updateDialogFilterOrder for reference.
type UpdateDialogFilterOrder struct {
	// Ordered folder IDs¹
	//
	// Links:
	//  1) https://core.telegram.org/api/folders
	Order []int
}

// UpdateDialogFilterOrderTypeID is TL type id of UpdateDialogFilterOrder.
const UpdateDialogFilterOrderTypeID = 0xa5d72105

// construct implements constructor of UpdateClass.
func ( UpdateDialogFilterOrder) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDialogFilterOrder{}
)

func ( *UpdateDialogFilterOrder) () bool {
	if  == nil {
		return true
	}
	if !(.Order == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateDialogFilterOrder from given interface.
func ( *UpdateDialogFilterOrder) ( interface {
	() ( []int)
}) {
	.Order = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateDialogFilterOrder) () tdp.Type {
	 := tdp.Type{
		Name: "updateDialogFilterOrder",
		ID:   UpdateDialogFilterOrderTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Order",
			SchemaName: "order",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateDialogFilterOrder) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogFilterOrder#a5d72105 as nil")
	}
	.PutID(UpdateDialogFilterOrderTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDialogFilterOrder) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogFilterOrder#a5d72105 as nil")
	}
	.PutVectorHeader(len(.Order))
	for ,  := range .Order {
		.PutInt()
	}
	return nil
}

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

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

		if  > 0 {
			.Order = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateDialogFilterOrder#a5d72105: field order: %w", )
			}
			.Order = append(.Order, )
		}
	}
	return nil
}

// GetOrder returns value of Order field.
func ( *UpdateDialogFilterOrder) () ( []int) {
	if  == nil {
		return
	}
	return .Order
}

// UpdateDialogFilters represents TL type `updateDialogFilters#3504914f`.
// Clients should update folder¹ info
//
// Links:
//  1. https://core.telegram.org/api/folders
//
// See https://core.telegram.org/constructor/updateDialogFilters for reference.
type UpdateDialogFilters struct {
}

// UpdateDialogFiltersTypeID is TL type id of UpdateDialogFilters.
const UpdateDialogFiltersTypeID = 0x3504914f

// construct implements constructor of UpdateClass.
func ( UpdateDialogFilters) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateDialogFilters{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateDialogFilters) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogFilters#3504914f as nil")
	}
	.PutID(UpdateDialogFiltersTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDialogFilters) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogFilters#3504914f as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDialogFilters) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDialogFilters#3504914f to nil")
	}
	return nil
}

// UpdatePhoneCallSignalingData represents TL type `updatePhoneCallSignalingData#2661bf09`.
// Incoming phone call signaling payload
//
// See https://core.telegram.org/constructor/updatePhoneCallSignalingData for reference.
type UpdatePhoneCallSignalingData struct {
	// Phone call ID
	PhoneCallID int64
	// Signaling payload
	Data []byte
}

// UpdatePhoneCallSignalingDataTypeID is TL type id of UpdatePhoneCallSignalingData.
const UpdatePhoneCallSignalingDataTypeID = 0x2661bf09

// construct implements constructor of UpdateClass.
func ( UpdatePhoneCallSignalingData) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePhoneCallSignalingData{}
)

func ( *UpdatePhoneCallSignalingData) () bool {
	if  == nil {
		return true
	}
	if !(.PhoneCallID == 0) {
		return false
	}
	if !(.Data == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePhoneCallSignalingData from given interface.
func ( *UpdatePhoneCallSignalingData) ( interface {
	() ( int64)
	() ( []byte)
}) {
	.PhoneCallID = .()
	.Data = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePhoneCallSignalingData) () tdp.Type {
	 := tdp.Type{
		Name: "updatePhoneCallSignalingData",
		ID:   UpdatePhoneCallSignalingDataTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PhoneCallID",
			SchemaName: "phone_call_id",
		},
		{
			Name:       "Data",
			SchemaName: "data",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatePhoneCallSignalingData) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePhoneCallSignalingData#2661bf09 as nil")
	}
	.PutID(UpdatePhoneCallSignalingDataTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePhoneCallSignalingData) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePhoneCallSignalingData#2661bf09 as nil")
	}
	.PutLong(.PhoneCallID)
	.PutBytes(.Data)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePhoneCallSignalingData) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePhoneCallSignalingData#2661bf09 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updatePhoneCallSignalingData#2661bf09: field phone_call_id: %w", )
		}
		.PhoneCallID = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode updatePhoneCallSignalingData#2661bf09: field data: %w", )
		}
		.Data = 
	}
	return nil
}

// GetPhoneCallID returns value of PhoneCallID field.
func ( *UpdatePhoneCallSignalingData) () ( int64) {
	if  == nil {
		return
	}
	return .PhoneCallID
}

// GetData returns value of Data field.
func ( *UpdatePhoneCallSignalingData) () ( []byte) {
	if  == nil {
		return
	}
	return .Data
}

// UpdateChannelMessageForwards represents TL type `updateChannelMessageForwards#d29a27f4`.
// The forward counter of a message in a channel has changed
//
// See https://core.telegram.org/constructor/updateChannelMessageForwards for reference.
type UpdateChannelMessageForwards struct {
	// Channel ID
	ChannelID int64
	// ID of the message
	ID int
	// New forward counter
	Forwards int
}

// UpdateChannelMessageForwardsTypeID is TL type id of UpdateChannelMessageForwards.
const UpdateChannelMessageForwardsTypeID = 0xd29a27f4

// construct implements constructor of UpdateClass.
func ( UpdateChannelMessageForwards) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelMessageForwards{}
)

func ( *UpdateChannelMessageForwards) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.Forwards == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelMessageForwards from given interface.
func ( *UpdateChannelMessageForwards) ( interface {
	() ( int64)
	() ( int)
	() ( int)
}) {
	.ChannelID = .()
	.ID = .()
	.Forwards = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelMessageForwards) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelMessageForwards",
		ID:   UpdateChannelMessageForwardsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "Forwards",
			SchemaName: "forwards",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChannelMessageForwards) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelMessageForwards#d29a27f4 as nil")
	}
	.PutID(UpdateChannelMessageForwardsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelMessageForwards) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelMessageForwards#d29a27f4 as nil")
	}
	.PutLong(.ChannelID)
	.PutInt(.ID)
	.PutInt(.Forwards)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelMessageForwards) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelMessageForwards#d29a27f4 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelMessageForwards#d29a27f4: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelMessageForwards#d29a27f4: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelMessageForwards#d29a27f4: field forwards: %w", )
		}
		.Forwards = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelMessageForwards) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

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

// GetForwards returns value of Forwards field.
func ( *UpdateChannelMessageForwards) () ( int) {
	if  == nil {
		return
	}
	return .Forwards
}

// UpdateReadChannelDiscussionInbox represents TL type `updateReadChannelDiscussionInbox#d6b19546`.
// Incoming comments in a discussion thread¹ were marked as read
//
// Links:
//  1. https://core.telegram.org/api/threads
//
// See https://core.telegram.org/constructor/updateReadChannelDiscussionInbox for reference.
type UpdateReadChannelDiscussionInbox struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Discussion group ID¹
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	ChannelID int64
	// ID of the group message that started the thread¹ (message in linked discussion group)
	//
	// Links:
	//  1) https://core.telegram.org/api/threads
	TopMsgID int
	// Message ID of latest read incoming message for this thread¹
	//
	// Links:
	//  1) https://core.telegram.org/api/threads
	ReadMaxID int
	// If set, contains the ID of the channel¹ that contains the post that started the
	// comment thread² in the discussion group (channel_id)
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	//  2) https://core.telegram.org/api/threads
	//
	// Use SetBroadcastID and GetBroadcastID helpers.
	BroadcastID int64
	// If set, contains the ID of the channel post that started the comment thread¹
	//
	// Links:
	//  1) https://core.telegram.org/api/threads
	//
	// Use SetBroadcastPost and GetBroadcastPost helpers.
	BroadcastPost int
}

// UpdateReadChannelDiscussionInboxTypeID is TL type id of UpdateReadChannelDiscussionInbox.
const UpdateReadChannelDiscussionInboxTypeID = 0xd6b19546

// construct implements constructor of UpdateClass.
func ( UpdateReadChannelDiscussionInbox) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadChannelDiscussionInbox{}
)

func ( *UpdateReadChannelDiscussionInbox) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.ReadMaxID == 0) {
		return false
	}
	if !(.BroadcastID == 0) {
		return false
	}
	if !(.BroadcastPost == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateReadChannelDiscussionInbox from given interface.
func ( *UpdateReadChannelDiscussionInbox) ( interface {
	() ( int64)
	() ( int)
	() ( int)
	() ( int64,  bool)
	() ( int,  bool)
}) {
	.ChannelID = .()
	.TopMsgID = .()
	.ReadMaxID = .()
	if ,  := .();  {
		.BroadcastID = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateReadChannelDiscussionInbox) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadChannelDiscussionInbox",
		ID:   UpdateReadChannelDiscussionInboxTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
		},
		{
			Name:       "ReadMaxID",
			SchemaName: "read_max_id",
		},
		{
			Name:       "BroadcastID",
			SchemaName: "broadcast_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "BroadcastPost",
			SchemaName: "broadcast_post",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateReadChannelDiscussionInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadChannelDiscussionInbox#d6b19546 as nil")
	}
	.PutID(UpdateReadChannelDiscussionInboxTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadChannelDiscussionInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadChannelDiscussionInbox#d6b19546 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadChannelDiscussionInbox#d6b19546: field flags: %w", )
	}
	.PutLong(.ChannelID)
	.PutInt(.TopMsgID)
	.PutInt(.ReadMaxID)
	if .Flags.Has(0) {
		.PutLong(.BroadcastID)
	}
	if .Flags.Has(0) {
		.PutInt(.BroadcastPost)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadChannelDiscussionInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadChannelDiscussionInbox#d6b19546 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field read_max_id: %w", )
		}
		.ReadMaxID = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field broadcast_id: %w", )
		}
		.BroadcastID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionInbox#d6b19546: field broadcast_post: %w", )
		}
		.BroadcastPost = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateReadChannelDiscussionInbox) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetTopMsgID returns value of TopMsgID field.
func ( *UpdateReadChannelDiscussionInbox) () ( int) {
	if  == nil {
		return
	}
	return .TopMsgID
}

// GetReadMaxID returns value of ReadMaxID field.
func ( *UpdateReadChannelDiscussionInbox) () ( int) {
	if  == nil {
		return
	}
	return .ReadMaxID
}

// SetBroadcastID sets value of BroadcastID conditional field.
func ( *UpdateReadChannelDiscussionInbox) ( int64) {
	.Flags.Set(0)
	.BroadcastID = 
}

// GetBroadcastID returns value of BroadcastID conditional field and
// boolean which is true if field was set.
func ( *UpdateReadChannelDiscussionInbox) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .BroadcastID, true
}

// SetBroadcastPost sets value of BroadcastPost conditional field.
func ( *UpdateReadChannelDiscussionInbox) ( int) {
	.Flags.Set(0)
	.BroadcastPost = 
}

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

// UpdateReadChannelDiscussionOutbox represents TL type `updateReadChannelDiscussionOutbox#695c9e7c`.
// Outgoing comments in a discussion thread¹ were marked as read
//
// Links:
//  1. https://core.telegram.org/api/threads
//
// See https://core.telegram.org/constructor/updateReadChannelDiscussionOutbox for reference.
type UpdateReadChannelDiscussionOutbox struct {
	// Supergroup ID¹
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	ChannelID int64
	// ID of the group message that started the thread¹
	//
	// Links:
	//  1) https://core.telegram.org/api/threads
	TopMsgID int
	// Message ID of latest read outgoing message for this thread¹
	//
	// Links:
	//  1) https://core.telegram.org/api/threads
	ReadMaxID int
}

// UpdateReadChannelDiscussionOutboxTypeID is TL type id of UpdateReadChannelDiscussionOutbox.
const UpdateReadChannelDiscussionOutboxTypeID = 0x695c9e7c

// construct implements constructor of UpdateClass.
func ( UpdateReadChannelDiscussionOutbox) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadChannelDiscussionOutbox{}
)

func ( *UpdateReadChannelDiscussionOutbox) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.ReadMaxID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateReadChannelDiscussionOutbox from given interface.
func ( *UpdateReadChannelDiscussionOutbox) ( interface {
	() ( int64)
	() ( int)
	() ( int)
}) {
	.ChannelID = .()
	.TopMsgID = .()
	.ReadMaxID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateReadChannelDiscussionOutbox) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadChannelDiscussionOutbox",
		ID:   UpdateReadChannelDiscussionOutboxTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
		},
		{
			Name:       "ReadMaxID",
			SchemaName: "read_max_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateReadChannelDiscussionOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadChannelDiscussionOutbox#695c9e7c as nil")
	}
	.PutID(UpdateReadChannelDiscussionOutboxTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadChannelDiscussionOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadChannelDiscussionOutbox#695c9e7c as nil")
	}
	.PutLong(.ChannelID)
	.PutInt(.TopMsgID)
	.PutInt(.ReadMaxID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadChannelDiscussionOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadChannelDiscussionOutbox#695c9e7c to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field read_max_id: %w", )
		}
		.ReadMaxID = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateReadChannelDiscussionOutbox) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetTopMsgID returns value of TopMsgID field.
func ( *UpdateReadChannelDiscussionOutbox) () ( int) {
	if  == nil {
		return
	}
	return .TopMsgID
}

// GetReadMaxID returns value of ReadMaxID field.
func ( *UpdateReadChannelDiscussionOutbox) () ( int) {
	if  == nil {
		return
	}
	return .ReadMaxID
}

// UpdatePeerBlocked represents TL type `updatePeerBlocked#ebe07752`.
// We blocked a peer, see here »¹ for more info on blocklists.
//
// Links:
//  1. https://core.telegram.org/api/block
//
// See https://core.telegram.org/constructor/updatePeerBlocked for reference.
type UpdatePeerBlocked struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the peer was blocked or unblocked
	Blocked bool
	// Whether the peer was added/removed to/from the story blocklist; if not set, this
	// update affects the main blocklist, see here »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/block
	BlockedMyStoriesFrom bool
	// The (un)blocked peer
	PeerID PeerClass
}

// UpdatePeerBlockedTypeID is TL type id of UpdatePeerBlocked.
const UpdatePeerBlockedTypeID = 0xebe07752

// construct implements constructor of UpdateClass.
func ( UpdatePeerBlocked) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePeerBlocked{}
)

func ( *UpdatePeerBlocked) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Blocked == false) {
		return false
	}
	if !(.BlockedMyStoriesFrom == false) {
		return false
	}
	if !(.PeerID == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePeerBlocked from given interface.
func ( *UpdatePeerBlocked) ( interface {
	() ( bool)
	() ( bool)
	() ( PeerClass)
}) {
	.Blocked = .()
	.BlockedMyStoriesFrom = .()
	.PeerID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePeerBlocked) () tdp.Type {
	 := tdp.Type{
		Name: "updatePeerBlocked",
		ID:   UpdatePeerBlockedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Blocked",
			SchemaName: "blocked",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "BlockedMyStoriesFrom",
			SchemaName: "blocked_my_stories_from",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "PeerID",
			SchemaName: "peer_id",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdatePeerBlocked) () {
	if !(.Blocked == false) {
		.Flags.Set(0)
	}
	if !(.BlockedMyStoriesFrom == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdatePeerBlocked) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerBlocked#ebe07752 as nil")
	}
	.PutID(UpdatePeerBlockedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePeerBlocked) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerBlocked#ebe07752 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePeerBlocked#ebe07752: field flags: %w", )
	}
	if .PeerID == nil {
		return fmt.Errorf("unable to encode updatePeerBlocked#ebe07752: field peer_id is nil")
	}
	if  := .PeerID.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePeerBlocked#ebe07752: field peer_id: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePeerBlocked) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePeerBlocked#ebe07752 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePeerBlocked#ebe07752: field flags: %w", )
		}
	}
	.Blocked = .Flags.Has(0)
	.BlockedMyStoriesFrom = .Flags.Has(1)
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updatePeerBlocked#ebe07752: field peer_id: %w", )
		}
		.PeerID = 
	}
	return nil
}

// SetBlocked sets value of Blocked conditional field.
func ( *UpdatePeerBlocked) ( bool) {
	if  {
		.Flags.Set(0)
		.Blocked = true
	} else {
		.Flags.Unset(0)
		.Blocked = false
	}
}

// GetBlocked returns value of Blocked conditional field.
func ( *UpdatePeerBlocked) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetBlockedMyStoriesFrom sets value of BlockedMyStoriesFrom conditional field.
func ( *UpdatePeerBlocked) ( bool) {
	if  {
		.Flags.Set(1)
		.BlockedMyStoriesFrom = true
	} else {
		.Flags.Unset(1)
		.BlockedMyStoriesFrom = false
	}
}

// GetBlockedMyStoriesFrom returns value of BlockedMyStoriesFrom conditional field.
func ( *UpdatePeerBlocked) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetPeerID returns value of PeerID field.
func ( *UpdatePeerBlocked) () ( PeerClass) {
	if  == nil {
		return
	}
	return .PeerID
}

// UpdateChannelUserTyping represents TL type `updateChannelUserTyping#8c88c923`.
// A user is typing in a supergroup, channel¹ or message thread²
//
// Links:
//  1. https://core.telegram.org/api/channel
//  2. https://core.telegram.org/api/threads
//
// See https://core.telegram.org/constructor/updateChannelUserTyping for reference.
type UpdateChannelUserTyping struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Channel ID
	ChannelID int64
	// Thread ID¹
	//
	// Links:
	//  1) https://core.telegram.org/api/threads
	//
	// Use SetTopMsgID and GetTopMsgID helpers.
	TopMsgID int
	// The peer that is typing
	FromID PeerClass
	// Whether the user is typing, sending a media or doing something else
	Action SendMessageActionClass
}

// UpdateChannelUserTypingTypeID is TL type id of UpdateChannelUserTyping.
const UpdateChannelUserTypingTypeID = 0x8c88c923

// construct implements constructor of UpdateClass.
func ( UpdateChannelUserTyping) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelUserTyping{}
)

func ( *UpdateChannelUserTyping) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.FromID == nil) {
		return false
	}
	if !(.Action == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelUserTyping from given interface.
func ( *UpdateChannelUserTyping) ( interface {
	() ( int64)
	() ( int,  bool)
	() ( PeerClass)
	() ( SendMessageActionClass)
}) {
	.ChannelID = .()
	if ,  := .();  {
		.TopMsgID = 
	}

	.FromID = .()
	.Action = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelUserTyping) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelUserTyping",
		ID:   UpdateChannelUserTypingTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "FromID",
			SchemaName: "from_id",
		},
		{
			Name:       "Action",
			SchemaName: "action",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateChannelUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelUserTyping#8c88c923 as nil")
	}
	.PutID(UpdateChannelUserTypingTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelUserTyping#8c88c923 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field flags: %w", )
	}
	.PutLong(.ChannelID)
	if .Flags.Has(0) {
		.PutInt(.TopMsgID)
	}
	if .FromID == nil {
		return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field from_id is nil")
	}
	if  := .FromID.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field from_id: %w", )
	}
	if .Action == nil {
		return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field action is nil")
	}
	if  := .Action.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChannelUserTyping#8c88c923: field action: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelUserTyping#8c88c923 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field channel_id: %w", )
		}
		.ChannelID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field from_id: %w", )
		}
		.FromID = 
	}
	{
		,  := DecodeSendMessageAction()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelUserTyping#8c88c923: field action: %w", )
		}
		.Action = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelUserTyping) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// SetTopMsgID sets value of TopMsgID conditional field.
func ( *UpdateChannelUserTyping) ( int) {
	.Flags.Set(0)
	.TopMsgID = 
}

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

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

// GetAction returns value of Action field.
func ( *UpdateChannelUserTyping) () ( SendMessageActionClass) {
	if  == nil {
		return
	}
	return .Action
}

// UpdatePinnedMessages represents TL type `updatePinnedMessages#ed85eab5`.
// Some messages were pinned in a chat
//
// See https://core.telegram.org/constructor/updatePinnedMessages for reference.
type UpdatePinnedMessages struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the messages were pinned or unpinned
	Pinned bool
	// Peer
	Peer PeerClass
	// Message IDs
	Messages []int
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdatePinnedMessagesTypeID is TL type id of UpdatePinnedMessages.
const UpdatePinnedMessagesTypeID = 0xed85eab5

// construct implements constructor of UpdateClass.
func ( UpdatePinnedMessages) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePinnedMessages{}
)

func ( *UpdatePinnedMessages) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Pinned == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePinnedMessages from given interface.
func ( *UpdatePinnedMessages) ( interface {
	() ( bool)
	() ( PeerClass)
	() ( []int)
	() ( int)
	() ( int)
}) {
	.Pinned = .()
	.Peer = .()
	.Messages = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePinnedMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updatePinnedMessages",
		ID:   UpdatePinnedMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Pinned",
			SchemaName: "pinned",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdatePinnedMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedMessages#ed85eab5 as nil")
	}
	.PutID(UpdatePinnedMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePinnedMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedMessages#ed85eab5 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedMessages#ed85eab5: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updatePinnedMessages#ed85eab5: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedMessages#ed85eab5: field peer: %w", )
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePinnedMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePinnedMessages#ed85eab5 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePinnedMessages#ed85eab5: field flags: %w", )
		}
	}
	.Pinned = .Flags.Has(0)
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedMessages#ed85eab5: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedMessages#ed85eab5: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updatePinnedMessages#ed85eab5: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedMessages#ed85eab5: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedMessages#ed85eab5: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// SetPinned sets value of Pinned conditional field.
func ( *UpdatePinnedMessages) ( bool) {
	if  {
		.Flags.Set(0)
		.Pinned = true
	} else {
		.Flags.Unset(0)
		.Pinned = false
	}
}

// GetPinned returns value of Pinned conditional field.
func ( *UpdatePinnedMessages) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetPeer returns value of Peer field.
func ( *UpdatePinnedMessages) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMessages returns value of Messages field.
func ( *UpdatePinnedMessages) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

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

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

// UpdatePinnedChannelMessages represents TL type `updatePinnedChannelMessages#5bb98608`.
// Messages were pinned/unpinned in a channel/supergroup¹
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updatePinnedChannelMessages for reference.
type UpdatePinnedChannelMessages struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the messages were pinned or unpinned
	Pinned bool
	// Channel ID
	ChannelID int64
	// Messages
	Messages []int
	// Event count after generation¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Pts int
	// Number of events that were generated¹
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	PtsCount int
}

// UpdatePinnedChannelMessagesTypeID is TL type id of UpdatePinnedChannelMessages.
const UpdatePinnedChannelMessagesTypeID = 0x5bb98608

// construct implements constructor of UpdateClass.
func ( UpdatePinnedChannelMessages) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePinnedChannelMessages{}
)

func ( *UpdatePinnedChannelMessages) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Pinned == false) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.Pts == 0) {
		return false
	}
	if !(.PtsCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePinnedChannelMessages from given interface.
func ( *UpdatePinnedChannelMessages) ( interface {
	() ( bool)
	() ( int64)
	() ( []int)
	() ( int)
	() ( int)
}) {
	.Pinned = .()
	.ChannelID = .()
	.Messages = .()
	.Pts = .()
	.PtsCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePinnedChannelMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updatePinnedChannelMessages",
		ID:   UpdatePinnedChannelMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Pinned",
			SchemaName: "pinned",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "Pts",
			SchemaName: "pts",
		},
		{
			Name:       "PtsCount",
			SchemaName: "pts_count",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdatePinnedChannelMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedChannelMessages#5bb98608 as nil")
	}
	.PutID(UpdatePinnedChannelMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePinnedChannelMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedChannelMessages#5bb98608 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedChannelMessages#5bb98608: field flags: %w", )
	}
	.PutLong(.ChannelID)
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	.PutInt(.Pts)
	.PutInt(.PtsCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePinnedChannelMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePinnedChannelMessages#5bb98608 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field flags: %w", )
		}
	}
	.Pinned = .Flags.Has(0)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedChannelMessages#5bb98608: field pts_count: %w", )
		}
		.PtsCount = 
	}
	return nil
}

// SetPinned sets value of Pinned conditional field.
func ( *UpdatePinnedChannelMessages) ( bool) {
	if  {
		.Flags.Set(0)
		.Pinned = true
	} else {
		.Flags.Unset(0)
		.Pinned = false
	}
}

// GetPinned returns value of Pinned conditional field.
func ( *UpdatePinnedChannelMessages) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetChannelID returns value of ChannelID field.
func ( *UpdatePinnedChannelMessages) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetMessages returns value of Messages field.
func ( *UpdatePinnedChannelMessages) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

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

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

// UpdateChat represents TL type `updateChat#f89a6a4e`.
// Chat (chat¹ and/or chatFull²) information was updated.
// This update can only be received through getDifference or in
// updates¹/updatesCombined² constructors, so it will always come bundled with the
// updated chat³, that should be applied as usual »⁴, without re-fetching the info
// manually.
// However, full peer information will not come bundled in updates, so the full peer
// cache (chatFull¹) must be invalidated for chat_id when receiving this update.
//
// Links:
//  1. https://core.telegram.org/constructor/chat
//  2. https://core.telegram.org/constructor/chatFull
//  3. https://core.telegram.org/constructor/updates
//  4. https://core.telegram.org/constructor/updatesCombined
//  5. https://core.telegram.org/constructor/chat
//  6. https://core.telegram.org/api/peers
//  7. https://core.telegram.org/constructor/chatFull
//
// See https://core.telegram.org/constructor/updateChat for reference.
type UpdateChat struct {
	// Chat ID
	ChatID int64
}

// UpdateChatTypeID is TL type id of UpdateChat.
const UpdateChatTypeID = 0xf89a6a4e

// construct implements constructor of UpdateClass.
func ( UpdateChat) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChat{}
)

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

	return true
}

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

// FillFrom fills UpdateChat from given interface.
func ( *UpdateChat) ( interface {
	() ( int64)
}) {
	.ChatID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChat) () tdp.Type {
	 := tdp.Type{
		Name: "updateChat",
		ID:   UpdateChatTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChat) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChat#f89a6a4e as nil")
	}
	.PutID(UpdateChatTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChat) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChat#f89a6a4e as nil")
	}
	.PutLong(.ChatID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChat) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChat#f89a6a4e to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChat#f89a6a4e: field chat_id: %w", )
		}
		.ChatID = 
	}
	return nil
}

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

// UpdateGroupCallParticipants represents TL type `updateGroupCallParticipants#f2ebdb4e`.
// The participant list of a group call¹ has changed.
//
// Links:
//  1. https://core.telegram.org/api/group-calls#applying-group-call-updates
//
// See https://core.telegram.org/constructor/updateGroupCallParticipants for reference.
type UpdateGroupCallParticipants struct {
	// Group call
	Call InputGroupCallClass
	// New participant list
	Participants []GroupCallParticipant
	// Version
	Version int
}

// UpdateGroupCallParticipantsTypeID is TL type id of UpdateGroupCallParticipants.
const UpdateGroupCallParticipantsTypeID = 0xf2ebdb4e

// construct implements constructor of UpdateClass.
func ( UpdateGroupCallParticipants) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateGroupCallParticipants{}
)

func ( *UpdateGroupCallParticipants) () bool {
	if  == nil {
		return true
	}
	if !(.Call == nil) {
		return false
	}
	if !(.Participants == nil) {
		return false
	}
	if !(.Version == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateGroupCallParticipants from given interface.
func ( *UpdateGroupCallParticipants) ( interface {
	() ( InputGroupCallClass)
	() ( []GroupCallParticipant)
	() ( int)
}) {
	.Call = .()
	.Participants = .()
	.Version = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateGroupCallParticipants) () tdp.Type {
	 := tdp.Type{
		Name: "updateGroupCallParticipants",
		ID:   UpdateGroupCallParticipantsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "Participants",
			SchemaName: "participants",
		},
		{
			Name:       "Version",
			SchemaName: "version",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateGroupCallParticipants) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallParticipants#f2ebdb4e as nil")
	}
	.PutID(UpdateGroupCallParticipantsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGroupCallParticipants) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallParticipants#f2ebdb4e as nil")
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode updateGroupCallParticipants#f2ebdb4e: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCallParticipants#f2ebdb4e: field call: %w", )
	}
	.PutVectorHeader(len(.Participants))
	for ,  := range .Participants {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateGroupCallParticipants#f2ebdb4e: field participants element with index %d: %w", , )
		}
	}
	.PutInt(.Version)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateGroupCallParticipants) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCallParticipants#f2ebdb4e to nil")
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallParticipants#f2ebdb4e: field call: %w", )
		}
		.Call = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallParticipants#f2ebdb4e: field participants: %w", )
		}

		if  > 0 {
			.Participants = make([]GroupCallParticipant, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  GroupCallParticipant
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode updateGroupCallParticipants#f2ebdb4e: field participants: %w", )
			}
			.Participants = append(.Participants, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallParticipants#f2ebdb4e: field version: %w", )
		}
		.Version = 
	}
	return nil
}

// GetCall returns value of Call field.
func ( *UpdateGroupCallParticipants) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// GetParticipants returns value of Participants field.
func ( *UpdateGroupCallParticipants) () ( []GroupCallParticipant) {
	if  == nil {
		return
	}
	return .Participants
}

// GetVersion returns value of Version field.
func ( *UpdateGroupCallParticipants) () ( int) {
	if  == nil {
		return
	}
	return .Version
}

// UpdateGroupCall represents TL type `updateGroupCall#9d2216e0`.
// Info about a group call¹ was updated.
//
// Links:
//  1. https://core.telegram.org/api/group-calls
//
// See https://core.telegram.org/constructor/updateGroupCall for reference.
type UpdateGroupCall struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// LiveStory field of UpdateGroupCall.
	LiveStory bool
	// Peer field of UpdateGroupCall.
	//
	// Use SetPeer and GetPeer helpers.
	Peer PeerClass
	// Info about the group call or livestream
	Call GroupCallClass
}

// UpdateGroupCallTypeID is TL type id of UpdateGroupCall.
const UpdateGroupCallTypeID = 0x9d2216e0

// construct implements constructor of UpdateClass.
func ( UpdateGroupCall) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateGroupCall{}
)

func ( *UpdateGroupCall) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.LiveStory == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Call == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateGroupCall from given interface.
func ( *UpdateGroupCall) ( interface {
	() ( bool)
	() ( PeerClass,  bool)
	() ( GroupCallClass)
}) {
	.LiveStory = .()
	if ,  := .();  {
		.Peer = 
	}

	.Call = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateGroupCall) () tdp.Type {
	 := tdp.Type{
		Name: "updateGroupCall",
		ID:   UpdateGroupCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "LiveStory",
			SchemaName: "live_story",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Call",
			SchemaName: "call",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateGroupCall) () {
	if !(.LiveStory == false) {
		.Flags.Set(2)
	}
	if !(.Peer == nil) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCall#9d2216e0 as nil")
	}
	.PutID(UpdateGroupCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCall#9d2216e0 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCall#9d2216e0: field flags: %w", )
	}
	if .Flags.Has(1) {
		if .Peer == nil {
			return fmt.Errorf("unable to encode updateGroupCall#9d2216e0: field peer is nil")
		}
		if  := .Peer.Encode();  != nil {
			return fmt.Errorf("unable to encode updateGroupCall#9d2216e0: field peer: %w", )
		}
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode updateGroupCall#9d2216e0: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCall#9d2216e0: field call: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCall#9d2216e0 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateGroupCall#9d2216e0: field flags: %w", )
		}
	}
	.LiveStory = .Flags.Has(2)
	if .Flags.Has(1) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCall#9d2216e0: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := DecodeGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCall#9d2216e0: field call: %w", )
		}
		.Call = 
	}
	return nil
}

// SetLiveStory sets value of LiveStory conditional field.
func ( *UpdateGroupCall) ( bool) {
	if  {
		.Flags.Set(2)
		.LiveStory = true
	} else {
		.Flags.Unset(2)
		.LiveStory = false
	}
}

// GetLiveStory returns value of LiveStory conditional field.
func ( *UpdateGroupCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetPeer sets value of Peer conditional field.
func ( *UpdateGroupCall) ( PeerClass) {
	.Flags.Set(1)
	.Peer = 
}

// GetPeer returns value of Peer conditional field and
// boolean which is true if field was set.
func ( *UpdateGroupCall) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Peer, true
}

// GetCall returns value of Call field.
func ( *UpdateGroupCall) () ( GroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// UpdatePeerHistoryTTL represents TL type `updatePeerHistoryTTL#bb9bb9a5`.
// The Time-To-Live for messages sent by the current user in a specific chat has changed
//
// See https://core.telegram.org/constructor/updatePeerHistoryTTL for reference.
type UpdatePeerHistoryTTL struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// The chat
	Peer PeerClass
	// The new Time-To-Live
	//
	// Use SetTTLPeriod and GetTTLPeriod helpers.
	TTLPeriod int
}

// UpdatePeerHistoryTTLTypeID is TL type id of UpdatePeerHistoryTTL.
const UpdatePeerHistoryTTLTypeID = 0xbb9bb9a5

// construct implements constructor of UpdateClass.
func ( UpdatePeerHistoryTTL) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePeerHistoryTTL{}
)

func ( *UpdatePeerHistoryTTL) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.TTLPeriod == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePeerHistoryTTL from given interface.
func ( *UpdatePeerHistoryTTL) ( interface {
	() ( PeerClass)
	() ( int,  bool)
}) {
	.Peer = .()
	if ,  := .();  {
		.TTLPeriod = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePeerHistoryTTL) () tdp.Type {
	 := tdp.Type{
		Name: "updatePeerHistoryTTL",
		ID:   UpdatePeerHistoryTTLTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "TTLPeriod",
			SchemaName: "ttl_period",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdatePeerHistoryTTL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerHistoryTTL#bb9bb9a5 as nil")
	}
	.PutID(UpdatePeerHistoryTTLTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePeerHistoryTTL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerHistoryTTL#bb9bb9a5 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePeerHistoryTTL#bb9bb9a5: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updatePeerHistoryTTL#bb9bb9a5: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePeerHistoryTTL#bb9bb9a5: field peer: %w", )
	}
	if .Flags.Has(0) {
		.PutInt(.TTLPeriod)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePeerHistoryTTL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePeerHistoryTTL#bb9bb9a5 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePeerHistoryTTL#bb9bb9a5: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updatePeerHistoryTTL#bb9bb9a5: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatePeerHistoryTTL#bb9bb9a5: field ttl_period: %w", )
		}
		.TTLPeriod = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdatePeerHistoryTTL) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

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

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

// UpdateChatParticipant represents TL type `updateChatParticipant#d087663a`.
// A user has joined or left a specific basic group »¹
//
// Links:
//  1. https://core.telegram.org/api/channel#basic-groups
//
// See https://core.telegram.org/constructor/updateChatParticipant for reference.
type UpdateChatParticipant struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Chat¹ ID
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	ChatID int64
	// When did this event occur
	Date int
	// User that triggered the change (inviter, admin that kicked the user, or the even the
	// user_id itself)
	ActorID int64
	// User that was affected by the change
	UserID int64
	// Previous participant info (empty if this participant just joined)
	//
	// Use SetPrevParticipant and GetPrevParticipant helpers.
	PrevParticipant ChatParticipantClass
	// New participant info (empty if this participant just left)
	//
	// Use SetNewParticipant and GetNewParticipant helpers.
	NewParticipant ChatParticipantClass
	// The invite that was used to join the group
	//
	// Use SetInvite and GetInvite helpers.
	Invite ExportedChatInviteClass
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateChatParticipantTypeID is TL type id of UpdateChatParticipant.
const UpdateChatParticipantTypeID = 0xd087663a

// construct implements constructor of UpdateClass.
func ( UpdateChatParticipant) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChatParticipant{}
)

func ( *UpdateChatParticipant) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ChatID == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.ActorID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.PrevParticipant == nil) {
		return false
	}
	if !(.NewParticipant == nil) {
		return false
	}
	if !(.Invite == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChatParticipant from given interface.
func ( *UpdateChatParticipant) ( interface {
	() ( int64)
	() ( int)
	() ( int64)
	() ( int64)
	() ( ChatParticipantClass,  bool)
	() ( ChatParticipantClass,  bool)
	() ( ExportedChatInviteClass,  bool)
	() ( int)
}) {
	.ChatID = .()
	.Date = .()
	.ActorID = .()
	.UserID = .()
	if ,  := .();  {
		.PrevParticipant = 
	}

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

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

	.Qts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChatParticipant) () tdp.Type {
	 := tdp.Type{
		Name: "updateChatParticipant",
		ID:   UpdateChatParticipantTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "ActorID",
			SchemaName: "actor_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "PrevParticipant",
			SchemaName: "prev_participant",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "NewParticipant",
			SchemaName: "new_participant",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Invite",
			SchemaName: "invite",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateChatParticipant) () {
	if !(.PrevParticipant == nil) {
		.Flags.Set(0)
	}
	if !(.NewParticipant == nil) {
		.Flags.Set(1)
	}
	if !(.Invite == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateChatParticipant) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipant#d087663a as nil")
	}
	.PutID(UpdateChatParticipantTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChatParticipant) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipant#d087663a as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field flags: %w", )
	}
	.PutLong(.ChatID)
	.PutInt(.Date)
	.PutLong(.ActorID)
	.PutLong(.UserID)
	if .Flags.Has(0) {
		if .PrevParticipant == nil {
			return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field prev_participant is nil")
		}
		if  := .PrevParticipant.Encode();  != nil {
			return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field prev_participant: %w", )
		}
	}
	if .Flags.Has(1) {
		if .NewParticipant == nil {
			return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field new_participant is nil")
		}
		if  := .NewParticipant.Encode();  != nil {
			return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field new_participant: %w", )
		}
	}
	if .Flags.Has(2) {
		if .Invite == nil {
			return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field invite is nil")
		}
		if  := .Invite.Encode();  != nil {
			return fmt.Errorf("unable to encode updateChatParticipant#d087663a: field invite: %w", )
		}
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChatParticipant) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatParticipant#d087663a to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field actor_id: %w", )
		}
		.ActorID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field user_id: %w", )
		}
		.UserID = 
	}
	if .Flags.Has(0) {
		,  := DecodeChatParticipant()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field prev_participant: %w", )
		}
		.PrevParticipant = 
	}
	if .Flags.Has(1) {
		,  := DecodeChatParticipant()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field new_participant: %w", )
		}
		.NewParticipant = 
	}
	if .Flags.Has(2) {
		,  := DecodeExportedChatInvite()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field invite: %w", )
		}
		.Invite = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipant#d087663a: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

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

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

// GetActorID returns value of ActorID field.
func ( *UpdateChatParticipant) () ( int64) {
	if  == nil {
		return
	}
	return .ActorID
}

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

// SetPrevParticipant sets value of PrevParticipant conditional field.
func ( *UpdateChatParticipant) ( ChatParticipantClass) {
	.Flags.Set(0)
	.PrevParticipant = 
}

// GetPrevParticipant returns value of PrevParticipant conditional field and
// boolean which is true if field was set.
func ( *UpdateChatParticipant) () ( ChatParticipantClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .PrevParticipant, true
}

// SetNewParticipant sets value of NewParticipant conditional field.
func ( *UpdateChatParticipant) ( ChatParticipantClass) {
	.Flags.Set(1)
	.NewParticipant = 
}

// GetNewParticipant returns value of NewParticipant conditional field and
// boolean which is true if field was set.
func ( *UpdateChatParticipant) () ( ChatParticipantClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .NewParticipant, true
}

// SetInvite sets value of Invite conditional field.
func ( *UpdateChatParticipant) ( ExportedChatInviteClass) {
	.Flags.Set(2)
	.Invite = 
}

// GetInvite returns value of Invite conditional field and
// boolean which is true if field was set.
func ( *UpdateChatParticipant) () ( ExportedChatInviteClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .Invite, true
}

// GetQts returns value of Qts field.
func ( *UpdateChatParticipant) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateChannelParticipant represents TL type `updateChannelParticipant#985d3abb`.
// A participant has left, joined, was banned or admined in a channel or supergroup¹.
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateChannelParticipant for reference.
type UpdateChannelParticipant struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the participant joined using a chat folder deep link »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/links#chat-folder-links
	ViaChatlist bool
	// Channel ID
	ChannelID int64
	// Date of the event
	Date int
	// User that triggered the change (inviter, admin that kicked the user, or the even the
	// user_id itself)
	ActorID int64
	// User that was affected by the change
	UserID int64
	// Previous participant status
	//
	// Use SetPrevParticipant and GetPrevParticipant helpers.
	PrevParticipant ChannelParticipantClass
	// New participant status
	//
	// Use SetNewParticipant and GetNewParticipant helpers.
	NewParticipant ChannelParticipantClass
	// Chat invite used to join the channel/supergroup¹
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	//
	// Use SetInvite and GetInvite helpers.
	Invite ExportedChatInviteClass
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateChannelParticipantTypeID is TL type id of UpdateChannelParticipant.
const UpdateChannelParticipantTypeID = 0x985d3abb

// construct implements constructor of UpdateClass.
func ( UpdateChannelParticipant) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelParticipant{}
)

func ( *UpdateChannelParticipant) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ViaChatlist == false) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.ActorID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.PrevParticipant == nil) {
		return false
	}
	if !(.NewParticipant == nil) {
		return false
	}
	if !(.Invite == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelParticipant from given interface.
func ( *UpdateChannelParticipant) ( interface {
	() ( bool)
	() ( int64)
	() ( int)
	() ( int64)
	() ( int64)
	() ( ChannelParticipantClass,  bool)
	() ( ChannelParticipantClass,  bool)
	() ( ExportedChatInviteClass,  bool)
	() ( int)
}) {
	.ViaChatlist = .()
	.ChannelID = .()
	.Date = .()
	.ActorID = .()
	.UserID = .()
	if ,  := .();  {
		.PrevParticipant = 
	}

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

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

	.Qts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelParticipant) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelParticipant",
		ID:   UpdateChannelParticipantTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ViaChatlist",
			SchemaName: "via_chatlist",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "ActorID",
			SchemaName: "actor_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "PrevParticipant",
			SchemaName: "prev_participant",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "NewParticipant",
			SchemaName: "new_participant",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Invite",
			SchemaName: "invite",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateChannelParticipant) () {
	if !(.ViaChatlist == false) {
		.Flags.Set(3)
	}
	if !(.PrevParticipant == nil) {
		.Flags.Set(0)
	}
	if !(.NewParticipant == nil) {
		.Flags.Set(1)
	}
	if !(.Invite == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateChannelParticipant) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelParticipant#985d3abb as nil")
	}
	.PutID(UpdateChannelParticipantTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelParticipant) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelParticipant#985d3abb as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field flags: %w", )
	}
	.PutLong(.ChannelID)
	.PutInt(.Date)
	.PutLong(.ActorID)
	.PutLong(.UserID)
	if .Flags.Has(0) {
		if .PrevParticipant == nil {
			return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field prev_participant is nil")
		}
		if  := .PrevParticipant.Encode();  != nil {
			return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field prev_participant: %w", )
		}
	}
	if .Flags.Has(1) {
		if .NewParticipant == nil {
			return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field new_participant is nil")
		}
		if  := .NewParticipant.Encode();  != nil {
			return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field new_participant: %w", )
		}
	}
	if .Flags.Has(2) {
		if .Invite == nil {
			return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field invite is nil")
		}
		if  := .Invite.Encode();  != nil {
			return fmt.Errorf("unable to encode updateChannelParticipant#985d3abb: field invite: %w", )
		}
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelParticipant) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelParticipant#985d3abb to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field flags: %w", )
		}
	}
	.ViaChatlist = .Flags.Has(3)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field actor_id: %w", )
		}
		.ActorID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field user_id: %w", )
		}
		.UserID = 
	}
	if .Flags.Has(0) {
		,  := DecodeChannelParticipant()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field prev_participant: %w", )
		}
		.PrevParticipant = 
	}
	if .Flags.Has(1) {
		,  := DecodeChannelParticipant()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field new_participant: %w", )
		}
		.NewParticipant = 
	}
	if .Flags.Has(2) {
		,  := DecodeExportedChatInvite()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field invite: %w", )
		}
		.Invite = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelParticipant#985d3abb: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// SetViaChatlist sets value of ViaChatlist conditional field.
func ( *UpdateChannelParticipant) ( bool) {
	if  {
		.Flags.Set(3)
		.ViaChatlist = true
	} else {
		.Flags.Unset(3)
		.ViaChatlist = false
	}
}

// GetViaChatlist returns value of ViaChatlist conditional field.
func ( *UpdateChannelParticipant) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelParticipant) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

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

// GetActorID returns value of ActorID field.
func ( *UpdateChannelParticipant) () ( int64) {
	if  == nil {
		return
	}
	return .ActorID
}

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

// SetPrevParticipant sets value of PrevParticipant conditional field.
func ( *UpdateChannelParticipant) ( ChannelParticipantClass) {
	.Flags.Set(0)
	.PrevParticipant = 
}

// GetPrevParticipant returns value of PrevParticipant conditional field and
// boolean which is true if field was set.
func ( *UpdateChannelParticipant) () ( ChannelParticipantClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .PrevParticipant, true
}

// SetNewParticipant sets value of NewParticipant conditional field.
func ( *UpdateChannelParticipant) ( ChannelParticipantClass) {
	.Flags.Set(1)
	.NewParticipant = 
}

// GetNewParticipant returns value of NewParticipant conditional field and
// boolean which is true if field was set.
func ( *UpdateChannelParticipant) () ( ChannelParticipantClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .NewParticipant, true
}

// SetInvite sets value of Invite conditional field.
func ( *UpdateChannelParticipant) ( ExportedChatInviteClass) {
	.Flags.Set(2)
	.Invite = 
}

// GetInvite returns value of Invite conditional field and
// boolean which is true if field was set.
func ( *UpdateChannelParticipant) () ( ExportedChatInviteClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .Invite, true
}

// GetQts returns value of Qts field.
func ( *UpdateChannelParticipant) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateBotStopped represents TL type `updateBotStopped#c4870a49`.
// A bot was stopped or re-started.
//
// See https://core.telegram.org/constructor/updateBotStopped for reference.
type UpdateBotStopped struct {
	// The user ID
	UserID int64
	// When did this action occur
	Date int
	// Whether the bot was stopped or started
	Stopped bool
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotStoppedTypeID is TL type id of UpdateBotStopped.
const UpdateBotStoppedTypeID = 0xc4870a49

// construct implements constructor of UpdateClass.
func ( UpdateBotStopped) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotStopped{}
)

func ( *UpdateBotStopped) () bool {
	if  == nil {
		return true
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Stopped == false) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotStopped from given interface.
func ( *UpdateBotStopped) ( interface {
	() ( int64)
	() ( int)
	() ( bool)
	() ( int)
}) {
	.UserID = .()
	.Date = .()
	.Stopped = .()
	.Qts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotStopped) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotStopped",
		ID:   UpdateBotStoppedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "Stopped",
			SchemaName: "stopped",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotStopped) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotStopped#c4870a49 as nil")
	}
	.PutID(UpdateBotStoppedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotStopped) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotStopped#c4870a49 as nil")
	}
	.PutLong(.UserID)
	.PutInt(.Date)
	.PutBool(.Stopped)
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotStopped) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotStopped#c4870a49 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotStopped#c4870a49: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotStopped#c4870a49: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotStopped#c4870a49: field stopped: %w", )
		}
		.Stopped = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotStopped#c4870a49: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

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

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

// GetStopped returns value of Stopped field.
func ( *UpdateBotStopped) () ( bool) {
	if  == nil {
		return
	}
	return .Stopped
}

// GetQts returns value of Qts field.
func ( *UpdateBotStopped) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateGroupCallConnection represents TL type `updateGroupCallConnection#b783982`.
// New WebRTC connection parameters for the currently joined group call¹.
//
// Links:
//  1. https://core.telegram.org/api/group-calls
//
// See https://core.telegram.org/constructor/updateGroupCallConnection for reference.
type UpdateGroupCallConnection struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Are these parameters related to the screen capture session currently in progress?
	Presentation bool
	// WebRTC parameters
	Params DataJSON
}

// UpdateGroupCallConnectionTypeID is TL type id of UpdateGroupCallConnection.
const UpdateGroupCallConnectionTypeID = 0xb783982

// construct implements constructor of UpdateClass.
func ( UpdateGroupCallConnection) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateGroupCallConnection{}
)

func ( *UpdateGroupCallConnection) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Presentation == false) {
		return false
	}
	if !(.Params.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateGroupCallConnection from given interface.
func ( *UpdateGroupCallConnection) ( interface {
	() ( bool)
	() ( DataJSON)
}) {
	.Presentation = .()
	.Params = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateGroupCallConnection) () tdp.Type {
	 := tdp.Type{
		Name: "updateGroupCallConnection",
		ID:   UpdateGroupCallConnectionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Presentation",
			SchemaName: "presentation",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Params",
			SchemaName: "params",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateGroupCallConnection) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallConnection#b783982 as nil")
	}
	.PutID(UpdateGroupCallConnectionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGroupCallConnection) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallConnection#b783982 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCallConnection#b783982: field flags: %w", )
	}
	if  := .Params.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCallConnection#b783982: field params: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateGroupCallConnection) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCallConnection#b783982 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateGroupCallConnection#b783982: field flags: %w", )
		}
	}
	.Presentation = .Flags.Has(0)
	{
		if  := .Params.Decode();  != nil {
			return fmt.Errorf("unable to decode updateGroupCallConnection#b783982: field params: %w", )
		}
	}
	return nil
}

// SetPresentation sets value of Presentation conditional field.
func ( *UpdateGroupCallConnection) ( bool) {
	if  {
		.Flags.Set(0)
		.Presentation = true
	} else {
		.Flags.Unset(0)
		.Presentation = false
	}
}

// GetPresentation returns value of Presentation conditional field.
func ( *UpdateGroupCallConnection) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetParams returns value of Params field.
func ( *UpdateGroupCallConnection) () ( DataJSON) {
	if  == nil {
		return
	}
	return .Params
}

// UpdateBotCommands represents TL type `updateBotCommands#4d712f2e`.
// The command set¹ of a certain bot in a certain chat has changed.
//
// Links:
//  1. https://core.telegram.org/api/bots/commands
//
// See https://core.telegram.org/constructor/updateBotCommands for reference.
type UpdateBotCommands struct {
	// The affected chat
	Peer PeerClass
	// ID of the bot that changed its command set
	BotID int64
	// New bot commands
	Commands []BotCommand
}

// UpdateBotCommandsTypeID is TL type id of UpdateBotCommands.
const UpdateBotCommandsTypeID = 0x4d712f2e

// construct implements constructor of UpdateClass.
func ( UpdateBotCommands) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotCommands{}
)

func ( *UpdateBotCommands) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.BotID == 0) {
		return false
	}
	if !(.Commands == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotCommands from given interface.
func ( *UpdateBotCommands) ( interface {
	() ( PeerClass)
	() ( int64)
	() ( []BotCommand)
}) {
	.Peer = .()
	.BotID = .()
	.Commands = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotCommands) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotCommands",
		ID:   UpdateBotCommandsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "BotID",
			SchemaName: "bot_id",
		},
		{
			Name:       "Commands",
			SchemaName: "commands",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotCommands) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotCommands#4d712f2e as nil")
	}
	.PutID(UpdateBotCommandsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotCommands) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotCommands#4d712f2e as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateBotCommands#4d712f2e: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotCommands#4d712f2e: field peer: %w", )
	}
	.PutLong(.BotID)
	.PutVectorHeader(len(.Commands))
	for ,  := range .Commands {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotCommands#4d712f2e: field commands element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotCommands) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotCommands#4d712f2e to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: field bot_id: %w", )
		}
		.BotID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: field commands: %w", )
		}

		if  > 0 {
			.Commands = make([]BotCommand, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  BotCommand
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode updateBotCommands#4d712f2e: field commands: %w", )
			}
			.Commands = append(.Commands, )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateBotCommands) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetBotID returns value of BotID field.
func ( *UpdateBotCommands) () ( int64) {
	if  == nil {
		return
	}
	return .BotID
}

// GetCommands returns value of Commands field.
func ( *UpdateBotCommands) () ( []BotCommand) {
	if  == nil {
		return
	}
	return .Commands
}

// UpdatePendingJoinRequests represents TL type `updatePendingJoinRequests#7063c3db`.
// Someone has requested to join a chat or channel
//
// See https://core.telegram.org/constructor/updatePendingJoinRequests for reference.
type UpdatePendingJoinRequests struct {
	// Chat or channel
	Peer PeerClass
	// Number of pending join requests »¹ for the chat or channel
	//
	// Links:
	//  1) https://core.telegram.org/api/invites#join-requests
	RequestsPending int
	// IDs of users that have recently requested to join
	RecentRequesters []int64
}

// UpdatePendingJoinRequestsTypeID is TL type id of UpdatePendingJoinRequests.
const UpdatePendingJoinRequestsTypeID = 0x7063c3db

// construct implements constructor of UpdateClass.
func ( UpdatePendingJoinRequests) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePendingJoinRequests{}
)

func ( *UpdatePendingJoinRequests) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.RequestsPending == 0) {
		return false
	}
	if !(.RecentRequesters == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePendingJoinRequests from given interface.
func ( *UpdatePendingJoinRequests) ( interface {
	() ( PeerClass)
	() ( int)
	() ( []int64)
}) {
	.Peer = .()
	.RequestsPending = .()
	.RecentRequesters = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePendingJoinRequests) () tdp.Type {
	 := tdp.Type{
		Name: "updatePendingJoinRequests",
		ID:   UpdatePendingJoinRequestsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "RequestsPending",
			SchemaName: "requests_pending",
		},
		{
			Name:       "RecentRequesters",
			SchemaName: "recent_requesters",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatePendingJoinRequests) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePendingJoinRequests#7063c3db as nil")
	}
	.PutID(UpdatePendingJoinRequestsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePendingJoinRequests) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePendingJoinRequests#7063c3db as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updatePendingJoinRequests#7063c3db: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePendingJoinRequests#7063c3db: field peer: %w", )
	}
	.PutInt(.RequestsPending)
	.PutVectorHeader(len(.RecentRequesters))
	for ,  := range .RecentRequesters {
		.PutLong()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePendingJoinRequests) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePendingJoinRequests#7063c3db to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updatePendingJoinRequests#7063c3db: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatePendingJoinRequests#7063c3db: field requests_pending: %w", )
		}
		.RequestsPending = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatePendingJoinRequests#7063c3db: field recent_requesters: %w", )
		}

		if  > 0 {
			.RecentRequesters = make([]int64, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Long()
			if  != nil {
				return fmt.Errorf("unable to decode updatePendingJoinRequests#7063c3db: field recent_requesters: %w", )
			}
			.RecentRequesters = append(.RecentRequesters, )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdatePendingJoinRequests) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetRequestsPending returns value of RequestsPending field.
func ( *UpdatePendingJoinRequests) () ( int) {
	if  == nil {
		return
	}
	return .RequestsPending
}

// GetRecentRequesters returns value of RecentRequesters field.
func ( *UpdatePendingJoinRequests) () ( []int64) {
	if  == nil {
		return
	}
	return .RecentRequesters
}

// UpdateBotChatInviteRequester represents TL type `updateBotChatInviteRequester#7cb34d79`.
// Someone has requested to join a chat or channel (bots only, users will receive an
// updatePendingJoinRequests¹, instead)
//
// Links:
//  1. https://core.telegram.org/constructor/updatePendingJoinRequests
//
// See https://core.telegram.org/constructor/updateBotChatInviteRequester for reference.
type UpdateBotChatInviteRequester struct {
	// Flags field of UpdateBotChatInviteRequester.
	Flags bin.Fields
	// The chat or channel in question
	Peer PeerClass
	// When was the join request »¹ made
	//
	// Links:
	//  1) https://core.telegram.org/api/invites#join-requests
	Date int
	// The user ID that is asking to join the chat or channel
	UserID int64
	// Bio of the user
	About string
	// Chat invite link that was used by the user to send the join request »¹
	//
	// Links:
	//  1) https://core.telegram.org/api/invites#join-requests
	Invite ExportedChatInviteClass
	// QTS¹ event sequence identifier
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
	// QueryID field of UpdateBotChatInviteRequester.
	//
	// Use SetQueryID and GetQueryID helpers.
	QueryID int64
}

// UpdateBotChatInviteRequesterTypeID is TL type id of UpdateBotChatInviteRequester.
const UpdateBotChatInviteRequesterTypeID = 0x7cb34d79

// construct implements constructor of UpdateClass.
func ( UpdateBotChatInviteRequester) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotChatInviteRequester{}
)

func ( *UpdateBotChatInviteRequester) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.About == "") {
		return false
	}
	if !(.Invite == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotChatInviteRequester from given interface.
func ( *UpdateBotChatInviteRequester) ( interface {
	() ( PeerClass)
	() ( int)
	() ( int64)
	() ( string)
	() ( ExportedChatInviteClass)
	() ( int)
	() ( int64,  bool)
}) {
	.Peer = .()
	.Date = .()
	.UserID = .()
	.About = .()
	.Invite = .()
	.Qts = .()
	if ,  := .();  {
		.QueryID = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotChatInviteRequester) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotChatInviteRequester",
		ID:   UpdateBotChatInviteRequesterTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "About",
			SchemaName: "about",
		},
		{
			Name:       "Invite",
			SchemaName: "invite",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
		{
			Name:       "QueryID",
			SchemaName: "query_id",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateBotChatInviteRequester) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotChatInviteRequester#7cb34d79 as nil")
	}
	.PutID(UpdateBotChatInviteRequesterTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotChatInviteRequester) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotChatInviteRequester#7cb34d79 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#7cb34d79: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#7cb34d79: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#7cb34d79: field peer: %w", )
	}
	.PutInt(.Date)
	.PutLong(.UserID)
	.PutString(.About)
	if .Invite == nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#7cb34d79: field invite is nil")
	}
	if  := .Invite.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#7cb34d79: field invite: %w", )
	}
	.PutInt(.Qts)
	if .Flags.Has(0) {
		.PutLong(.QueryID)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotChatInviteRequester) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotChatInviteRequester#7cb34d79 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#7cb34d79: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#7cb34d79: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#7cb34d79: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#7cb34d79: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#7cb34d79: field about: %w", )
		}
		.About = 
	}
	{
		,  := DecodeExportedChatInvite()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#7cb34d79: field invite: %w", )
		}
		.Invite = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#7cb34d79: field qts: %w", )
		}
		.Qts = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#7cb34d79: field query_id: %w", )
		}
		.QueryID = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateBotChatInviteRequester) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

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

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

// GetAbout returns value of About field.
func ( *UpdateBotChatInviteRequester) () ( string) {
	if  == nil {
		return
	}
	return .About
}

// GetInvite returns value of Invite field.
func ( *UpdateBotChatInviteRequester) () ( ExportedChatInviteClass) {
	if  == nil {
		return
	}
	return .Invite
}

// GetQts returns value of Qts field.
func ( *UpdateBotChatInviteRequester) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// SetQueryID sets value of QueryID conditional field.
func ( *UpdateBotChatInviteRequester) ( int64) {
	.Flags.Set(0)
	.QueryID = 
}

// GetQueryID returns value of QueryID conditional field and
// boolean which is true if field was set.
func ( *UpdateBotChatInviteRequester) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .QueryID, true
}

// UpdateMessageReactions represents TL type `updateMessageReactions#1e297bfa`.
// New message reactions »¹ are available
//
// Links:
//  1. https://core.telegram.org/api/reactions
//
// See https://core.telegram.org/constructor/updateMessageReactions for reference.
type UpdateMessageReactions struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Peer
	Peer PeerClass
	// Message ID
	MsgID int
	// Forum topic ID¹
	//
	// Links:
	//  1) https://core.telegram.org/api/forum#forum-topics
	//
	// Use SetTopMsgID and GetTopMsgID helpers.
	TopMsgID int
	// If set, the reactions are in the specified monoforum topic »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/monoforum
	//
	// Use SetSavedPeerID and GetSavedPeerID helpers.
	SavedPeerID PeerClass
	// Reactions
	Reactions MessageReactions
}

// UpdateMessageReactionsTypeID is TL type id of UpdateMessageReactions.
const UpdateMessageReactionsTypeID = 0x1e297bfa

// construct implements constructor of UpdateClass.
func ( UpdateMessageReactions) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateMessageReactions{}
)

func ( *UpdateMessageReactions) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}
	if !(.SavedPeerID == nil) {
		return false
	}
	if !(.Reactions.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateMessageReactions from given interface.
func ( *UpdateMessageReactions) ( interface {
	() ( PeerClass)
	() ( int)
	() ( int,  bool)
	() ( PeerClass,  bool)
	() ( MessageReactions)
}) {
	.Peer = .()
	.MsgID = .()
	if ,  := .();  {
		.TopMsgID = 
	}

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

	.Reactions = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateMessageReactions) () tdp.Type {
	 := tdp.Type{
		Name: "updateMessageReactions",
		ID:   UpdateMessageReactionsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "SavedPeerID",
			SchemaName: "saved_peer_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Reactions",
			SchemaName: "reactions",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateMessageReactions) () {
	if !(.TopMsgID == 0) {
		.Flags.Set(0)
	}
	if !(.SavedPeerID == nil) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageReactions#1e297bfa as nil")
	}
	.PutID(UpdateMessageReactionsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageReactions#1e297bfa as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageReactions#1e297bfa: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateMessageReactions#1e297bfa: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageReactions#1e297bfa: field peer: %w", )
	}
	.PutInt(.MsgID)
	if .Flags.Has(0) {
		.PutInt(.TopMsgID)
	}
	if .Flags.Has(1) {
		if .SavedPeerID == nil {
			return fmt.Errorf("unable to encode updateMessageReactions#1e297bfa: field saved_peer_id is nil")
		}
		if  := .SavedPeerID.Encode();  != nil {
			return fmt.Errorf("unable to encode updateMessageReactions#1e297bfa: field saved_peer_id: %w", )
		}
	}
	if  := .Reactions.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageReactions#1e297bfa: field reactions: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessageReactions#1e297bfa to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#1e297bfa: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#1e297bfa: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#1e297bfa: field msg_id: %w", )
		}
		.MsgID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#1e297bfa: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	if .Flags.Has(1) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#1e297bfa: field saved_peer_id: %w", )
		}
		.SavedPeerID = 
	}
	{
		if  := .Reactions.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#1e297bfa: field reactions: %w", )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateMessageReactions) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMsgID returns value of MsgID field.
func ( *UpdateMessageReactions) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

// SetTopMsgID sets value of TopMsgID conditional field.
func ( *UpdateMessageReactions) ( int) {
	.Flags.Set(0)
	.TopMsgID = 
}

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

// SetSavedPeerID sets value of SavedPeerID conditional field.
func ( *UpdateMessageReactions) ( PeerClass) {
	.Flags.Set(1)
	.SavedPeerID = 
}

// GetSavedPeerID returns value of SavedPeerID conditional field and
// boolean which is true if field was set.
func ( *UpdateMessageReactions) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .SavedPeerID, true
}

// GetReactions returns value of Reactions field.
func ( *UpdateMessageReactions) () ( MessageReactions) {
	if  == nil {
		return
	}
	return .Reactions
}

// UpdateAttachMenuBots represents TL type `updateAttachMenuBots#17b7a20b`.
// The list of installed attachment menu entries »¹ has changed, use messages
// getAttachMenuBots² to fetch the updated list.
//
// Links:
//  1. https://core.telegram.org/api/bots/attach
//  2. https://core.telegram.org/method/messages.getAttachMenuBots
//
// See https://core.telegram.org/constructor/updateAttachMenuBots for reference.
type UpdateAttachMenuBots struct {
}

// UpdateAttachMenuBotsTypeID is TL type id of UpdateAttachMenuBots.
const UpdateAttachMenuBotsTypeID = 0x17b7a20b

// construct implements constructor of UpdateClass.
func ( UpdateAttachMenuBots) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateAttachMenuBots{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateAttachMenuBots) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateAttachMenuBots#17b7a20b as nil")
	}
	.PutID(UpdateAttachMenuBotsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateAttachMenuBots) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateAttachMenuBots#17b7a20b as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateAttachMenuBots) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateAttachMenuBots#17b7a20b to nil")
	}
	return nil
}

// UpdateWebViewResultSent represents TL type `updateWebViewResultSent#1592b79d`.
// Indicates to a bot that a webview was closed and an inline message was sent on behalf
// of the user using messages.sendWebViewResultMessage¹
//
// Links:
//  1. https://core.telegram.org/method/messages.sendWebViewResultMessage
//
// See https://core.telegram.org/constructor/updateWebViewResultSent for reference.
type UpdateWebViewResultSent struct {
	// Web app interaction ID
	QueryID int64
}

// UpdateWebViewResultSentTypeID is TL type id of UpdateWebViewResultSent.
const UpdateWebViewResultSentTypeID = 0x1592b79d

// construct implements constructor of UpdateClass.
func ( UpdateWebViewResultSent) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateWebViewResultSent{}
)

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

	return true
}

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

// FillFrom fills UpdateWebViewResultSent from given interface.
func ( *UpdateWebViewResultSent) ( interface {
	() ( int64)
}) {
	.QueryID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateWebViewResultSent) () tdp.Type {
	 := tdp.Type{
		Name: "updateWebViewResultSent",
		ID:   UpdateWebViewResultSentTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateWebViewResultSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateWebViewResultSent#1592b79d as nil")
	}
	.PutID(UpdateWebViewResultSentTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateWebViewResultSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateWebViewResultSent#1592b79d as nil")
	}
	.PutLong(.QueryID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateWebViewResultSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateWebViewResultSent#1592b79d to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateWebViewResultSent#1592b79d: field query_id: %w", )
		}
		.QueryID = 
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateWebViewResultSent) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

// UpdateBotMenuButton represents TL type `updateBotMenuButton#14b85813`.
// The menu button behavior for the specified bot has changed
//
// See https://core.telegram.org/constructor/updateBotMenuButton for reference.
type UpdateBotMenuButton struct {
	// Bot ID
	BotID int64
	// New menu button
	Button BotMenuButtonClass
}

// UpdateBotMenuButtonTypeID is TL type id of UpdateBotMenuButton.
const UpdateBotMenuButtonTypeID = 0x14b85813

// construct implements constructor of UpdateClass.
func ( UpdateBotMenuButton) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotMenuButton{}
)

func ( *UpdateBotMenuButton) () bool {
	if  == nil {
		return true
	}
	if !(.BotID == 0) {
		return false
	}
	if !(.Button == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotMenuButton from given interface.
func ( *UpdateBotMenuButton) ( interface {
	() ( int64)
	() ( BotMenuButtonClass)
}) {
	.BotID = .()
	.Button = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotMenuButton) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotMenuButton",
		ID:   UpdateBotMenuButtonTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "BotID",
			SchemaName: "bot_id",
		},
		{
			Name:       "Button",
			SchemaName: "button",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotMenuButton) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotMenuButton#14b85813 as nil")
	}
	.PutID(UpdateBotMenuButtonTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotMenuButton) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotMenuButton#14b85813 as nil")
	}
	.PutLong(.BotID)
	if .Button == nil {
		return fmt.Errorf("unable to encode updateBotMenuButton#14b85813: field button is nil")
	}
	if  := .Button.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotMenuButton#14b85813: field button: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotMenuButton) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotMenuButton#14b85813 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMenuButton#14b85813: field bot_id: %w", )
		}
		.BotID = 
	}
	{
		,  := DecodeBotMenuButton()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMenuButton#14b85813: field button: %w", )
		}
		.Button = 
	}
	return nil
}

// GetBotID returns value of BotID field.
func ( *UpdateBotMenuButton) () ( int64) {
	if  == nil {
		return
	}
	return .BotID
}

// GetButton returns value of Button field.
func ( *UpdateBotMenuButton) () ( BotMenuButtonClass) {
	if  == nil {
		return
	}
	return .Button
}

// UpdateSavedRingtones represents TL type `updateSavedRingtones#74d8be99`.
// The list of saved notification sounds has changed, use account.getSavedRingtones¹ to
// fetch the new list.
//
// Links:
//  1. https://core.telegram.org/method/account.getSavedRingtones
//
// See https://core.telegram.org/constructor/updateSavedRingtones for reference.
type UpdateSavedRingtones struct {
}

// UpdateSavedRingtonesTypeID is TL type id of UpdateSavedRingtones.
const UpdateSavedRingtonesTypeID = 0x74d8be99

// construct implements constructor of UpdateClass.
func ( UpdateSavedRingtones) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateSavedRingtones{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateSavedRingtones) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSavedRingtones#74d8be99 as nil")
	}
	.PutID(UpdateSavedRingtonesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateSavedRingtones) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSavedRingtones#74d8be99 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateSavedRingtones) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateSavedRingtones#74d8be99 to nil")
	}
	return nil
}

// UpdateTranscribedAudio represents TL type `updateTranscribedAudio#84cd5a`.
// A pending voice message transcription »¹ initiated with messages.transcribeAudio²
// was updated.
//
// Links:
//  1. https://core.telegram.org/api/transcribe
//  2. https://core.telegram.org/method/messages.transcribeAudio
//
// See https://core.telegram.org/constructor/updateTranscribedAudio for reference.
type UpdateTranscribedAudio struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether this transcription is still pending and further updateTranscribedAudio¹ about
	// it will be sent in the future.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/updateTranscribedAudio
	Pending bool
	// Peer of the transcribed message
	Peer PeerClass
	// Transcribed message ID
	MsgID int
	// Transcription ID
	TranscriptionID int64
	// Transcribed text
	Text string
}

// UpdateTranscribedAudioTypeID is TL type id of UpdateTranscribedAudio.
const UpdateTranscribedAudioTypeID = 0x84cd5a

// construct implements constructor of UpdateClass.
func ( UpdateTranscribedAudio) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateTranscribedAudio{}
)

func ( *UpdateTranscribedAudio) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Pending == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.TranscriptionID == 0) {
		return false
	}
	if !(.Text == "") {
		return false
	}

	return true
}

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

// FillFrom fills UpdateTranscribedAudio from given interface.
func ( *UpdateTranscribedAudio) ( interface {
	() ( bool)
	() ( PeerClass)
	() ( int)
	() ( int64)
	() ( string)
}) {
	.Pending = .()
	.Peer = .()
	.MsgID = .()
	.TranscriptionID = .()
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateTranscribedAudio) () tdp.Type {
	 := tdp.Type{
		Name: "updateTranscribedAudio",
		ID:   UpdateTranscribedAudioTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Pending",
			SchemaName: "pending",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "TranscriptionID",
			SchemaName: "transcription_id",
		},
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateTranscribedAudio) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateTranscribedAudio#84cd5a as nil")
	}
	.PutID(UpdateTranscribedAudioTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateTranscribedAudio) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateTranscribedAudio#84cd5a as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateTranscribedAudio#84cd5a: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateTranscribedAudio#84cd5a: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateTranscribedAudio#84cd5a: field peer: %w", )
	}
	.PutInt(.MsgID)
	.PutLong(.TranscriptionID)
	.PutString(.Text)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateTranscribedAudio) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateTranscribedAudio#84cd5a to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateTranscribedAudio#84cd5a: field flags: %w", )
		}
	}
	.Pending = .Flags.Has(0)
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateTranscribedAudio#84cd5a: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateTranscribedAudio#84cd5a: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateTranscribedAudio#84cd5a: field transcription_id: %w", )
		}
		.TranscriptionID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateTranscribedAudio#84cd5a: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// SetPending sets value of Pending conditional field.
func ( *UpdateTranscribedAudio) ( bool) {
	if  {
		.Flags.Set(0)
		.Pending = true
	} else {
		.Flags.Unset(0)
		.Pending = false
	}
}

// GetPending returns value of Pending conditional field.
func ( *UpdateTranscribedAudio) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetPeer returns value of Peer field.
func ( *UpdateTranscribedAudio) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMsgID returns value of MsgID field.
func ( *UpdateTranscribedAudio) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

// GetTranscriptionID returns value of TranscriptionID field.
func ( *UpdateTranscribedAudio) () ( int64) {
	if  == nil {
		return
	}
	return .TranscriptionID
}

// GetText returns value of Text field.
func ( *UpdateTranscribedAudio) () ( string) {
	if  == nil {
		return
	}
	return .Text
}

// UpdateReadFeaturedEmojiStickers represents TL type `updateReadFeaturedEmojiStickers#fb4c496c`.
// Some featured custom emoji stickers¹ were marked as read
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji
//
// See https://core.telegram.org/constructor/updateReadFeaturedEmojiStickers for reference.
type UpdateReadFeaturedEmojiStickers struct {
}

// UpdateReadFeaturedEmojiStickersTypeID is TL type id of UpdateReadFeaturedEmojiStickers.
const UpdateReadFeaturedEmojiStickersTypeID = 0xfb4c496c

// construct implements constructor of UpdateClass.
func ( UpdateReadFeaturedEmojiStickers) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadFeaturedEmojiStickers{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateReadFeaturedEmojiStickers) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadFeaturedEmojiStickers#fb4c496c as nil")
	}
	.PutID(UpdateReadFeaturedEmojiStickersTypeID)
	return .EncodeBare()
}

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

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

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

// UpdateUserEmojiStatus represents TL type `updateUserEmojiStatus#28373599`.
// The emoji status¹ of a certain user has changed
//
// Links:
//  1. https://core.telegram.org/api/emoji-status
//
// See https://core.telegram.org/constructor/updateUserEmojiStatus for reference.
type UpdateUserEmojiStatus struct {
	// User ID
	UserID int64
	// New emoji status¹
	//
	// Links:
	//  1) https://core.telegram.org/api/emoji-status
	EmojiStatus EmojiStatusClass
}

// UpdateUserEmojiStatusTypeID is TL type id of UpdateUserEmojiStatus.
const UpdateUserEmojiStatusTypeID = 0x28373599

// construct implements constructor of UpdateClass.
func ( UpdateUserEmojiStatus) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateUserEmojiStatus{}
)

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

	return true
}

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

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

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

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

// TypeInfo returns info about TL type.
func ( *UpdateUserEmojiStatus) () tdp.Type {
	 := tdp.Type{
		Name: "updateUserEmojiStatus",
		ID:   UpdateUserEmojiStatusTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "EmojiStatus",
			SchemaName: "emoji_status",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateUserEmojiStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUserEmojiStatus#28373599 as nil")
	}
	.PutID(UpdateUserEmojiStatusTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateUserEmojiStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateUserEmojiStatus#28373599 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserEmojiStatus#28373599: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := DecodeEmojiStatus()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserEmojiStatus#28373599: field emoji_status: %w", )
		}
		.EmojiStatus = 
	}
	return nil
}

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

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

// UpdateRecentEmojiStatuses represents TL type `updateRecentEmojiStatuses#30f443db`.
// The list of recent emoji statuses¹ has changed
//
// Links:
//  1. https://core.telegram.org/api/emoji-status
//
// See https://core.telegram.org/constructor/updateRecentEmojiStatuses for reference.
type UpdateRecentEmojiStatuses struct {
}

// UpdateRecentEmojiStatusesTypeID is TL type id of UpdateRecentEmojiStatuses.
const UpdateRecentEmojiStatusesTypeID = 0x30f443db

// construct implements constructor of UpdateClass.
func ( UpdateRecentEmojiStatuses) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateRecentEmojiStatuses{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateRecentEmojiStatuses) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateRecentEmojiStatuses#30f443db as nil")
	}
	.PutID(UpdateRecentEmojiStatusesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateRecentEmojiStatuses) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateRecentEmojiStatuses#30f443db as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateRecentEmojiStatuses) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateRecentEmojiStatuses#30f443db to nil")
	}
	return nil
}

// UpdateRecentReactions represents TL type `updateRecentReactions#6f7863f4`.
// The list of recent message reactions¹ has changed
//
// Links:
//  1. https://core.telegram.org/api/reactions
//
// See https://core.telegram.org/constructor/updateRecentReactions for reference.
type UpdateRecentReactions struct {
}

// UpdateRecentReactionsTypeID is TL type id of UpdateRecentReactions.
const UpdateRecentReactionsTypeID = 0x6f7863f4

// construct implements constructor of UpdateClass.
func ( UpdateRecentReactions) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateRecentReactions{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateRecentReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateRecentReactions#6f7863f4 as nil")
	}
	.PutID(UpdateRecentReactionsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateRecentReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateRecentReactions#6f7863f4 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateRecentReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateRecentReactions#6f7863f4 to nil")
	}
	return nil
}

// UpdateMoveStickerSetToTop represents TL type `updateMoveStickerSetToTop#86fccf85`.
// A stickerset was just moved to top, see here for more info »¹
//
// Links:
//  1. https://core.telegram.org/api/stickers#recent-stickersets
//
// See https://core.telegram.org/constructor/updateMoveStickerSetToTop for reference.
type UpdateMoveStickerSetToTop struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// This update is referring to a mask stickerset¹
	//
	// Links:
	//  1) https://core.telegram.org/api/stickers#mask-stickers
	Masks bool
	// This update is referring to a custom emoji stickerset¹
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	Emojis bool
	// Stickerset¹ ID
	//
	// Links:
	//  1) https://core.telegram.org/api/stickers
	Stickerset int64
}

// UpdateMoveStickerSetToTopTypeID is TL type id of UpdateMoveStickerSetToTop.
const UpdateMoveStickerSetToTopTypeID = 0x86fccf85

// construct implements constructor of UpdateClass.
func ( UpdateMoveStickerSetToTop) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateMoveStickerSetToTop{}
)

func ( *UpdateMoveStickerSetToTop) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Masks == false) {
		return false
	}
	if !(.Emojis == false) {
		return false
	}
	if !(.Stickerset == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateMoveStickerSetToTop from given interface.
func ( *UpdateMoveStickerSetToTop) ( interface {
	() ( bool)
	() ( bool)
	() ( int64)
}) {
	.Masks = .()
	.Emojis = .()
	.Stickerset = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateMoveStickerSetToTop) () tdp.Type {
	 := tdp.Type{
		Name: "updateMoveStickerSetToTop",
		ID:   UpdateMoveStickerSetToTopTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Masks",
			SchemaName: "masks",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Emojis",
			SchemaName: "emojis",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Stickerset",
			SchemaName: "stickerset",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateMoveStickerSetToTop) () {
	if !(.Masks == false) {
		.Flags.Set(0)
	}
	if !(.Emojis == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateMoveStickerSetToTop) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMoveStickerSetToTop#86fccf85 as nil")
	}
	.PutID(UpdateMoveStickerSetToTopTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMoveStickerSetToTop) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMoveStickerSetToTop#86fccf85 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMoveStickerSetToTop#86fccf85: field flags: %w", )
	}
	.PutLong(.Stickerset)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMoveStickerSetToTop) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMoveStickerSetToTop#86fccf85 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMoveStickerSetToTop#86fccf85: field flags: %w", )
		}
	}
	.Masks = .Flags.Has(0)
	.Emojis = .Flags.Has(1)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateMoveStickerSetToTop#86fccf85: field stickerset: %w", )
		}
		.Stickerset = 
	}
	return nil
}

// SetMasks sets value of Masks conditional field.
func ( *UpdateMoveStickerSetToTop) ( bool) {
	if  {
		.Flags.Set(0)
		.Masks = true
	} else {
		.Flags.Unset(0)
		.Masks = false
	}
}

// GetMasks returns value of Masks conditional field.
func ( *UpdateMoveStickerSetToTop) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetEmojis sets value of Emojis conditional field.
func ( *UpdateMoveStickerSetToTop) ( bool) {
	if  {
		.Flags.Set(1)
		.Emojis = true
	} else {
		.Flags.Unset(1)
		.Emojis = false
	}
}

// GetEmojis returns value of Emojis conditional field.
func ( *UpdateMoveStickerSetToTop) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetStickerset returns value of Stickerset field.
func ( *UpdateMoveStickerSetToTop) () ( int64) {
	if  == nil {
		return
	}
	return .Stickerset
}

// UpdateMessageExtendedMedia represents TL type `updateMessageExtendedMedia#d5a41724`.
// You bought a paid media »¹: this update contains the revealed media.
//
// Links:
//  1. https://core.telegram.org/api/paid-media
//
// See https://core.telegram.org/constructor/updateMessageExtendedMedia for reference.
type UpdateMessageExtendedMedia struct {
	// Peer where the paid media was posted
	Peer PeerClass
	// ID of the message containing the paid media
	MsgID int
	// Revealed media, contains only messageExtendedMedia¹ constructors.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/messageExtendedMedia
	ExtendedMedia []MessageExtendedMediaClass
}

// UpdateMessageExtendedMediaTypeID is TL type id of UpdateMessageExtendedMedia.
const UpdateMessageExtendedMediaTypeID = 0xd5a41724

// construct implements constructor of UpdateClass.
func ( UpdateMessageExtendedMedia) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateMessageExtendedMedia{}
)

func ( *UpdateMessageExtendedMedia) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.ExtendedMedia == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateMessageExtendedMedia from given interface.
func ( *UpdateMessageExtendedMedia) ( interface {
	() ( PeerClass)
	() ( int)
	() ( []MessageExtendedMediaClass)
}) {
	.Peer = .()
	.MsgID = .()
	.ExtendedMedia = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateMessageExtendedMedia) () tdp.Type {
	 := tdp.Type{
		Name: "updateMessageExtendedMedia",
		ID:   UpdateMessageExtendedMediaTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "ExtendedMedia",
			SchemaName: "extended_media",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateMessageExtendedMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageExtendedMedia#d5a41724 as nil")
	}
	.PutID(UpdateMessageExtendedMediaTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessageExtendedMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageExtendedMedia#d5a41724 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateMessageExtendedMedia#d5a41724: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageExtendedMedia#d5a41724: field peer: %w", )
	}
	.PutInt(.MsgID)
	.PutVectorHeader(len(.ExtendedMedia))
	for ,  := range .ExtendedMedia {
		if  == nil {
			return fmt.Errorf("unable to encode updateMessageExtendedMedia#d5a41724: field extended_media element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateMessageExtendedMedia#d5a41724: field extended_media element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessageExtendedMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessageExtendedMedia#d5a41724 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageExtendedMedia#d5a41724: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageExtendedMedia#d5a41724: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageExtendedMedia#d5a41724: field extended_media: %w", )
		}

		if  > 0 {
			.ExtendedMedia = make([]MessageExtendedMediaClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessageExtendedMedia()
			if  != nil {
				return fmt.Errorf("unable to decode updateMessageExtendedMedia#d5a41724: field extended_media: %w", )
			}
			.ExtendedMedia = append(.ExtendedMedia, )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateMessageExtendedMedia) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMsgID returns value of MsgID field.
func ( *UpdateMessageExtendedMedia) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

// GetExtendedMedia returns value of ExtendedMedia field.
func ( *UpdateMessageExtendedMedia) () ( []MessageExtendedMediaClass) {
	if  == nil {
		return
	}
	return .ExtendedMedia
}

// MapExtendedMedia returns field ExtendedMedia wrapped in MessageExtendedMediaClassArray helper.
func ( *UpdateMessageExtendedMedia) () ( MessageExtendedMediaClassArray) {
	return MessageExtendedMediaClassArray(.ExtendedMedia)
}

// UpdateUser represents TL type `updateUser#20529438`.
// User (user¹ and/or userFull²) information was updated.
// This update can only be received through getDifference or in
// updates¹/updatesCombined² constructors, so it will always come bundled with the
// updated user³, that should be applied as usual »⁴, without re-fetching the info
// manually.
// However, full peer information will not come bundled in updates, so the full peer
// cache (userFull¹) must be invalidated for user_id when receiving this update.
//
// Links:
//  1. https://core.telegram.org/constructor/user
//  2. https://core.telegram.org/constructor/userFull
//  3. https://core.telegram.org/constructor/updates
//  4. https://core.telegram.org/constructor/updatesCombined
//  5. https://core.telegram.org/constructor/user
//  6. https://core.telegram.org/api/peers
//  7. https://core.telegram.org/constructor/userFull
//
// See https://core.telegram.org/constructor/updateUser for reference.
type UpdateUser struct {
	// User ID
	UserID int64
}

// UpdateUserTypeID is TL type id of UpdateUser.
const UpdateUserTypeID = 0x20529438

// construct implements constructor of UpdateClass.
func ( UpdateUser) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateUser{}
)

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

	return true
}

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

// FillFrom fills UpdateUser from given interface.
func ( *UpdateUser) ( interface {
	() ( int64)
}) {
	.UserID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateUser) () tdp.Type {
	 := tdp.Type{
		Name: "updateUser",
		ID:   UpdateUserTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateUser) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUser#20529438 as nil")
	}
	.PutID(UpdateUserTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateUser) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateUser#20529438 as nil")
	}
	.PutLong(.UserID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateUser) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateUser#20529438 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateUser#20529438: field user_id: %w", )
		}
		.UserID = 
	}
	return nil
}

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

// UpdateAutoSaveSettings represents TL type `updateAutoSaveSettings#ec05b097`.
// Media autosave settings have changed and must be refetched using account
// getAutoSaveSettings¹.
//
// Links:
//  1. https://core.telegram.org/method/account.getAutoSaveSettings
//
// See https://core.telegram.org/constructor/updateAutoSaveSettings for reference.
type UpdateAutoSaveSettings struct {
}

// UpdateAutoSaveSettingsTypeID is TL type id of UpdateAutoSaveSettings.
const UpdateAutoSaveSettingsTypeID = 0xec05b097

// construct implements constructor of UpdateClass.
func ( UpdateAutoSaveSettings) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateAutoSaveSettings{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateAutoSaveSettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateAutoSaveSettings#ec05b097 as nil")
	}
	.PutID(UpdateAutoSaveSettingsTypeID)
	return .EncodeBare()
}

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

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

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

// UpdateStory represents TL type `updateStory#75b3b798`.
// A new story was posted.
//
// See https://core.telegram.org/constructor/updateStory for reference.
type UpdateStory struct {
	// ID of the poster.
	Peer PeerClass
	// The story that was posted.
	Story StoryItemClass
}

// UpdateStoryTypeID is TL type id of UpdateStory.
const UpdateStoryTypeID = 0x75b3b798

// construct implements constructor of UpdateClass.
func ( UpdateStory) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateStory{}
)

func ( *UpdateStory) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Story == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateStory from given interface.
func ( *UpdateStory) ( interface {
	() ( PeerClass)
	() ( StoryItemClass)
}) {
	.Peer = .()
	.Story = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateStory) () tdp.Type {
	 := tdp.Type{
		Name: "updateStory",
		ID:   UpdateStoryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Story",
			SchemaName: "story",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateStory) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStory#75b3b798 as nil")
	}
	.PutID(UpdateStoryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStory) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStory#75b3b798 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateStory#75b3b798: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStory#75b3b798: field peer: %w", )
	}
	if .Story == nil {
		return fmt.Errorf("unable to encode updateStory#75b3b798: field story is nil")
	}
	if  := .Story.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStory#75b3b798: field story: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStory) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStory#75b3b798 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateStory#75b3b798: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := DecodeStoryItem()
		if  != nil {
			return fmt.Errorf("unable to decode updateStory#75b3b798: field story: %w", )
		}
		.Story = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateStory) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetStory returns value of Story field.
func ( *UpdateStory) () ( StoryItemClass) {
	if  == nil {
		return
	}
	return .Story
}

// UpdateReadStories represents TL type `updateReadStories#f74e932b`.
// Stories of a specific peer were marked as read.
//
// See https://core.telegram.org/constructor/updateReadStories for reference.
type UpdateReadStories struct {
	// The peer
	Peer PeerClass
	// ID of the last story that was marked as read
	MaxID int
}

// UpdateReadStoriesTypeID is TL type id of UpdateReadStories.
const UpdateReadStoriesTypeID = 0xf74e932b

// construct implements constructor of UpdateClass.
func ( UpdateReadStories) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateReadStories{}
)

func ( *UpdateReadStories) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MaxID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateReadStories from given interface.
func ( *UpdateReadStories) ( interface {
	() ( PeerClass)
	() ( int)
}) {
	.Peer = .()
	.MaxID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateReadStories) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadStories",
		ID:   UpdateReadStoriesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MaxID",
			SchemaName: "max_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateReadStories) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadStories#f74e932b as nil")
	}
	.PutID(UpdateReadStoriesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadStories) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadStories#f74e932b as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateReadStories#f74e932b: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadStories#f74e932b: field peer: %w", )
	}
	.PutInt(.MaxID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadStories) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadStories#f74e932b to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadStories#f74e932b: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadStories#f74e932b: field max_id: %w", )
		}
		.MaxID = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateReadStories) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMaxID returns value of MaxID field.
func ( *UpdateReadStories) () ( int) {
	if  == nil {
		return
	}
	return .MaxID
}

// UpdateStoryID represents TL type `updateStoryID#1bf335b9`.
// A story was successfully uploaded.
// Once a story is successfully uploaded, an updateStoryID¹ will be returned, indicating
// the story ID (id) that was attributed to the story (like for messages, random_id
// indicates the random_id that was passed to stories.sendStory²: this way, you can tell
// which story was assigned a specific id by checking which stories.sendStory³ call has
// the returned random_id).
//
// Links:
//  1. https://core.telegram.org/constructor/updateStoryID
//  2. https://core.telegram.org/method/stories.sendStory
//  3. https://core.telegram.org/method/stories.sendStory
//
// See https://core.telegram.org/constructor/updateStoryID for reference.
type UpdateStoryID struct {
	// The id that was attributed to the story.
	ID int
	// The random_id that was passed to stories.sendStory¹.
	//
	// Links:
	//  1) https://core.telegram.org/method/stories.sendStory
	RandomID int64
}

// UpdateStoryIDTypeID is TL type id of UpdateStoryID.
const UpdateStoryIDTypeID = 0x1bf335b9

// construct implements constructor of UpdateClass.
func ( UpdateStoryID) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateStoryID{}
)

func ( *UpdateStoryID) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.RandomID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateStoryID from given interface.
func ( *UpdateStoryID) ( interface {
	() ( int)
	() ( int64)
}) {
	.ID = .()
	.RandomID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateStoryID) () tdp.Type {
	 := tdp.Type{
		Name: "updateStoryID",
		ID:   UpdateStoryIDTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "RandomID",
			SchemaName: "random_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateStoryID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStoryID#1bf335b9 as nil")
	}
	.PutID(UpdateStoryIDTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStoryID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStoryID#1bf335b9 as nil")
	}
	.PutInt(.ID)
	.PutLong(.RandomID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStoryID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStoryID#1bf335b9 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateStoryID#1bf335b9: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateStoryID#1bf335b9: field random_id: %w", )
		}
		.RandomID = 
	}
	return nil
}

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

// GetRandomID returns value of RandomID field.
func ( *UpdateStoryID) () ( int64) {
	if  == nil {
		return
	}
	return .RandomID
}

// UpdateStoriesStealthMode represents TL type `updateStoriesStealthMode#2c084dc1`.
// Indicates that stories stealth mode¹ was activated.
//
// Links:
//  1. https://core.telegram.org/api/stories#stealth-mode
//
// See https://core.telegram.org/constructor/updateStoriesStealthMode for reference.
type UpdateStoriesStealthMode struct {
	// Information about the current stealth mode¹ session.
	//
	// Links:
	//  1) https://core.telegram.org/api/stories#stealth-mode
	StealthMode StoriesStealthMode
}

// UpdateStoriesStealthModeTypeID is TL type id of UpdateStoriesStealthMode.
const UpdateStoriesStealthModeTypeID = 0x2c084dc1

// construct implements constructor of UpdateClass.
func ( UpdateStoriesStealthMode) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateStoriesStealthMode{}
)

func ( *UpdateStoriesStealthMode) () bool {
	if  == nil {
		return true
	}
	if !(.StealthMode.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateStoriesStealthMode from given interface.
func ( *UpdateStoriesStealthMode) ( interface {
	() ( StoriesStealthMode)
}) {
	.StealthMode = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateStoriesStealthMode) () tdp.Type {
	 := tdp.Type{
		Name: "updateStoriesStealthMode",
		ID:   UpdateStoriesStealthModeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "StealthMode",
			SchemaName: "stealth_mode",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateStoriesStealthMode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStoriesStealthMode#2c084dc1 as nil")
	}
	.PutID(UpdateStoriesStealthModeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStoriesStealthMode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStoriesStealthMode#2c084dc1 as nil")
	}
	if  := .StealthMode.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStoriesStealthMode#2c084dc1: field stealth_mode: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStoriesStealthMode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStoriesStealthMode#2c084dc1 to nil")
	}
	{
		if  := .StealthMode.Decode();  != nil {
			return fmt.Errorf("unable to decode updateStoriesStealthMode#2c084dc1: field stealth_mode: %w", )
		}
	}
	return nil
}

// GetStealthMode returns value of StealthMode field.
func ( *UpdateStoriesStealthMode) () ( StoriesStealthMode) {
	if  == nil {
		return
	}
	return .StealthMode
}

// UpdateSentStoryReaction represents TL type `updateSentStoryReaction#7d627683`.
// Indicates we reacted to a story »¹.
//
// Links:
//  1. https://core.telegram.org/api/stories#reactions
//
// See https://core.telegram.org/constructor/updateSentStoryReaction for reference.
type UpdateSentStoryReaction struct {
	// The peer that sent the story
	Peer PeerClass
	// ID of the story we reacted to
	StoryID int
	// The reaction that was sent
	Reaction ReactionClass
}

// UpdateSentStoryReactionTypeID is TL type id of UpdateSentStoryReaction.
const UpdateSentStoryReactionTypeID = 0x7d627683

// construct implements constructor of UpdateClass.
func ( UpdateSentStoryReaction) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateSentStoryReaction{}
)

func ( *UpdateSentStoryReaction) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.StoryID == 0) {
		return false
	}
	if !(.Reaction == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateSentStoryReaction from given interface.
func ( *UpdateSentStoryReaction) ( interface {
	() ( PeerClass)
	() ( int)
	() ( ReactionClass)
}) {
	.Peer = .()
	.StoryID = .()
	.Reaction = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateSentStoryReaction) () tdp.Type {
	 := tdp.Type{
		Name: "updateSentStoryReaction",
		ID:   UpdateSentStoryReactionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "StoryID",
			SchemaName: "story_id",
		},
		{
			Name:       "Reaction",
			SchemaName: "reaction",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateSentStoryReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSentStoryReaction#7d627683 as nil")
	}
	.PutID(UpdateSentStoryReactionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateSentStoryReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSentStoryReaction#7d627683 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateSentStoryReaction#7d627683: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateSentStoryReaction#7d627683: field peer: %w", )
	}
	.PutInt(.StoryID)
	if .Reaction == nil {
		return fmt.Errorf("unable to encode updateSentStoryReaction#7d627683: field reaction is nil")
	}
	if  := .Reaction.Encode();  != nil {
		return fmt.Errorf("unable to encode updateSentStoryReaction#7d627683: field reaction: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateSentStoryReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateSentStoryReaction#7d627683 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateSentStoryReaction#7d627683: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateSentStoryReaction#7d627683: field story_id: %w", )
		}
		.StoryID = 
	}
	{
		,  := DecodeReaction()
		if  != nil {
			return fmt.Errorf("unable to decode updateSentStoryReaction#7d627683: field reaction: %w", )
		}
		.Reaction = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateSentStoryReaction) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetStoryID returns value of StoryID field.
func ( *UpdateSentStoryReaction) () ( int) {
	if  == nil {
		return
	}
	return .StoryID
}

// GetReaction returns value of Reaction field.
func ( *UpdateSentStoryReaction) () ( ReactionClass) {
	if  == nil {
		return
	}
	return .Reaction
}

// UpdateBotChatBoost represents TL type `updateBotChatBoost#904dd49c`.
// A channel/supergroup boost¹ has changed (bots only)
//
// Links:
//  1. https://core.telegram.org/api/boost
//
// See https://core.telegram.org/constructor/updateBotChatBoost for reference.
type UpdateBotChatBoost struct {
	// Channel
	Peer PeerClass
	// New boost information
	Boost Boost
	// QTS¹ event sequence identifier
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotChatBoostTypeID is TL type id of UpdateBotChatBoost.
const UpdateBotChatBoostTypeID = 0x904dd49c

// construct implements constructor of UpdateClass.
func ( UpdateBotChatBoost) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotChatBoost{}
)

func ( *UpdateBotChatBoost) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Boost.Zero()) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotChatBoost from given interface.
func ( *UpdateBotChatBoost) ( interface {
	() ( PeerClass)
	() ( Boost)
	() ( int)
}) {
	.Peer = .()
	.Boost = .()
	.Qts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotChatBoost) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotChatBoost",
		ID:   UpdateBotChatBoostTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Boost",
			SchemaName: "boost",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotChatBoost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotChatBoost#904dd49c as nil")
	}
	.PutID(UpdateBotChatBoostTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotChatBoost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotChatBoost#904dd49c as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateBotChatBoost#904dd49c: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotChatBoost#904dd49c: field peer: %w", )
	}
	if  := .Boost.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotChatBoost#904dd49c: field boost: %w", )
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotChatBoost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotChatBoost#904dd49c to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatBoost#904dd49c: field peer: %w", )
		}
		.Peer = 
	}
	{
		if  := .Boost.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotChatBoost#904dd49c: field boost: %w", )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatBoost#904dd49c: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateBotChatBoost) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetBoost returns value of Boost field.
func ( *UpdateBotChatBoost) () ( Boost) {
	if  == nil {
		return
	}
	return .Boost
}

// GetQts returns value of Qts field.
func ( *UpdateBotChatBoost) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateChannelViewForumAsMessages represents TL type `updateChannelViewForumAsMessages#7b68920`.
// Users may also choose to display messages from all topics as if they were sent to a
// normal group, using a "View as messages" setting in the local client.
// This setting only affects the current account, and is synced to other logged in
// sessions using the channels.toggleViewForumAsMessages¹ method; invoking this method
// will update the value of the view_forum_as_messages flag of channelFull² or dialog³
// and emit an updateChannelViewForumAsMessages⁴.
//
// Links:
//  1. https://core.telegram.org/method/channels.toggleViewForumAsMessages
//  2. https://core.telegram.org/constructor/channelFull
//  3. https://core.telegram.org/constructor/dialog
//  4. https://core.telegram.org/constructor/updateChannelViewForumAsMessages
//
// See https://core.telegram.org/constructor/updateChannelViewForumAsMessages for reference.
type UpdateChannelViewForumAsMessages struct {
	// The forum ID
	ChannelID int64
	// The new value of the toggle.
	Enabled bool
}

// UpdateChannelViewForumAsMessagesTypeID is TL type id of UpdateChannelViewForumAsMessages.
const UpdateChannelViewForumAsMessagesTypeID = 0x7b68920

// construct implements constructor of UpdateClass.
func ( UpdateChannelViewForumAsMessages) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateChannelViewForumAsMessages{}
)

func ( *UpdateChannelViewForumAsMessages) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.Enabled == false) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelViewForumAsMessages from given interface.
func ( *UpdateChannelViewForumAsMessages) ( interface {
	() ( int64)
	() ( bool)
}) {
	.ChannelID = .()
	.Enabled = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelViewForumAsMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelViewForumAsMessages",
		ID:   UpdateChannelViewForumAsMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "Enabled",
			SchemaName: "enabled",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChannelViewForumAsMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelViewForumAsMessages#7b68920 as nil")
	}
	.PutID(UpdateChannelViewForumAsMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelViewForumAsMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelViewForumAsMessages#7b68920 as nil")
	}
	.PutLong(.ChannelID)
	.PutBool(.Enabled)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelViewForumAsMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelViewForumAsMessages#7b68920 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelViewForumAsMessages#7b68920: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelViewForumAsMessages#7b68920: field enabled: %w", )
		}
		.Enabled = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateChannelViewForumAsMessages) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetEnabled returns value of Enabled field.
func ( *UpdateChannelViewForumAsMessages) () ( bool) {
	if  == nil {
		return
	}
	return .Enabled
}

// UpdatePeerWallpaper represents TL type `updatePeerWallpaper#ae3f101d`.
// The wallpaper »¹ of a given peer has changed.
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// See https://core.telegram.org/constructor/updatePeerWallpaper for reference.
type UpdatePeerWallpaper struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the other user has chosen a custom wallpaper for us using messages
	// setChatWallPaper¹ and the for_both flag, see here »² for more info.
	//
	// Links:
	//  1) https://core.telegram.org/method/messages.setChatWallPaper
	//  2) https://core.telegram.org/api/wallpapers#installing-wallpapers-in-a-specific-chat-or-channel
	WallpaperOverridden bool
	// The peer where the wallpaper has changed.
	Peer PeerClass
	// The new wallpaper, if none the wallpaper was removed and the default wallpaper should
	// be used.
	//
	// Use SetWallpaper and GetWallpaper helpers.
	Wallpaper WallPaperClass
}

// UpdatePeerWallpaperTypeID is TL type id of UpdatePeerWallpaper.
const UpdatePeerWallpaperTypeID = 0xae3f101d

// construct implements constructor of UpdateClass.
func ( UpdatePeerWallpaper) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePeerWallpaper{}
)

func ( *UpdatePeerWallpaper) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.WallpaperOverridden == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Wallpaper == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePeerWallpaper from given interface.
func ( *UpdatePeerWallpaper) ( interface {
	() ( bool)
	() ( PeerClass)
	() ( WallPaperClass,  bool)
}) {
	.WallpaperOverridden = .()
	.Peer = .()
	if ,  := .();  {
		.Wallpaper = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePeerWallpaper) () tdp.Type {
	 := tdp.Type{
		Name: "updatePeerWallpaper",
		ID:   UpdatePeerWallpaperTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "WallpaperOverridden",
			SchemaName: "wallpaper_overridden",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Wallpaper",
			SchemaName: "wallpaper",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdatePeerWallpaper) () {
	if !(.WallpaperOverridden == false) {
		.Flags.Set(1)
	}
	if !(.Wallpaper == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdatePeerWallpaper) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerWallpaper#ae3f101d as nil")
	}
	.PutID(UpdatePeerWallpaperTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePeerWallpaper) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePeerWallpaper#ae3f101d as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field peer: %w", )
	}
	if .Flags.Has(0) {
		if .Wallpaper == nil {
			return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field wallpaper is nil")
		}
		if  := .Wallpaper.Encode();  != nil {
			return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field wallpaper: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePeerWallpaper) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePeerWallpaper#ae3f101d to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePeerWallpaper#ae3f101d: field flags: %w", )
		}
	}
	.WallpaperOverridden = .Flags.Has(1)
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updatePeerWallpaper#ae3f101d: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(0) {
		,  := DecodeWallPaper()
		if  != nil {
			return fmt.Errorf("unable to decode updatePeerWallpaper#ae3f101d: field wallpaper: %w", )
		}
		.Wallpaper = 
	}
	return nil
}

// SetWallpaperOverridden sets value of WallpaperOverridden conditional field.
func ( *UpdatePeerWallpaper) ( bool) {
	if  {
		.Flags.Set(1)
		.WallpaperOverridden = true
	} else {
		.Flags.Unset(1)
		.WallpaperOverridden = false
	}
}

// GetWallpaperOverridden returns value of WallpaperOverridden conditional field.
func ( *UpdatePeerWallpaper) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetPeer returns value of Peer field.
func ( *UpdatePeerWallpaper) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// SetWallpaper sets value of Wallpaper conditional field.
func ( *UpdatePeerWallpaper) ( WallPaperClass) {
	.Flags.Set(0)
	.Wallpaper = 
}

// GetWallpaper returns value of Wallpaper conditional field and
// boolean which is true if field was set.
func ( *UpdatePeerWallpaper) () ( WallPaperClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Wallpaper, true
}

// UpdateBotMessageReaction represents TL type `updateBotMessageReaction#ac21d3ce`.
// Bots only: a user has changed their reactions on a message with public reactions.
//
// See https://core.telegram.org/constructor/updateBotMessageReaction for reference.
type UpdateBotMessageReaction struct {
	// Peer of the reacted-to message.
	Peer PeerClass
	// ID of the reacted-to message.
	MsgID int
	// Date of the change.
	Date int
	// The user that (un)reacted to the message.
	Actor PeerClass
	// Old reactions
	OldReactions []ReactionClass
	// New reactions
	NewReactions []ReactionClass
	// QTS¹ event sequence identifier
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotMessageReactionTypeID is TL type id of UpdateBotMessageReaction.
const UpdateBotMessageReactionTypeID = 0xac21d3ce

// construct implements constructor of UpdateClass.
func ( UpdateBotMessageReaction) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotMessageReaction{}
)

func ( *UpdateBotMessageReaction) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Actor == nil) {
		return false
	}
	if !(.OldReactions == nil) {
		return false
	}
	if !(.NewReactions == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotMessageReaction from given interface.
func ( *UpdateBotMessageReaction) ( interface {
	() ( PeerClass)
	() ( int)
	() ( int)
	() ( PeerClass)
	() ( []ReactionClass)
	() ( []ReactionClass)
	() ( int)
}) {
	.Peer = .()
	.MsgID = .()
	.Date = .()
	.Actor = .()
	.OldReactions = .()
	.NewReactions = .()
	.Qts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotMessageReaction) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotMessageReaction",
		ID:   UpdateBotMessageReactionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "Actor",
			SchemaName: "actor",
		},
		{
			Name:       "OldReactions",
			SchemaName: "old_reactions",
		},
		{
			Name:       "NewReactions",
			SchemaName: "new_reactions",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotMessageReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotMessageReaction#ac21d3ce as nil")
	}
	.PutID(UpdateBotMessageReactionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotMessageReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotMessageReaction#ac21d3ce as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field peer: %w", )
	}
	.PutInt(.MsgID)
	.PutInt(.Date)
	if .Actor == nil {
		return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field actor is nil")
	}
	if  := .Actor.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field actor: %w", )
	}
	.PutVectorHeader(len(.OldReactions))
	for ,  := range .OldReactions {
		if  == nil {
			return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field old_reactions element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field old_reactions element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.NewReactions))
	for ,  := range .NewReactions {
		if  == nil {
			return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field new_reactions element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field new_reactions element with index %d: %w", , )
		}
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotMessageReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotMessageReaction#ac21d3ce to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field date: %w", )
		}
		.Date = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field actor: %w", )
		}
		.Actor = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field old_reactions: %w", )
		}

		if  > 0 {
			.OldReactions = make([]ReactionClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeReaction()
			if  != nil {
				return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field old_reactions: %w", )
			}
			.OldReactions = append(.OldReactions, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field new_reactions: %w", )
		}

		if  > 0 {
			.NewReactions = make([]ReactionClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeReaction()
			if  != nil {
				return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field new_reactions: %w", )
			}
			.NewReactions = append(.NewReactions, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateBotMessageReaction) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMsgID returns value of MsgID field.
func ( *UpdateBotMessageReaction) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

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

// GetActor returns value of Actor field.
func ( *UpdateBotMessageReaction) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Actor
}

// GetOldReactions returns value of OldReactions field.
func ( *UpdateBotMessageReaction) () ( []ReactionClass) {
	if  == nil {
		return
	}
	return .OldReactions
}

// GetNewReactions returns value of NewReactions field.
func ( *UpdateBotMessageReaction) () ( []ReactionClass) {
	if  == nil {
		return
	}
	return .NewReactions
}

// GetQts returns value of Qts field.
func ( *UpdateBotMessageReaction) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// MapOldReactions returns field OldReactions wrapped in ReactionClassArray helper.
func ( *UpdateBotMessageReaction) () ( ReactionClassArray) {
	return ReactionClassArray(.OldReactions)
}

// MapNewReactions returns field NewReactions wrapped in ReactionClassArray helper.
func ( *UpdateBotMessageReaction) () ( ReactionClassArray) {
	return ReactionClassArray(.NewReactions)
}

// UpdateBotMessageReactions represents TL type `updateBotMessageReactions#9cb7759`.
// Bots only: the number of reactions on a message with anonymous reactions has changed.
//
// See https://core.telegram.org/constructor/updateBotMessageReactions for reference.
type UpdateBotMessageReactions struct {
	// Peer of the reacted-to message.
	Peer PeerClass
	// ID of the reacted-to message.
	MsgID int
	// Date of the change.
	Date int
	// New reaction counters.
	Reactions []ReactionCount
	// QTS¹ event sequence identifier
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotMessageReactionsTypeID is TL type id of UpdateBotMessageReactions.
const UpdateBotMessageReactionsTypeID = 0x9cb7759

// construct implements constructor of UpdateClass.
func ( UpdateBotMessageReactions) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateBotMessageReactions{}
)

func ( *UpdateBotMessageReactions) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Reactions == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateBotMessageReactions from given interface.
func ( *UpdateBotMessageReactions) ( interface {
	() ( PeerClass)
	() ( int)
	() ( int)
	() ( []ReactionCount)
	() ( int)
}) {
	.Peer = .()
	.MsgID = .()
	.Date = .()
	.Reactions = .()
	.Qts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateBotMessageReactions) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotMessageReactions",
		ID:   UpdateBotMessageReactionsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "Reactions",
			SchemaName: "reactions",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotMessageReactions#9cb7759 as nil")
	}
	.PutID(UpdateBotMessageReactionsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotMessageReactions#9cb7759 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateBotMessageReactions#9cb7759: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotMessageReactions#9cb7759: field peer: %w", )
	}
	.PutInt(.MsgID)
	.PutInt(.Date)
	.PutVectorHeader(len(.Reactions))
	for ,  := range .Reactions {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotMessageReactions#9cb7759: field reactions element with index %d: %w", , )
		}
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotMessageReactions#9cb7759 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field reactions: %w", )
		}

		if  > 0 {
			.Reactions = make([]ReactionCount, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  ReactionCount
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field reactions: %w", )
			}
			.Reactions = append(.Reactions, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateBotMessageReactions) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMsgID returns value of MsgID field.
func ( *UpdateBotMessageReactions) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

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

// GetReactions returns value of Reactions field.
func ( *UpdateBotMessageReactions) () ( []ReactionCount) {
	if  == nil {
		return
	}
	return .Reactions
}

// GetQts returns value of Qts field.
func ( *UpdateBotMessageReactions) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateSavedDialogPinned represents TL type `updateSavedDialogPinned#aeaf9e74`.
// A saved message dialog¹ was pinned/unpinned
//
// Links:
//  1. https://core.telegram.org/api/saved-messages
//
// See https://core.telegram.org/constructor/updateSavedDialogPinned for reference.
type UpdateSavedDialogPinned struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the dialog was pinned
	Pinned bool
	// The dialog
	Peer DialogPeerClass
}

// UpdateSavedDialogPinnedTypeID is TL type id of UpdateSavedDialogPinned.
const UpdateSavedDialogPinnedTypeID = 0xaeaf9e74

// construct implements constructor of UpdateClass.
func ( UpdateSavedDialogPinned) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateSavedDialogPinned{}
)

func ( *UpdateSavedDialogPinned) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Pinned == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateSavedDialogPinned from given interface.
func ( *UpdateSavedDialogPinned) ( interface {
	() ( bool)
	() ( DialogPeerClass)
}) {
	.Pinned = .()
	.Peer = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateSavedDialogPinned) () tdp.Type {
	 := tdp.Type{
		Name: "updateSavedDialogPinned",
		ID:   UpdateSavedDialogPinnedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Pinned",
			SchemaName: "pinned",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateSavedDialogPinned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSavedDialogPinned#aeaf9e74 as nil")
	}
	.PutID(UpdateSavedDialogPinnedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateSavedDialogPinned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSavedDialogPinned#aeaf9e74 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateSavedDialogPinned#aeaf9e74: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateSavedDialogPinned#aeaf9e74: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateSavedDialogPinned#aeaf9e74: field peer: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateSavedDialogPinned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateSavedDialogPinned#aeaf9e74 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateSavedDialogPinned#aeaf9e74: field flags: %w", )
		}
	}
	.Pinned = .Flags.Has(0)
	{
		,  := DecodeDialogPeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateSavedDialogPinned#aeaf9e74: field peer: %w", )
		}
		.Peer = 
	}
	return nil
}

// SetPinned sets value of Pinned conditional field.
func ( *UpdateSavedDialogPinned) ( bool) {
	if  {
		.Flags.Set(0)
		.Pinned = true
	} else {
		.Flags.Unset(0)
		.Pinned = false
	}
}

// GetPinned returns value of Pinned conditional field.
func ( *UpdateSavedDialogPinned) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetPeer returns value of Peer field.
func ( *UpdateSavedDialogPinned) () ( DialogPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// UpdatePinnedSavedDialogs represents TL type `updatePinnedSavedDialogs#686c85a6`.
// Pinned saved dialogs »¹ were updated
//
// Links:
//  1. https://core.telegram.org/api/saved-messages
//
// See https://core.telegram.org/constructor/updatePinnedSavedDialogs for reference.
type UpdatePinnedSavedDialogs struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// New order of pinned saved dialogs
	//
	// Use SetOrder and GetOrder helpers.
	Order []DialogPeerClass
}

// UpdatePinnedSavedDialogsTypeID is TL type id of UpdatePinnedSavedDialogs.
const UpdatePinnedSavedDialogsTypeID = 0x686c85a6

// construct implements constructor of UpdateClass.
func ( UpdatePinnedSavedDialogs) () UpdateClass { return & }

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

	_ UpdateClass = &UpdatePinnedSavedDialogs{}
)

func ( *UpdatePinnedSavedDialogs) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Order == nil) {
		return false
	}

	return true
}

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

// FillFrom fills UpdatePinnedSavedDialogs from given interface.
func ( *UpdatePinnedSavedDialogs) ( interface {
	() ( []DialogPeerClass,  bool)
}) {
	if ,  := .();  {
		.Order = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdatePinnedSavedDialogs) () tdp.Type {
	 := tdp.Type{
		Name: "updatePinnedSavedDialogs",
		ID:   UpdatePinnedSavedDialogsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Order",
			SchemaName: "order",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdatePinnedSavedDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedSavedDialogs#686c85a6 as nil")
	}
	.PutID(UpdatePinnedSavedDialogsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePinnedSavedDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedSavedDialogs#686c85a6 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedSavedDialogs#686c85a6: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutVectorHeader(len(.Order))
		for ,  := range .Order {
			if  == nil {
				return fmt.Errorf("unable to encode updatePinnedSavedDialogs#686c85a6: field order element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode updatePinnedSavedDialogs#686c85a6: field order element with index %d: %w", , )
			}
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePinnedSavedDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePinnedSavedDialogs#686c85a6 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePinnedSavedDialogs#686c85a6: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedSavedDialogs#686c85a6: field order: %w", )
		}

		if  > 0 {
			.Order = make([]DialogPeerClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeDialogPeer()
			if  != nil {
				return fmt.Errorf("unable to decode updatePinnedSavedDialogs#686c85a6: field order: %w", )
			}
			.Order = append(.Order, )
		}
	}
	return nil
}

// SetOrder sets value of Order conditional field.
func ( *UpdatePinnedSavedDialogs) ( []DialogPeerClass) {
	.Flags.Set(0)
	.Order = 
}

// GetOrder returns value of Order conditional field and
// boolean which is true if field was set.
func ( *UpdatePinnedSavedDialogs) () ( []DialogPeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Order, true
}

// MapOrder returns field Order wrapped in DialogPeerClassArray helper.
func ( *UpdatePinnedSavedDialogs) () ( DialogPeerClassArray,  bool) {
	if !.Flags.Has(0) {
		return , false
	}
	return DialogPeerClassArray(.Order), true
}

// UpdateSavedReactionTags represents TL type `updateSavedReactionTags#39c67432`.
// The list of reaction tag »¹ names assigned by the user has changed and should be
// refetched using messages.getSavedReactionTags »².
//
// Links:
//  1. https://core.telegram.org/api/saved-messages#tags
//  2. https://core.telegram.org/method/messages.getSavedReactionTags
//
// See https://core.telegram.org/constructor/updateSavedReactionTags for reference.
type UpdateSavedReactionTags struct {
}

// UpdateSavedReactionTagsTypeID is TL type id of UpdateSavedReactionTags.
const UpdateSavedReactionTagsTypeID = 0x39c67432

// construct implements constructor of UpdateClass.
func ( UpdateSavedReactionTags) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateSavedReactionTags{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateSavedReactionTags) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSavedReactionTags#39c67432 as nil")
	}
	.PutID(UpdateSavedReactionTagsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateSavedReactionTags) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSavedReactionTags#39c67432 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateSavedReactionTags) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateSavedReactionTags#39c67432 to nil")
	}
	return nil
}

// UpdateSMSJob represents TL type `updateSmsJob#f16269d4`.
// A new SMS job was received
//
// See https://core.telegram.org/constructor/updateSmsJob for reference.
type UpdateSMSJob struct {
	// SMS job ID
	JobID string
}

// UpdateSMSJobTypeID is TL type id of UpdateSMSJob.
const UpdateSMSJobTypeID = 0xf16269d4

// construct implements constructor of UpdateClass.
func ( UpdateSMSJob) () UpdateClass { return & }

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

	_ UpdateClass = &UpdateSMSJob{}
)

func ( *UpdateSMSJob) () bool {
	if  == nil {
		return true
	}
	if !(.JobID == "") {
		return false
	}

	return true
}

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

// FillFrom fills UpdateSMSJob from given interface.
func ( *UpdateSMSJob) ( interface {
	() ( string)
}) {
	.JobID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateSMSJob) () tdp.Type {
	 := tdp.Type{
		Name: "updateSmsJob",
		ID:   UpdateSMSJobTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "JobID",
			SchemaName: "job_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateSMSJob) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSmsJob#f16269d4 as nil")
	}
	.PutID(UpdateSMSJobTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateSMSJob) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSmsJob#f16269d4 as nil")
	}
	.PutString(.JobID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateSMSJob) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateSmsJob#f16269d4 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateSmsJob#f16269d4: field job_id: %w", )
		}
		.JobID = 
	}
	return nil
}

// GetJobID returns value of JobID field.
func ( *UpdateSMSJob) () ( string) {
	if  == nil {
		return
	}
	return .JobID
}

// UpdateQuickReplies represents TL type `updateQuickReplies#f9470ab2`.
// Info about or the order of quick reply shortcuts »¹ was changed.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//
// See https://core.telegram.org/constructor/updateQuickReplies for reference.
type UpdateQuickReplies struct {
	// New quick reply shortcut order and information.
	QuickReplies []QuickReply
}

// UpdateQuickRepliesTypeID is TL type id of UpdateQuickReplies.
const UpdateQuickRepliesTypeID = 0xf9470ab2

// construct implements constructor of UpdateClass.
func ( UpdateQuickReplies) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateQuickReplies.
var (
	_ bin.Encoder     = &UpdateQuickReplies{}
	_ bin.Decoder     = &UpdateQuickReplies{}
	_ bin.BareEncoder = &UpdateQuickReplies{}
	_ bin.BareDecoder = &UpdateQuickReplies{}

	_ UpdateClass = &UpdateQuickReplies{}
)

func ( *UpdateQuickReplies) () bool {
	if  == nil {
		return true
	}
	if !(.QuickReplies == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateQuickReplies) () string {
	if  == nil {
		return "UpdateQuickReplies(nil)"
	}
	type  UpdateQuickReplies
	return fmt.Sprintf("UpdateQuickReplies%+v", (*))
}

// FillFrom fills UpdateQuickReplies from given interface.
func ( *UpdateQuickReplies) ( interface {
	() ( []QuickReply)
}) {
	.QuickReplies = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateQuickReplies) () uint32 {
	return UpdateQuickRepliesTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateQuickReplies) () string {
	return "updateQuickReplies"
}

// TypeInfo returns info about TL type.
func ( *UpdateQuickReplies) () tdp.Type {
	 := tdp.Type{
		Name: "updateQuickReplies",
		ID:   UpdateQuickRepliesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QuickReplies",
			SchemaName: "quick_replies",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateQuickReplies) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateQuickReplies#f9470ab2 as nil")
	}
	.PutID(UpdateQuickRepliesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateQuickReplies) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateQuickReplies#f9470ab2 as nil")
	}
	.PutVectorHeader(len(.QuickReplies))
	for ,  := range .QuickReplies {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode updateQuickReplies#f9470ab2: field quick_replies element with index %d: %w", , )
		}
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateQuickReplies) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateQuickReplies#f9470ab2 to nil")
	}
	if  := .ConsumeID(UpdateQuickRepliesTypeID);  != nil {
		return fmt.Errorf("unable to decode updateQuickReplies#f9470ab2: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateQuickReplies) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateQuickReplies#f9470ab2 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateQuickReplies#f9470ab2: field quick_replies: %w", )
		}

		if  > 0 {
			.QuickReplies = make([]QuickReply, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  QuickReply
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode updateQuickReplies#f9470ab2: field quick_replies: %w", )
			}
			.QuickReplies = append(.QuickReplies, )
		}
	}
	return nil
}

// GetQuickReplies returns value of QuickReplies field.
func ( *UpdateQuickReplies) () ( []QuickReply) {
	if  == nil {
		return
	}
	return .QuickReplies
}

// UpdateNewQuickReply represents TL type `updateNewQuickReply#f53da717`.
// A new quick reply shortcut »¹ was created.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//
// See https://core.telegram.org/constructor/updateNewQuickReply for reference.
type UpdateNewQuickReply struct {
	// Quick reply shortcut.
	QuickReply QuickReply
}

// UpdateNewQuickReplyTypeID is TL type id of UpdateNewQuickReply.
const UpdateNewQuickReplyTypeID = 0xf53da717

// construct implements constructor of UpdateClass.
func ( UpdateNewQuickReply) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateNewQuickReply.
var (
	_ bin.Encoder     = &UpdateNewQuickReply{}
	_ bin.Decoder     = &UpdateNewQuickReply{}
	_ bin.BareEncoder = &UpdateNewQuickReply{}
	_ bin.BareDecoder = &UpdateNewQuickReply{}

	_ UpdateClass = &UpdateNewQuickReply{}
)

func ( *UpdateNewQuickReply) () bool {
	if  == nil {
		return true
	}
	if !(.QuickReply.Zero()) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateNewQuickReply) () string {
	if  == nil {
		return "UpdateNewQuickReply(nil)"
	}
	type  UpdateNewQuickReply
	return fmt.Sprintf("UpdateNewQuickReply%+v", (*))
}

// FillFrom fills UpdateNewQuickReply from given interface.
func ( *UpdateNewQuickReply) ( interface {
	() ( QuickReply)
}) {
	.QuickReply = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateNewQuickReply) () uint32 {
	return UpdateNewQuickReplyTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateNewQuickReply) () string {
	return "updateNewQuickReply"
}

// TypeInfo returns info about TL type.
func ( *UpdateNewQuickReply) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewQuickReply",
		ID:   UpdateNewQuickReplyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QuickReply",
			SchemaName: "quick_reply",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateNewQuickReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewQuickReply#f53da717 as nil")
	}
	.PutID(UpdateNewQuickReplyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewQuickReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewQuickReply#f53da717 as nil")
	}
	if  := .QuickReply.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewQuickReply#f53da717: field quick_reply: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateNewQuickReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewQuickReply#f53da717 to nil")
	}
	if  := .ConsumeID(UpdateNewQuickReplyTypeID);  != nil {
		return fmt.Errorf("unable to decode updateNewQuickReply#f53da717: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewQuickReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewQuickReply#f53da717 to nil")
	}
	{
		if  := .QuickReply.Decode();  != nil {
			return fmt.Errorf("unable to decode updateNewQuickReply#f53da717: field quick_reply: %w", )
		}
	}
	return nil
}

// GetQuickReply returns value of QuickReply field.
func ( *UpdateNewQuickReply) () ( QuickReply) {
	if  == nil {
		return
	}
	return .QuickReply
}

// UpdateDeleteQuickReply represents TL type `updateDeleteQuickReply#53e6f1ec`.
// A quick reply shortcut »¹ was deleted. This will not emit
// updateDeleteQuickReplyMessages² updates, even if all the messages in the shortcut are
// also deleted by this update.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//  2. https://core.telegram.org/constructor/updateDeleteQuickReplyMessages
//
// See https://core.telegram.org/constructor/updateDeleteQuickReply for reference.
type UpdateDeleteQuickReply struct {
	// ID of the quick reply shortcut that was deleted.
	ShortcutID int
}

// UpdateDeleteQuickReplyTypeID is TL type id of UpdateDeleteQuickReply.
const UpdateDeleteQuickReplyTypeID = 0x53e6f1ec

// construct implements constructor of UpdateClass.
func ( UpdateDeleteQuickReply) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateDeleteQuickReply.
var (
	_ bin.Encoder     = &UpdateDeleteQuickReply{}
	_ bin.Decoder     = &UpdateDeleteQuickReply{}
	_ bin.BareEncoder = &UpdateDeleteQuickReply{}
	_ bin.BareDecoder = &UpdateDeleteQuickReply{}

	_ UpdateClass = &UpdateDeleteQuickReply{}
)

func ( *UpdateDeleteQuickReply) () bool {
	if  == nil {
		return true
	}
	if !(.ShortcutID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateDeleteQuickReply) () string {
	if  == nil {
		return "UpdateDeleteQuickReply(nil)"
	}
	type  UpdateDeleteQuickReply
	return fmt.Sprintf("UpdateDeleteQuickReply%+v", (*))
}

// FillFrom fills UpdateDeleteQuickReply from given interface.
func ( *UpdateDeleteQuickReply) ( interface {
	() ( int)
}) {
	.ShortcutID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateDeleteQuickReply) () uint32 {
	return UpdateDeleteQuickReplyTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateDeleteQuickReply) () string {
	return "updateDeleteQuickReply"
}

// TypeInfo returns info about TL type.
func ( *UpdateDeleteQuickReply) () tdp.Type {
	 := tdp.Type{
		Name: "updateDeleteQuickReply",
		ID:   UpdateDeleteQuickReplyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ShortcutID",
			SchemaName: "shortcut_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateDeleteQuickReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteQuickReply#53e6f1ec as nil")
	}
	.PutID(UpdateDeleteQuickReplyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDeleteQuickReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteQuickReply#53e6f1ec as nil")
	}
	.PutInt(.ShortcutID)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateDeleteQuickReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteQuickReply#53e6f1ec to nil")
	}
	if  := .ConsumeID(UpdateDeleteQuickReplyTypeID);  != nil {
		return fmt.Errorf("unable to decode updateDeleteQuickReply#53e6f1ec: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDeleteQuickReply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteQuickReply#53e6f1ec to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteQuickReply#53e6f1ec: field shortcut_id: %w", )
		}
		.ShortcutID = 
	}
	return nil
}

// GetShortcutID returns value of ShortcutID field.
func ( *UpdateDeleteQuickReply) () ( int) {
	if  == nil {
		return
	}
	return .ShortcutID
}

// UpdateQuickReplyMessage represents TL type `updateQuickReplyMessage#3e050d0f`.
// A new message was added to a quick reply shortcut »¹.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//
// See https://core.telegram.org/constructor/updateQuickReplyMessage for reference.
type UpdateQuickReplyMessage struct {
	// The message that was added (the message¹.quick_reply_shortcut_id field will contain
	// the shortcut ID).
	//
	// Links:
	//  1) https://core.telegram.org/constructor/message
	Message MessageClass
}

// UpdateQuickReplyMessageTypeID is TL type id of UpdateQuickReplyMessage.
const UpdateQuickReplyMessageTypeID = 0x3e050d0f

// construct implements constructor of UpdateClass.
func ( UpdateQuickReplyMessage) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateQuickReplyMessage.
var (
	_ bin.Encoder     = &UpdateQuickReplyMessage{}
	_ bin.Decoder     = &UpdateQuickReplyMessage{}
	_ bin.BareEncoder = &UpdateQuickReplyMessage{}
	_ bin.BareDecoder = &UpdateQuickReplyMessage{}

	_ UpdateClass = &UpdateQuickReplyMessage{}
)

func ( *UpdateQuickReplyMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Message == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateQuickReplyMessage) () string {
	if  == nil {
		return "UpdateQuickReplyMessage(nil)"
	}
	type  UpdateQuickReplyMessage
	return fmt.Sprintf("UpdateQuickReplyMessage%+v", (*))
}

// FillFrom fills UpdateQuickReplyMessage from given interface.
func ( *UpdateQuickReplyMessage) ( interface {
	() ( MessageClass)
}) {
	.Message = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateQuickReplyMessage) () uint32 {
	return UpdateQuickReplyMessageTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateQuickReplyMessage) () string {
	return "updateQuickReplyMessage"
}

// TypeInfo returns info about TL type.
func ( *UpdateQuickReplyMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateQuickReplyMessage",
		ID:   UpdateQuickReplyMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Message",
			SchemaName: "message",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateQuickReplyMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateQuickReplyMessage#3e050d0f as nil")
	}
	.PutID(UpdateQuickReplyMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateQuickReplyMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateQuickReplyMessage#3e050d0f as nil")
	}
	if .Message == nil {
		return fmt.Errorf("unable to encode updateQuickReplyMessage#3e050d0f: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateQuickReplyMessage#3e050d0f: field message: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateQuickReplyMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateQuickReplyMessage#3e050d0f to nil")
	}
	if  := .ConsumeID(UpdateQuickReplyMessageTypeID);  != nil {
		return fmt.Errorf("unable to decode updateQuickReplyMessage#3e050d0f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateQuickReplyMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateQuickReplyMessage#3e050d0f to nil")
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateQuickReplyMessage#3e050d0f: field message: %w", )
		}
		.Message = 
	}
	return nil
}

// GetMessage returns value of Message field.
func ( *UpdateQuickReplyMessage) () ( MessageClass) {
	if  == nil {
		return
	}
	return .Message
}

// UpdateDeleteQuickReplyMessages represents TL type `updateDeleteQuickReplyMessages#566fe7cd`.
// One or more messages in a quick reply shortcut »¹ were deleted.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//
// See https://core.telegram.org/constructor/updateDeleteQuickReplyMessages for reference.
type UpdateDeleteQuickReplyMessages struct {
	// Quick reply shortcut ID.
	ShortcutID int
	// IDs of the deleted messages.
	Messages []int
}

// UpdateDeleteQuickReplyMessagesTypeID is TL type id of UpdateDeleteQuickReplyMessages.
const UpdateDeleteQuickReplyMessagesTypeID = 0x566fe7cd

// construct implements constructor of UpdateClass.
func ( UpdateDeleteQuickReplyMessages) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateDeleteQuickReplyMessages.
var (
	_ bin.Encoder     = &UpdateDeleteQuickReplyMessages{}
	_ bin.Decoder     = &UpdateDeleteQuickReplyMessages{}
	_ bin.BareEncoder = &UpdateDeleteQuickReplyMessages{}
	_ bin.BareDecoder = &UpdateDeleteQuickReplyMessages{}

	_ UpdateClass = &UpdateDeleteQuickReplyMessages{}
)

func ( *UpdateDeleteQuickReplyMessages) () bool {
	if  == nil {
		return true
	}
	if !(.ShortcutID == 0) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateDeleteQuickReplyMessages) () string {
	if  == nil {
		return "UpdateDeleteQuickReplyMessages(nil)"
	}
	type  UpdateDeleteQuickReplyMessages
	return fmt.Sprintf("UpdateDeleteQuickReplyMessages%+v", (*))
}

// FillFrom fills UpdateDeleteQuickReplyMessages from given interface.
func ( *UpdateDeleteQuickReplyMessages) ( interface {
	() ( int)
	() ( []int)
}) {
	.ShortcutID = .()
	.Messages = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateDeleteQuickReplyMessages) () uint32 {
	return UpdateDeleteQuickReplyMessagesTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateDeleteQuickReplyMessages) () string {
	return "updateDeleteQuickReplyMessages"
}

// TypeInfo returns info about TL type.
func ( *UpdateDeleteQuickReplyMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updateDeleteQuickReplyMessages",
		ID:   UpdateDeleteQuickReplyMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ShortcutID",
			SchemaName: "shortcut_id",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateDeleteQuickReplyMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteQuickReplyMessages#566fe7cd as nil")
	}
	.PutID(UpdateDeleteQuickReplyMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDeleteQuickReplyMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteQuickReplyMessages#566fe7cd as nil")
	}
	.PutInt(.ShortcutID)
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateDeleteQuickReplyMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteQuickReplyMessages#566fe7cd to nil")
	}
	if  := .ConsumeID(UpdateDeleteQuickReplyMessagesTypeID);  != nil {
		return fmt.Errorf("unable to decode updateDeleteQuickReplyMessages#566fe7cd: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDeleteQuickReplyMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteQuickReplyMessages#566fe7cd to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteQuickReplyMessages#566fe7cd: field shortcut_id: %w", )
		}
		.ShortcutID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteQuickReplyMessages#566fe7cd: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateDeleteQuickReplyMessages#566fe7cd: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	return nil
}

// GetShortcutID returns value of ShortcutID field.
func ( *UpdateDeleteQuickReplyMessages) () ( int) {
	if  == nil {
		return
	}
	return .ShortcutID
}

// GetMessages returns value of Messages field.
func ( *UpdateDeleteQuickReplyMessages) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

// UpdateBotBusinessConnect represents TL type `updateBotBusinessConnect#8ae5c97a`.
// Connecting or disconnecting a business bot¹ or changing the connection settings will
// emit an updateBotBusinessConnect² update to the bot, with the new settings and a
// connection_id that will be used by the bot to handle updates from and send messages as
// the user.
//
// Links:
//  1. https://core.telegram.org/api/bots/connected-business-bots
//  2. https://core.telegram.org/constructor/updateBotBusinessConnect
//
// See https://core.telegram.org/constructor/updateBotBusinessConnect for reference.
type UpdateBotBusinessConnect struct {
	// Business connection settings
	Connection BotBusinessConnection
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotBusinessConnectTypeID is TL type id of UpdateBotBusinessConnect.
const UpdateBotBusinessConnectTypeID = 0x8ae5c97a

// construct implements constructor of UpdateClass.
func ( UpdateBotBusinessConnect) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateBotBusinessConnect.
var (
	_ bin.Encoder     = &UpdateBotBusinessConnect{}
	_ bin.Decoder     = &UpdateBotBusinessConnect{}
	_ bin.BareEncoder = &UpdateBotBusinessConnect{}
	_ bin.BareDecoder = &UpdateBotBusinessConnect{}

	_ UpdateClass = &UpdateBotBusinessConnect{}
)

func ( *UpdateBotBusinessConnect) () bool {
	if  == nil {
		return true
	}
	if !(.Connection.Zero()) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateBotBusinessConnect) () string {
	if  == nil {
		return "UpdateBotBusinessConnect(nil)"
	}
	type  UpdateBotBusinessConnect
	return fmt.Sprintf("UpdateBotBusinessConnect%+v", (*))
}

// FillFrom fills UpdateBotBusinessConnect from given interface.
func ( *UpdateBotBusinessConnect) ( interface {
	() ( BotBusinessConnection)
	() ( int)
}) {
	.Connection = .()
	.Qts = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateBotBusinessConnect) () uint32 {
	return UpdateBotBusinessConnectTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateBotBusinessConnect) () string {
	return "updateBotBusinessConnect"
}

// TypeInfo returns info about TL type.
func ( *UpdateBotBusinessConnect) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotBusinessConnect",
		ID:   UpdateBotBusinessConnectTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Connection",
			SchemaName: "connection",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotBusinessConnect) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotBusinessConnect#8ae5c97a as nil")
	}
	.PutID(UpdateBotBusinessConnectTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotBusinessConnect) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotBusinessConnect#8ae5c97a as nil")
	}
	if  := .Connection.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotBusinessConnect#8ae5c97a: field connection: %w", )
	}
	.PutInt(.Qts)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateBotBusinessConnect) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotBusinessConnect#8ae5c97a to nil")
	}
	if  := .ConsumeID(UpdateBotBusinessConnectTypeID);  != nil {
		return fmt.Errorf("unable to decode updateBotBusinessConnect#8ae5c97a: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotBusinessConnect) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotBusinessConnect#8ae5c97a to nil")
	}
	{
		if  := .Connection.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotBusinessConnect#8ae5c97a: field connection: %w", )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotBusinessConnect#8ae5c97a: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetConnection returns value of Connection field.
func ( *UpdateBotBusinessConnect) () ( BotBusinessConnection) {
	if  == nil {
		return
	}
	return .Connection
}

// GetQts returns value of Qts field.
func ( *UpdateBotBusinessConnect) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateBotNewBusinessMessage represents TL type `updateBotNewBusinessMessage#9ddb347c`.
// A message was received via a connected business chat »¹.
//
// Links:
//  1. https://core.telegram.org/api/bots/connected-business-bots
//
// See https://core.telegram.org/constructor/updateBotNewBusinessMessage for reference.
type UpdateBotNewBusinessMessage struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Connection ID.
	ConnectionID string
	// New message.
	Message MessageClass
	// The message that message is replying to.
	//
	// Use SetReplyToMessage and GetReplyToMessage helpers.
	ReplyToMessage MessageClass
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotNewBusinessMessageTypeID is TL type id of UpdateBotNewBusinessMessage.
const UpdateBotNewBusinessMessageTypeID = 0x9ddb347c

// construct implements constructor of UpdateClass.
func ( UpdateBotNewBusinessMessage) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateBotNewBusinessMessage.
var (
	_ bin.Encoder     = &UpdateBotNewBusinessMessage{}
	_ bin.Decoder     = &UpdateBotNewBusinessMessage{}
	_ bin.BareEncoder = &UpdateBotNewBusinessMessage{}
	_ bin.BareDecoder = &UpdateBotNewBusinessMessage{}

	_ UpdateClass = &UpdateBotNewBusinessMessage{}
)

func ( *UpdateBotNewBusinessMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ConnectionID == "") {
		return false
	}
	if !(.Message == nil) {
		return false
	}
	if !(.ReplyToMessage == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateBotNewBusinessMessage) () string {
	if  == nil {
		return "UpdateBotNewBusinessMessage(nil)"
	}
	type  UpdateBotNewBusinessMessage
	return fmt.Sprintf("UpdateBotNewBusinessMessage%+v", (*))
}

// FillFrom fills UpdateBotNewBusinessMessage from given interface.
func ( *UpdateBotNewBusinessMessage) ( interface {
	() ( string)
	() ( MessageClass)
	() ( MessageClass,  bool)
	() ( int)
}) {
	.ConnectionID = .()
	.Message = .()
	if ,  := .();  {
		.ReplyToMessage = 
	}

	.Qts = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateBotNewBusinessMessage) () uint32 {
	return UpdateBotNewBusinessMessageTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateBotNewBusinessMessage) () string {
	return "updateBotNewBusinessMessage"
}

// TypeInfo returns info about TL type.
func ( *UpdateBotNewBusinessMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotNewBusinessMessage",
		ID:   UpdateBotNewBusinessMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ConnectionID",
			SchemaName: "connection_id",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "ReplyToMessage",
			SchemaName: "reply_to_message",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateBotNewBusinessMessage) () {
	if !(.ReplyToMessage == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateBotNewBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotNewBusinessMessage#9ddb347c as nil")
	}
	.PutID(UpdateBotNewBusinessMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotNewBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotNewBusinessMessage#9ddb347c as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotNewBusinessMessage#9ddb347c: field flags: %w", )
	}
	.PutString(.ConnectionID)
	if .Message == nil {
		return fmt.Errorf("unable to encode updateBotNewBusinessMessage#9ddb347c: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotNewBusinessMessage#9ddb347c: field message: %w", )
	}
	if .Flags.Has(0) {
		if .ReplyToMessage == nil {
			return fmt.Errorf("unable to encode updateBotNewBusinessMessage#9ddb347c: field reply_to_message is nil")
		}
		if  := .ReplyToMessage.Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotNewBusinessMessage#9ddb347c: field reply_to_message: %w", )
		}
	}
	.PutInt(.Qts)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateBotNewBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotNewBusinessMessage#9ddb347c to nil")
	}
	if  := .ConsumeID(UpdateBotNewBusinessMessageTypeID);  != nil {
		return fmt.Errorf("unable to decode updateBotNewBusinessMessage#9ddb347c: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotNewBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotNewBusinessMessage#9ddb347c to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotNewBusinessMessage#9ddb347c: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotNewBusinessMessage#9ddb347c: field connection_id: %w", )
		}
		.ConnectionID = 
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotNewBusinessMessage#9ddb347c: field message: %w", )
		}
		.Message = 
	}
	if .Flags.Has(0) {
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotNewBusinessMessage#9ddb347c: field reply_to_message: %w", )
		}
		.ReplyToMessage = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotNewBusinessMessage#9ddb347c: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetConnectionID returns value of ConnectionID field.
func ( *UpdateBotNewBusinessMessage) () ( string) {
	if  == nil {
		return
	}
	return .ConnectionID
}

// GetMessage returns value of Message field.
func ( *UpdateBotNewBusinessMessage) () ( MessageClass) {
	if  == nil {
		return
	}
	return .Message
}

// SetReplyToMessage sets value of ReplyToMessage conditional field.
func ( *UpdateBotNewBusinessMessage) ( MessageClass) {
	.Flags.Set(0)
	.ReplyToMessage = 
}

// GetReplyToMessage returns value of ReplyToMessage conditional field and
// boolean which is true if field was set.
func ( *UpdateBotNewBusinessMessage) () ( MessageClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .ReplyToMessage, true
}

// GetQts returns value of Qts field.
func ( *UpdateBotNewBusinessMessage) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateBotEditBusinessMessage represents TL type `updateBotEditBusinessMessage#7df587c`.
// A message was edited in a connected business chat »¹.
//
// Links:
//  1. https://core.telegram.org/api/bots/connected-business-bots
//
// See https://core.telegram.org/constructor/updateBotEditBusinessMessage for reference.
type UpdateBotEditBusinessMessage struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Business connection ID
	ConnectionID string
	// New message.
	Message MessageClass
	// The message that message is replying to.
	//
	// Use SetReplyToMessage and GetReplyToMessage helpers.
	ReplyToMessage MessageClass
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotEditBusinessMessageTypeID is TL type id of UpdateBotEditBusinessMessage.
const UpdateBotEditBusinessMessageTypeID = 0x7df587c

// construct implements constructor of UpdateClass.
func ( UpdateBotEditBusinessMessage) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateBotEditBusinessMessage.
var (
	_ bin.Encoder     = &UpdateBotEditBusinessMessage{}
	_ bin.Decoder     = &UpdateBotEditBusinessMessage{}
	_ bin.BareEncoder = &UpdateBotEditBusinessMessage{}
	_ bin.BareDecoder = &UpdateBotEditBusinessMessage{}

	_ UpdateClass = &UpdateBotEditBusinessMessage{}
)

func ( *UpdateBotEditBusinessMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ConnectionID == "") {
		return false
	}
	if !(.Message == nil) {
		return false
	}
	if !(.ReplyToMessage == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateBotEditBusinessMessage) () string {
	if  == nil {
		return "UpdateBotEditBusinessMessage(nil)"
	}
	type  UpdateBotEditBusinessMessage
	return fmt.Sprintf("UpdateBotEditBusinessMessage%+v", (*))
}

// FillFrom fills UpdateBotEditBusinessMessage from given interface.
func ( *UpdateBotEditBusinessMessage) ( interface {
	() ( string)
	() ( MessageClass)
	() ( MessageClass,  bool)
	() ( int)
}) {
	.ConnectionID = .()
	.Message = .()
	if ,  := .();  {
		.ReplyToMessage = 
	}

	.Qts = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateBotEditBusinessMessage) () uint32 {
	return UpdateBotEditBusinessMessageTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateBotEditBusinessMessage) () string {
	return "updateBotEditBusinessMessage"
}

// TypeInfo returns info about TL type.
func ( *UpdateBotEditBusinessMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotEditBusinessMessage",
		ID:   UpdateBotEditBusinessMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ConnectionID",
			SchemaName: "connection_id",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "ReplyToMessage",
			SchemaName: "reply_to_message",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateBotEditBusinessMessage) () {
	if !(.ReplyToMessage == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateBotEditBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotEditBusinessMessage#7df587c as nil")
	}
	.PutID(UpdateBotEditBusinessMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotEditBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotEditBusinessMessage#7df587c as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotEditBusinessMessage#7df587c: field flags: %w", )
	}
	.PutString(.ConnectionID)
	if .Message == nil {
		return fmt.Errorf("unable to encode updateBotEditBusinessMessage#7df587c: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotEditBusinessMessage#7df587c: field message: %w", )
	}
	if .Flags.Has(0) {
		if .ReplyToMessage == nil {
			return fmt.Errorf("unable to encode updateBotEditBusinessMessage#7df587c: field reply_to_message is nil")
		}
		if  := .ReplyToMessage.Encode();  != nil {
			return fmt.Errorf("unable to encode updateBotEditBusinessMessage#7df587c: field reply_to_message: %w", )
		}
	}
	.PutInt(.Qts)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateBotEditBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotEditBusinessMessage#7df587c to nil")
	}
	if  := .ConsumeID(UpdateBotEditBusinessMessageTypeID);  != nil {
		return fmt.Errorf("unable to decode updateBotEditBusinessMessage#7df587c: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotEditBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotEditBusinessMessage#7df587c to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotEditBusinessMessage#7df587c: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotEditBusinessMessage#7df587c: field connection_id: %w", )
		}
		.ConnectionID = 
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotEditBusinessMessage#7df587c: field message: %w", )
		}
		.Message = 
	}
	if .Flags.Has(0) {
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotEditBusinessMessage#7df587c: field reply_to_message: %w", )
		}
		.ReplyToMessage = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotEditBusinessMessage#7df587c: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetConnectionID returns value of ConnectionID field.
func ( *UpdateBotEditBusinessMessage) () ( string) {
	if  == nil {
		return
	}
	return .ConnectionID
}

// GetMessage returns value of Message field.
func ( *UpdateBotEditBusinessMessage) () ( MessageClass) {
	if  == nil {
		return
	}
	return .Message
}

// SetReplyToMessage sets value of ReplyToMessage conditional field.
func ( *UpdateBotEditBusinessMessage) ( MessageClass) {
	.Flags.Set(0)
	.ReplyToMessage = 
}

// GetReplyToMessage returns value of ReplyToMessage conditional field and
// boolean which is true if field was set.
func ( *UpdateBotEditBusinessMessage) () ( MessageClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .ReplyToMessage, true
}

// GetQts returns value of Qts field.
func ( *UpdateBotEditBusinessMessage) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateBotDeleteBusinessMessage represents TL type `updateBotDeleteBusinessMessage#a02a982e`.
// A message was deleted in a connected business chat »¹.
//
// Links:
//  1. https://core.telegram.org/api/bots/connected-business-bots
//
// See https://core.telegram.org/constructor/updateBotDeleteBusinessMessage for reference.
type UpdateBotDeleteBusinessMessage struct {
	// Business connection ID.
	ConnectionID string
	// Peer¹ where the messages were deleted.
	//
	// Links:
	//  1) https://core.telegram.org/api/peers
	Peer PeerClass
	// IDs of the messages that were deleted.
	Messages []int
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotDeleteBusinessMessageTypeID is TL type id of UpdateBotDeleteBusinessMessage.
const UpdateBotDeleteBusinessMessageTypeID = 0xa02a982e

// construct implements constructor of UpdateClass.
func ( UpdateBotDeleteBusinessMessage) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateBotDeleteBusinessMessage.
var (
	_ bin.Encoder     = &UpdateBotDeleteBusinessMessage{}
	_ bin.Decoder     = &UpdateBotDeleteBusinessMessage{}
	_ bin.BareEncoder = &UpdateBotDeleteBusinessMessage{}
	_ bin.BareDecoder = &UpdateBotDeleteBusinessMessage{}

	_ UpdateClass = &UpdateBotDeleteBusinessMessage{}
)

func ( *UpdateBotDeleteBusinessMessage) () bool {
	if  == nil {
		return true
	}
	if !(.ConnectionID == "") {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateBotDeleteBusinessMessage) () string {
	if  == nil {
		return "UpdateBotDeleteBusinessMessage(nil)"
	}
	type  UpdateBotDeleteBusinessMessage
	return fmt.Sprintf("UpdateBotDeleteBusinessMessage%+v", (*))
}

// FillFrom fills UpdateBotDeleteBusinessMessage from given interface.
func ( *UpdateBotDeleteBusinessMessage) ( interface {
	() ( string)
	() ( PeerClass)
	() ( []int)
	() ( int)
}) {
	.ConnectionID = .()
	.Peer = .()
	.Messages = .()
	.Qts = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateBotDeleteBusinessMessage) () uint32 {
	return UpdateBotDeleteBusinessMessageTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateBotDeleteBusinessMessage) () string {
	return "updateBotDeleteBusinessMessage"
}

// TypeInfo returns info about TL type.
func ( *UpdateBotDeleteBusinessMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotDeleteBusinessMessage",
		ID:   UpdateBotDeleteBusinessMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ConnectionID",
			SchemaName: "connection_id",
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotDeleteBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotDeleteBusinessMessage#a02a982e as nil")
	}
	.PutID(UpdateBotDeleteBusinessMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotDeleteBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotDeleteBusinessMessage#a02a982e as nil")
	}
	.PutString(.ConnectionID)
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateBotDeleteBusinessMessage#a02a982e: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotDeleteBusinessMessage#a02a982e: field peer: %w", )
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	.PutInt(.Qts)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateBotDeleteBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotDeleteBusinessMessage#a02a982e to nil")
	}
	if  := .ConsumeID(UpdateBotDeleteBusinessMessageTypeID);  != nil {
		return fmt.Errorf("unable to decode updateBotDeleteBusinessMessage#a02a982e: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotDeleteBusinessMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotDeleteBusinessMessage#a02a982e to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotDeleteBusinessMessage#a02a982e: field connection_id: %w", )
		}
		.ConnectionID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotDeleteBusinessMessage#a02a982e: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotDeleteBusinessMessage#a02a982e: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateBotDeleteBusinessMessage#a02a982e: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotDeleteBusinessMessage#a02a982e: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetConnectionID returns value of ConnectionID field.
func ( *UpdateBotDeleteBusinessMessage) () ( string) {
	if  == nil {
		return
	}
	return .ConnectionID
}

// GetPeer returns value of Peer field.
func ( *UpdateBotDeleteBusinessMessage) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetMessages returns value of Messages field.
func ( *UpdateBotDeleteBusinessMessage) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

// GetQts returns value of Qts field.
func ( *UpdateBotDeleteBusinessMessage) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateNewStoryReaction represents TL type `updateNewStoryReaction#1824e40b`.
// Represents a new reaction to a story¹.
//
// Links:
//  1. https://core.telegram.org/api/reactions#notifications-about-reactions
//
// See https://core.telegram.org/constructor/updateNewStoryReaction for reference.
type UpdateNewStoryReaction struct {
	// Story ID¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/stories
	StoryID int
	// The peer where the story was posted.
	Peer PeerClass
	// The reaction¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/reactions
	Reaction ReactionClass
}

// UpdateNewStoryReactionTypeID is TL type id of UpdateNewStoryReaction.
const UpdateNewStoryReactionTypeID = 0x1824e40b

// construct implements constructor of UpdateClass.
func ( UpdateNewStoryReaction) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateNewStoryReaction.
var (
	_ bin.Encoder     = &UpdateNewStoryReaction{}
	_ bin.Decoder     = &UpdateNewStoryReaction{}
	_ bin.BareEncoder = &UpdateNewStoryReaction{}
	_ bin.BareDecoder = &UpdateNewStoryReaction{}

	_ UpdateClass = &UpdateNewStoryReaction{}
)

func ( *UpdateNewStoryReaction) () bool {
	if  == nil {
		return true
	}
	if !(.StoryID == 0) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Reaction == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateNewStoryReaction) () string {
	if  == nil {
		return "UpdateNewStoryReaction(nil)"
	}
	type  UpdateNewStoryReaction
	return fmt.Sprintf("UpdateNewStoryReaction%+v", (*))
}

// FillFrom fills UpdateNewStoryReaction from given interface.
func ( *UpdateNewStoryReaction) ( interface {
	() ( int)
	() ( PeerClass)
	() ( ReactionClass)
}) {
	.StoryID = .()
	.Peer = .()
	.Reaction = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateNewStoryReaction) () uint32 {
	return UpdateNewStoryReactionTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateNewStoryReaction) () string {
	return "updateNewStoryReaction"
}

// TypeInfo returns info about TL type.
func ( *UpdateNewStoryReaction) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewStoryReaction",
		ID:   UpdateNewStoryReactionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "StoryID",
			SchemaName: "story_id",
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Reaction",
			SchemaName: "reaction",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateNewStoryReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewStoryReaction#1824e40b as nil")
	}
	.PutID(UpdateNewStoryReactionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewStoryReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewStoryReaction#1824e40b as nil")
	}
	.PutInt(.StoryID)
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateNewStoryReaction#1824e40b: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewStoryReaction#1824e40b: field peer: %w", )
	}
	if .Reaction == nil {
		return fmt.Errorf("unable to encode updateNewStoryReaction#1824e40b: field reaction is nil")
	}
	if  := .Reaction.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewStoryReaction#1824e40b: field reaction: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateNewStoryReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewStoryReaction#1824e40b to nil")
	}
	if  := .ConsumeID(UpdateNewStoryReactionTypeID);  != nil {
		return fmt.Errorf("unable to decode updateNewStoryReaction#1824e40b: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewStoryReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewStoryReaction#1824e40b to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewStoryReaction#1824e40b: field story_id: %w", )
		}
		.StoryID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewStoryReaction#1824e40b: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := DecodeReaction()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewStoryReaction#1824e40b: field reaction: %w", )
		}
		.Reaction = 
	}
	return nil
}

// GetStoryID returns value of StoryID field.
func ( *UpdateNewStoryReaction) () ( int) {
	if  == nil {
		return
	}
	return .StoryID
}

// GetPeer returns value of Peer field.
func ( *UpdateNewStoryReaction) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetReaction returns value of Reaction field.
func ( *UpdateNewStoryReaction) () ( ReactionClass) {
	if  == nil {
		return
	}
	return .Reaction
}

// UpdateStarsBalance represents TL type `updateStarsBalance#4e80a379`.
// The current account's Telegram Stars balance »¹ has changed.
//
// Links:
//  1. https://core.telegram.org/api/stars
//
// See https://core.telegram.org/constructor/updateStarsBalance for reference.
type UpdateStarsBalance struct {
	// New balance.
	Balance StarsAmountClass
}

// UpdateStarsBalanceTypeID is TL type id of UpdateStarsBalance.
const UpdateStarsBalanceTypeID = 0x4e80a379

// construct implements constructor of UpdateClass.
func ( UpdateStarsBalance) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateStarsBalance.
var (
	_ bin.Encoder     = &UpdateStarsBalance{}
	_ bin.Decoder     = &UpdateStarsBalance{}
	_ bin.BareEncoder = &UpdateStarsBalance{}
	_ bin.BareDecoder = &UpdateStarsBalance{}

	_ UpdateClass = &UpdateStarsBalance{}
)

func ( *UpdateStarsBalance) () bool {
	if  == nil {
		return true
	}
	if !(.Balance == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateStarsBalance) () string {
	if  == nil {
		return "UpdateStarsBalance(nil)"
	}
	type  UpdateStarsBalance
	return fmt.Sprintf("UpdateStarsBalance%+v", (*))
}

// FillFrom fills UpdateStarsBalance from given interface.
func ( *UpdateStarsBalance) ( interface {
	() ( StarsAmountClass)
}) {
	.Balance = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateStarsBalance) () uint32 {
	return UpdateStarsBalanceTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateStarsBalance) () string {
	return "updateStarsBalance"
}

// TypeInfo returns info about TL type.
func ( *UpdateStarsBalance) () tdp.Type {
	 := tdp.Type{
		Name: "updateStarsBalance",
		ID:   UpdateStarsBalanceTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Balance",
			SchemaName: "balance",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateStarsBalance) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarsBalance#4e80a379 as nil")
	}
	.PutID(UpdateStarsBalanceTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStarsBalance) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarsBalance#4e80a379 as nil")
	}
	if .Balance == nil {
		return fmt.Errorf("unable to encode updateStarsBalance#4e80a379: field balance is nil")
	}
	if  := .Balance.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStarsBalance#4e80a379: field balance: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateStarsBalance) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarsBalance#4e80a379 to nil")
	}
	if  := .ConsumeID(UpdateStarsBalanceTypeID);  != nil {
		return fmt.Errorf("unable to decode updateStarsBalance#4e80a379: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStarsBalance) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarsBalance#4e80a379 to nil")
	}
	{
		,  := DecodeStarsAmount()
		if  != nil {
			return fmt.Errorf("unable to decode updateStarsBalance#4e80a379: field balance: %w", )
		}
		.Balance = 
	}
	return nil
}

// GetBalance returns value of Balance field.
func ( *UpdateStarsBalance) () ( StarsAmountClass) {
	if  == nil {
		return
	}
	return .Balance
}

// UpdateBusinessBotCallbackQuery represents TL type `updateBusinessBotCallbackQuery#1ea2fda7`.
// A callback button sent via a business connection¹ was pressed, and the button data
// was sent to the bot that created the button.
//
// Links:
//  1. https://core.telegram.org/api/bots/connected-business-bots
//
// See https://core.telegram.org/constructor/updateBusinessBotCallbackQuery for reference.
type UpdateBusinessBotCallbackQuery struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Query ID
	QueryID int64
	// ID of the user that pressed the button
	UserID int64
	// Business connection ID¹
	//
	// Links:
	//  1) https://core.telegram.org/api/bots/connected-business-bots
	ConnectionID string
	// Message that contains the keyboard (also contains info about the chat where the
	// message was sent).
	Message MessageClass
	// The message that message is replying to.
	//
	// Use SetReplyToMessage and GetReplyToMessage helpers.
	ReplyToMessage MessageClass
	// Global identifier, uniquely corresponding to the chat to which the message with the
	// callback button was sent. Useful for high scores in games.
	ChatInstance int64
	// Callback data
	//
	// Use SetData and GetData helpers.
	Data []byte
}

// UpdateBusinessBotCallbackQueryTypeID is TL type id of UpdateBusinessBotCallbackQuery.
const UpdateBusinessBotCallbackQueryTypeID = 0x1ea2fda7

// construct implements constructor of UpdateClass.
func ( UpdateBusinessBotCallbackQuery) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateBusinessBotCallbackQuery.
var (
	_ bin.Encoder     = &UpdateBusinessBotCallbackQuery{}
	_ bin.Decoder     = &UpdateBusinessBotCallbackQuery{}
	_ bin.BareEncoder = &UpdateBusinessBotCallbackQuery{}
	_ bin.BareDecoder = &UpdateBusinessBotCallbackQuery{}

	_ UpdateClass = &UpdateBusinessBotCallbackQuery{}
)

func ( *UpdateBusinessBotCallbackQuery) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.ConnectionID == "") {
		return false
	}
	if !(.Message == nil) {
		return false
	}
	if !(.ReplyToMessage == nil) {
		return false
	}
	if !(.ChatInstance == 0) {
		return false
	}
	if !(.Data == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateBusinessBotCallbackQuery) () string {
	if  == nil {
		return "UpdateBusinessBotCallbackQuery(nil)"
	}
	type  UpdateBusinessBotCallbackQuery
	return fmt.Sprintf("UpdateBusinessBotCallbackQuery%+v", (*))
}

// FillFrom fills UpdateBusinessBotCallbackQuery from given interface.
func ( *UpdateBusinessBotCallbackQuery) ( interface {
	() ( int64)
	() ( int64)
	() ( string)
	() ( MessageClass)
	() ( MessageClass,  bool)
	() ( int64)
	() ( []byte,  bool)
}) {
	.QueryID = .()
	.UserID = .()
	.ConnectionID = .()
	.Message = .()
	if ,  := .();  {
		.ReplyToMessage = 
	}

	.ChatInstance = .()
	if ,  := .();  {
		.Data = 
	}

}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateBusinessBotCallbackQuery) () uint32 {
	return UpdateBusinessBotCallbackQueryTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateBusinessBotCallbackQuery) () string {
	return "updateBusinessBotCallbackQuery"
}

// TypeInfo returns info about TL type.
func ( *UpdateBusinessBotCallbackQuery) () tdp.Type {
	 := tdp.Type{
		Name: "updateBusinessBotCallbackQuery",
		ID:   UpdateBusinessBotCallbackQueryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "ConnectionID",
			SchemaName: "connection_id",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "ReplyToMessage",
			SchemaName: "reply_to_message",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "ChatInstance",
			SchemaName: "chat_instance",
		},
		{
			Name:       "Data",
			SchemaName: "data",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateBusinessBotCallbackQuery) () {
	if !(.ReplyToMessage == nil) {
		.Flags.Set(2)
	}
	if !(.Data == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateBusinessBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBusinessBotCallbackQuery#1ea2fda7 as nil")
	}
	.PutID(UpdateBusinessBotCallbackQueryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBusinessBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBusinessBotCallbackQuery#1ea2fda7 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBusinessBotCallbackQuery#1ea2fda7: field flags: %w", )
	}
	.PutLong(.QueryID)
	.PutLong(.UserID)
	.PutString(.ConnectionID)
	if .Message == nil {
		return fmt.Errorf("unable to encode updateBusinessBotCallbackQuery#1ea2fda7: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBusinessBotCallbackQuery#1ea2fda7: field message: %w", )
	}
	if .Flags.Has(2) {
		if .ReplyToMessage == nil {
			return fmt.Errorf("unable to encode updateBusinessBotCallbackQuery#1ea2fda7: field reply_to_message is nil")
		}
		if  := .ReplyToMessage.Encode();  != nil {
			return fmt.Errorf("unable to encode updateBusinessBotCallbackQuery#1ea2fda7: field reply_to_message: %w", )
		}
	}
	.PutLong(.ChatInstance)
	if .Flags.Has(0) {
		.PutBytes(.Data)
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateBusinessBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBusinessBotCallbackQuery#1ea2fda7 to nil")
	}
	if  := .ConsumeID(UpdateBusinessBotCallbackQueryTypeID);  != nil {
		return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBusinessBotCallbackQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBusinessBotCallbackQuery#1ea2fda7 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: field connection_id: %w", )
		}
		.ConnectionID = 
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: field message: %w", )
		}
		.Message = 
	}
	if .Flags.Has(2) {
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: field reply_to_message: %w", )
		}
		.ReplyToMessage = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: field chat_instance: %w", )
		}
		.ChatInstance = 
	}
	if .Flags.Has(0) {
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode updateBusinessBotCallbackQuery#1ea2fda7: field data: %w", )
		}
		.Data = 
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateBusinessBotCallbackQuery) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

// GetUserID returns value of UserID field.
func ( *UpdateBusinessBotCallbackQuery) () ( int64) {
	if  == nil {
		return
	}
	return .UserID
}

// GetConnectionID returns value of ConnectionID field.
func ( *UpdateBusinessBotCallbackQuery) () ( string) {
	if  == nil {
		return
	}
	return .ConnectionID
}

// GetMessage returns value of Message field.
func ( *UpdateBusinessBotCallbackQuery) () ( MessageClass) {
	if  == nil {
		return
	}
	return .Message
}

// SetReplyToMessage sets value of ReplyToMessage conditional field.
func ( *UpdateBusinessBotCallbackQuery) ( MessageClass) {
	.Flags.Set(2)
	.ReplyToMessage = 
}

// GetReplyToMessage returns value of ReplyToMessage conditional field and
// boolean which is true if field was set.
func ( *UpdateBusinessBotCallbackQuery) () ( MessageClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .ReplyToMessage, true
}

// GetChatInstance returns value of ChatInstance field.
func ( *UpdateBusinessBotCallbackQuery) () ( int64) {
	if  == nil {
		return
	}
	return .ChatInstance
}

// SetData sets value of Data conditional field.
func ( *UpdateBusinessBotCallbackQuery) ( []byte) {
	.Flags.Set(0)
	.Data = 
}

// GetData returns value of Data conditional field and
// boolean which is true if field was set.
func ( *UpdateBusinessBotCallbackQuery) () ( []byte,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Data, true
}

// UpdateStarsRevenueStatus represents TL type `updateStarsRevenueStatus#a584b019`.
// The Telegram Star balance of a channel/bot we own has changed »¹.
//
// Links:
//  1. https://core.telegram.org/api/stars#revenue-statistics
//
// See https://core.telegram.org/constructor/updateStarsRevenueStatus for reference.
type UpdateStarsRevenueStatus struct {
	// Channel/bot
	Peer PeerClass
	// New Telegram Star balance.
	Status StarsRevenueStatus
}

// UpdateStarsRevenueStatusTypeID is TL type id of UpdateStarsRevenueStatus.
const UpdateStarsRevenueStatusTypeID = 0xa584b019

// construct implements constructor of UpdateClass.
func ( UpdateStarsRevenueStatus) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateStarsRevenueStatus.
var (
	_ bin.Encoder     = &UpdateStarsRevenueStatus{}
	_ bin.Decoder     = &UpdateStarsRevenueStatus{}
	_ bin.BareEncoder = &UpdateStarsRevenueStatus{}
	_ bin.BareDecoder = &UpdateStarsRevenueStatus{}

	_ UpdateClass = &UpdateStarsRevenueStatus{}
)

func ( *UpdateStarsRevenueStatus) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Status.Zero()) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateStarsRevenueStatus) () string {
	if  == nil {
		return "UpdateStarsRevenueStatus(nil)"
	}
	type  UpdateStarsRevenueStatus
	return fmt.Sprintf("UpdateStarsRevenueStatus%+v", (*))
}

// FillFrom fills UpdateStarsRevenueStatus from given interface.
func ( *UpdateStarsRevenueStatus) ( interface {
	() ( PeerClass)
	() ( StarsRevenueStatus)
}) {
	.Peer = .()
	.Status = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateStarsRevenueStatus) () uint32 {
	return UpdateStarsRevenueStatusTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateStarsRevenueStatus) () string {
	return "updateStarsRevenueStatus"
}

// TypeInfo returns info about TL type.
func ( *UpdateStarsRevenueStatus) () tdp.Type {
	 := tdp.Type{
		Name: "updateStarsRevenueStatus",
		ID:   UpdateStarsRevenueStatusTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Status",
			SchemaName: "status",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateStarsRevenueStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarsRevenueStatus#a584b019 as nil")
	}
	.PutID(UpdateStarsRevenueStatusTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStarsRevenueStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarsRevenueStatus#a584b019 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateStarsRevenueStatus#a584b019: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStarsRevenueStatus#a584b019: field peer: %w", )
	}
	if  := .Status.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStarsRevenueStatus#a584b019: field status: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateStarsRevenueStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarsRevenueStatus#a584b019 to nil")
	}
	if  := .ConsumeID(UpdateStarsRevenueStatusTypeID);  != nil {
		return fmt.Errorf("unable to decode updateStarsRevenueStatus#a584b019: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStarsRevenueStatus) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarsRevenueStatus#a584b019 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateStarsRevenueStatus#a584b019: field peer: %w", )
		}
		.Peer = 
	}
	{
		if  := .Status.Decode();  != nil {
			return fmt.Errorf("unable to decode updateStarsRevenueStatus#a584b019: field status: %w", )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateStarsRevenueStatus) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetStatus returns value of Status field.
func ( *UpdateStarsRevenueStatus) () ( StarsRevenueStatus) {
	if  == nil {
		return
	}
	return .Status
}

// UpdateBotPurchasedPaidMedia represents TL type `updateBotPurchasedPaidMedia#283bd312`.
// Bots only: a user has purchased a paid media¹.
//
// Links:
//  1. https://core.telegram.org/api/paid-media
//
// See https://core.telegram.org/constructor/updateBotPurchasedPaidMedia for reference.
type UpdateBotPurchasedPaidMedia struct {
	// The user that bought the media
	UserID int64
	// Payload passed by the bot in inputMediaPaidMedia¹.payload
	//
	// Links:
	//  1) https://core.telegram.org/constructor/inputMediaPaidMedia
	Payload string
	// New qts value, see updates »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/updates
	Qts int
}

// UpdateBotPurchasedPaidMediaTypeID is TL type id of UpdateBotPurchasedPaidMedia.
const UpdateBotPurchasedPaidMediaTypeID = 0x283bd312

// construct implements constructor of UpdateClass.
func ( UpdateBotPurchasedPaidMedia) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateBotPurchasedPaidMedia.
var (
	_ bin.Encoder     = &UpdateBotPurchasedPaidMedia{}
	_ bin.Decoder     = &UpdateBotPurchasedPaidMedia{}
	_ bin.BareEncoder = &UpdateBotPurchasedPaidMedia{}
	_ bin.BareDecoder = &UpdateBotPurchasedPaidMedia{}

	_ UpdateClass = &UpdateBotPurchasedPaidMedia{}
)

func ( *UpdateBotPurchasedPaidMedia) () bool {
	if  == nil {
		return true
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Payload == "") {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateBotPurchasedPaidMedia) () string {
	if  == nil {
		return "UpdateBotPurchasedPaidMedia(nil)"
	}
	type  UpdateBotPurchasedPaidMedia
	return fmt.Sprintf("UpdateBotPurchasedPaidMedia%+v", (*))
}

// FillFrom fills UpdateBotPurchasedPaidMedia from given interface.
func ( *UpdateBotPurchasedPaidMedia) ( interface {
	() ( int64)
	() ( string)
	() ( int)
}) {
	.UserID = .()
	.Payload = .()
	.Qts = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateBotPurchasedPaidMedia) () uint32 {
	return UpdateBotPurchasedPaidMediaTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateBotPurchasedPaidMedia) () string {
	return "updateBotPurchasedPaidMedia"
}

// TypeInfo returns info about TL type.
func ( *UpdateBotPurchasedPaidMedia) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotPurchasedPaidMedia",
		ID:   UpdateBotPurchasedPaidMediaTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Payload",
			SchemaName: "payload",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotPurchasedPaidMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotPurchasedPaidMedia#283bd312 as nil")
	}
	.PutID(UpdateBotPurchasedPaidMediaTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotPurchasedPaidMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotPurchasedPaidMedia#283bd312 as nil")
	}
	.PutLong(.UserID)
	.PutString(.Payload)
	.PutInt(.Qts)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateBotPurchasedPaidMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotPurchasedPaidMedia#283bd312 to nil")
	}
	if  := .ConsumeID(UpdateBotPurchasedPaidMediaTypeID);  != nil {
		return fmt.Errorf("unable to decode updateBotPurchasedPaidMedia#283bd312: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotPurchasedPaidMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotPurchasedPaidMedia#283bd312 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPurchasedPaidMedia#283bd312: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPurchasedPaidMedia#283bd312: field payload: %w", )
		}
		.Payload = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotPurchasedPaidMedia#283bd312: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetUserID returns value of UserID field.
func ( *UpdateBotPurchasedPaidMedia) () ( int64) {
	if  == nil {
		return
	}
	return .UserID
}

// GetPayload returns value of Payload field.
func ( *UpdateBotPurchasedPaidMedia) () ( string) {
	if  == nil {
		return
	}
	return .Payload
}

// GetQts returns value of Qts field.
func ( *UpdateBotPurchasedPaidMedia) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdatePaidReactionPrivacy represents TL type `updatePaidReactionPrivacy#8b725fce`.
// Contains the current default paid reaction privacy, see here »¹ for more info.
// Clients should invoke messages.getPaidReactionPrivacy¹ on startup to fetch the
// current default reaction privacy because this update is only sent to currently online
// sessions and cannot be fetched using getDifference on client startup.
//
// Links:
//  1. https://core.telegram.org/api/reactions#paid-reactions
//  2. https://core.telegram.org/method/messages.getPaidReactionPrivacy
//
// See https://core.telegram.org/constructor/updatePaidReactionPrivacy for reference.
type UpdatePaidReactionPrivacy struct {
	// Paid reaction privacy settings.
	Private PaidReactionPrivacyClass
}

// UpdatePaidReactionPrivacyTypeID is TL type id of UpdatePaidReactionPrivacy.
const UpdatePaidReactionPrivacyTypeID = 0x8b725fce

// construct implements constructor of UpdateClass.
func ( UpdatePaidReactionPrivacy) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdatePaidReactionPrivacy.
var (
	_ bin.Encoder     = &UpdatePaidReactionPrivacy{}
	_ bin.Decoder     = &UpdatePaidReactionPrivacy{}
	_ bin.BareEncoder = &UpdatePaidReactionPrivacy{}
	_ bin.BareDecoder = &UpdatePaidReactionPrivacy{}

	_ UpdateClass = &UpdatePaidReactionPrivacy{}
)

func ( *UpdatePaidReactionPrivacy) () bool {
	if  == nil {
		return true
	}
	if !(.Private == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdatePaidReactionPrivacy) () string {
	if  == nil {
		return "UpdatePaidReactionPrivacy(nil)"
	}
	type  UpdatePaidReactionPrivacy
	return fmt.Sprintf("UpdatePaidReactionPrivacy%+v", (*))
}

// FillFrom fills UpdatePaidReactionPrivacy from given interface.
func ( *UpdatePaidReactionPrivacy) ( interface {
	() ( PaidReactionPrivacyClass)
}) {
	.Private = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdatePaidReactionPrivacy) () uint32 {
	return UpdatePaidReactionPrivacyTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdatePaidReactionPrivacy) () string {
	return "updatePaidReactionPrivacy"
}

// TypeInfo returns info about TL type.
func ( *UpdatePaidReactionPrivacy) () tdp.Type {
	 := tdp.Type{
		Name: "updatePaidReactionPrivacy",
		ID:   UpdatePaidReactionPrivacyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Private",
			SchemaName: "private",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatePaidReactionPrivacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePaidReactionPrivacy#8b725fce as nil")
	}
	.PutID(UpdatePaidReactionPrivacyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePaidReactionPrivacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePaidReactionPrivacy#8b725fce as nil")
	}
	if .Private == nil {
		return fmt.Errorf("unable to encode updatePaidReactionPrivacy#8b725fce: field private is nil")
	}
	if  := .Private.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePaidReactionPrivacy#8b725fce: field private: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdatePaidReactionPrivacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePaidReactionPrivacy#8b725fce to nil")
	}
	if  := .ConsumeID(UpdatePaidReactionPrivacyTypeID);  != nil {
		return fmt.Errorf("unable to decode updatePaidReactionPrivacy#8b725fce: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePaidReactionPrivacy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePaidReactionPrivacy#8b725fce to nil")
	}
	{
		,  := DecodePaidReactionPrivacy()
		if  != nil {
			return fmt.Errorf("unable to decode updatePaidReactionPrivacy#8b725fce: field private: %w", )
		}
		.Private = 
	}
	return nil
}

// GetPrivate returns value of Private field.
func ( *UpdatePaidReactionPrivacy) () ( PaidReactionPrivacyClass) {
	if  == nil {
		return
	}
	return .Private
}

// UpdateSentPhoneCode represents TL type `updateSentPhoneCode#504aa18f`.
// A paid login SMS code was successfully sent.
//
// See https://core.telegram.org/constructor/updateSentPhoneCode for reference.
type UpdateSentPhoneCode struct {
	// Info about the sent code.
	SentCode AuthSentCodeClass
}

// UpdateSentPhoneCodeTypeID is TL type id of UpdateSentPhoneCode.
const UpdateSentPhoneCodeTypeID = 0x504aa18f

// construct implements constructor of UpdateClass.
func ( UpdateSentPhoneCode) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateSentPhoneCode.
var (
	_ bin.Encoder     = &UpdateSentPhoneCode{}
	_ bin.Decoder     = &UpdateSentPhoneCode{}
	_ bin.BareEncoder = &UpdateSentPhoneCode{}
	_ bin.BareDecoder = &UpdateSentPhoneCode{}

	_ UpdateClass = &UpdateSentPhoneCode{}
)

func ( *UpdateSentPhoneCode) () bool {
	if  == nil {
		return true
	}
	if !(.SentCode == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateSentPhoneCode) () string {
	if  == nil {
		return "UpdateSentPhoneCode(nil)"
	}
	type  UpdateSentPhoneCode
	return fmt.Sprintf("UpdateSentPhoneCode%+v", (*))
}

// FillFrom fills UpdateSentPhoneCode from given interface.
func ( *UpdateSentPhoneCode) ( interface {
	() ( AuthSentCodeClass)
}) {
	.SentCode = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateSentPhoneCode) () uint32 {
	return UpdateSentPhoneCodeTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateSentPhoneCode) () string {
	return "updateSentPhoneCode"
}

// TypeInfo returns info about TL type.
func ( *UpdateSentPhoneCode) () tdp.Type {
	 := tdp.Type{
		Name: "updateSentPhoneCode",
		ID:   UpdateSentPhoneCodeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "SentCode",
			SchemaName: "sent_code",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateSentPhoneCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSentPhoneCode#504aa18f as nil")
	}
	.PutID(UpdateSentPhoneCodeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateSentPhoneCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateSentPhoneCode#504aa18f as nil")
	}
	if .SentCode == nil {
		return fmt.Errorf("unable to encode updateSentPhoneCode#504aa18f: field sent_code is nil")
	}
	if  := .SentCode.Encode();  != nil {
		return fmt.Errorf("unable to encode updateSentPhoneCode#504aa18f: field sent_code: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateSentPhoneCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateSentPhoneCode#504aa18f to nil")
	}
	if  := .ConsumeID(UpdateSentPhoneCodeTypeID);  != nil {
		return fmt.Errorf("unable to decode updateSentPhoneCode#504aa18f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateSentPhoneCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateSentPhoneCode#504aa18f to nil")
	}
	{
		,  := DecodeAuthSentCode()
		if  != nil {
			return fmt.Errorf("unable to decode updateSentPhoneCode#504aa18f: field sent_code: %w", )
		}
		.SentCode = 
	}
	return nil
}

// GetSentCode returns value of SentCode field.
func ( *UpdateSentPhoneCode) () ( AuthSentCodeClass) {
	if  == nil {
		return
	}
	return .SentCode
}

// UpdateGroupCallChainBlocks represents TL type `updateGroupCallChainBlocks#a477288f`.
// Contains updates to the blockchain of a conference call, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/end-to-end/group-calls
//
// See https://core.telegram.org/constructor/updateGroupCallChainBlocks for reference.
type UpdateGroupCallChainBlocks struct {
	// The conference call.
	Call InputGroupCallClass
	// Subchain ID.
	SubChainID int
	// Blocks.
	Blocks [][]byte
	// Offset of the next block.
	NextOffset int
}

// UpdateGroupCallChainBlocksTypeID is TL type id of UpdateGroupCallChainBlocks.
const UpdateGroupCallChainBlocksTypeID = 0xa477288f

// construct implements constructor of UpdateClass.
func ( UpdateGroupCallChainBlocks) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateGroupCallChainBlocks.
var (
	_ bin.Encoder     = &UpdateGroupCallChainBlocks{}
	_ bin.Decoder     = &UpdateGroupCallChainBlocks{}
	_ bin.BareEncoder = &UpdateGroupCallChainBlocks{}
	_ bin.BareDecoder = &UpdateGroupCallChainBlocks{}

	_ UpdateClass = &UpdateGroupCallChainBlocks{}
)

func ( *UpdateGroupCallChainBlocks) () bool {
	if  == nil {
		return true
	}
	if !(.Call == nil) {
		return false
	}
	if !(.SubChainID == 0) {
		return false
	}
	if !(.Blocks == nil) {
		return false
	}
	if !(.NextOffset == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateGroupCallChainBlocks) () string {
	if  == nil {
		return "UpdateGroupCallChainBlocks(nil)"
	}
	type  UpdateGroupCallChainBlocks
	return fmt.Sprintf("UpdateGroupCallChainBlocks%+v", (*))
}

// FillFrom fills UpdateGroupCallChainBlocks from given interface.
func ( *UpdateGroupCallChainBlocks) ( interface {
	() ( InputGroupCallClass)
	() ( int)
	() ( [][]byte)
	() ( int)
}) {
	.Call = .()
	.SubChainID = .()
	.Blocks = .()
	.NextOffset = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateGroupCallChainBlocks) () uint32 {
	return UpdateGroupCallChainBlocksTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateGroupCallChainBlocks) () string {
	return "updateGroupCallChainBlocks"
}

// TypeInfo returns info about TL type.
func ( *UpdateGroupCallChainBlocks) () tdp.Type {
	 := tdp.Type{
		Name: "updateGroupCallChainBlocks",
		ID:   UpdateGroupCallChainBlocksTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "SubChainID",
			SchemaName: "sub_chain_id",
		},
		{
			Name:       "Blocks",
			SchemaName: "blocks",
		},
		{
			Name:       "NextOffset",
			SchemaName: "next_offset",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateGroupCallChainBlocks) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallChainBlocks#a477288f as nil")
	}
	.PutID(UpdateGroupCallChainBlocksTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGroupCallChainBlocks) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallChainBlocks#a477288f as nil")
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode updateGroupCallChainBlocks#a477288f: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCallChainBlocks#a477288f: field call: %w", )
	}
	.PutInt(.SubChainID)
	.PutVectorHeader(len(.Blocks))
	for ,  := range .Blocks {
		.PutBytes()
	}
	.PutInt(.NextOffset)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateGroupCallChainBlocks) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCallChainBlocks#a477288f to nil")
	}
	if  := .ConsumeID(UpdateGroupCallChainBlocksTypeID);  != nil {
		return fmt.Errorf("unable to decode updateGroupCallChainBlocks#a477288f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateGroupCallChainBlocks) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCallChainBlocks#a477288f to nil")
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallChainBlocks#a477288f: field call: %w", )
		}
		.Call = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallChainBlocks#a477288f: field sub_chain_id: %w", )
		}
		.SubChainID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallChainBlocks#a477288f: field blocks: %w", )
		}

		if  > 0 {
			.Blocks = make([][]byte, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Bytes()
			if  != nil {
				return fmt.Errorf("unable to decode updateGroupCallChainBlocks#a477288f: field blocks: %w", )
			}
			.Blocks = append(.Blocks, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallChainBlocks#a477288f: field next_offset: %w", )
		}
		.NextOffset = 
	}
	return nil
}

// GetCall returns value of Call field.
func ( *UpdateGroupCallChainBlocks) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// GetSubChainID returns value of SubChainID field.
func ( *UpdateGroupCallChainBlocks) () ( int) {
	if  == nil {
		return
	}
	return .SubChainID
}

// GetBlocks returns value of Blocks field.
func ( *UpdateGroupCallChainBlocks) () ( [][]byte) {
	if  == nil {
		return
	}
	return .Blocks
}

// GetNextOffset returns value of NextOffset field.
func ( *UpdateGroupCallChainBlocks) () ( int) {
	if  == nil {
		return
	}
	return .NextOffset
}

// UpdateReadMonoForumInbox represents TL type `updateReadMonoForumInbox#77b0e372`.
// Incoming messages in a monoforum topic¹ were read
//
// Links:
//  1. https://core.telegram.org/api/monoforum
//
// See https://core.telegram.org/constructor/updateReadMonoForumInbox for reference.
type UpdateReadMonoForumInbox struct {
	// ID of the monoforum.
	ChannelID int64
	// Topic ID.
	SavedPeerID PeerClass
	// Position up to which all incoming messages are read.
	ReadMaxID int
}

// UpdateReadMonoForumInboxTypeID is TL type id of UpdateReadMonoForumInbox.
const UpdateReadMonoForumInboxTypeID = 0x77b0e372

// construct implements constructor of UpdateClass.
func ( UpdateReadMonoForumInbox) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateReadMonoForumInbox.
var (
	_ bin.Encoder     = &UpdateReadMonoForumInbox{}
	_ bin.Decoder     = &UpdateReadMonoForumInbox{}
	_ bin.BareEncoder = &UpdateReadMonoForumInbox{}
	_ bin.BareDecoder = &UpdateReadMonoForumInbox{}

	_ UpdateClass = &UpdateReadMonoForumInbox{}
)

func ( *UpdateReadMonoForumInbox) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.SavedPeerID == nil) {
		return false
	}
	if !(.ReadMaxID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateReadMonoForumInbox) () string {
	if  == nil {
		return "UpdateReadMonoForumInbox(nil)"
	}
	type  UpdateReadMonoForumInbox
	return fmt.Sprintf("UpdateReadMonoForumInbox%+v", (*))
}

// FillFrom fills UpdateReadMonoForumInbox from given interface.
func ( *UpdateReadMonoForumInbox) ( interface {
	() ( int64)
	() ( PeerClass)
	() ( int)
}) {
	.ChannelID = .()
	.SavedPeerID = .()
	.ReadMaxID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateReadMonoForumInbox) () uint32 {
	return UpdateReadMonoForumInboxTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateReadMonoForumInbox) () string {
	return "updateReadMonoForumInbox"
}

// TypeInfo returns info about TL type.
func ( *UpdateReadMonoForumInbox) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadMonoForumInbox",
		ID:   UpdateReadMonoForumInboxTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "SavedPeerID",
			SchemaName: "saved_peer_id",
		},
		{
			Name:       "ReadMaxID",
			SchemaName: "read_max_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateReadMonoForumInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadMonoForumInbox#77b0e372 as nil")
	}
	.PutID(UpdateReadMonoForumInboxTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadMonoForumInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadMonoForumInbox#77b0e372 as nil")
	}
	.PutLong(.ChannelID)
	if .SavedPeerID == nil {
		return fmt.Errorf("unable to encode updateReadMonoForumInbox#77b0e372: field saved_peer_id is nil")
	}
	if  := .SavedPeerID.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadMonoForumInbox#77b0e372: field saved_peer_id: %w", )
	}
	.PutInt(.ReadMaxID)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateReadMonoForumInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadMonoForumInbox#77b0e372 to nil")
	}
	if  := .ConsumeID(UpdateReadMonoForumInboxTypeID);  != nil {
		return fmt.Errorf("unable to decode updateReadMonoForumInbox#77b0e372: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadMonoForumInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadMonoForumInbox#77b0e372 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMonoForumInbox#77b0e372: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMonoForumInbox#77b0e372: field saved_peer_id: %w", )
		}
		.SavedPeerID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMonoForumInbox#77b0e372: field read_max_id: %w", )
		}
		.ReadMaxID = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateReadMonoForumInbox) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetSavedPeerID returns value of SavedPeerID field.
func ( *UpdateReadMonoForumInbox) () ( PeerClass) {
	if  == nil {
		return
	}
	return .SavedPeerID
}

// GetReadMaxID returns value of ReadMaxID field.
func ( *UpdateReadMonoForumInbox) () ( int) {
	if  == nil {
		return
	}
	return .ReadMaxID
}

// UpdateReadMonoForumOutbox represents TL type `updateReadMonoForumOutbox#a4a79376`.
// Outgoing messages in a monoforum¹ were read.
//
// Links:
//  1. https://core.telegram.org/api/monoforum
//
// See https://core.telegram.org/constructor/updateReadMonoForumOutbox for reference.
type UpdateReadMonoForumOutbox struct {
	// ID of the monoforum.
	ChannelID int64
	// Topic ID.
	SavedPeerID PeerClass
	// Position up to which all outgoing messages are read.
	ReadMaxID int
}

// UpdateReadMonoForumOutboxTypeID is TL type id of UpdateReadMonoForumOutbox.
const UpdateReadMonoForumOutboxTypeID = 0xa4a79376

// construct implements constructor of UpdateClass.
func ( UpdateReadMonoForumOutbox) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateReadMonoForumOutbox.
var (
	_ bin.Encoder     = &UpdateReadMonoForumOutbox{}
	_ bin.Decoder     = &UpdateReadMonoForumOutbox{}
	_ bin.BareEncoder = &UpdateReadMonoForumOutbox{}
	_ bin.BareDecoder = &UpdateReadMonoForumOutbox{}

	_ UpdateClass = &UpdateReadMonoForumOutbox{}
)

func ( *UpdateReadMonoForumOutbox) () bool {
	if  == nil {
		return true
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.SavedPeerID == nil) {
		return false
	}
	if !(.ReadMaxID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateReadMonoForumOutbox) () string {
	if  == nil {
		return "UpdateReadMonoForumOutbox(nil)"
	}
	type  UpdateReadMonoForumOutbox
	return fmt.Sprintf("UpdateReadMonoForumOutbox%+v", (*))
}

// FillFrom fills UpdateReadMonoForumOutbox from given interface.
func ( *UpdateReadMonoForumOutbox) ( interface {
	() ( int64)
	() ( PeerClass)
	() ( int)
}) {
	.ChannelID = .()
	.SavedPeerID = .()
	.ReadMaxID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateReadMonoForumOutbox) () uint32 {
	return UpdateReadMonoForumOutboxTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateReadMonoForumOutbox) () string {
	return "updateReadMonoForumOutbox"
}

// TypeInfo returns info about TL type.
func ( *UpdateReadMonoForumOutbox) () tdp.Type {
	 := tdp.Type{
		Name: "updateReadMonoForumOutbox",
		ID:   UpdateReadMonoForumOutboxTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "SavedPeerID",
			SchemaName: "saved_peer_id",
		},
		{
			Name:       "ReadMaxID",
			SchemaName: "read_max_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateReadMonoForumOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadMonoForumOutbox#a4a79376 as nil")
	}
	.PutID(UpdateReadMonoForumOutboxTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadMonoForumOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadMonoForumOutbox#a4a79376 as nil")
	}
	.PutLong(.ChannelID)
	if .SavedPeerID == nil {
		return fmt.Errorf("unable to encode updateReadMonoForumOutbox#a4a79376: field saved_peer_id is nil")
	}
	if  := .SavedPeerID.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadMonoForumOutbox#a4a79376: field saved_peer_id: %w", )
	}
	.PutInt(.ReadMaxID)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateReadMonoForumOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadMonoForumOutbox#a4a79376 to nil")
	}
	if  := .ConsumeID(UpdateReadMonoForumOutboxTypeID);  != nil {
		return fmt.Errorf("unable to decode updateReadMonoForumOutbox#a4a79376: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadMonoForumOutbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadMonoForumOutbox#a4a79376 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMonoForumOutbox#a4a79376: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMonoForumOutbox#a4a79376: field saved_peer_id: %w", )
		}
		.SavedPeerID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadMonoForumOutbox#a4a79376: field read_max_id: %w", )
		}
		.ReadMaxID = 
	}
	return nil
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateReadMonoForumOutbox) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetSavedPeerID returns value of SavedPeerID field.
func ( *UpdateReadMonoForumOutbox) () ( PeerClass) {
	if  == nil {
		return
	}
	return .SavedPeerID
}

// GetReadMaxID returns value of ReadMaxID field.
func ( *UpdateReadMonoForumOutbox) () ( int) {
	if  == nil {
		return
	}
	return .ReadMaxID
}

// UpdateMonoForumNoPaidException represents TL type `updateMonoForumNoPaidException#9f812b08`.
// An admin has (un)exempted this monoforum topic »¹ from payment to send messages
// using account.toggleNoPaidMessagesException².
//
// Links:
//  1. https://core.telegram.org/api/monoforum
//  2. https://core.telegram.org/method/account.toggleNoPaidMessagesException
//
// See https://core.telegram.org/constructor/updateMonoForumNoPaidException for reference.
type UpdateMonoForumNoPaidException struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, an admin has exempted this peer, otherwise the peer was unexempted.
	Exception bool
	// The monoforum ID.
	ChannelID int64
	// The peer/topic ID.
	SavedPeerID PeerClass
}

// UpdateMonoForumNoPaidExceptionTypeID is TL type id of UpdateMonoForumNoPaidException.
const UpdateMonoForumNoPaidExceptionTypeID = 0x9f812b08

// construct implements constructor of UpdateClass.
func ( UpdateMonoForumNoPaidException) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateMonoForumNoPaidException.
var (
	_ bin.Encoder     = &UpdateMonoForumNoPaidException{}
	_ bin.Decoder     = &UpdateMonoForumNoPaidException{}
	_ bin.BareEncoder = &UpdateMonoForumNoPaidException{}
	_ bin.BareDecoder = &UpdateMonoForumNoPaidException{}

	_ UpdateClass = &UpdateMonoForumNoPaidException{}
)

func ( *UpdateMonoForumNoPaidException) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Exception == false) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.SavedPeerID == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateMonoForumNoPaidException) () string {
	if  == nil {
		return "UpdateMonoForumNoPaidException(nil)"
	}
	type  UpdateMonoForumNoPaidException
	return fmt.Sprintf("UpdateMonoForumNoPaidException%+v", (*))
}

// FillFrom fills UpdateMonoForumNoPaidException from given interface.
func ( *UpdateMonoForumNoPaidException) ( interface {
	() ( bool)
	() ( int64)
	() ( PeerClass)
}) {
	.Exception = .()
	.ChannelID = .()
	.SavedPeerID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateMonoForumNoPaidException) () uint32 {
	return UpdateMonoForumNoPaidExceptionTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateMonoForumNoPaidException) () string {
	return "updateMonoForumNoPaidException"
}

// TypeInfo returns info about TL type.
func ( *UpdateMonoForumNoPaidException) () tdp.Type {
	 := tdp.Type{
		Name: "updateMonoForumNoPaidException",
		ID:   UpdateMonoForumNoPaidExceptionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Exception",
			SchemaName: "exception",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "SavedPeerID",
			SchemaName: "saved_peer_id",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateMonoForumNoPaidException) () {
	if !(.Exception == false) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateMonoForumNoPaidException) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMonoForumNoPaidException#9f812b08 as nil")
	}
	.PutID(UpdateMonoForumNoPaidExceptionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMonoForumNoPaidException) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMonoForumNoPaidException#9f812b08 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMonoForumNoPaidException#9f812b08: field flags: %w", )
	}
	.PutLong(.ChannelID)
	if .SavedPeerID == nil {
		return fmt.Errorf("unable to encode updateMonoForumNoPaidException#9f812b08: field saved_peer_id is nil")
	}
	if  := .SavedPeerID.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMonoForumNoPaidException#9f812b08: field saved_peer_id: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateMonoForumNoPaidException) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMonoForumNoPaidException#9f812b08 to nil")
	}
	if  := .ConsumeID(UpdateMonoForumNoPaidExceptionTypeID);  != nil {
		return fmt.Errorf("unable to decode updateMonoForumNoPaidException#9f812b08: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMonoForumNoPaidException) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMonoForumNoPaidException#9f812b08 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMonoForumNoPaidException#9f812b08: field flags: %w", )
		}
	}
	.Exception = .Flags.Has(0)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateMonoForumNoPaidException#9f812b08: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMonoForumNoPaidException#9f812b08: field saved_peer_id: %w", )
		}
		.SavedPeerID = 
	}
	return nil
}

// SetException sets value of Exception conditional field.
func ( *UpdateMonoForumNoPaidException) ( bool) {
	if  {
		.Flags.Set(0)
		.Exception = true
	} else {
		.Flags.Unset(0)
		.Exception = false
	}
}

// GetException returns value of Exception conditional field.
func ( *UpdateMonoForumNoPaidException) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetChannelID returns value of ChannelID field.
func ( *UpdateMonoForumNoPaidException) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetSavedPeerID returns value of SavedPeerID field.
func ( *UpdateMonoForumNoPaidException) () ( PeerClass) {
	if  == nil {
		return
	}
	return .SavedPeerID
}

// UpdateGroupCallMessage represents TL type `updateGroupCallMessage#d8326f0d`.
// A new in-call message was received in a group call or livestream¹, sent using phone
// sendGroupCallMessage².
//
// Links:
//  1. https://core.telegram.org/api/group-calls
//  2. https://core.telegram.org/method/phone.sendGroupCallMessage
//
// See https://core.telegram.org/constructor/updateGroupCallMessage for reference.
type UpdateGroupCallMessage struct {
	// Call field of UpdateGroupCallMessage.
	Call InputGroupCallClass
	// Message field of UpdateGroupCallMessage.
	Message GroupCallMessage
}

// UpdateGroupCallMessageTypeID is TL type id of UpdateGroupCallMessage.
const UpdateGroupCallMessageTypeID = 0xd8326f0d

// construct implements constructor of UpdateClass.
func ( UpdateGroupCallMessage) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateGroupCallMessage.
var (
	_ bin.Encoder     = &UpdateGroupCallMessage{}
	_ bin.Decoder     = &UpdateGroupCallMessage{}
	_ bin.BareEncoder = &UpdateGroupCallMessage{}
	_ bin.BareDecoder = &UpdateGroupCallMessage{}

	_ UpdateClass = &UpdateGroupCallMessage{}
)

func ( *UpdateGroupCallMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Call == nil) {
		return false
	}
	if !(.Message.Zero()) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateGroupCallMessage) () string {
	if  == nil {
		return "UpdateGroupCallMessage(nil)"
	}
	type  UpdateGroupCallMessage
	return fmt.Sprintf("UpdateGroupCallMessage%+v", (*))
}

// FillFrom fills UpdateGroupCallMessage from given interface.
func ( *UpdateGroupCallMessage) ( interface {
	() ( InputGroupCallClass)
	() ( GroupCallMessage)
}) {
	.Call = .()
	.Message = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateGroupCallMessage) () uint32 {
	return UpdateGroupCallMessageTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateGroupCallMessage) () string {
	return "updateGroupCallMessage"
}

// TypeInfo returns info about TL type.
func ( *UpdateGroupCallMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateGroupCallMessage",
		ID:   UpdateGroupCallMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateGroupCallMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallMessage#d8326f0d as nil")
	}
	.PutID(UpdateGroupCallMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGroupCallMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallMessage#d8326f0d as nil")
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode updateGroupCallMessage#d8326f0d: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCallMessage#d8326f0d: field call: %w", )
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCallMessage#d8326f0d: field message: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateGroupCallMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCallMessage#d8326f0d to nil")
	}
	if  := .ConsumeID(UpdateGroupCallMessageTypeID);  != nil {
		return fmt.Errorf("unable to decode updateGroupCallMessage#d8326f0d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateGroupCallMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCallMessage#d8326f0d to nil")
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallMessage#d8326f0d: field call: %w", )
		}
		.Call = 
	}
	{
		if  := .Message.Decode();  != nil {
			return fmt.Errorf("unable to decode updateGroupCallMessage#d8326f0d: field message: %w", )
		}
	}
	return nil
}

// GetCall returns value of Call field.
func ( *UpdateGroupCallMessage) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// GetMessage returns value of Message field.
func ( *UpdateGroupCallMessage) () ( GroupCallMessage) {
	if  == nil {
		return
	}
	return .Message
}

// UpdateGroupCallEncryptedMessage represents TL type `updateGroupCallEncryptedMessage#c957a766`.
// A new E2E-encrypted message was received in a conference call¹, sent using phone
// sendGroupCallEncryptedMessage².
//
// Links:
//  1. https://core.telegram.org/api/group-calls#conference-calls
//  2. https://core.telegram.org/method/phone.sendGroupCallEncryptedMessage
//
// See https://core.telegram.org/constructor/updateGroupCallEncryptedMessage for reference.
type UpdateGroupCallEncryptedMessage struct {
	// Call field of UpdateGroupCallEncryptedMessage.
	Call InputGroupCallClass
	// FromID field of UpdateGroupCallEncryptedMessage.
	FromID PeerClass
	// EncryptedMessage field of UpdateGroupCallEncryptedMessage.
	EncryptedMessage []byte
}

// UpdateGroupCallEncryptedMessageTypeID is TL type id of UpdateGroupCallEncryptedMessage.
const UpdateGroupCallEncryptedMessageTypeID = 0xc957a766

// construct implements constructor of UpdateClass.
func ( UpdateGroupCallEncryptedMessage) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateGroupCallEncryptedMessage.
var (
	_ bin.Encoder     = &UpdateGroupCallEncryptedMessage{}
	_ bin.Decoder     = &UpdateGroupCallEncryptedMessage{}
	_ bin.BareEncoder = &UpdateGroupCallEncryptedMessage{}
	_ bin.BareDecoder = &UpdateGroupCallEncryptedMessage{}

	_ UpdateClass = &UpdateGroupCallEncryptedMessage{}
)

func ( *UpdateGroupCallEncryptedMessage) () bool {
	if  == nil {
		return true
	}
	if !(.Call == nil) {
		return false
	}
	if !(.FromID == nil) {
		return false
	}
	if !(.EncryptedMessage == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateGroupCallEncryptedMessage) () string {
	if  == nil {
		return "UpdateGroupCallEncryptedMessage(nil)"
	}
	type  UpdateGroupCallEncryptedMessage
	return fmt.Sprintf("UpdateGroupCallEncryptedMessage%+v", (*))
}

// FillFrom fills UpdateGroupCallEncryptedMessage from given interface.
func ( *UpdateGroupCallEncryptedMessage) ( interface {
	() ( InputGroupCallClass)
	() ( PeerClass)
	() ( []byte)
}) {
	.Call = .()
	.FromID = .()
	.EncryptedMessage = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateGroupCallEncryptedMessage) () uint32 {
	return UpdateGroupCallEncryptedMessageTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateGroupCallEncryptedMessage) () string {
	return "updateGroupCallEncryptedMessage"
}

// TypeInfo returns info about TL type.
func ( *UpdateGroupCallEncryptedMessage) () tdp.Type {
	 := tdp.Type{
		Name: "updateGroupCallEncryptedMessage",
		ID:   UpdateGroupCallEncryptedMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "FromID",
			SchemaName: "from_id",
		},
		{
			Name:       "EncryptedMessage",
			SchemaName: "encrypted_message",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateGroupCallEncryptedMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallEncryptedMessage#c957a766 as nil")
	}
	.PutID(UpdateGroupCallEncryptedMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGroupCallEncryptedMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCallEncryptedMessage#c957a766 as nil")
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode updateGroupCallEncryptedMessage#c957a766: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCallEncryptedMessage#c957a766: field call: %w", )
	}
	if .FromID == nil {
		return fmt.Errorf("unable to encode updateGroupCallEncryptedMessage#c957a766: field from_id is nil")
	}
	if  := .FromID.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCallEncryptedMessage#c957a766: field from_id: %w", )
	}
	.PutBytes(.EncryptedMessage)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateGroupCallEncryptedMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCallEncryptedMessage#c957a766 to nil")
	}
	if  := .ConsumeID(UpdateGroupCallEncryptedMessageTypeID);  != nil {
		return fmt.Errorf("unable to decode updateGroupCallEncryptedMessage#c957a766: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateGroupCallEncryptedMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCallEncryptedMessage#c957a766 to nil")
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallEncryptedMessage#c957a766: field call: %w", )
		}
		.Call = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallEncryptedMessage#c957a766: field from_id: %w", )
		}
		.FromID = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCallEncryptedMessage#c957a766: field encrypted_message: %w", )
		}
		.EncryptedMessage = 
	}
	return nil
}

// GetCall returns value of Call field.
func ( *UpdateGroupCallEncryptedMessage) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// GetFromID returns value of FromID field.
func ( *UpdateGroupCallEncryptedMessage) () ( PeerClass) {
	if  == nil {
		return
	}
	return .FromID
}

// GetEncryptedMessage returns value of EncryptedMessage field.
func ( *UpdateGroupCallEncryptedMessage) () ( []byte) {
	if  == nil {
		return
	}
	return .EncryptedMessage
}

// UpdatePinnedForumTopic represents TL type `updatePinnedForumTopic#683b2c52`.
// A forum topic »¹ was pinned or unpinned.
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/updatePinnedForumTopic for reference.
type UpdatePinnedForumTopic struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the topic was pinned or unpinned
	Pinned bool
	// The supergroup forum, private chat (for forum-enabled bots) or bot forum (for users)
	// where the topic is located.
	Peer PeerClass
	// The topic ID
	TopicID int
}

// UpdatePinnedForumTopicTypeID is TL type id of UpdatePinnedForumTopic.
const UpdatePinnedForumTopicTypeID = 0x683b2c52

// construct implements constructor of UpdateClass.
func ( UpdatePinnedForumTopic) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdatePinnedForumTopic.
var (
	_ bin.Encoder     = &UpdatePinnedForumTopic{}
	_ bin.Decoder     = &UpdatePinnedForumTopic{}
	_ bin.BareEncoder = &UpdatePinnedForumTopic{}
	_ bin.BareDecoder = &UpdatePinnedForumTopic{}

	_ UpdateClass = &UpdatePinnedForumTopic{}
)

func ( *UpdatePinnedForumTopic) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Pinned == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.TopicID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdatePinnedForumTopic) () string {
	if  == nil {
		return "UpdatePinnedForumTopic(nil)"
	}
	type  UpdatePinnedForumTopic
	return fmt.Sprintf("UpdatePinnedForumTopic%+v", (*))
}

// FillFrom fills UpdatePinnedForumTopic from given interface.
func ( *UpdatePinnedForumTopic) ( interface {
	() ( bool)
	() ( PeerClass)
	() ( int)
}) {
	.Pinned = .()
	.Peer = .()
	.TopicID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdatePinnedForumTopic) () uint32 {
	return UpdatePinnedForumTopicTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdatePinnedForumTopic) () string {
	return "updatePinnedForumTopic"
}

// TypeInfo returns info about TL type.
func ( *UpdatePinnedForumTopic) () tdp.Type {
	 := tdp.Type{
		Name: "updatePinnedForumTopic",
		ID:   UpdatePinnedForumTopicTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Pinned",
			SchemaName: "pinned",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "TopicID",
			SchemaName: "topic_id",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdatePinnedForumTopic) () {
	if !(.Pinned == false) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdatePinnedForumTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedForumTopic#683b2c52 as nil")
	}
	.PutID(UpdatePinnedForumTopicTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePinnedForumTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedForumTopic#683b2c52 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedForumTopic#683b2c52: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updatePinnedForumTopic#683b2c52: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedForumTopic#683b2c52: field peer: %w", )
	}
	.PutInt(.TopicID)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdatePinnedForumTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePinnedForumTopic#683b2c52 to nil")
	}
	if  := .ConsumeID(UpdatePinnedForumTopicTypeID);  != nil {
		return fmt.Errorf("unable to decode updatePinnedForumTopic#683b2c52: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePinnedForumTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePinnedForumTopic#683b2c52 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePinnedForumTopic#683b2c52: field flags: %w", )
		}
	}
	.Pinned = .Flags.Has(0)
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedForumTopic#683b2c52: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedForumTopic#683b2c52: field topic_id: %w", )
		}
		.TopicID = 
	}
	return nil
}

// SetPinned sets value of Pinned conditional field.
func ( *UpdatePinnedForumTopic) ( bool) {
	if  {
		.Flags.Set(0)
		.Pinned = true
	} else {
		.Flags.Unset(0)
		.Pinned = false
	}
}

// GetPinned returns value of Pinned conditional field.
func ( *UpdatePinnedForumTopic) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetPeer returns value of Peer field.
func ( *UpdatePinnedForumTopic) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetTopicID returns value of TopicID field.
func ( *UpdatePinnedForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .TopicID
}

// UpdatePinnedForumTopics represents TL type `updatePinnedForumTopics#def143d0`.
// The pinned topics¹ of a forum have changed.
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/updatePinnedForumTopics for reference.
type UpdatePinnedForumTopics struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// The supergroup forum, private chat (for forum-enabled bots) or bot forum (for users)
	// where the topic is located.
	Peer PeerClass
	// Ordered list containing the IDs of all pinned topics.
	//
	// Use SetOrder and GetOrder helpers.
	Order []int
}

// UpdatePinnedForumTopicsTypeID is TL type id of UpdatePinnedForumTopics.
const UpdatePinnedForumTopicsTypeID = 0xdef143d0

// construct implements constructor of UpdateClass.
func ( UpdatePinnedForumTopics) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdatePinnedForumTopics.
var (
	_ bin.Encoder     = &UpdatePinnedForumTopics{}
	_ bin.Decoder     = &UpdatePinnedForumTopics{}
	_ bin.BareEncoder = &UpdatePinnedForumTopics{}
	_ bin.BareDecoder = &UpdatePinnedForumTopics{}

	_ UpdateClass = &UpdatePinnedForumTopics{}
)

func ( *UpdatePinnedForumTopics) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Order == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdatePinnedForumTopics) () string {
	if  == nil {
		return "UpdatePinnedForumTopics(nil)"
	}
	type  UpdatePinnedForumTopics
	return fmt.Sprintf("UpdatePinnedForumTopics%+v", (*))
}

// FillFrom fills UpdatePinnedForumTopics from given interface.
func ( *UpdatePinnedForumTopics) ( interface {
	() ( PeerClass)
	() ( []int,  bool)
}) {
	.Peer = .()
	if ,  := .();  {
		.Order = 
	}

}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdatePinnedForumTopics) () uint32 {
	return UpdatePinnedForumTopicsTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdatePinnedForumTopics) () string {
	return "updatePinnedForumTopics"
}

// TypeInfo returns info about TL type.
func ( *UpdatePinnedForumTopics) () tdp.Type {
	 := tdp.Type{
		Name: "updatePinnedForumTopics",
		ID:   UpdatePinnedForumTopicsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Order",
			SchemaName: "order",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdatePinnedForumTopics) () {
	if !(.Order == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdatePinnedForumTopics) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedForumTopics#def143d0 as nil")
	}
	.PutID(UpdatePinnedForumTopicsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatePinnedForumTopics) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updatePinnedForumTopics#def143d0 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedForumTopics#def143d0: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updatePinnedForumTopics#def143d0: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updatePinnedForumTopics#def143d0: field peer: %w", )
	}
	if .Flags.Has(0) {
		.PutVectorHeader(len(.Order))
		for ,  := range .Order {
			.PutInt()
		}
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdatePinnedForumTopics) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePinnedForumTopics#def143d0 to nil")
	}
	if  := .ConsumeID(UpdatePinnedForumTopicsTypeID);  != nil {
		return fmt.Errorf("unable to decode updatePinnedForumTopics#def143d0: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdatePinnedForumTopics) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updatePinnedForumTopics#def143d0 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updatePinnedForumTopics#def143d0: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedForumTopics#def143d0: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(0) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updatePinnedForumTopics#def143d0: field order: %w", )
		}

		if  > 0 {
			.Order = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updatePinnedForumTopics#def143d0: field order: %w", )
			}
			.Order = append(.Order, )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdatePinnedForumTopics) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// SetOrder sets value of Order conditional field.
func ( *UpdatePinnedForumTopics) ( []int) {
	.Flags.Set(0)
	.Order = 
}

// GetOrder returns value of Order conditional field and
// boolean which is true if field was set.
func ( *UpdatePinnedForumTopics) () ( []int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Order, true
}

// UpdateDeleteGroupCallMessages represents TL type `updateDeleteGroupCallMessages#3e85e92c`.
//
// See https://core.telegram.org/constructor/updateDeleteGroupCallMessages for reference.
type UpdateDeleteGroupCallMessages struct {
	// Call field of UpdateDeleteGroupCallMessages.
	Call InputGroupCallClass
	// Messages field of UpdateDeleteGroupCallMessages.
	Messages []int
}

// UpdateDeleteGroupCallMessagesTypeID is TL type id of UpdateDeleteGroupCallMessages.
const UpdateDeleteGroupCallMessagesTypeID = 0x3e85e92c

// construct implements constructor of UpdateClass.
func ( UpdateDeleteGroupCallMessages) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateDeleteGroupCallMessages.
var (
	_ bin.Encoder     = &UpdateDeleteGroupCallMessages{}
	_ bin.Decoder     = &UpdateDeleteGroupCallMessages{}
	_ bin.BareEncoder = &UpdateDeleteGroupCallMessages{}
	_ bin.BareDecoder = &UpdateDeleteGroupCallMessages{}

	_ UpdateClass = &UpdateDeleteGroupCallMessages{}
)

func ( *UpdateDeleteGroupCallMessages) () bool {
	if  == nil {
		return true
	}
	if !(.Call == nil) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateDeleteGroupCallMessages) () string {
	if  == nil {
		return "UpdateDeleteGroupCallMessages(nil)"
	}
	type  UpdateDeleteGroupCallMessages
	return fmt.Sprintf("UpdateDeleteGroupCallMessages%+v", (*))
}

// FillFrom fills UpdateDeleteGroupCallMessages from given interface.
func ( *UpdateDeleteGroupCallMessages) ( interface {
	() ( InputGroupCallClass)
	() ( []int)
}) {
	.Call = .()
	.Messages = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateDeleteGroupCallMessages) () uint32 {
	return UpdateDeleteGroupCallMessagesTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateDeleteGroupCallMessages) () string {
	return "updateDeleteGroupCallMessages"
}

// TypeInfo returns info about TL type.
func ( *UpdateDeleteGroupCallMessages) () tdp.Type {
	 := tdp.Type{
		Name: "updateDeleteGroupCallMessages",
		ID:   UpdateDeleteGroupCallMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateDeleteGroupCallMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteGroupCallMessages#3e85e92c as nil")
	}
	.PutID(UpdateDeleteGroupCallMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDeleteGroupCallMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteGroupCallMessages#3e85e92c as nil")
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode updateDeleteGroupCallMessages#3e85e92c: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDeleteGroupCallMessages#3e85e92c: field call: %w", )
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateDeleteGroupCallMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteGroupCallMessages#3e85e92c to nil")
	}
	if  := .ConsumeID(UpdateDeleteGroupCallMessagesTypeID);  != nil {
		return fmt.Errorf("unable to decode updateDeleteGroupCallMessages#3e85e92c: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDeleteGroupCallMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteGroupCallMessages#3e85e92c to nil")
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteGroupCallMessages#3e85e92c: field call: %w", )
		}
		.Call = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteGroupCallMessages#3e85e92c: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateDeleteGroupCallMessages#3e85e92c: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	return nil
}

// GetCall returns value of Call field.
func ( *UpdateDeleteGroupCallMessages) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// GetMessages returns value of Messages field.
func ( *UpdateDeleteGroupCallMessages) () ( []int) {
	if  == nil {
		return
	}
	return .Messages
}

// UpdateStarGiftAuctionState represents TL type `updateStarGiftAuctionState#48e246c2`.
// Contains updates to auction state, see here »¹ for more info on how to enable these
// updates.
//
// Links:
//  1. https://core.telegram.org/api/auctions
//
// See https://core.telegram.org/constructor/updateStarGiftAuctionState for reference.
type UpdateStarGiftAuctionState struct {
	// ID of the collectible gift »¹ currently being distributed in the auction.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#collectible-gifts
	GiftID int64
	// Auction state.
	State StarGiftAuctionStateClass
}

// UpdateStarGiftAuctionStateTypeID is TL type id of UpdateStarGiftAuctionState.
const UpdateStarGiftAuctionStateTypeID = 0x48e246c2

// construct implements constructor of UpdateClass.
func ( UpdateStarGiftAuctionState) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateStarGiftAuctionState.
var (
	_ bin.Encoder     = &UpdateStarGiftAuctionState{}
	_ bin.Decoder     = &UpdateStarGiftAuctionState{}
	_ bin.BareEncoder = &UpdateStarGiftAuctionState{}
	_ bin.BareDecoder = &UpdateStarGiftAuctionState{}

	_ UpdateClass = &UpdateStarGiftAuctionState{}
)

func ( *UpdateStarGiftAuctionState) () bool {
	if  == nil {
		return true
	}
	if !(.GiftID == 0) {
		return false
	}
	if !(.State == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateStarGiftAuctionState) () string {
	if  == nil {
		return "UpdateStarGiftAuctionState(nil)"
	}
	type  UpdateStarGiftAuctionState
	return fmt.Sprintf("UpdateStarGiftAuctionState%+v", (*))
}

// FillFrom fills UpdateStarGiftAuctionState from given interface.
func ( *UpdateStarGiftAuctionState) ( interface {
	() ( int64)
	() ( StarGiftAuctionStateClass)
}) {
	.GiftID = .()
	.State = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateStarGiftAuctionState) () uint32 {
	return UpdateStarGiftAuctionStateTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateStarGiftAuctionState) () string {
	return "updateStarGiftAuctionState"
}

// TypeInfo returns info about TL type.
func ( *UpdateStarGiftAuctionState) () tdp.Type {
	 := tdp.Type{
		Name: "updateStarGiftAuctionState",
		ID:   UpdateStarGiftAuctionStateTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "GiftID",
			SchemaName: "gift_id",
		},
		{
			Name:       "State",
			SchemaName: "state",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateStarGiftAuctionState) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarGiftAuctionState#48e246c2 as nil")
	}
	.PutID(UpdateStarGiftAuctionStateTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStarGiftAuctionState) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarGiftAuctionState#48e246c2 as nil")
	}
	.PutLong(.GiftID)
	if .State == nil {
		return fmt.Errorf("unable to encode updateStarGiftAuctionState#48e246c2: field state is nil")
	}
	if  := .State.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStarGiftAuctionState#48e246c2: field state: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateStarGiftAuctionState) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarGiftAuctionState#48e246c2 to nil")
	}
	if  := .ConsumeID(UpdateStarGiftAuctionStateTypeID);  != nil {
		return fmt.Errorf("unable to decode updateStarGiftAuctionState#48e246c2: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStarGiftAuctionState) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarGiftAuctionState#48e246c2 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateStarGiftAuctionState#48e246c2: field gift_id: %w", )
		}
		.GiftID = 
	}
	{
		,  := DecodeStarGiftAuctionState()
		if  != nil {
			return fmt.Errorf("unable to decode updateStarGiftAuctionState#48e246c2: field state: %w", )
		}
		.State = 
	}
	return nil
}

// GetGiftID returns value of GiftID field.
func ( *UpdateStarGiftAuctionState) () ( int64) {
	if  == nil {
		return
	}
	return .GiftID
}

// GetState returns value of State field.
func ( *UpdateStarGiftAuctionState) () ( StarGiftAuctionStateClass) {
	if  == nil {
		return
	}
	return .State
}

// UpdateStarGiftAuctionUserState represents TL type `updateStarGiftAuctionUserState#dc58f31e`.
// Contains updates to auction state related to the current user, see here »¹ for more
// info on how to enable these updates.
//
// Links:
//  1. https://core.telegram.org/api/auctions
//
// See https://core.telegram.org/constructor/updateStarGiftAuctionUserState for reference.
type UpdateStarGiftAuctionUserState struct {
	// ID of the collectible gift »¹ currently being distributed in the auction.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#collectible-gifts
	GiftID int64
	// Auction state related to the current user (i.e. info about placed bids, won gifts and
	// so on).
	UserState StarGiftAuctionUserState
}

// UpdateStarGiftAuctionUserStateTypeID is TL type id of UpdateStarGiftAuctionUserState.
const UpdateStarGiftAuctionUserStateTypeID = 0xdc58f31e

// construct implements constructor of UpdateClass.
func ( UpdateStarGiftAuctionUserState) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateStarGiftAuctionUserState.
var (
	_ bin.Encoder     = &UpdateStarGiftAuctionUserState{}
	_ bin.Decoder     = &UpdateStarGiftAuctionUserState{}
	_ bin.BareEncoder = &UpdateStarGiftAuctionUserState{}
	_ bin.BareDecoder = &UpdateStarGiftAuctionUserState{}

	_ UpdateClass = &UpdateStarGiftAuctionUserState{}
)

func ( *UpdateStarGiftAuctionUserState) () bool {
	if  == nil {
		return true
	}
	if !(.GiftID == 0) {
		return false
	}
	if !(.UserState.Zero()) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateStarGiftAuctionUserState) () string {
	if  == nil {
		return "UpdateStarGiftAuctionUserState(nil)"
	}
	type  UpdateStarGiftAuctionUserState
	return fmt.Sprintf("UpdateStarGiftAuctionUserState%+v", (*))
}

// FillFrom fills UpdateStarGiftAuctionUserState from given interface.
func ( *UpdateStarGiftAuctionUserState) ( interface {
	() ( int64)
	() ( StarGiftAuctionUserState)
}) {
	.GiftID = .()
	.UserState = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateStarGiftAuctionUserState) () uint32 {
	return UpdateStarGiftAuctionUserStateTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateStarGiftAuctionUserState) () string {
	return "updateStarGiftAuctionUserState"
}

// TypeInfo returns info about TL type.
func ( *UpdateStarGiftAuctionUserState) () tdp.Type {
	 := tdp.Type{
		Name: "updateStarGiftAuctionUserState",
		ID:   UpdateStarGiftAuctionUserStateTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "GiftID",
			SchemaName: "gift_id",
		},
		{
			Name:       "UserState",
			SchemaName: "user_state",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateStarGiftAuctionUserState) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarGiftAuctionUserState#dc58f31e as nil")
	}
	.PutID(UpdateStarGiftAuctionUserStateTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStarGiftAuctionUserState) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarGiftAuctionUserState#dc58f31e as nil")
	}
	.PutLong(.GiftID)
	if  := .UserState.Encode();  != nil {
		return fmt.Errorf("unable to encode updateStarGiftAuctionUserState#dc58f31e: field user_state: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateStarGiftAuctionUserState) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarGiftAuctionUserState#dc58f31e to nil")
	}
	if  := .ConsumeID(UpdateStarGiftAuctionUserStateTypeID);  != nil {
		return fmt.Errorf("unable to decode updateStarGiftAuctionUserState#dc58f31e: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStarGiftAuctionUserState) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarGiftAuctionUserState#dc58f31e to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateStarGiftAuctionUserState#dc58f31e: field gift_id: %w", )
		}
		.GiftID = 
	}
	{
		if  := .UserState.Decode();  != nil {
			return fmt.Errorf("unable to decode updateStarGiftAuctionUserState#dc58f31e: field user_state: %w", )
		}
	}
	return nil
}

// GetGiftID returns value of GiftID field.
func ( *UpdateStarGiftAuctionUserState) () ( int64) {
	if  == nil {
		return
	}
	return .GiftID
}

// GetUserState returns value of UserState field.
func ( *UpdateStarGiftAuctionUserState) () ( StarGiftAuctionUserState) {
	if  == nil {
		return
	}
	return .UserState
}

// UpdateEmojiGameInfo represents TL type `updateEmojiGameInfo#fb9c547a`.
//
// See https://core.telegram.org/constructor/updateEmojiGameInfo for reference.
type UpdateEmojiGameInfo struct {
	// Info field of UpdateEmojiGameInfo.
	Info MessagesEmojiGameInfoClass
}

// UpdateEmojiGameInfoTypeID is TL type id of UpdateEmojiGameInfo.
const UpdateEmojiGameInfoTypeID = 0xfb9c547a

// construct implements constructor of UpdateClass.
func ( UpdateEmojiGameInfo) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateEmojiGameInfo.
var (
	_ bin.Encoder     = &UpdateEmojiGameInfo{}
	_ bin.Decoder     = &UpdateEmojiGameInfo{}
	_ bin.BareEncoder = &UpdateEmojiGameInfo{}
	_ bin.BareDecoder = &UpdateEmojiGameInfo{}

	_ UpdateClass = &UpdateEmojiGameInfo{}
)

func ( *UpdateEmojiGameInfo) () bool {
	if  == nil {
		return true
	}
	if !(.Info == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateEmojiGameInfo) () string {
	if  == nil {
		return "UpdateEmojiGameInfo(nil)"
	}
	type  UpdateEmojiGameInfo
	return fmt.Sprintf("UpdateEmojiGameInfo%+v", (*))
}

// FillFrom fills UpdateEmojiGameInfo from given interface.
func ( *UpdateEmojiGameInfo) ( interface {
	() ( MessagesEmojiGameInfoClass)
}) {
	.Info = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateEmojiGameInfo) () uint32 {
	return UpdateEmojiGameInfoTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateEmojiGameInfo) () string {
	return "updateEmojiGameInfo"
}

// TypeInfo returns info about TL type.
func ( *UpdateEmojiGameInfo) () tdp.Type {
	 := tdp.Type{
		Name: "updateEmojiGameInfo",
		ID:   UpdateEmojiGameInfoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Info",
			SchemaName: "info",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateEmojiGameInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEmojiGameInfo#fb9c547a as nil")
	}
	.PutID(UpdateEmojiGameInfoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateEmojiGameInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateEmojiGameInfo#fb9c547a as nil")
	}
	if .Info == nil {
		return fmt.Errorf("unable to encode updateEmojiGameInfo#fb9c547a: field info is nil")
	}
	if  := .Info.Encode();  != nil {
		return fmt.Errorf("unable to encode updateEmojiGameInfo#fb9c547a: field info: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateEmojiGameInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateEmojiGameInfo#fb9c547a to nil")
	}
	if  := .ConsumeID(UpdateEmojiGameInfoTypeID);  != nil {
		return fmt.Errorf("unable to decode updateEmojiGameInfo#fb9c547a: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateEmojiGameInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateEmojiGameInfo#fb9c547a to nil")
	}
	{
		,  := DecodeMessagesEmojiGameInfo()
		if  != nil {
			return fmt.Errorf("unable to decode updateEmojiGameInfo#fb9c547a: field info: %w", )
		}
		.Info = 
	}
	return nil
}

// GetInfo returns value of Info field.
func ( *UpdateEmojiGameInfo) () ( MessagesEmojiGameInfoClass) {
	if  == nil {
		return
	}
	return .Info
}

// UpdateStarGiftCraftFail represents TL type `updateStarGiftCraftFail#ac072444`.
// Indicates that a crafting »¹ attempt did not produce a new collectible gift.
//
// Links:
//  1. https://core.telegram.org/api/gifts#crafting-collectible-gifts
//
// See https://core.telegram.org/constructor/updateStarGiftCraftFail for reference.
type UpdateStarGiftCraftFail struct {
}

// UpdateStarGiftCraftFailTypeID is TL type id of UpdateStarGiftCraftFail.
const UpdateStarGiftCraftFailTypeID = 0xac072444

// construct implements constructor of UpdateClass.
func ( UpdateStarGiftCraftFail) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateStarGiftCraftFail.
var (
	_ bin.Encoder     = &UpdateStarGiftCraftFail{}
	_ bin.Decoder     = &UpdateStarGiftCraftFail{}
	_ bin.BareEncoder = &UpdateStarGiftCraftFail{}
	_ bin.BareDecoder = &UpdateStarGiftCraftFail{}

	_ UpdateClass = &UpdateStarGiftCraftFail{}
)

func ( *UpdateStarGiftCraftFail) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateStarGiftCraftFail) () string {
	if  == nil {
		return "UpdateStarGiftCraftFail(nil)"
	}
	type  UpdateStarGiftCraftFail
	return fmt.Sprintf("UpdateStarGiftCraftFail%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateStarGiftCraftFail) () uint32 {
	return UpdateStarGiftCraftFailTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateStarGiftCraftFail) () string {
	return "updateStarGiftCraftFail"
}

// TypeInfo returns info about TL type.
func ( *UpdateStarGiftCraftFail) () tdp.Type {
	 := tdp.Type{
		Name: "updateStarGiftCraftFail",
		ID:   UpdateStarGiftCraftFailTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateStarGiftCraftFail) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarGiftCraftFail#ac072444 as nil")
	}
	.PutID(UpdateStarGiftCraftFailTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateStarGiftCraftFail) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateStarGiftCraftFail#ac072444 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateStarGiftCraftFail) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarGiftCraftFail#ac072444 to nil")
	}
	if  := .ConsumeID(UpdateStarGiftCraftFailTypeID);  != nil {
		return fmt.Errorf("unable to decode updateStarGiftCraftFail#ac072444: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateStarGiftCraftFail) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateStarGiftCraftFail#ac072444 to nil")
	}
	return nil
}

// UpdateChatParticipantRank represents TL type `updateChatParticipantRank#bd8367b9`.
// The tag »¹ of a participant of a basic group »² has changed.
//
// Links:
//  1. https://core.telegram.org/api/rank
//  2. https://core.telegram.org/api/channel#basic-groups
//
// See https://core.telegram.org/constructor/updateChatParticipantRank for reference.
type UpdateChatParticipantRank struct {
	// Basic group ID.
	ChatID int64
	// User ID.
	UserID int64
	// The new tag.
	Rank string
	// Used similarly to pts values to deduplicate/update outdated chat information as
	// specified here »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/peers#basic-group-updates
	Version int
}

// UpdateChatParticipantRankTypeID is TL type id of UpdateChatParticipantRank.
const UpdateChatParticipantRankTypeID = 0xbd8367b9

// construct implements constructor of UpdateClass.
func ( UpdateChatParticipantRank) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateChatParticipantRank.
var (
	_ bin.Encoder     = &UpdateChatParticipantRank{}
	_ bin.Decoder     = &UpdateChatParticipantRank{}
	_ bin.BareEncoder = &UpdateChatParticipantRank{}
	_ bin.BareDecoder = &UpdateChatParticipantRank{}

	_ UpdateClass = &UpdateChatParticipantRank{}
)

func ( *UpdateChatParticipantRank) () bool {
	if  == nil {
		return true
	}
	if !(.ChatID == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.Rank == "") {
		return false
	}
	if !(.Version == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateChatParticipantRank) () string {
	if  == nil {
		return "UpdateChatParticipantRank(nil)"
	}
	type  UpdateChatParticipantRank
	return fmt.Sprintf("UpdateChatParticipantRank%+v", (*))
}

// FillFrom fills UpdateChatParticipantRank from given interface.
func ( *UpdateChatParticipantRank) ( interface {
	() ( int64)
	() ( int64)
	() ( string)
	() ( int)
}) {
	.ChatID = .()
	.UserID = .()
	.Rank = .()
	.Version = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateChatParticipantRank) () uint32 {
	return UpdateChatParticipantRankTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateChatParticipantRank) () string {
	return "updateChatParticipantRank"
}

// TypeInfo returns info about TL type.
func ( *UpdateChatParticipantRank) () tdp.Type {
	 := tdp.Type{
		Name: "updateChatParticipantRank",
		ID:   UpdateChatParticipantRankTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "Rank",
			SchemaName: "rank",
		},
		{
			Name:       "Version",
			SchemaName: "version",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateChatParticipantRank) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipantRank#bd8367b9 as nil")
	}
	.PutID(UpdateChatParticipantRankTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChatParticipantRank) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChatParticipantRank#bd8367b9 as nil")
	}
	.PutLong(.ChatID)
	.PutLong(.UserID)
	.PutString(.Rank)
	.PutInt(.Version)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateChatParticipantRank) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatParticipantRank#bd8367b9 to nil")
	}
	if  := .ConsumeID(UpdateChatParticipantRankTypeID);  != nil {
		return fmt.Errorf("unable to decode updateChatParticipantRank#bd8367b9: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChatParticipantRank) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChatParticipantRank#bd8367b9 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantRank#bd8367b9: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantRank#bd8367b9: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantRank#bd8367b9: field rank: %w", )
		}
		.Rank = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChatParticipantRank#bd8367b9: field version: %w", )
		}
		.Version = 
	}
	return nil
}

// GetChatID returns value of ChatID field.
func ( *UpdateChatParticipantRank) () ( int64) {
	if  == nil {
		return
	}
	return .ChatID
}

// GetUserID returns value of UserID field.
func ( *UpdateChatParticipantRank) () ( int64) {
	if  == nil {
		return
	}
	return .UserID
}

// GetRank returns value of Rank field.
func ( *UpdateChatParticipantRank) () ( string) {
	if  == nil {
		return
	}
	return .Rank
}

// GetVersion returns value of Version field.
func ( *UpdateChatParticipantRank) () ( int) {
	if  == nil {
		return
	}
	return .Version
}

// UpdateManagedBot represents TL type `updateManagedBot#4880ed9a`.
//
// See https://core.telegram.org/constructor/updateManagedBot for reference.
type UpdateManagedBot struct {
	// UserID field of UpdateManagedBot.
	UserID int64
	// BotID field of UpdateManagedBot.
	BotID int64
	// Qts field of UpdateManagedBot.
	Qts int
}

// UpdateManagedBotTypeID is TL type id of UpdateManagedBot.
const UpdateManagedBotTypeID = 0x4880ed9a

// construct implements constructor of UpdateClass.
func ( UpdateManagedBot) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateManagedBot.
var (
	_ bin.Encoder     = &UpdateManagedBot{}
	_ bin.Decoder     = &UpdateManagedBot{}
	_ bin.BareEncoder = &UpdateManagedBot{}
	_ bin.BareDecoder = &UpdateManagedBot{}

	_ UpdateClass = &UpdateManagedBot{}
)

func ( *UpdateManagedBot) () bool {
	if  == nil {
		return true
	}
	if !(.UserID == 0) {
		return false
	}
	if !(.BotID == 0) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateManagedBot) () string {
	if  == nil {
		return "UpdateManagedBot(nil)"
	}
	type  UpdateManagedBot
	return fmt.Sprintf("UpdateManagedBot%+v", (*))
}

// FillFrom fills UpdateManagedBot from given interface.
func ( *UpdateManagedBot) ( interface {
	() ( int64)
	() ( int64)
	() ( int)
}) {
	.UserID = .()
	.BotID = .()
	.Qts = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateManagedBot) () uint32 {
	return UpdateManagedBotTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateManagedBot) () string {
	return "updateManagedBot"
}

// TypeInfo returns info about TL type.
func ( *UpdateManagedBot) () tdp.Type {
	 := tdp.Type{
		Name: "updateManagedBot",
		ID:   UpdateManagedBotTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
		{
			Name:       "BotID",
			SchemaName: "bot_id",
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateManagedBot) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateManagedBot#4880ed9a as nil")
	}
	.PutID(UpdateManagedBotTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateManagedBot) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateManagedBot#4880ed9a as nil")
	}
	.PutLong(.UserID)
	.PutLong(.BotID)
	.PutInt(.Qts)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateManagedBot) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateManagedBot#4880ed9a to nil")
	}
	if  := .ConsumeID(UpdateManagedBotTypeID);  != nil {
		return fmt.Errorf("unable to decode updateManagedBot#4880ed9a: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateManagedBot) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateManagedBot#4880ed9a to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateManagedBot#4880ed9a: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateManagedBot#4880ed9a: field bot_id: %w", )
		}
		.BotID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateManagedBot#4880ed9a: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetUserID returns value of UserID field.
func ( *UpdateManagedBot) () ( int64) {
	if  == nil {
		return
	}
	return .UserID
}

// GetBotID returns value of BotID field.
func ( *UpdateManagedBot) () ( int64) {
	if  == nil {
		return
	}
	return .BotID
}

// GetQts returns value of Qts field.
func ( *UpdateManagedBot) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// UpdateBotGuestChatQuery represents TL type `updateBotGuestChatQuery#cdd4093d`.
//
// See https://core.telegram.org/constructor/updateBotGuestChatQuery for reference.
type UpdateBotGuestChatQuery struct {
	// Flags field of UpdateBotGuestChatQuery.
	Flags bin.Fields
	// QueryID field of UpdateBotGuestChatQuery.
	QueryID int64
	// Message field of UpdateBotGuestChatQuery.
	Message MessageClass
	// ReferenceMessages field of UpdateBotGuestChatQuery.
	//
	// Use SetReferenceMessages and GetReferenceMessages helpers.
	ReferenceMessages []MessageClass
	// Qts field of UpdateBotGuestChatQuery.
	Qts int
}

// UpdateBotGuestChatQueryTypeID is TL type id of UpdateBotGuestChatQuery.
const UpdateBotGuestChatQueryTypeID = 0xcdd4093d

// construct implements constructor of UpdateClass.
func ( UpdateBotGuestChatQuery) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateBotGuestChatQuery.
var (
	_ bin.Encoder     = &UpdateBotGuestChatQuery{}
	_ bin.Decoder     = &UpdateBotGuestChatQuery{}
	_ bin.BareEncoder = &UpdateBotGuestChatQuery{}
	_ bin.BareDecoder = &UpdateBotGuestChatQuery{}

	_ UpdateClass = &UpdateBotGuestChatQuery{}
)

func ( *UpdateBotGuestChatQuery) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.Message == nil) {
		return false
	}
	if !(.ReferenceMessages == nil) {
		return false
	}
	if !(.Qts == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateBotGuestChatQuery) () string {
	if  == nil {
		return "UpdateBotGuestChatQuery(nil)"
	}
	type  UpdateBotGuestChatQuery
	return fmt.Sprintf("UpdateBotGuestChatQuery%+v", (*))
}

// FillFrom fills UpdateBotGuestChatQuery from given interface.
func ( *UpdateBotGuestChatQuery) ( interface {
	() ( int64)
	() ( MessageClass)
	() ( []MessageClass,  bool)
	() ( int)
}) {
	.QueryID = .()
	.Message = .()
	if ,  := .();  {
		.ReferenceMessages = 
	}

	.Qts = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateBotGuestChatQuery) () uint32 {
	return UpdateBotGuestChatQueryTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateBotGuestChatQuery) () string {
	return "updateBotGuestChatQuery"
}

// TypeInfo returns info about TL type.
func ( *UpdateBotGuestChatQuery) () tdp.Type {
	 := tdp.Type{
		Name: "updateBotGuestChatQuery",
		ID:   UpdateBotGuestChatQueryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
		{
			Name:       "ReferenceMessages",
			SchemaName: "reference_messages",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateBotGuestChatQuery) () {
	if !(.ReferenceMessages == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateBotGuestChatQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotGuestChatQuery#cdd4093d as nil")
	}
	.PutID(UpdateBotGuestChatQueryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotGuestChatQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotGuestChatQuery#cdd4093d as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotGuestChatQuery#cdd4093d: field flags: %w", )
	}
	.PutLong(.QueryID)
	if .Message == nil {
		return fmt.Errorf("unable to encode updateBotGuestChatQuery#cdd4093d: field message is nil")
	}
	if  := .Message.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotGuestChatQuery#cdd4093d: field message: %w", )
	}
	if .Flags.Has(0) {
		.PutVectorHeader(len(.ReferenceMessages))
		for ,  := range .ReferenceMessages {
			if  == nil {
				return fmt.Errorf("unable to encode updateBotGuestChatQuery#cdd4093d: field reference_messages element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode updateBotGuestChatQuery#cdd4093d: field reference_messages element with index %d: %w", , )
			}
		}
	}
	.PutInt(.Qts)
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateBotGuestChatQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotGuestChatQuery#cdd4093d to nil")
	}
	if  := .ConsumeID(UpdateBotGuestChatQueryTypeID);  != nil {
		return fmt.Errorf("unable to decode updateBotGuestChatQuery#cdd4093d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotGuestChatQuery) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotGuestChatQuery#cdd4093d to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateBotGuestChatQuery#cdd4093d: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotGuestChatQuery#cdd4093d: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := DecodeMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotGuestChatQuery#cdd4093d: field message: %w", )
		}
		.Message = 
	}
	if .Flags.Has(0) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotGuestChatQuery#cdd4093d: field reference_messages: %w", )
		}

		if  > 0 {
			.ReferenceMessages = make([]MessageClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessage()
			if  != nil {
				return fmt.Errorf("unable to decode updateBotGuestChatQuery#cdd4093d: field reference_messages: %w", )
			}
			.ReferenceMessages = append(.ReferenceMessages, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotGuestChatQuery#cdd4093d: field qts: %w", )
		}
		.Qts = 
	}
	return nil
}

// GetQueryID returns value of QueryID field.
func ( *UpdateBotGuestChatQuery) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

// GetMessage returns value of Message field.
func ( *UpdateBotGuestChatQuery) () ( MessageClass) {
	if  == nil {
		return
	}
	return .Message
}

// SetReferenceMessages sets value of ReferenceMessages conditional field.
func ( *UpdateBotGuestChatQuery) ( []MessageClass) {
	.Flags.Set(0)
	.ReferenceMessages = 
}

// GetReferenceMessages returns value of ReferenceMessages conditional field and
// boolean which is true if field was set.
func ( *UpdateBotGuestChatQuery) () ( []MessageClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .ReferenceMessages, true
}

// GetQts returns value of Qts field.
func ( *UpdateBotGuestChatQuery) () ( int) {
	if  == nil {
		return
	}
	return .Qts
}

// MapReferenceMessages returns field ReferenceMessages wrapped in MessageClassArray helper.
func ( *UpdateBotGuestChatQuery) () ( MessageClassArray,  bool) {
	if !.Flags.Has(0) {
		return , false
	}
	return MessageClassArray(.ReferenceMessages), true
}

// UpdateAiComposeTones represents TL type `updateAiComposeTones#8c0f91fb`.
//
// See https://core.telegram.org/constructor/updateAiComposeTones for reference.
type UpdateAiComposeTones struct {
}

// UpdateAiComposeTonesTypeID is TL type id of UpdateAiComposeTones.
const UpdateAiComposeTonesTypeID = 0x8c0f91fb

// construct implements constructor of UpdateClass.
func ( UpdateAiComposeTones) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateAiComposeTones.
var (
	_ bin.Encoder     = &UpdateAiComposeTones{}
	_ bin.Decoder     = &UpdateAiComposeTones{}
	_ bin.BareEncoder = &UpdateAiComposeTones{}
	_ bin.BareDecoder = &UpdateAiComposeTones{}

	_ UpdateClass = &UpdateAiComposeTones{}
)

func ( *UpdateAiComposeTones) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateAiComposeTones) () string {
	if  == nil {
		return "UpdateAiComposeTones(nil)"
	}
	type  UpdateAiComposeTones
	return fmt.Sprintf("UpdateAiComposeTones%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateAiComposeTones) () uint32 {
	return UpdateAiComposeTonesTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateAiComposeTones) () string {
	return "updateAiComposeTones"
}

// TypeInfo returns info about TL type.
func ( *UpdateAiComposeTones) () tdp.Type {
	 := tdp.Type{
		Name: "updateAiComposeTones",
		ID:   UpdateAiComposeTonesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateAiComposeTones) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateAiComposeTones#8c0f91fb as nil")
	}
	.PutID(UpdateAiComposeTonesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateAiComposeTones) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateAiComposeTones#8c0f91fb as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateAiComposeTones) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateAiComposeTones#8c0f91fb to nil")
	}
	if  := .ConsumeID(UpdateAiComposeTonesTypeID);  != nil {
		return fmt.Errorf("unable to decode updateAiComposeTones#8c0f91fb: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateAiComposeTones) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateAiComposeTones#8c0f91fb to nil")
	}
	return nil
}

// UpdateJoinChatWebViewDecision represents TL type `updateJoinChatWebViewDecision#bdac7e70`.
//
// See https://core.telegram.org/constructor/updateJoinChatWebViewDecision for reference.
type UpdateJoinChatWebViewDecision struct {
	// Peer field of UpdateJoinChatWebViewDecision.
	Peer PeerClass
	// QueryID field of UpdateJoinChatWebViewDecision.
	QueryID int64
	// Result field of UpdateJoinChatWebViewDecision.
	Result JoinChatBotResultClass
}

// UpdateJoinChatWebViewDecisionTypeID is TL type id of UpdateJoinChatWebViewDecision.
const UpdateJoinChatWebViewDecisionTypeID = 0xbdac7e70

// construct implements constructor of UpdateClass.
func ( UpdateJoinChatWebViewDecision) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateJoinChatWebViewDecision.
var (
	_ bin.Encoder     = &UpdateJoinChatWebViewDecision{}
	_ bin.Decoder     = &UpdateJoinChatWebViewDecision{}
	_ bin.BareEncoder = &UpdateJoinChatWebViewDecision{}
	_ bin.BareDecoder = &UpdateJoinChatWebViewDecision{}

	_ UpdateClass = &UpdateJoinChatWebViewDecision{}
)

func ( *UpdateJoinChatWebViewDecision) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.Result == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateJoinChatWebViewDecision) () string {
	if  == nil {
		return "UpdateJoinChatWebViewDecision(nil)"
	}
	type  UpdateJoinChatWebViewDecision
	return fmt.Sprintf("UpdateJoinChatWebViewDecision%+v", (*))
}

// FillFrom fills UpdateJoinChatWebViewDecision from given interface.
func ( *UpdateJoinChatWebViewDecision) ( interface {
	() ( PeerClass)
	() ( int64)
	() ( JoinChatBotResultClass)
}) {
	.Peer = .()
	.QueryID = .()
	.Result = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateJoinChatWebViewDecision) () uint32 {
	return UpdateJoinChatWebViewDecisionTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateJoinChatWebViewDecision) () string {
	return "updateJoinChatWebViewDecision"
}

// TypeInfo returns info about TL type.
func ( *UpdateJoinChatWebViewDecision) () tdp.Type {
	 := tdp.Type{
		Name: "updateJoinChatWebViewDecision",
		ID:   UpdateJoinChatWebViewDecisionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "Result",
			SchemaName: "result",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateJoinChatWebViewDecision) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateJoinChatWebViewDecision#bdac7e70 as nil")
	}
	.PutID(UpdateJoinChatWebViewDecisionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateJoinChatWebViewDecision) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateJoinChatWebViewDecision#bdac7e70 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateJoinChatWebViewDecision#bdac7e70: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateJoinChatWebViewDecision#bdac7e70: field peer: %w", )
	}
	.PutLong(.QueryID)
	if .Result == nil {
		return fmt.Errorf("unable to encode updateJoinChatWebViewDecision#bdac7e70: field result is nil")
	}
	if  := .Result.Encode();  != nil {
		return fmt.Errorf("unable to encode updateJoinChatWebViewDecision#bdac7e70: field result: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateJoinChatWebViewDecision) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateJoinChatWebViewDecision#bdac7e70 to nil")
	}
	if  := .ConsumeID(UpdateJoinChatWebViewDecisionTypeID);  != nil {
		return fmt.Errorf("unable to decode updateJoinChatWebViewDecision#bdac7e70: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateJoinChatWebViewDecision) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateJoinChatWebViewDecision#bdac7e70 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateJoinChatWebViewDecision#bdac7e70: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateJoinChatWebViewDecision#bdac7e70: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := DecodeJoinChatBotResult()
		if  != nil {
			return fmt.Errorf("unable to decode updateJoinChatWebViewDecision#bdac7e70: field result: %w", )
		}
		.Result = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *UpdateJoinChatWebViewDecision) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetQueryID returns value of QueryID field.
func ( *UpdateJoinChatWebViewDecision) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

// GetResult returns value of Result field.
func ( *UpdateJoinChatWebViewDecision) () ( JoinChatBotResultClass) {
	if  == nil {
		return
	}
	return .Result
}

// UpdateNewBotConnection represents TL type `updateNewBotConnection#b22083a6`.
//
// See https://core.telegram.org/constructor/updateNewBotConnection for reference.
type UpdateNewBotConnection struct {
	// Flags field of UpdateNewBotConnection.
	Flags bin.Fields
	// Confirmed field of UpdateNewBotConnection.
	Confirmed bool
	// BotID field of UpdateNewBotConnection.
	BotID int64
	// Date field of UpdateNewBotConnection.
	//
	// Use SetDate and GetDate helpers.
	Date int
	// Device field of UpdateNewBotConnection.
	//
	// Use SetDevice and GetDevice helpers.
	Device string
	// Location field of UpdateNewBotConnection.
	//
	// Use SetLocation and GetLocation helpers.
	Location string
}

// UpdateNewBotConnectionTypeID is TL type id of UpdateNewBotConnection.
const UpdateNewBotConnectionTypeID = 0xb22083a6

// construct implements constructor of UpdateClass.
func ( UpdateNewBotConnection) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateNewBotConnection.
var (
	_ bin.Encoder     = &UpdateNewBotConnection{}
	_ bin.Decoder     = &UpdateNewBotConnection{}
	_ bin.BareEncoder = &UpdateNewBotConnection{}
	_ bin.BareDecoder = &UpdateNewBotConnection{}

	_ UpdateClass = &UpdateNewBotConnection{}
)

func ( *UpdateNewBotConnection) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Confirmed == false) {
		return false
	}
	if !(.BotID == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Device == "") {
		return false
	}
	if !(.Location == "") {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateNewBotConnection) () string {
	if  == nil {
		return "UpdateNewBotConnection(nil)"
	}
	type  UpdateNewBotConnection
	return fmt.Sprintf("UpdateNewBotConnection%+v", (*))
}

// FillFrom fills UpdateNewBotConnection from given interface.
func ( *UpdateNewBotConnection) ( interface {
	() ( bool)
	() ( int64)
	() ( int,  bool)
	() ( string,  bool)
	() ( string,  bool)
}) {
	.Confirmed = .()
	.BotID = .()
	if ,  := .();  {
		.Date = 
	}

	if ,  := .();  {
		.Device = 
	}

	if ,  := .();  {
		.Location = 
	}

}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateNewBotConnection) () uint32 {
	return UpdateNewBotConnectionTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateNewBotConnection) () string {
	return "updateNewBotConnection"
}

// TypeInfo returns info about TL type.
func ( *UpdateNewBotConnection) () tdp.Type {
	 := tdp.Type{
		Name: "updateNewBotConnection",
		ID:   UpdateNewBotConnectionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Confirmed",
			SchemaName: "confirmed",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "BotID",
			SchemaName: "bot_id",
		},
		{
			Name:       "Date",
			SchemaName: "date",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Device",
			SchemaName: "device",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Location",
			SchemaName: "location",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateNewBotConnection) () {
	if !(.Confirmed == false) {
		.Flags.Set(0)
	}
	if !(.Date == 0) {
		.Flags.Set(1)
	}
	if !(.Device == "") {
		.Flags.Set(1)
	}
	if !(.Location == "") {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateNewBotConnection) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewBotConnection#b22083a6 as nil")
	}
	.PutID(UpdateNewBotConnectionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateNewBotConnection) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateNewBotConnection#b22083a6 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateNewBotConnection#b22083a6: field flags: %w", )
	}
	.PutLong(.BotID)
	if .Flags.Has(1) {
		.PutInt(.Date)
	}
	if .Flags.Has(1) {
		.PutString(.Device)
	}
	if .Flags.Has(1) {
		.PutString(.Location)
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateNewBotConnection) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewBotConnection#b22083a6 to nil")
	}
	if  := .ConsumeID(UpdateNewBotConnectionTypeID);  != nil {
		return fmt.Errorf("unable to decode updateNewBotConnection#b22083a6: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateNewBotConnection) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateNewBotConnection#b22083a6 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateNewBotConnection#b22083a6: field flags: %w", )
		}
	}
	.Confirmed = .Flags.Has(0)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewBotConnection#b22083a6: field bot_id: %w", )
		}
		.BotID = 
	}
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewBotConnection#b22083a6: field date: %w", )
		}
		.Date = 
	}
	if .Flags.Has(1) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewBotConnection#b22083a6: field device: %w", )
		}
		.Device = 
	}
	if .Flags.Has(1) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateNewBotConnection#b22083a6: field location: %w", )
		}
		.Location = 
	}
	return nil
}

// SetConfirmed sets value of Confirmed conditional field.
func ( *UpdateNewBotConnection) ( bool) {
	if  {
		.Flags.Set(0)
		.Confirmed = true
	} else {
		.Flags.Unset(0)
		.Confirmed = false
	}
}

// GetConfirmed returns value of Confirmed conditional field.
func ( *UpdateNewBotConnection) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetBotID returns value of BotID field.
func ( *UpdateNewBotConnection) () ( int64) {
	if  == nil {
		return
	}
	return .BotID
}

// SetDate sets value of Date conditional field.
func ( *UpdateNewBotConnection) ( int) {
	.Flags.Set(1)
	.Date = 
}

// GetDate returns value of Date conditional field and
// boolean which is true if field was set.
func ( *UpdateNewBotConnection) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Date, true
}

// SetDevice sets value of Device conditional field.
func ( *UpdateNewBotConnection) ( string) {
	.Flags.Set(1)
	.Device = 
}

// GetDevice returns value of Device conditional field and
// boolean which is true if field was set.
func ( *UpdateNewBotConnection) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Device, true
}

// SetLocation sets value of Location conditional field.
func ( *UpdateNewBotConnection) ( string) {
	.Flags.Set(1)
	.Location = 
}

// GetLocation returns value of Location conditional field and
// boolean which is true if field was set.
func ( *UpdateNewBotConnection) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Location, true
}

// UpdateWebBrowserSettings represents TL type `updateWebBrowserSettings#c39a2ade`.
//
// See https://core.telegram.org/constructor/updateWebBrowserSettings for reference.
type UpdateWebBrowserSettings struct {
	// Flags field of UpdateWebBrowserSettings.
	Flags bin.Fields
	// OpenExternalBrowser field of UpdateWebBrowserSettings.
	OpenExternalBrowser bool
	// DisplayCloseButton field of UpdateWebBrowserSettings.
	DisplayCloseButton bool
}

// UpdateWebBrowserSettingsTypeID is TL type id of UpdateWebBrowserSettings.
const UpdateWebBrowserSettingsTypeID = 0xc39a2ade

// construct implements constructor of UpdateClass.
func ( UpdateWebBrowserSettings) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateWebBrowserSettings.
var (
	_ bin.Encoder     = &UpdateWebBrowserSettings{}
	_ bin.Decoder     = &UpdateWebBrowserSettings{}
	_ bin.BareEncoder = &UpdateWebBrowserSettings{}
	_ bin.BareDecoder = &UpdateWebBrowserSettings{}

	_ UpdateClass = &UpdateWebBrowserSettings{}
)

func ( *UpdateWebBrowserSettings) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.OpenExternalBrowser == false) {
		return false
	}
	if !(.DisplayCloseButton == false) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateWebBrowserSettings) () string {
	if  == nil {
		return "UpdateWebBrowserSettings(nil)"
	}
	type  UpdateWebBrowserSettings
	return fmt.Sprintf("UpdateWebBrowserSettings%+v", (*))
}

// FillFrom fills UpdateWebBrowserSettings from given interface.
func ( *UpdateWebBrowserSettings) ( interface {
	() ( bool)
	() ( bool)
}) {
	.OpenExternalBrowser = .()
	.DisplayCloseButton = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateWebBrowserSettings) () uint32 {
	return UpdateWebBrowserSettingsTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateWebBrowserSettings) () string {
	return "updateWebBrowserSettings"
}

// TypeInfo returns info about TL type.
func ( *UpdateWebBrowserSettings) () tdp.Type {
	 := tdp.Type{
		Name: "updateWebBrowserSettings",
		ID:   UpdateWebBrowserSettingsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "OpenExternalBrowser",
			SchemaName: "open_external_browser",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "DisplayCloseButton",
			SchemaName: "display_close_button",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateWebBrowserSettings) () {
	if !(.OpenExternalBrowser == false) {
		.Flags.Set(0)
	}
	if !(.DisplayCloseButton == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateWebBrowserSettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateWebBrowserSettings#c39a2ade as nil")
	}
	.PutID(UpdateWebBrowserSettingsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateWebBrowserSettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateWebBrowserSettings#c39a2ade as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateWebBrowserSettings#c39a2ade: field flags: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateWebBrowserSettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateWebBrowserSettings#c39a2ade to nil")
	}
	if  := .ConsumeID(UpdateWebBrowserSettingsTypeID);  != nil {
		return fmt.Errorf("unable to decode updateWebBrowserSettings#c39a2ade: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateWebBrowserSettings) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateWebBrowserSettings#c39a2ade to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateWebBrowserSettings#c39a2ade: field flags: %w", )
		}
	}
	.OpenExternalBrowser = .Flags.Has(0)
	.DisplayCloseButton = .Flags.Has(1)
	return nil
}

// SetOpenExternalBrowser sets value of OpenExternalBrowser conditional field.
func ( *UpdateWebBrowserSettings) ( bool) {
	if  {
		.Flags.Set(0)
		.OpenExternalBrowser = true
	} else {
		.Flags.Unset(0)
		.OpenExternalBrowser = false
	}
}

// GetOpenExternalBrowser returns value of OpenExternalBrowser conditional field.
func ( *UpdateWebBrowserSettings) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetDisplayCloseButton sets value of DisplayCloseButton conditional field.
func ( *UpdateWebBrowserSettings) ( bool) {
	if  {
		.Flags.Set(1)
		.DisplayCloseButton = true
	} else {
		.Flags.Unset(1)
		.DisplayCloseButton = false
	}
}

// GetDisplayCloseButton returns value of DisplayCloseButton conditional field.
func ( *UpdateWebBrowserSettings) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// UpdateWebBrowserException represents TL type `updateWebBrowserException#140502d1`.
//
// See https://core.telegram.org/constructor/updateWebBrowserException for reference.
type UpdateWebBrowserException struct {
	// Flags field of UpdateWebBrowserException.
	Flags bin.Fields
	// Delete field of UpdateWebBrowserException.
	Delete bool
	// OpenExternalBrowser field of UpdateWebBrowserException.
	//
	// Use SetOpenExternalBrowser and GetOpenExternalBrowser helpers.
	OpenExternalBrowser bool
	// Exception field of UpdateWebBrowserException.
	Exception WebDomainException
}

// UpdateWebBrowserExceptionTypeID is TL type id of UpdateWebBrowserException.
const UpdateWebBrowserExceptionTypeID = 0x140502d1

// construct implements constructor of UpdateClass.
func ( UpdateWebBrowserException) () UpdateClass { return & }

// Ensuring interfaces in compile-time for UpdateWebBrowserException.
var (
	_ bin.Encoder     = &UpdateWebBrowserException{}
	_ bin.Decoder     = &UpdateWebBrowserException{}
	_ bin.BareEncoder = &UpdateWebBrowserException{}
	_ bin.BareDecoder = &UpdateWebBrowserException{}

	_ UpdateClass = &UpdateWebBrowserException{}
)

func ( *UpdateWebBrowserException) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Delete == false) {
		return false
	}
	if !(.OpenExternalBrowser == false) {
		return false
	}
	if !(.Exception.Zero()) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *UpdateWebBrowserException) () string {
	if  == nil {
		return "UpdateWebBrowserException(nil)"
	}
	type  UpdateWebBrowserException
	return fmt.Sprintf("UpdateWebBrowserException%+v", (*))
}

// FillFrom fills UpdateWebBrowserException from given interface.
func ( *UpdateWebBrowserException) ( interface {
	() ( bool)
	() ( bool,  bool)
	() ( WebDomainException)
}) {
	.Delete = .()
	if ,  := .();  {
		.OpenExternalBrowser = 
	}

	.Exception = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*UpdateWebBrowserException) () uint32 {
	return UpdateWebBrowserExceptionTypeID
}

// TypeName returns name of type in TL schema.
func (*UpdateWebBrowserException) () string {
	return "updateWebBrowserException"
}

// TypeInfo returns info about TL type.
func ( *UpdateWebBrowserException) () tdp.Type {
	 := tdp.Type{
		Name: "updateWebBrowserException",
		ID:   UpdateWebBrowserExceptionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Delete",
			SchemaName: "delete",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "OpenExternalBrowser",
			SchemaName: "open_external_browser",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Exception",
			SchemaName: "exception",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *UpdateWebBrowserException) () {
	if !(.Delete == false) {
		.Flags.Set(1)
	}
	if !(.OpenExternalBrowser == false) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateWebBrowserException) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateWebBrowserException#140502d1 as nil")
	}
	.PutID(UpdateWebBrowserExceptionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateWebBrowserException) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateWebBrowserException#140502d1 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateWebBrowserException#140502d1: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutBool(.OpenExternalBrowser)
	}
	if  := .Exception.Encode();  != nil {
		return fmt.Errorf("unable to encode updateWebBrowserException#140502d1: field exception: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdateWebBrowserException) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateWebBrowserException#140502d1 to nil")
	}
	if  := .ConsumeID(UpdateWebBrowserExceptionTypeID);  != nil {
		return fmt.Errorf("unable to decode updateWebBrowserException#140502d1: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateWebBrowserException) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateWebBrowserException#140502d1 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateWebBrowserException#140502d1: field flags: %w", )
		}
	}
	.Delete = .Flags.Has(1)
	if .Flags.Has(0) {
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode updateWebBrowserException#140502d1: field open_external_browser: %w", )
		}
		.OpenExternalBrowser = 
	}
	{
		if  := .Exception.Decode();  != nil {
			return fmt.Errorf("unable to decode updateWebBrowserException#140502d1: field exception: %w", )
		}
	}
	return nil
}

// SetDelete sets value of Delete conditional field.
func ( *UpdateWebBrowserException) ( bool) {
	if  {
		.Flags.Set(1)
		.Delete = true
	} else {
		.Flags.Unset(1)
		.Delete = false
	}
}

// GetDelete returns value of Delete conditional field.
func ( *UpdateWebBrowserException) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetOpenExternalBrowser sets value of OpenExternalBrowser conditional field.
func ( *UpdateWebBrowserException) ( bool) {
	.Flags.Set(0)
	.OpenExternalBrowser = 
}

// GetOpenExternalBrowser returns value of OpenExternalBrowser conditional field and
// boolean which is true if field was set.
func ( *UpdateWebBrowserException) () ( bool,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .OpenExternalBrowser, true
}

// GetException returns value of Exception field.
func ( *UpdateWebBrowserException) () ( WebDomainException) {
	if  == nil {
		return
	}
	return .Exception
}

// UpdateClassName is schema name of UpdateClass.
const UpdateClassName = "Update"

// UpdateClass represents Update generic type.
//
// See https://core.telegram.org/type/Update for reference.
//
// Constructors:
//   - [UpdateNewMessage]
//   - [UpdateMessageID]
//   - [UpdateDeleteMessages]
//   - [UpdateUserTyping]
//   - [UpdateChatUserTyping]
//   - [UpdateChatParticipants]
//   - [UpdateUserStatus]
//   - [UpdateUserName]
//   - [UpdateNewAuthorization]
//   - [UpdateNewEncryptedMessage]
//   - [UpdateEncryptedChatTyping]
//   - [UpdateEncryption]
//   - [UpdateEncryptedMessagesRead]
//   - [UpdateChatParticipantAdd]
//   - [UpdateChatParticipantDelete]
//   - [UpdateDCOptions]
//   - [UpdateNotifySettings]
//   - [UpdateServiceNotification]
//   - [UpdatePrivacy]
//   - [UpdateUserPhone]
//   - [UpdateReadHistoryInbox]
//   - [UpdateReadHistoryOutbox]
//   - [UpdateWebPage]
//   - [UpdateReadMessagesContents]
//   - [UpdateChannelTooLong]
//   - [UpdateChannel]
//   - [UpdateNewChannelMessage]
//   - [UpdateReadChannelInbox]
//   - [UpdateDeleteChannelMessages]
//   - [UpdateChannelMessageViews]
//   - [UpdateChatParticipantAdmin]
//   - [UpdateNewStickerSet]
//   - [UpdateStickerSetsOrder]
//   - [UpdateStickerSets]
//   - [UpdateSavedGifs]
//   - [UpdateBotInlineQuery]
//   - [UpdateBotInlineSend]
//   - [UpdateEditChannelMessage]
//   - [UpdateBotCallbackQuery]
//   - [UpdateEditMessage]
//   - [UpdateInlineBotCallbackQuery]
//   - [UpdateReadChannelOutbox]
//   - [UpdateDraftMessage]
//   - [UpdateReadFeaturedStickers]
//   - [UpdateRecentStickers]
//   - [UpdateConfig]
//   - [UpdatePtsChanged]
//   - [UpdateChannelWebPage]
//   - [UpdateDialogPinned]
//   - [UpdatePinnedDialogs]
//   - [UpdateBotWebhookJSON]
//   - [UpdateBotWebhookJSONQuery]
//   - [UpdateBotShippingQuery]
//   - [UpdateBotPrecheckoutQuery]
//   - [UpdatePhoneCall]
//   - [UpdateLangPackTooLong]
//   - [UpdateLangPack]
//   - [UpdateFavedStickers]
//   - [UpdateChannelReadMessagesContents]
//   - [UpdateContactsReset]
//   - [UpdateChannelAvailableMessages]
//   - [UpdateDialogUnreadMark]
//   - [UpdateMessagePoll]
//   - [UpdateChatDefaultBannedRights]
//   - [UpdateFolderPeers]
//   - [UpdatePeerSettings]
//   - [UpdatePeerLocated]
//   - [UpdateNewScheduledMessage]
//   - [UpdateDeleteScheduledMessages]
//   - [UpdateTheme]
//   - [UpdateGeoLiveViewed]
//   - [UpdateLoginToken]
//   - [UpdateMessagePollVote]
//   - [UpdateDialogFilter]
//   - [UpdateDialogFilterOrder]
//   - [UpdateDialogFilters]
//   - [UpdatePhoneCallSignalingData]
//   - [UpdateChannelMessageForwards]
//   - [UpdateReadChannelDiscussionInbox]
//   - [UpdateReadChannelDiscussionOutbox]
//   - [UpdatePeerBlocked]
//   - [UpdateChannelUserTyping]
//   - [UpdatePinnedMessages]
//   - [UpdatePinnedChannelMessages]
//   - [UpdateChat]
//   - [UpdateGroupCallParticipants]
//   - [UpdateGroupCall]
//   - [UpdatePeerHistoryTTL]
//   - [UpdateChatParticipant]
//   - [UpdateChannelParticipant]
//   - [UpdateBotStopped]
//   - [UpdateGroupCallConnection]
//   - [UpdateBotCommands]
//   - [UpdatePendingJoinRequests]
//   - [UpdateBotChatInviteRequester]
//   - [UpdateMessageReactions]
//   - [UpdateAttachMenuBots]
//   - [UpdateWebViewResultSent]
//   - [UpdateBotMenuButton]
//   - [UpdateSavedRingtones]
//   - [UpdateTranscribedAudio]
//   - [UpdateReadFeaturedEmojiStickers]
//   - [UpdateUserEmojiStatus]
//   - [UpdateRecentEmojiStatuses]
//   - [UpdateRecentReactions]
//   - [UpdateMoveStickerSetToTop]
//   - [UpdateMessageExtendedMedia]
//   - [UpdateUser]
//   - [UpdateAutoSaveSettings]
//   - [UpdateStory]
//   - [UpdateReadStories]
//   - [UpdateStoryID]
//   - [UpdateStoriesStealthMode]
//   - [UpdateSentStoryReaction]
//   - [UpdateBotChatBoost]
//   - [UpdateChannelViewForumAsMessages]
//   - [UpdatePeerWallpaper]
//   - [UpdateBotMessageReaction]
//   - [UpdateBotMessageReactions]
//   - [UpdateSavedDialogPinned]
//   - [UpdatePinnedSavedDialogs]
//   - [UpdateSavedReactionTags]
//   - [UpdateSMSJob]
//   - [UpdateQuickReplies]
//   - [UpdateNewQuickReply]
//   - [UpdateDeleteQuickReply]
//   - [UpdateQuickReplyMessage]
//   - [UpdateDeleteQuickReplyMessages]
//   - [UpdateBotBusinessConnect]
//   - [UpdateBotNewBusinessMessage]
//   - [UpdateBotEditBusinessMessage]
//   - [UpdateBotDeleteBusinessMessage]
//   - [UpdateNewStoryReaction]
//   - [UpdateStarsBalance]
//   - [UpdateBusinessBotCallbackQuery]
//   - [UpdateStarsRevenueStatus]
//   - [UpdateBotPurchasedPaidMedia]
//   - [UpdatePaidReactionPrivacy]
//   - [UpdateSentPhoneCode]
//   - [UpdateGroupCallChainBlocks]
//   - [UpdateReadMonoForumInbox]
//   - [UpdateReadMonoForumOutbox]
//   - [UpdateMonoForumNoPaidException]
//   - [UpdateGroupCallMessage]
//   - [UpdateGroupCallEncryptedMessage]
//   - [UpdatePinnedForumTopic]
//   - [UpdatePinnedForumTopics]
//   - [UpdateDeleteGroupCallMessages]
//   - [UpdateStarGiftAuctionState]
//   - [UpdateStarGiftAuctionUserState]
//   - [UpdateEmojiGameInfo]
//   - [UpdateStarGiftCraftFail]
//   - [UpdateChatParticipantRank]
//   - [UpdateManagedBot]
//   - [UpdateBotGuestChatQuery]
//   - [UpdateAiComposeTones]
//   - [UpdateJoinChatWebViewDecision]
//   - [UpdateNewBotConnection]
//   - [UpdateWebBrowserSettings]
//   - [UpdateWebBrowserException]
//
// Example:
//
//	g, err := tg.DecodeUpdate(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.UpdateNewMessage: // updateNewMessage#1f2b0afd
//	case *tg.UpdateMessageID: // updateMessageID#4e90bfd6
//	case *tg.UpdateDeleteMessages: // updateDeleteMessages#a20db0e5
//	case *tg.UpdateUserTyping: // updateUserTyping#2a17bf5c
//	case *tg.UpdateChatUserTyping: // updateChatUserTyping#83487af0
//	case *tg.UpdateChatParticipants: // updateChatParticipants#7761198
//	case *tg.UpdateUserStatus: // updateUserStatus#e5bdf8de
//	case *tg.UpdateUserName: // updateUserName#a7848924
//	case *tg.UpdateNewAuthorization: // updateNewAuthorization#8951abef
//	case *tg.UpdateNewEncryptedMessage: // updateNewEncryptedMessage#12bcbd9a
//	case *tg.UpdateEncryptedChatTyping: // updateEncryptedChatTyping#1710f156
//	case *tg.UpdateEncryption: // updateEncryption#b4a2e88d
//	case *tg.UpdateEncryptedMessagesRead: // updateEncryptedMessagesRead#38fe25b7
//	case *tg.UpdateChatParticipantAdd: // updateChatParticipantAdd#3dda5451
//	case *tg.UpdateChatParticipantDelete: // updateChatParticipantDelete#e32f3d77
//	case *tg.UpdateDCOptions: // updateDcOptions#8e5e9873
//	case *tg.UpdateNotifySettings: // updateNotifySettings#bec268ef
//	case *tg.UpdateServiceNotification: // updateServiceNotification#ebe46819
//	case *tg.UpdatePrivacy: // updatePrivacy#ee3b272a
//	case *tg.UpdateUserPhone: // updateUserPhone#5492a13
//	case *tg.UpdateReadHistoryInbox: // updateReadHistoryInbox#9e84bc99
//	case *tg.UpdateReadHistoryOutbox: // updateReadHistoryOutbox#2f2f21bf
//	case *tg.UpdateWebPage: // updateWebPage#7f891213
//	case *tg.UpdateReadMessagesContents: // updateReadMessagesContents#f8227181
//	case *tg.UpdateChannelTooLong: // updateChannelTooLong#108d941f
//	case *tg.UpdateChannel: // updateChannel#635b4c09
//	case *tg.UpdateNewChannelMessage: // updateNewChannelMessage#62ba04d9
//	case *tg.UpdateReadChannelInbox: // updateReadChannelInbox#922e6e10
//	case *tg.UpdateDeleteChannelMessages: // updateDeleteChannelMessages#c32d5b12
//	case *tg.UpdateChannelMessageViews: // updateChannelMessageViews#f226ac08
//	case *tg.UpdateChatParticipantAdmin: // updateChatParticipantAdmin#d7ca61a2
//	case *tg.UpdateNewStickerSet: // updateNewStickerSet#688a30aa
//	case *tg.UpdateStickerSetsOrder: // updateStickerSetsOrder#bb2d201
//	case *tg.UpdateStickerSets: // updateStickerSets#31c24808
//	case *tg.UpdateSavedGifs: // updateSavedGifs#9375341e
//	case *tg.UpdateBotInlineQuery: // updateBotInlineQuery#496f379c
//	case *tg.UpdateBotInlineSend: // updateBotInlineSend#12f12a07
//	case *tg.UpdateEditChannelMessage: // updateEditChannelMessage#1b3f4df7
//	case *tg.UpdateBotCallbackQuery: // updateBotCallbackQuery#b9cfc48d
//	case *tg.UpdateEditMessage: // updateEditMessage#e40370a3
//	case *tg.UpdateInlineBotCallbackQuery: // updateInlineBotCallbackQuery#691e9052
//	case *tg.UpdateReadChannelOutbox: // updateReadChannelOutbox#b75f99a9
//	case *tg.UpdateDraftMessage: // updateDraftMessage#edfc111e
//	case *tg.UpdateReadFeaturedStickers: // updateReadFeaturedStickers#571d2742
//	case *tg.UpdateRecentStickers: // updateRecentStickers#9a422c20
//	case *tg.UpdateConfig: // updateConfig#a229dd06
//	case *tg.UpdatePtsChanged: // updatePtsChanged#3354678f
//	case *tg.UpdateChannelWebPage: // updateChannelWebPage#2f2ba99f
//	case *tg.UpdateDialogPinned: // updateDialogPinned#6e6fe51c
//	case *tg.UpdatePinnedDialogs: // updatePinnedDialogs#fa0f3ca2
//	case *tg.UpdateBotWebhookJSON: // updateBotWebhookJSON#8317c0c3
//	case *tg.UpdateBotWebhookJSONQuery: // updateBotWebhookJSONQuery#9b9240a6
//	case *tg.UpdateBotShippingQuery: // updateBotShippingQuery#b5aefd7d
//	case *tg.UpdateBotPrecheckoutQuery: // updateBotPrecheckoutQuery#8caa9a96
//	case *tg.UpdatePhoneCall: // updatePhoneCall#ab0f6b1e
//	case *tg.UpdateLangPackTooLong: // updateLangPackTooLong#46560264
//	case *tg.UpdateLangPack: // updateLangPack#56022f4d
//	case *tg.UpdateFavedStickers: // updateFavedStickers#e511996d
//	case *tg.UpdateChannelReadMessagesContents: // updateChannelReadMessagesContents#25f324f7
//	case *tg.UpdateContactsReset: // updateContactsReset#7084a7be
//	case *tg.UpdateChannelAvailableMessages: // updateChannelAvailableMessages#b23fc698
//	case *tg.UpdateDialogUnreadMark: // updateDialogUnreadMark#b658f23e
//	case *tg.UpdateMessagePoll: // updateMessagePoll#d64c522b
//	case *tg.UpdateChatDefaultBannedRights: // updateChatDefaultBannedRights#54c01850
//	case *tg.UpdateFolderPeers: // updateFolderPeers#19360dc0
//	case *tg.UpdatePeerSettings: // updatePeerSettings#6a7e7366
//	case *tg.UpdatePeerLocated: // updatePeerLocated#b4afcfb0
//	case *tg.UpdateNewScheduledMessage: // updateNewScheduledMessage#39a51dfb
//	case *tg.UpdateDeleteScheduledMessages: // updateDeleteScheduledMessages#f2a71983
//	case *tg.UpdateTheme: // updateTheme#8216fba3
//	case *tg.UpdateGeoLiveViewed: // updateGeoLiveViewed#871fb939
//	case *tg.UpdateLoginToken: // updateLoginToken#564fe691
//	case *tg.UpdateMessagePollVote: // updateMessagePollVote#7699f014
//	case *tg.UpdateDialogFilter: // updateDialogFilter#26ffde7d
//	case *tg.UpdateDialogFilterOrder: // updateDialogFilterOrder#a5d72105
//	case *tg.UpdateDialogFilters: // updateDialogFilters#3504914f
//	case *tg.UpdatePhoneCallSignalingData: // updatePhoneCallSignalingData#2661bf09
//	case *tg.UpdateChannelMessageForwards: // updateChannelMessageForwards#d29a27f4
//	case *tg.UpdateReadChannelDiscussionInbox: // updateReadChannelDiscussionInbox#d6b19546
//	case *tg.UpdateReadChannelDiscussionOutbox: // updateReadChannelDiscussionOutbox#695c9e7c
//	case *tg.UpdatePeerBlocked: // updatePeerBlocked#ebe07752
//	case *tg.UpdateChannelUserTyping: // updateChannelUserTyping#8c88c923
//	case *tg.UpdatePinnedMessages: // updatePinnedMessages#ed85eab5
//	case *tg.UpdatePinnedChannelMessages: // updatePinnedChannelMessages#5bb98608
//	case *tg.UpdateChat: // updateChat#f89a6a4e
//	case *tg.UpdateGroupCallParticipants: // updateGroupCallParticipants#f2ebdb4e
//	case *tg.UpdateGroupCall: // updateGroupCall#9d2216e0
//	case *tg.UpdatePeerHistoryTTL: // updatePeerHistoryTTL#bb9bb9a5
//	case *tg.UpdateChatParticipant: // updateChatParticipant#d087663a
//	case *tg.UpdateChannelParticipant: // updateChannelParticipant#985d3abb
//	case *tg.UpdateBotStopped: // updateBotStopped#c4870a49
//	case *tg.UpdateGroupCallConnection: // updateGroupCallConnection#b783982
//	case *tg.UpdateBotCommands: // updateBotCommands#4d712f2e
//	case *tg.UpdatePendingJoinRequests: // updatePendingJoinRequests#7063c3db
//	case *tg.UpdateBotChatInviteRequester: // updateBotChatInviteRequester#7cb34d79
//	case *tg.UpdateMessageReactions: // updateMessageReactions#1e297bfa
//	case *tg.UpdateAttachMenuBots: // updateAttachMenuBots#17b7a20b
//	case *tg.UpdateWebViewResultSent: // updateWebViewResultSent#1592b79d
//	case *tg.UpdateBotMenuButton: // updateBotMenuButton#14b85813
//	case *tg.UpdateSavedRingtones: // updateSavedRingtones#74d8be99
//	case *tg.UpdateTranscribedAudio: // updateTranscribedAudio#84cd5a
//	case *tg.UpdateReadFeaturedEmojiStickers: // updateReadFeaturedEmojiStickers#fb4c496c
//	case *tg.UpdateUserEmojiStatus: // updateUserEmojiStatus#28373599
//	case *tg.UpdateRecentEmojiStatuses: // updateRecentEmojiStatuses#30f443db
//	case *tg.UpdateRecentReactions: // updateRecentReactions#6f7863f4
//	case *tg.UpdateMoveStickerSetToTop: // updateMoveStickerSetToTop#86fccf85
//	case *tg.UpdateMessageExtendedMedia: // updateMessageExtendedMedia#d5a41724
//	case *tg.UpdateUser: // updateUser#20529438
//	case *tg.UpdateAutoSaveSettings: // updateAutoSaveSettings#ec05b097
//	case *tg.UpdateStory: // updateStory#75b3b798
//	case *tg.UpdateReadStories: // updateReadStories#f74e932b
//	case *tg.UpdateStoryID: // updateStoryID#1bf335b9
//	case *tg.UpdateStoriesStealthMode: // updateStoriesStealthMode#2c084dc1
//	case *tg.UpdateSentStoryReaction: // updateSentStoryReaction#7d627683
//	case *tg.UpdateBotChatBoost: // updateBotChatBoost#904dd49c
//	case *tg.UpdateChannelViewForumAsMessages: // updateChannelViewForumAsMessages#7b68920
//	case *tg.UpdatePeerWallpaper: // updatePeerWallpaper#ae3f101d
//	case *tg.UpdateBotMessageReaction: // updateBotMessageReaction#ac21d3ce
//	case *tg.UpdateBotMessageReactions: // updateBotMessageReactions#9cb7759
//	case *tg.UpdateSavedDialogPinned: // updateSavedDialogPinned#aeaf9e74
//	case *tg.UpdatePinnedSavedDialogs: // updatePinnedSavedDialogs#686c85a6
//	case *tg.UpdateSavedReactionTags: // updateSavedReactionTags#39c67432
//	case *tg.UpdateSMSJob: // updateSmsJob#f16269d4
//	case *tg.UpdateQuickReplies: // updateQuickReplies#f9470ab2
//	case *tg.UpdateNewQuickReply: // updateNewQuickReply#f53da717
//	case *tg.UpdateDeleteQuickReply: // updateDeleteQuickReply#53e6f1ec
//	case *tg.UpdateQuickReplyMessage: // updateQuickReplyMessage#3e050d0f
//	case *tg.UpdateDeleteQuickReplyMessages: // updateDeleteQuickReplyMessages#566fe7cd
//	case *tg.UpdateBotBusinessConnect: // updateBotBusinessConnect#8ae5c97a
//	case *tg.UpdateBotNewBusinessMessage: // updateBotNewBusinessMessage#9ddb347c
//	case *tg.UpdateBotEditBusinessMessage: // updateBotEditBusinessMessage#7df587c
//	case *tg.UpdateBotDeleteBusinessMessage: // updateBotDeleteBusinessMessage#a02a982e
//	case *tg.UpdateNewStoryReaction: // updateNewStoryReaction#1824e40b
//	case *tg.UpdateStarsBalance: // updateStarsBalance#4e80a379
//	case *tg.UpdateBusinessBotCallbackQuery: // updateBusinessBotCallbackQuery#1ea2fda7
//	case *tg.UpdateStarsRevenueStatus: // updateStarsRevenueStatus#a584b019
//	case *tg.UpdateBotPurchasedPaidMedia: // updateBotPurchasedPaidMedia#283bd312
//	case *tg.UpdatePaidReactionPrivacy: // updatePaidReactionPrivacy#8b725fce
//	case *tg.UpdateSentPhoneCode: // updateSentPhoneCode#504aa18f
//	case *tg.UpdateGroupCallChainBlocks: // updateGroupCallChainBlocks#a477288f
//	case *tg.UpdateReadMonoForumInbox: // updateReadMonoForumInbox#77b0e372
//	case *tg.UpdateReadMonoForumOutbox: // updateReadMonoForumOutbox#a4a79376
//	case *tg.UpdateMonoForumNoPaidException: // updateMonoForumNoPaidException#9f812b08
//	case *tg.UpdateGroupCallMessage: // updateGroupCallMessage#d8326f0d
//	case *tg.UpdateGroupCallEncryptedMessage: // updateGroupCallEncryptedMessage#c957a766
//	case *tg.UpdatePinnedForumTopic: // updatePinnedForumTopic#683b2c52
//	case *tg.UpdatePinnedForumTopics: // updatePinnedForumTopics#def143d0
//	case *tg.UpdateDeleteGroupCallMessages: // updateDeleteGroupCallMessages#3e85e92c
//	case *tg.UpdateStarGiftAuctionState: // updateStarGiftAuctionState#48e246c2
//	case *tg.UpdateStarGiftAuctionUserState: // updateStarGiftAuctionUserState#dc58f31e
//	case *tg.UpdateEmojiGameInfo: // updateEmojiGameInfo#fb9c547a
//	case *tg.UpdateStarGiftCraftFail: // updateStarGiftCraftFail#ac072444
//	case *tg.UpdateChatParticipantRank: // updateChatParticipantRank#bd8367b9
//	case *tg.UpdateManagedBot: // updateManagedBot#4880ed9a
//	case *tg.UpdateBotGuestChatQuery: // updateBotGuestChatQuery#cdd4093d
//	case *tg.UpdateAiComposeTones: // updateAiComposeTones#8c0f91fb
//	case *tg.UpdateJoinChatWebViewDecision: // updateJoinChatWebViewDecision#bdac7e70
//	case *tg.UpdateNewBotConnection: // updateNewBotConnection#b22083a6
//	case *tg.UpdateWebBrowserSettings: // updateWebBrowserSettings#c39a2ade
//	case *tg.UpdateWebBrowserException: // updateWebBrowserException#140502d1
//	default: panic(v)
//	}
type UpdateClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() UpdateClass

	// 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
}

// DecodeUpdate implements binary de-serialization for UpdateClass.
func ( *bin.Buffer) (UpdateClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case UpdateNewMessageTypeID:
		// Decoding updateNewMessage#1f2b0afd.
		 := UpdateNewMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMessageIDTypeID:
		// Decoding updateMessageID#4e90bfd6.
		 := UpdateMessageID{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDeleteMessagesTypeID:
		// Decoding updateDeleteMessages#a20db0e5.
		 := UpdateDeleteMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateUserTypingTypeID:
		// Decoding updateUserTyping#2a17bf5c.
		 := UpdateUserTyping{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatUserTypingTypeID:
		// Decoding updateChatUserTyping#83487af0.
		 := UpdateChatUserTyping{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatParticipantsTypeID:
		// Decoding updateChatParticipants#7761198.
		 := UpdateChatParticipants{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateUserStatusTypeID:
		// Decoding updateUserStatus#e5bdf8de.
		 := UpdateUserStatus{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateUserNameTypeID:
		// Decoding updateUserName#a7848924.
		 := UpdateUserName{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNewAuthorizationTypeID:
		// Decoding updateNewAuthorization#8951abef.
		 := UpdateNewAuthorization{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNewEncryptedMessageTypeID:
		// Decoding updateNewEncryptedMessage#12bcbd9a.
		 := UpdateNewEncryptedMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateEncryptedChatTypingTypeID:
		// Decoding updateEncryptedChatTyping#1710f156.
		 := UpdateEncryptedChatTyping{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateEncryptionTypeID:
		// Decoding updateEncryption#b4a2e88d.
		 := UpdateEncryption{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateEncryptedMessagesReadTypeID:
		// Decoding updateEncryptedMessagesRead#38fe25b7.
		 := UpdateEncryptedMessagesRead{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatParticipantAddTypeID:
		// Decoding updateChatParticipantAdd#3dda5451.
		 := UpdateChatParticipantAdd{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatParticipantDeleteTypeID:
		// Decoding updateChatParticipantDelete#e32f3d77.
		 := UpdateChatParticipantDelete{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDCOptionsTypeID:
		// Decoding updateDcOptions#8e5e9873.
		 := UpdateDCOptions{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNotifySettingsTypeID:
		// Decoding updateNotifySettings#bec268ef.
		 := UpdateNotifySettings{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateServiceNotificationTypeID:
		// Decoding updateServiceNotification#ebe46819.
		 := UpdateServiceNotification{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePrivacyTypeID:
		// Decoding updatePrivacy#ee3b272a.
		 := UpdatePrivacy{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateUserPhoneTypeID:
		// Decoding updateUserPhone#5492a13.
		 := UpdateUserPhone{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadHistoryInboxTypeID:
		// Decoding updateReadHistoryInbox#9e84bc99.
		 := UpdateReadHistoryInbox{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadHistoryOutboxTypeID:
		// Decoding updateReadHistoryOutbox#2f2f21bf.
		 := UpdateReadHistoryOutbox{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateWebPageTypeID:
		// Decoding updateWebPage#7f891213.
		 := UpdateWebPage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadMessagesContentsTypeID:
		// Decoding updateReadMessagesContents#f8227181.
		 := UpdateReadMessagesContents{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelTooLongTypeID:
		// Decoding updateChannelTooLong#108d941f.
		 := UpdateChannelTooLong{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelTypeID:
		// Decoding updateChannel#635b4c09.
		 := UpdateChannel{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNewChannelMessageTypeID:
		// Decoding updateNewChannelMessage#62ba04d9.
		 := UpdateNewChannelMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadChannelInboxTypeID:
		// Decoding updateReadChannelInbox#922e6e10.
		 := UpdateReadChannelInbox{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDeleteChannelMessagesTypeID:
		// Decoding updateDeleteChannelMessages#c32d5b12.
		 := UpdateDeleteChannelMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelMessageViewsTypeID:
		// Decoding updateChannelMessageViews#f226ac08.
		 := UpdateChannelMessageViews{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatParticipantAdminTypeID:
		// Decoding updateChatParticipantAdmin#d7ca61a2.
		 := UpdateChatParticipantAdmin{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNewStickerSetTypeID:
		// Decoding updateNewStickerSet#688a30aa.
		 := UpdateNewStickerSet{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStickerSetsOrderTypeID:
		// Decoding updateStickerSetsOrder#bb2d201.
		 := UpdateStickerSetsOrder{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStickerSetsTypeID:
		// Decoding updateStickerSets#31c24808.
		 := UpdateStickerSets{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateSavedGifsTypeID:
		// Decoding updateSavedGifs#9375341e.
		 := UpdateSavedGifs{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotInlineQueryTypeID:
		// Decoding updateBotInlineQuery#496f379c.
		 := UpdateBotInlineQuery{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotInlineSendTypeID:
		// Decoding updateBotInlineSend#12f12a07.
		 := UpdateBotInlineSend{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateEditChannelMessageTypeID:
		// Decoding updateEditChannelMessage#1b3f4df7.
		 := UpdateEditChannelMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotCallbackQueryTypeID:
		// Decoding updateBotCallbackQuery#b9cfc48d.
		 := UpdateBotCallbackQuery{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateEditMessageTypeID:
		// Decoding updateEditMessage#e40370a3.
		 := UpdateEditMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateInlineBotCallbackQueryTypeID:
		// Decoding updateInlineBotCallbackQuery#691e9052.
		 := UpdateInlineBotCallbackQuery{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadChannelOutboxTypeID:
		// Decoding updateReadChannelOutbox#b75f99a9.
		 := UpdateReadChannelOutbox{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDraftMessageTypeID:
		// Decoding updateDraftMessage#edfc111e.
		 := UpdateDraftMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadFeaturedStickersTypeID:
		// Decoding updateReadFeaturedStickers#571d2742.
		 := UpdateReadFeaturedStickers{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateRecentStickersTypeID:
		// Decoding updateRecentStickers#9a422c20.
		 := UpdateRecentStickers{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateConfigTypeID:
		// Decoding updateConfig#a229dd06.
		 := UpdateConfig{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePtsChangedTypeID:
		// Decoding updatePtsChanged#3354678f.
		 := UpdatePtsChanged{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelWebPageTypeID:
		// Decoding updateChannelWebPage#2f2ba99f.
		 := UpdateChannelWebPage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDialogPinnedTypeID:
		// Decoding updateDialogPinned#6e6fe51c.
		 := UpdateDialogPinned{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePinnedDialogsTypeID:
		// Decoding updatePinnedDialogs#fa0f3ca2.
		 := UpdatePinnedDialogs{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotWebhookJSONTypeID:
		// Decoding updateBotWebhookJSON#8317c0c3.
		 := UpdateBotWebhookJSON{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotWebhookJSONQueryTypeID:
		// Decoding updateBotWebhookJSONQuery#9b9240a6.
		 := UpdateBotWebhookJSONQuery{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotShippingQueryTypeID:
		// Decoding updateBotShippingQuery#b5aefd7d.
		 := UpdateBotShippingQuery{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotPrecheckoutQueryTypeID:
		// Decoding updateBotPrecheckoutQuery#8caa9a96.
		 := UpdateBotPrecheckoutQuery{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePhoneCallTypeID:
		// Decoding updatePhoneCall#ab0f6b1e.
		 := UpdatePhoneCall{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateLangPackTooLongTypeID:
		// Decoding updateLangPackTooLong#46560264.
		 := UpdateLangPackTooLong{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateLangPackTypeID:
		// Decoding updateLangPack#56022f4d.
		 := UpdateLangPack{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateFavedStickersTypeID:
		// Decoding updateFavedStickers#e511996d.
		 := UpdateFavedStickers{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelReadMessagesContentsTypeID:
		// Decoding updateChannelReadMessagesContents#25f324f7.
		 := UpdateChannelReadMessagesContents{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateContactsResetTypeID:
		// Decoding updateContactsReset#7084a7be.
		 := UpdateContactsReset{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelAvailableMessagesTypeID:
		// Decoding updateChannelAvailableMessages#b23fc698.
		 := UpdateChannelAvailableMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDialogUnreadMarkTypeID:
		// Decoding updateDialogUnreadMark#b658f23e.
		 := UpdateDialogUnreadMark{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMessagePollTypeID:
		// Decoding updateMessagePoll#d64c522b.
		 := UpdateMessagePoll{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatDefaultBannedRightsTypeID:
		// Decoding updateChatDefaultBannedRights#54c01850.
		 := UpdateChatDefaultBannedRights{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateFolderPeersTypeID:
		// Decoding updateFolderPeers#19360dc0.
		 := UpdateFolderPeers{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePeerSettingsTypeID:
		// Decoding updatePeerSettings#6a7e7366.
		 := UpdatePeerSettings{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePeerLocatedTypeID:
		// Decoding updatePeerLocated#b4afcfb0.
		 := UpdatePeerLocated{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNewScheduledMessageTypeID:
		// Decoding updateNewScheduledMessage#39a51dfb.
		 := UpdateNewScheduledMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDeleteScheduledMessagesTypeID:
		// Decoding updateDeleteScheduledMessages#f2a71983.
		 := UpdateDeleteScheduledMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateThemeTypeID:
		// Decoding updateTheme#8216fba3.
		 := UpdateTheme{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateGeoLiveViewedTypeID:
		// Decoding updateGeoLiveViewed#871fb939.
		 := UpdateGeoLiveViewed{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateLoginTokenTypeID:
		// Decoding updateLoginToken#564fe691.
		 := UpdateLoginToken{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMessagePollVoteTypeID:
		// Decoding updateMessagePollVote#7699f014.
		 := UpdateMessagePollVote{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDialogFilterTypeID:
		// Decoding updateDialogFilter#26ffde7d.
		 := UpdateDialogFilter{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDialogFilterOrderTypeID:
		// Decoding updateDialogFilterOrder#a5d72105.
		 := UpdateDialogFilterOrder{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDialogFiltersTypeID:
		// Decoding updateDialogFilters#3504914f.
		 := UpdateDialogFilters{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePhoneCallSignalingDataTypeID:
		// Decoding updatePhoneCallSignalingData#2661bf09.
		 := UpdatePhoneCallSignalingData{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelMessageForwardsTypeID:
		// Decoding updateChannelMessageForwards#d29a27f4.
		 := UpdateChannelMessageForwards{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadChannelDiscussionInboxTypeID:
		// Decoding updateReadChannelDiscussionInbox#d6b19546.
		 := UpdateReadChannelDiscussionInbox{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadChannelDiscussionOutboxTypeID:
		// Decoding updateReadChannelDiscussionOutbox#695c9e7c.
		 := UpdateReadChannelDiscussionOutbox{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePeerBlockedTypeID:
		// Decoding updatePeerBlocked#ebe07752.
		 := UpdatePeerBlocked{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelUserTypingTypeID:
		// Decoding updateChannelUserTyping#8c88c923.
		 := UpdateChannelUserTyping{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePinnedMessagesTypeID:
		// Decoding updatePinnedMessages#ed85eab5.
		 := UpdatePinnedMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePinnedChannelMessagesTypeID:
		// Decoding updatePinnedChannelMessages#5bb98608.
		 := UpdatePinnedChannelMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatTypeID:
		// Decoding updateChat#f89a6a4e.
		 := UpdateChat{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateGroupCallParticipantsTypeID:
		// Decoding updateGroupCallParticipants#f2ebdb4e.
		 := UpdateGroupCallParticipants{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateGroupCallTypeID:
		// Decoding updateGroupCall#9d2216e0.
		 := UpdateGroupCall{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePeerHistoryTTLTypeID:
		// Decoding updatePeerHistoryTTL#bb9bb9a5.
		 := UpdatePeerHistoryTTL{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatParticipantTypeID:
		// Decoding updateChatParticipant#d087663a.
		 := UpdateChatParticipant{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelParticipantTypeID:
		// Decoding updateChannelParticipant#985d3abb.
		 := UpdateChannelParticipant{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotStoppedTypeID:
		// Decoding updateBotStopped#c4870a49.
		 := UpdateBotStopped{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateGroupCallConnectionTypeID:
		// Decoding updateGroupCallConnection#b783982.
		 := UpdateGroupCallConnection{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotCommandsTypeID:
		// Decoding updateBotCommands#4d712f2e.
		 := UpdateBotCommands{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePendingJoinRequestsTypeID:
		// Decoding updatePendingJoinRequests#7063c3db.
		 := UpdatePendingJoinRequests{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotChatInviteRequesterTypeID:
		// Decoding updateBotChatInviteRequester#7cb34d79.
		 := UpdateBotChatInviteRequester{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMessageReactionsTypeID:
		// Decoding updateMessageReactions#1e297bfa.
		 := UpdateMessageReactions{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateAttachMenuBotsTypeID:
		// Decoding updateAttachMenuBots#17b7a20b.
		 := UpdateAttachMenuBots{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateWebViewResultSentTypeID:
		// Decoding updateWebViewResultSent#1592b79d.
		 := UpdateWebViewResultSent{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotMenuButtonTypeID:
		// Decoding updateBotMenuButton#14b85813.
		 := UpdateBotMenuButton{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateSavedRingtonesTypeID:
		// Decoding updateSavedRingtones#74d8be99.
		 := UpdateSavedRingtones{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateTranscribedAudioTypeID:
		// Decoding updateTranscribedAudio#84cd5a.
		 := UpdateTranscribedAudio{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadFeaturedEmojiStickersTypeID:
		// Decoding updateReadFeaturedEmojiStickers#fb4c496c.
		 := UpdateReadFeaturedEmojiStickers{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateUserEmojiStatusTypeID:
		// Decoding updateUserEmojiStatus#28373599.
		 := UpdateUserEmojiStatus{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateRecentEmojiStatusesTypeID:
		// Decoding updateRecentEmojiStatuses#30f443db.
		 := UpdateRecentEmojiStatuses{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateRecentReactionsTypeID:
		// Decoding updateRecentReactions#6f7863f4.
		 := UpdateRecentReactions{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMoveStickerSetToTopTypeID:
		// Decoding updateMoveStickerSetToTop#86fccf85.
		 := UpdateMoveStickerSetToTop{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMessageExtendedMediaTypeID:
		// Decoding updateMessageExtendedMedia#d5a41724.
		 := UpdateMessageExtendedMedia{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateUserTypeID:
		// Decoding updateUser#20529438.
		 := UpdateUser{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateAutoSaveSettingsTypeID:
		// Decoding updateAutoSaveSettings#ec05b097.
		 := UpdateAutoSaveSettings{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStoryTypeID:
		// Decoding updateStory#75b3b798.
		 := UpdateStory{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadStoriesTypeID:
		// Decoding updateReadStories#f74e932b.
		 := UpdateReadStories{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStoryIDTypeID:
		// Decoding updateStoryID#1bf335b9.
		 := UpdateStoryID{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStoriesStealthModeTypeID:
		// Decoding updateStoriesStealthMode#2c084dc1.
		 := UpdateStoriesStealthMode{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateSentStoryReactionTypeID:
		// Decoding updateSentStoryReaction#7d627683.
		 := UpdateSentStoryReaction{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotChatBoostTypeID:
		// Decoding updateBotChatBoost#904dd49c.
		 := UpdateBotChatBoost{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelViewForumAsMessagesTypeID:
		// Decoding updateChannelViewForumAsMessages#7b68920.
		 := UpdateChannelViewForumAsMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePeerWallpaperTypeID:
		// Decoding updatePeerWallpaper#ae3f101d.
		 := UpdatePeerWallpaper{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotMessageReactionTypeID:
		// Decoding updateBotMessageReaction#ac21d3ce.
		 := UpdateBotMessageReaction{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotMessageReactionsTypeID:
		// Decoding updateBotMessageReactions#9cb7759.
		 := UpdateBotMessageReactions{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateSavedDialogPinnedTypeID:
		// Decoding updateSavedDialogPinned#aeaf9e74.
		 := UpdateSavedDialogPinned{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePinnedSavedDialogsTypeID:
		// Decoding updatePinnedSavedDialogs#686c85a6.
		 := UpdatePinnedSavedDialogs{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateSavedReactionTagsTypeID:
		// Decoding updateSavedReactionTags#39c67432.
		 := UpdateSavedReactionTags{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateSMSJobTypeID:
		// Decoding updateSmsJob#f16269d4.
		 := UpdateSMSJob{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateQuickRepliesTypeID:
		// Decoding updateQuickReplies#f9470ab2.
		 := UpdateQuickReplies{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNewQuickReplyTypeID:
		// Decoding updateNewQuickReply#f53da717.
		 := UpdateNewQuickReply{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDeleteQuickReplyTypeID:
		// Decoding updateDeleteQuickReply#53e6f1ec.
		 := UpdateDeleteQuickReply{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateQuickReplyMessageTypeID:
		// Decoding updateQuickReplyMessage#3e050d0f.
		 := UpdateQuickReplyMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDeleteQuickReplyMessagesTypeID:
		// Decoding updateDeleteQuickReplyMessages#566fe7cd.
		 := UpdateDeleteQuickReplyMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotBusinessConnectTypeID:
		// Decoding updateBotBusinessConnect#8ae5c97a.
		 := UpdateBotBusinessConnect{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotNewBusinessMessageTypeID:
		// Decoding updateBotNewBusinessMessage#9ddb347c.
		 := UpdateBotNewBusinessMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotEditBusinessMessageTypeID:
		// Decoding updateBotEditBusinessMessage#7df587c.
		 := UpdateBotEditBusinessMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotDeleteBusinessMessageTypeID:
		// Decoding updateBotDeleteBusinessMessage#a02a982e.
		 := UpdateBotDeleteBusinessMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNewStoryReactionTypeID:
		// Decoding updateNewStoryReaction#1824e40b.
		 := UpdateNewStoryReaction{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStarsBalanceTypeID:
		// Decoding updateStarsBalance#4e80a379.
		 := UpdateStarsBalance{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBusinessBotCallbackQueryTypeID:
		// Decoding updateBusinessBotCallbackQuery#1ea2fda7.
		 := UpdateBusinessBotCallbackQuery{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStarsRevenueStatusTypeID:
		// Decoding updateStarsRevenueStatus#a584b019.
		 := UpdateStarsRevenueStatus{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotPurchasedPaidMediaTypeID:
		// Decoding updateBotPurchasedPaidMedia#283bd312.
		 := UpdateBotPurchasedPaidMedia{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePaidReactionPrivacyTypeID:
		// Decoding updatePaidReactionPrivacy#8b725fce.
		 := UpdatePaidReactionPrivacy{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateSentPhoneCodeTypeID:
		// Decoding updateSentPhoneCode#504aa18f.
		 := UpdateSentPhoneCode{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateGroupCallChainBlocksTypeID:
		// Decoding updateGroupCallChainBlocks#a477288f.
		 := UpdateGroupCallChainBlocks{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadMonoForumInboxTypeID:
		// Decoding updateReadMonoForumInbox#77b0e372.
		 := UpdateReadMonoForumInbox{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateReadMonoForumOutboxTypeID:
		// Decoding updateReadMonoForumOutbox#a4a79376.
		 := UpdateReadMonoForumOutbox{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMonoForumNoPaidExceptionTypeID:
		// Decoding updateMonoForumNoPaidException#9f812b08.
		 := UpdateMonoForumNoPaidException{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateGroupCallMessageTypeID:
		// Decoding updateGroupCallMessage#d8326f0d.
		 := UpdateGroupCallMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateGroupCallEncryptedMessageTypeID:
		// Decoding updateGroupCallEncryptedMessage#c957a766.
		 := UpdateGroupCallEncryptedMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePinnedForumTopicTypeID:
		// Decoding updatePinnedForumTopic#683b2c52.
		 := UpdatePinnedForumTopic{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdatePinnedForumTopicsTypeID:
		// Decoding updatePinnedForumTopics#def143d0.
		 := UpdatePinnedForumTopics{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateDeleteGroupCallMessagesTypeID:
		// Decoding updateDeleteGroupCallMessages#3e85e92c.
		 := UpdateDeleteGroupCallMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStarGiftAuctionStateTypeID:
		// Decoding updateStarGiftAuctionState#48e246c2.
		 := UpdateStarGiftAuctionState{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStarGiftAuctionUserStateTypeID:
		// Decoding updateStarGiftAuctionUserState#dc58f31e.
		 := UpdateStarGiftAuctionUserState{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateEmojiGameInfoTypeID:
		// Decoding updateEmojiGameInfo#fb9c547a.
		 := UpdateEmojiGameInfo{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateStarGiftCraftFailTypeID:
		// Decoding updateStarGiftCraftFail#ac072444.
		 := UpdateStarGiftCraftFail{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChatParticipantRankTypeID:
		// Decoding updateChatParticipantRank#bd8367b9.
		 := UpdateChatParticipantRank{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateManagedBotTypeID:
		// Decoding updateManagedBot#4880ed9a.
		 := UpdateManagedBot{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateBotGuestChatQueryTypeID:
		// Decoding updateBotGuestChatQuery#cdd4093d.
		 := UpdateBotGuestChatQuery{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateAiComposeTonesTypeID:
		// Decoding updateAiComposeTones#8c0f91fb.
		 := UpdateAiComposeTones{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateJoinChatWebViewDecisionTypeID:
		// Decoding updateJoinChatWebViewDecision#bdac7e70.
		 := UpdateJoinChatWebViewDecision{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateNewBotConnectionTypeID:
		// Decoding updateNewBotConnection#b22083a6.
		 := UpdateNewBotConnection{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateWebBrowserSettingsTypeID:
		// Decoding updateWebBrowserSettings#c39a2ade.
		 := UpdateWebBrowserSettings{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateWebBrowserExceptionTypeID:
		// Decoding updateWebBrowserException#140502d1.
		 := UpdateWebBrowserException{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode UpdateClass: %w", bin.NewUnexpectedID())
	}
}

// Update boxes the UpdateClass providing a helper.
type UpdateBox struct {
	Update UpdateClass
}

// Decode implements bin.Decoder for UpdateBox.
func ( *UpdateBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode UpdateBox to nil")
	}
	,  := DecodeUpdate()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.Update = 
	return nil
}

// Encode implements bin.Encode for UpdateBox.
func ( *UpdateBox) ( *bin.Buffer) error {
	if  == nil || .Update == nil {
		return fmt.Errorf("unable to encode UpdateClass as nil")
	}
	return .Update.Encode()
}