// 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#c01e857f`.
// 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 {
	// User id
	UserID int64
	// Action type
	Action SendMessageActionClass
}

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

// 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 !(.UserID == 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)
	() ( SendMessageActionClass)
}) {
	.UserID = .()
	.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:       "Action",
			SchemaName: "action",
		},
	}
	return 
}

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

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

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateUserTyping) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateUserTyping#c01e857f to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserTyping#c01e857f: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := DecodeSendMessageAction()
		if  != nil {
			return fmt.Errorf("unable to decode updateUserTyping#c01e857f: field action: %w", )
		}
		.Action = 
	}
	return nil
}

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

// 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`.
// Composition of chat participants changed.
//
// See https://core.telegram.org/constructor/updateChatParticipants for reference.
type UpdateChatParticipants struct {
	// Updated chat participants
	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 for pagination, 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
	// Chat version number
	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 group.
//
// See https://core.telegram.org/constructor/updateChatParticipantDelete for reference.
type UpdateChatParticipantDelete struct {
	// Group ID
	ChatID int64
	// ID of the user
	UserID int64
	// Used in basic groups to reorder updates and make sure that all of them was received.
	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#9c974fdf`.
// 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
	// 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 = 0x9c974fdf

// 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 !(.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)
	() ( int)
	() ( int)
	() ( int)
}) {
	if ,  := .();  {
		.FolderID = 
	}

	.Peer = .()
	.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:       "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)
	}
}

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

// EncodeBare implements bin.BareEncoder.
func ( *UpdateReadHistoryInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateReadHistoryInbox#9c974fdf as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadHistoryInbox#9c974fdf: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutInt(.FolderID)
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateReadHistoryInbox#9c974fdf: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateReadHistoryInbox#9c974fdf: field peer: %w", )
	}
	.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#9c974fdf to nil")
	}
	if  := .ConsumeID(UpdateReadHistoryInboxTypeID);  != nil {
		return fmt.Errorf("unable to decode updateReadHistoryInbox#9c974fdf: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateReadHistoryInbox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateReadHistoryInbox#9c974fdf to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9c974fdf: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9c974fdf: field folder_id: %w", )
		}
		.FolderID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9c974fdf: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9c974fdf: field max_id: %w", )
		}
		.MaxID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9c974fdf: field still_unread_count: %w", )
		}
		.StillUnreadCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9c974fdf: field pts: %w", )
		}
		.Pts = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateReadHistoryInbox#9c974fdf: 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
}

// 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
//
// Links:
//  1. https://core.telegram.org/api/updates
//
// 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.
// If the difference is too long or if the channel isn't currently in the states, start
// fetching from the specified pts.
//
// 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`.
// A new channel or supergroup is available, or info about an existing channel has
// changed and must be refeteched.
//
// 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 in basic groups to reorder updates and make sure that all of them was received.
	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#1b49ec6d`.
// 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
	// The draft
	Draft DraftMessageClass
}

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

// 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 !(.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)
	() ( DraftMessageClass)
}) {
	.Peer = .()
	if ,  := .();  {
		.TopMsgID = 
	}

	.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:       "Draft",
			SchemaName: "draft",
		},
	}
	return 
}

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

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

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

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDraftMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDraftMessage#1b49ec6d to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#1b49ec6d: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#1b49ec6d: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#1b49ec6d: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		,  := DecodeDraftMessage()
		if  != nil {
			return fmt.Errorf("unable to decode updateDraftMessage#1b49ec6d: 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
}

// 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¹
//
// Links:
//  1. https://core.telegram.org/method/help.getConfig
//
// 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
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	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#ea29055d`.
// The specified channel/supergroup¹ messages were read
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// 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
	// IDs of messages that were read
	Messages []int
}

// UpdateChannelReadMessagesContentsTypeID is TL type id of UpdateChannelReadMessagesContents.
const UpdateChannelReadMessagesContentsTypeID = 0xea29055d

// 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 !(.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)
	() ( []int)
}) {
	.ChannelID = .()
	if ,  := .();  {
		.TopMsgID = 
	}

	.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:       "Messages",
			SchemaName: "messages",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateChannelReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelReadMessagesContents#ea29055d as nil")
	}
	.PutID(UpdateChannelReadMessagesContentsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelReadMessagesContents#ea29055d as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChannelReadMessagesContents#ea29055d: field flags: %w", )
	}
	.PutLong(.ChannelID)
	if .Flags.Has(0) {
		.PutInt(.TopMsgID)
	}
	.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#ea29055d to nil")
	}
	if  := .ConsumeID(UpdateChannelReadMessagesContentsTypeID);  != nil {
		return fmt.Errorf("unable to decode updateChannelReadMessagesContents#ea29055d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelReadMessagesContents) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelReadMessagesContents#ea29055d to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#ea29055d: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#ea29055d: field channel_id: %w", )
		}
		.ChannelID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#ea29055d: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelReadMessagesContents#ea29055d: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateChannelReadMessagesContents#ea29055d: 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
}

// 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#e16459c3`.
// 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
}

// UpdateDialogUnreadMarkTypeID is TL type id of UpdateDialogUnreadMark.
const UpdateDialogUnreadMarkTypeID = 0xe16459c3

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

	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)
}) {
	.Unread = .()
	.Peer = .()
}

// 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",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateDialogUnreadMark) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDialogUnreadMark#e16459c3 as nil")
	}
	.PutID(UpdateDialogUnreadMarkTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDialogUnreadMark) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDialogUnreadMark#e16459c3 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateDialogUnreadMark#e16459c3: field flags: %w", )
		}
	}
	.Unread = .Flags.Has(0)
	{
		,  := DecodeDialogPeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDialogUnreadMark#e16459c3: field peer: %w", )
		}
		.Peer = 
	}
	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
}

// UpdateMessagePoll represents TL type `updateMessagePoll#aca1657b`.
// 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
	// 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 = 0xaca1657b

// 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 !(.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 {
	() ( int64)
	() ( Poll,  bool)
	() ( PollResults)
}) {
	.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:       "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 !(.Poll.Zero()) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *UpdateMessagePoll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessagePoll#aca1657b as nil")
	}
	.PutID(UpdateMessagePollTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessagePoll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessagePoll#aca1657b as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessagePoll#aca1657b: field flags: %w", )
	}
	.PutLong(.PollID)
	if .Flags.Has(0) {
		if  := .Poll.Encode();  != nil {
			return fmt.Errorf("unable to encode updateMessagePoll#aca1657b: field poll: %w", )
		}
	}
	if  := .Results.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessagePoll#aca1657b: field results: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessagePoll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessagePoll#aca1657b to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#aca1657b: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#aca1657b: field poll_id: %w", )
		}
		.PollID = 
	}
	if .Flags.Has(0) {
		if  := .Poll.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#aca1657b: field poll: %w", )
		}
	}
	{
		if  := .Results.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessagePoll#aca1657b: field results: %w", )
		}
	}
	return nil
}

// 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 normal chat¹ were updated
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/updateChatDefaultBannedRights for reference.
type UpdateChatDefaultBannedRights struct {
	// The chat
	Peer PeerClass
	// New default banned rights
	DefaultBannedRights ChatBannedRights
	// Version
	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#90866cee`.
// Some scheduled messages¹ were deleted 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 {
	// Peer
	Peer PeerClass
	// Deleted scheduled messages
	Messages []int
}

// UpdateDeleteScheduledMessagesTypeID is TL type id of UpdateDeleteScheduledMessages.
const UpdateDeleteScheduledMessagesTypeID = 0x90866cee

// 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 !(.Peer == nil) {
		return false
	}
	if !(.Messages == 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)
}) {
	.Peer = .()
	.Messages = .()
}

// 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",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateDeleteScheduledMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteScheduledMessages#90866cee as nil")
	}
	.PutID(UpdateDeleteScheduledMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateDeleteScheduledMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateDeleteScheduledMessages#90866cee as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateDeleteScheduledMessages#90866cee: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateDeleteScheduledMessages#90866cee: field peer: %w", )
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		.PutInt()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateDeleteScheduledMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateDeleteScheduledMessages#90866cee to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteScheduledMessages#90866cee: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateDeleteScheduledMessages#90866cee: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode updateDeleteScheduledMessages#90866cee: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	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
}

// 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#24f40e77`.
// 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
	// 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 = 0x24f40e77

// 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 !(.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)
}) {
	.PollID = .()
	.Peer = .()
	.Options = .()
	.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:       "Qts",
			SchemaName: "qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateMessagePollVote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessagePollVote#24f40e77 as nil")
	}
	.PutID(UpdateMessagePollVoteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessagePollVote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessagePollVote#24f40e77 as nil")
	}
	.PutLong(.PollID)
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateMessagePollVote#24f40e77: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessagePollVote#24f40e77: field peer: %w", )
	}
	.PutVectorHeader(len(.Options))
	for ,  := range .Options {
		.PutBytes()
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessagePollVote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessagePollVote#24f40e77 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#24f40e77: field poll_id: %w", )
		}
		.PollID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#24f40e77: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#24f40e77: field options: %w", )
		}

		if  > 0 {
			.Options = make([][]byte, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Bytes()
			if  != nil {
				return fmt.Errorf("unable to decode updateMessagePollVote#24f40e77: field options: %w", )
			}
			.Options = append(.Options, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessagePollVote#24f40e77: 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
}

// 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`.
// A new chat is available
//
// 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 certain group call has changed
//
// See https://core.telegram.org/constructor/updateGroupCallParticipants for reference.
type UpdateGroupCallParticipants struct {
	// Group call
	Call InputGroupCall
	// 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.Zero()) {
		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 {
	() ( InputGroupCall)
	() ( []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.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")
	}
	{
		if  := .Call.Decode();  != nil {
			return fmt.Errorf("unable to decode updateGroupCallParticipants#f2ebdb4e: field call: %w", )
		}
	}
	{
		,  := .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) () ( InputGroupCall) {
	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#14b24500`.
// A new groupcall was started
//
// See https://core.telegram.org/constructor/updateGroupCall for reference.
type UpdateGroupCall struct {
	// The channel/supergroup¹ where this group call or livestream takes place
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	ChatID int64
	// Info about the group call or livestream
	Call GroupCallClass
}

// UpdateGroupCallTypeID is TL type id of UpdateGroupCall.
const UpdateGroupCallTypeID = 0x14b24500

// 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 !(.ChatID == 0) {
		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 {
	() ( int64)
	() ( GroupCallClass)
}) {
	.ChatID = .()
	.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:       "ChatID",
			SchemaName: "chat_id",
		},
		{
			Name:       "Call",
			SchemaName: "call",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCall#14b24500 as nil")
	}
	.PutID(UpdateGroupCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupCall#14b24500 as nil")
	}
	.PutLong(.ChatID)
	if .Call == nil {
		return fmt.Errorf("unable to encode updateGroupCall#14b24500: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode updateGroupCall#14b24500: field call: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateGroupCall#14b24500 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCall#14b24500: field chat_id: %w", )
		}
		.ChatID = 
	}
	{
		,  := DecodeGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode updateGroupCall#14b24500: field call: %w", )
		}
		.Call = 
	}
	return nil
}

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

// 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 chat
//
// 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 parameters
//
// 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#11dfa986`.
// 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 {
	// 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
}

// UpdateBotChatInviteRequesterTypeID is TL type id of UpdateBotChatInviteRequester.
const UpdateBotChatInviteRequesterTypeID = 0x11dfa986

// 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 !(.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
	}

	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)
}) {
	.Peer = .()
	.Date = .()
	.UserID = .()
	.About = .()
	.Invite = .()
	.Qts = .()
}

// 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",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdateBotChatInviteRequester) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotChatInviteRequester#11dfa986 as nil")
	}
	.PutID(UpdateBotChatInviteRequesterTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateBotChatInviteRequester) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateBotChatInviteRequester#11dfa986 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#11dfa986: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#11dfa986: field peer: %w", )
	}
	.PutInt(.Date)
	.PutLong(.UserID)
	.PutString(.About)
	if .Invite == nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#11dfa986: field invite is nil")
	}
	if  := .Invite.Encode();  != nil {
		return fmt.Errorf("unable to encode updateBotChatInviteRequester#11dfa986: field invite: %w", )
	}
	.PutInt(.Qts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateBotChatInviteRequester) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateBotChatInviteRequester#11dfa986 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#11dfa986: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#11dfa986: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#11dfa986: field user_id: %w", )
		}
		.UserID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#11dfa986: field about: %w", )
		}
		.About = 
	}
	{
		,  := DecodeExportedChatInvite()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#11dfa986: field invite: %w", )
		}
		.Invite = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateBotChatInviteRequester#11dfa986: field qts: %w", )
		}
		.Qts = 
	}
	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
}

// UpdateMessageReactions represents TL type `updateMessageReactions#5e1b3cb8`.
// 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
	// Reactions
	Reactions MessageReactions
}

// UpdateMessageReactionsTypeID is TL type id of UpdateMessageReactions.
const UpdateMessageReactionsTypeID = 0x5e1b3cb8

// 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 !(.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)
	() ( MessageReactions)
}) {
	.Peer = .()
	.MsgID = .()
	if ,  := .();  {
		.TopMsgID = 
	}

	.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:       "Reactions",
			SchemaName: "reactions",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageReactions#5e1b3cb8 as nil")
	}
	.PutID(UpdateMessageReactionsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageReactions#5e1b3cb8 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageReactions#5e1b3cb8: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateMessageReactions#5e1b3cb8: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageReactions#5e1b3cb8: field peer: %w", )
	}
	.PutInt(.MsgID)
	if .Flags.Has(0) {
		.PutInt(.TopMsgID)
	}
	if  := .Reactions.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageReactions#5e1b3cb8: field reactions: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessageReactions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessageReactions#5e1b3cb8 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#5e1b3cb8: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#5e1b3cb8: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#5e1b3cb8: field msg_id: %w", )
		}
		.MsgID = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#5e1b3cb8: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	{
		if  := .Reactions.Decode();  != nil {
			return fmt.Errorf("unable to decode updateMessageReactions#5e1b3cb8: 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
}

// 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#5a73a98c`.
// Extended media update
//
// See https://core.telegram.org/constructor/updateMessageExtendedMedia for reference.
type UpdateMessageExtendedMedia struct {
	// Peer
	Peer PeerClass
	// Message ID
	MsgID int
	// Extended media
	ExtendedMedia MessageExtendedMediaClass
}

// UpdateMessageExtendedMediaTypeID is TL type id of UpdateMessageExtendedMedia.
const UpdateMessageExtendedMediaTypeID = 0x5a73a98c

// 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#5a73a98c as nil")
	}
	.PutID(UpdateMessageExtendedMediaTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateMessageExtendedMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateMessageExtendedMedia#5a73a98c as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode updateMessageExtendedMedia#5a73a98c: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageExtendedMedia#5a73a98c: field peer: %w", )
	}
	.PutInt(.MsgID)
	if .ExtendedMedia == nil {
		return fmt.Errorf("unable to encode updateMessageExtendedMedia#5a73a98c: field extended_media is nil")
	}
	if  := .ExtendedMedia.Encode();  != nil {
		return fmt.Errorf("unable to encode updateMessageExtendedMedia#5a73a98c: field extended_media: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateMessageExtendedMedia) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateMessageExtendedMedia#5a73a98c to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageExtendedMedia#5a73a98c: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageExtendedMedia#5a73a98c: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := DecodeMessageExtendedMedia()
		if  != nil {
			return fmt.Errorf("unable to decode updateMessageExtendedMedia#5a73a98c: field extended_media: %w", )
		}
		.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
}

// UpdateChannelPinnedTopic represents TL type `updateChannelPinnedTopic#192efbe3`.
// A forum topic »¹ was pinned or unpinned.
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/updateChannelPinnedTopic for reference.
type UpdateChannelPinnedTopic 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 forum ID
	ChannelID int64
	// The topic ID
	TopicID int
}

// UpdateChannelPinnedTopicTypeID is TL type id of UpdateChannelPinnedTopic.
const UpdateChannelPinnedTopicTypeID = 0x192efbe3

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

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

	_ UpdateClass = &UpdateChannelPinnedTopic{}
)

func ( *UpdateChannelPinnedTopic) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Pinned == false) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.TopicID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills UpdateChannelPinnedTopic from given interface.
func ( *UpdateChannelPinnedTopic) ( interface {
	() ( bool)
	() ( int64)
	() ( int)
}) {
	.Pinned = .()
	.ChannelID = .()
	.TopicID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelPinnedTopic) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelPinnedTopic",
		ID:   UpdateChannelPinnedTopicTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Pinned",
			SchemaName: "pinned",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "TopicID",
			SchemaName: "topic_id",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateChannelPinnedTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelPinnedTopic#192efbe3 as nil")
	}
	.PutID(UpdateChannelPinnedTopicTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateChannelPinnedTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelPinnedTopic#192efbe3 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode updateChannelPinnedTopic#192efbe3: field flags: %w", )
	}
	.PutLong(.ChannelID)
	.PutInt(.TopicID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelPinnedTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelPinnedTopic#192efbe3 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChannelPinnedTopic#192efbe3: field flags: %w", )
		}
	}
	.Pinned = .Flags.Has(0)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelPinnedTopic#192efbe3: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelPinnedTopic#192efbe3: field topic_id: %w", )
		}
		.TopicID = 
	}
	return nil
}

// SetPinned sets value of Pinned conditional field.
func ( *UpdateChannelPinnedTopic) ( bool) {
	if  {
		.Flags.Set(0)
		.Pinned = true
	} else {
		.Flags.Unset(0)
		.Pinned = false
	}
}

// GetPinned returns value of Pinned conditional field.
func ( *UpdateChannelPinnedTopic) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

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

// GetTopicID returns value of TopicID field.
func ( *UpdateChannelPinnedTopic) () ( int) {
	if  == nil {
		return
	}
	return .TopicID
}

// UpdateChannelPinnedTopics represents TL type `updateChannelPinnedTopics#fe198602`.
// The pinned topics¹ of a forum have changed.
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/updateChannelPinnedTopics for reference.
type UpdateChannelPinnedTopics struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Forum ID.
	ChannelID int64
	// Ordered list containing the IDs of all pinned topics.
	//
	// Use SetOrder and GetOrder helpers.
	Order []int
}

// UpdateChannelPinnedTopicsTypeID is TL type id of UpdateChannelPinnedTopics.
const UpdateChannelPinnedTopicsTypeID = 0xfe198602

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

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

	_ UpdateClass = &UpdateChannelPinnedTopics{}
)

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

	return true
}

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

// FillFrom fills UpdateChannelPinnedTopics from given interface.
func ( *UpdateChannelPinnedTopics) ( interface {
	() ( int64)
	() ( []int,  bool)
}) {
	.ChannelID = .()
	if ,  := .();  {
		.Order = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *UpdateChannelPinnedTopics) () tdp.Type {
	 := tdp.Type{
		Name: "updateChannelPinnedTopics",
		ID:   UpdateChannelPinnedTopicsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "Order",
			SchemaName: "order",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *UpdateChannelPinnedTopics) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateChannelPinnedTopics#fe198602 as nil")
	}
	.PutID(UpdateChannelPinnedTopicsTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *UpdateChannelPinnedTopics) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updateChannelPinnedTopics#fe198602 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode updateChannelPinnedTopics#fe198602: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelPinnedTopics#fe198602: field channel_id: %w", )
		}
		.ChannelID = 
	}
	if .Flags.Has(0) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode updateChannelPinnedTopics#fe198602: field order: %w", )
		}

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

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

// SetOrder sets value of Order conditional field.
func ( *UpdateChannelPinnedTopics) ( []int) {
	.Flags.Set(0)
	.Order = 
}

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

// UpdateUser represents TL type `updateUser#20529438`.
// User information was updated, it must be refetched using users.getFullUser¹.
//
// Links:
//  1. https://core.telegram.org/method/users.getFullUser
//
// 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
}

// UpdateGroupInvitePrivacyForbidden represents TL type `updateGroupInvitePrivacyForbidden#ccf08ad6`.
// 0-N updates of this type may be returned only when invoking messages.addChatUser¹,
// channels.inviteToChannel² or messages.createChat³: it indicates we couldn't add a
// user to a chat because of their privacy settings; if required, an invite link⁴ can
// be shared with the user, instead.
//
// Links:
//  1. https://core.telegram.org/method/messages.addChatUser
//  2. https://core.telegram.org/method/channels.inviteToChannel
//  3. https://core.telegram.org/method/messages.createChat
//  4. https://core.telegram.org/api/invites
//
// See https://core.telegram.org/constructor/updateGroupInvitePrivacyForbidden for reference.
type UpdateGroupInvitePrivacyForbidden struct {
	// ID of the user we couldn't add.
	UserID int64
}

// UpdateGroupInvitePrivacyForbiddenTypeID is TL type id of UpdateGroupInvitePrivacyForbidden.
const UpdateGroupInvitePrivacyForbiddenTypeID = 0xccf08ad6

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

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

	_ UpdateClass = &UpdateGroupInvitePrivacyForbidden{}
)

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *UpdateGroupInvitePrivacyForbidden) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupInvitePrivacyForbidden#ccf08ad6 as nil")
	}
	.PutID(UpdateGroupInvitePrivacyForbiddenTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdateGroupInvitePrivacyForbidden) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updateGroupInvitePrivacyForbidden#ccf08ad6 as nil")
	}
	.PutLong(.UserID)
	return nil
}

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

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

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

// 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 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
	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`.
//
// See https://core.telegram.org/constructor/updateBotMessageReaction for reference.
type UpdateBotMessageReaction struct {
	// Peer field of UpdateBotMessageReaction.
	Peer PeerClass
	// MsgID field of UpdateBotMessageReaction.
	MsgID int
	// Date field of UpdateBotMessageReaction.
	Date int
	// Actor field of UpdateBotMessageReaction.
	Actor PeerClass
	// OldReactions field of UpdateBotMessageReaction.
	OldReactions []ReactionClass
	// NewReactions field of UpdateBotMessageReaction.
	NewReactions []ReactionClass
	// Qts field of UpdateBotMessageReaction.
	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`.
//
// See https://core.telegram.org/constructor/updateBotMessageReactions for reference.
type UpdateBotMessageReactions struct {
	// Peer field of UpdateBotMessageReactions.
	Peer PeerClass
	// MsgID field of UpdateBotMessageReactions.
	MsgID int
	// Date field of UpdateBotMessageReactions.
	Date int
	// Reactions field of UpdateBotMessageReactions.
	Reactions []ReactionCount
	// Qts field of UpdateBotMessageReactions.
	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
}

// UpdateClassName is schema name of UpdateClass.
const UpdateClassName = "Update"

// UpdateClass represents Update generic type.
//
// See https://core.telegram.org/type/Update for reference.
//
// 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#c01e857f
//	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#9c974fdf
//	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#1b49ec6d
//	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#ea29055d
//	case *tg.UpdateContactsReset: // updateContactsReset#7084a7be
//	case *tg.UpdateChannelAvailableMessages: // updateChannelAvailableMessages#b23fc698
//	case *tg.UpdateDialogUnreadMark: // updateDialogUnreadMark#e16459c3
//	case *tg.UpdateMessagePoll: // updateMessagePoll#aca1657b
//	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#90866cee
//	case *tg.UpdateTheme: // updateTheme#8216fba3
//	case *tg.UpdateGeoLiveViewed: // updateGeoLiveViewed#871fb939
//	case *tg.UpdateLoginToken: // updateLoginToken#564fe691
//	case *tg.UpdateMessagePollVote: // updateMessagePollVote#24f40e77
//	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#14b24500
//	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#11dfa986
//	case *tg.UpdateMessageReactions: // updateMessageReactions#5e1b3cb8
//	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#5a73a98c
//	case *tg.UpdateChannelPinnedTopic: // updateChannelPinnedTopic#192efbe3
//	case *tg.UpdateChannelPinnedTopics: // updateChannelPinnedTopics#fe198602
//	case *tg.UpdateUser: // updateUser#20529438
//	case *tg.UpdateAutoSaveSettings: // updateAutoSaveSettings#ec05b097
//	case *tg.UpdateGroupInvitePrivacyForbidden: // updateGroupInvitePrivacyForbidden#ccf08ad6
//	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
//	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#c01e857f.
		 := 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#9c974fdf.
		 := 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#1b49ec6d.
		 := 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#ea29055d.
		 := 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#e16459c3.
		 := UpdateDialogUnreadMark{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMessagePollTypeID:
		// Decoding updateMessagePoll#aca1657b.
		 := 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#90866cee.
		 := 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#24f40e77.
		 := 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#14b24500.
		 := 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#11dfa986.
		 := UpdateBotChatInviteRequester{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateMessageReactionsTypeID:
		// Decoding updateMessageReactions#5e1b3cb8.
		 := 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#5a73a98c.
		 := UpdateMessageExtendedMedia{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelPinnedTopicTypeID:
		// Decoding updateChannelPinnedTopic#192efbe3.
		 := UpdateChannelPinnedTopic{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode UpdateClass: %w", )
		}
		return &, nil
	case UpdateChannelPinnedTopicsTypeID:
		// Decoding updateChannelPinnedTopics#fe198602.
		 := UpdateChannelPinnedTopics{}
		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 UpdateGroupInvitePrivacyForbiddenTypeID:
		// Decoding updateGroupInvitePrivacyForbidden#ccf08ad6.
		 := UpdateGroupInvitePrivacyForbidden{}
		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
	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()
}