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

// MessageActionEmpty represents TL type `messageActionEmpty#b6aef7b0`.
// Empty constructor.
//
// See https://core.telegram.org/constructor/messageActionEmpty for reference.
type MessageActionEmpty struct {
}

// MessageActionEmptyTypeID is TL type id of MessageActionEmpty.
const MessageActionEmptyTypeID = 0xb6aef7b0

// construct implements constructor of MessageActionClass.
func ( MessageActionEmpty) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionEmpty{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionEmpty) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionEmpty#b6aef7b0 as nil")
	}
	.PutID(MessageActionEmptyTypeID)
	return .EncodeBare()
}

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

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

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

// MessageActionChatCreate represents TL type `messageActionChatCreate#bd47cbad`.
// Group created
//
// See https://core.telegram.org/constructor/messageActionChatCreate for reference.
type MessageActionChatCreate struct {
	// Group name
	Title string
	// List of group members
	Users []int64
}

// MessageActionChatCreateTypeID is TL type id of MessageActionChatCreate.
const MessageActionChatCreateTypeID = 0xbd47cbad

// construct implements constructor of MessageActionClass.
func ( MessageActionChatCreate) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatCreate{}
)

func ( *MessageActionChatCreate) () bool {
	if  == nil {
		return true
	}
	if !(.Title == "") {
		return false
	}
	if !(.Users == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionChatCreate from given interface.
func ( *MessageActionChatCreate) ( interface {
	() ( string)
	() ( []int64)
}) {
	.Title = .()
	.Users = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionChatCreate) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionChatCreate",
		ID:   MessageActionChatCreateTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "Users",
			SchemaName: "users",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionChatCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatCreate#bd47cbad as nil")
	}
	.PutID(MessageActionChatCreateTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChatCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatCreate#bd47cbad as nil")
	}
	.PutString(.Title)
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		.PutLong()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChatCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChatCreate#bd47cbad to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChatCreate#bd47cbad: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChatCreate#bd47cbad: field users: %w", )
		}

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

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

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

// MessageActionChatEditTitle represents TL type `messageActionChatEditTitle#b5a1ce5a`.
// Group name changed.
//
// See https://core.telegram.org/constructor/messageActionChatEditTitle for reference.
type MessageActionChatEditTitle struct {
	// New group name
	Title string
}

// MessageActionChatEditTitleTypeID is TL type id of MessageActionChatEditTitle.
const MessageActionChatEditTitleTypeID = 0xb5a1ce5a

// construct implements constructor of MessageActionClass.
func ( MessageActionChatEditTitle) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatEditTitle{}
)

func ( *MessageActionChatEditTitle) () bool {
	if  == nil {
		return true
	}
	if !(.Title == "") {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionChatEditTitle from given interface.
func ( *MessageActionChatEditTitle) ( interface {
	() ( string)
}) {
	.Title = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionChatEditTitle) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionChatEditTitle",
		ID:   MessageActionChatEditTitleTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionChatEditTitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatEditTitle#b5a1ce5a as nil")
	}
	.PutID(MessageActionChatEditTitleTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChatEditTitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatEditTitle#b5a1ce5a as nil")
	}
	.PutString(.Title)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChatEditTitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChatEditTitle#b5a1ce5a to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChatEditTitle#b5a1ce5a: field title: %w", )
		}
		.Title = 
	}
	return nil
}

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

// MessageActionChatEditPhoto represents TL type `messageActionChatEditPhoto#7fcb13a8`.
// Group profile changed
//
// See https://core.telegram.org/constructor/messageActionChatEditPhoto for reference.
type MessageActionChatEditPhoto struct {
	// New group profile photo
	Photo PhotoClass
}

// MessageActionChatEditPhotoTypeID is TL type id of MessageActionChatEditPhoto.
const MessageActionChatEditPhotoTypeID = 0x7fcb13a8

// construct implements constructor of MessageActionClass.
func ( MessageActionChatEditPhoto) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatEditPhoto{}
)

func ( *MessageActionChatEditPhoto) () bool {
	if  == nil {
		return true
	}
	if !(.Photo == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionChatEditPhoto from given interface.
func ( *MessageActionChatEditPhoto) ( interface {
	() ( PhotoClass)
}) {
	.Photo = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionChatEditPhoto) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionChatEditPhoto",
		ID:   MessageActionChatEditPhotoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Photo",
			SchemaName: "photo",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionChatEditPhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatEditPhoto#7fcb13a8 as nil")
	}
	.PutID(MessageActionChatEditPhotoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChatEditPhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatEditPhoto#7fcb13a8 as nil")
	}
	if .Photo == nil {
		return fmt.Errorf("unable to encode messageActionChatEditPhoto#7fcb13a8: field photo is nil")
	}
	if  := .Photo.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionChatEditPhoto#7fcb13a8: field photo: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChatEditPhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChatEditPhoto#7fcb13a8 to nil")
	}
	{
		,  := DecodePhoto()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChatEditPhoto#7fcb13a8: field photo: %w", )
		}
		.Photo = 
	}
	return nil
}

// GetPhoto returns value of Photo field.
func ( *MessageActionChatEditPhoto) () ( PhotoClass) {
	if  == nil {
		return
	}
	return .Photo
}

// MessageActionChatDeletePhoto represents TL type `messageActionChatDeletePhoto#95e3fbef`.
// Group profile photo removed.
//
// See https://core.telegram.org/constructor/messageActionChatDeletePhoto for reference.
type MessageActionChatDeletePhoto struct {
}

// MessageActionChatDeletePhotoTypeID is TL type id of MessageActionChatDeletePhoto.
const MessageActionChatDeletePhotoTypeID = 0x95e3fbef

// construct implements constructor of MessageActionClass.
func ( MessageActionChatDeletePhoto) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatDeletePhoto{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionChatDeletePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatDeletePhoto#95e3fbef as nil")
	}
	.PutID(MessageActionChatDeletePhotoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChatDeletePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatDeletePhoto#95e3fbef as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChatDeletePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChatDeletePhoto#95e3fbef to nil")
	}
	return nil
}

// MessageActionChatAddUser represents TL type `messageActionChatAddUser#15cefd00`.
// New member in the group
//
// See https://core.telegram.org/constructor/messageActionChatAddUser for reference.
type MessageActionChatAddUser struct {
	// Users that were invited to the chat
	Users []int64
}

// MessageActionChatAddUserTypeID is TL type id of MessageActionChatAddUser.
const MessageActionChatAddUserTypeID = 0x15cefd00

// construct implements constructor of MessageActionClass.
func ( MessageActionChatAddUser) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatAddUser{}
)

func ( *MessageActionChatAddUser) () bool {
	if  == nil {
		return true
	}
	if !(.Users == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionChatAddUser from given interface.
func ( *MessageActionChatAddUser) ( interface {
	() ( []int64)
}) {
	.Users = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionChatAddUser) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionChatAddUser",
		ID:   MessageActionChatAddUserTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Users",
			SchemaName: "users",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionChatAddUser) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatAddUser#15cefd00 as nil")
	}
	.PutID(MessageActionChatAddUserTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChatAddUser) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatAddUser#15cefd00 as nil")
	}
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		.PutLong()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChatAddUser) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChatAddUser#15cefd00 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChatAddUser#15cefd00: field users: %w", )
		}

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

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

// MessageActionChatDeleteUser represents TL type `messageActionChatDeleteUser#a43f30cc`.
// User left the group.
//
// See https://core.telegram.org/constructor/messageActionChatDeleteUser for reference.
type MessageActionChatDeleteUser struct {
	// Leaving user ID
	UserID int64
}

// MessageActionChatDeleteUserTypeID is TL type id of MessageActionChatDeleteUser.
const MessageActionChatDeleteUserTypeID = 0xa43f30cc

// construct implements constructor of MessageActionClass.
func ( MessageActionChatDeleteUser) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatDeleteUser{}
)

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionChatDeleteUser) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatDeleteUser#a43f30cc as nil")
	}
	.PutID(MessageActionChatDeleteUserTypeID)
	return .EncodeBare()
}

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

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

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

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

// MessageActionChatJoinedByLink represents TL type `messageActionChatJoinedByLink#31224c3`.
// A user joined the chat via an invite link
//
// See https://core.telegram.org/constructor/messageActionChatJoinedByLink for reference.
type MessageActionChatJoinedByLink struct {
	// ID of the user that created the invite link
	InviterID int64
}

// MessageActionChatJoinedByLinkTypeID is TL type id of MessageActionChatJoinedByLink.
const MessageActionChatJoinedByLinkTypeID = 0x31224c3

// construct implements constructor of MessageActionClass.
func ( MessageActionChatJoinedByLink) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatJoinedByLink{}
)

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

	return true
}

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

// FillFrom fills MessageActionChatJoinedByLink from given interface.
func ( *MessageActionChatJoinedByLink) ( interface {
	() ( int64)
}) {
	.InviterID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionChatJoinedByLink) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionChatJoinedByLink",
		ID:   MessageActionChatJoinedByLinkTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "InviterID",
			SchemaName: "inviter_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionChatJoinedByLink) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatJoinedByLink#31224c3 as nil")
	}
	.PutID(MessageActionChatJoinedByLinkTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChatJoinedByLink) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatJoinedByLink#31224c3 as nil")
	}
	.PutLong(.InviterID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChatJoinedByLink) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChatJoinedByLink#31224c3 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChatJoinedByLink#31224c3: field inviter_id: %w", )
		}
		.InviterID = 
	}
	return nil
}

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

// MessageActionChannelCreate represents TL type `messageActionChannelCreate#95d2ac92`.
// The channel was created
//
// See https://core.telegram.org/constructor/messageActionChannelCreate for reference.
type MessageActionChannelCreate struct {
	// Original channel/supergroup title
	Title string
}

// MessageActionChannelCreateTypeID is TL type id of MessageActionChannelCreate.
const MessageActionChannelCreateTypeID = 0x95d2ac92

// construct implements constructor of MessageActionClass.
func ( MessageActionChannelCreate) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChannelCreate{}
)

func ( *MessageActionChannelCreate) () bool {
	if  == nil {
		return true
	}
	if !(.Title == "") {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionChannelCreate from given interface.
func ( *MessageActionChannelCreate) ( interface {
	() ( string)
}) {
	.Title = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionChannelCreate) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionChannelCreate",
		ID:   MessageActionChannelCreateTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionChannelCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChannelCreate#95d2ac92 as nil")
	}
	.PutID(MessageActionChannelCreateTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChannelCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChannelCreate#95d2ac92 as nil")
	}
	.PutString(.Title)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChannelCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChannelCreate#95d2ac92 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChannelCreate#95d2ac92: field title: %w", )
		}
		.Title = 
	}
	return nil
}

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

// MessageActionChatMigrateTo represents TL type `messageActionChatMigrateTo#e1037f92`.
// Indicates the chat was migrated¹ to the specified supergroup
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/messageActionChatMigrateTo for reference.
type MessageActionChatMigrateTo struct {
	// The supergroup it was migrated to
	ChannelID int64
}

// MessageActionChatMigrateToTypeID is TL type id of MessageActionChatMigrateTo.
const MessageActionChatMigrateToTypeID = 0xe1037f92

// construct implements constructor of MessageActionClass.
func ( MessageActionChatMigrateTo) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatMigrateTo{}
)

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionChatMigrateTo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatMigrateTo#e1037f92 as nil")
	}
	.PutID(MessageActionChatMigrateToTypeID)
	return .EncodeBare()
}

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

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

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

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

// MessageActionChannelMigrateFrom represents TL type `messageActionChannelMigrateFrom#ea3948e9`.
// Indicates the channel was migrated¹ from the specified chat
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/messageActionChannelMigrateFrom for reference.
type MessageActionChannelMigrateFrom struct {
	// The old chat title
	Title string
	// The old chat ID
	ChatID int64
}

// MessageActionChannelMigrateFromTypeID is TL type id of MessageActionChannelMigrateFrom.
const MessageActionChannelMigrateFromTypeID = 0xea3948e9

// construct implements constructor of MessageActionClass.
func ( MessageActionChannelMigrateFrom) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChannelMigrateFrom{}
)

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

	return true
}

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

// FillFrom fills MessageActionChannelMigrateFrom from given interface.
func ( *MessageActionChannelMigrateFrom) ( interface {
	() ( string)
	() ( int64)
}) {
	.Title = .()
	.ChatID = .()
}

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionChannelMigrateFrom) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChannelMigrateFrom#ea3948e9 as nil")
	}
	.PutID(MessageActionChannelMigrateFromTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChannelMigrateFrom) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChannelMigrateFrom#ea3948e9 as nil")
	}
	.PutString(.Title)
	.PutLong(.ChatID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChannelMigrateFrom) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChannelMigrateFrom#ea3948e9 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChannelMigrateFrom#ea3948e9: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChannelMigrateFrom#ea3948e9: field chat_id: %w", )
		}
		.ChatID = 
	}
	return nil
}

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

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

// MessageActionPinMessage represents TL type `messageActionPinMessage#94bd38ed`.
// A message was pinned
//
// See https://core.telegram.org/constructor/messageActionPinMessage for reference.
type MessageActionPinMessage struct {
}

// MessageActionPinMessageTypeID is TL type id of MessageActionPinMessage.
const MessageActionPinMessageTypeID = 0x94bd38ed

// construct implements constructor of MessageActionClass.
func ( MessageActionPinMessage) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPinMessage{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionPinMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPinMessage#94bd38ed as nil")
	}
	.PutID(MessageActionPinMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPinMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPinMessage#94bd38ed as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPinMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPinMessage#94bd38ed to nil")
	}
	return nil
}

// MessageActionHistoryClear represents TL type `messageActionHistoryClear#9fbab604`.
// Chat history was cleared
//
// See https://core.telegram.org/constructor/messageActionHistoryClear for reference.
type MessageActionHistoryClear struct {
}

// MessageActionHistoryClearTypeID is TL type id of MessageActionHistoryClear.
const MessageActionHistoryClearTypeID = 0x9fbab604

// construct implements constructor of MessageActionClass.
func ( MessageActionHistoryClear) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionHistoryClear{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionHistoryClear) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionHistoryClear#9fbab604 as nil")
	}
	.PutID(MessageActionHistoryClearTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionHistoryClear) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionHistoryClear#9fbab604 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionHistoryClear) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionHistoryClear#9fbab604 to nil")
	}
	return nil
}

// MessageActionGameScore represents TL type `messageActionGameScore#92a72876`.
// Someone scored in a game
//
// See https://core.telegram.org/constructor/messageActionGameScore for reference.
type MessageActionGameScore struct {
	// Game ID
	GameID int64
	// Score
	Score int
}

// MessageActionGameScoreTypeID is TL type id of MessageActionGameScore.
const MessageActionGameScoreTypeID = 0x92a72876

// construct implements constructor of MessageActionClass.
func ( MessageActionGameScore) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGameScore{}
)

func ( *MessageActionGameScore) () bool {
	if  == nil {
		return true
	}
	if !(.GameID == 0) {
		return false
	}
	if !(.Score == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGameScore from given interface.
func ( *MessageActionGameScore) ( interface {
	() ( int64)
	() ( int)
}) {
	.GameID = .()
	.Score = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGameScore) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGameScore",
		ID:   MessageActionGameScoreTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "GameID",
			SchemaName: "game_id",
		},
		{
			Name:       "Score",
			SchemaName: "score",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionGameScore) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGameScore#92a72876 as nil")
	}
	.PutID(MessageActionGameScoreTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGameScore) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGameScore#92a72876 as nil")
	}
	.PutLong(.GameID)
	.PutInt(.Score)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGameScore) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGameScore#92a72876 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGameScore#92a72876: field game_id: %w", )
		}
		.GameID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGameScore#92a72876: field score: %w", )
		}
		.Score = 
	}
	return nil
}

// GetGameID returns value of GameID field.
func ( *MessageActionGameScore) () ( int64) {
	if  == nil {
		return
	}
	return .GameID
}

// GetScore returns value of Score field.
func ( *MessageActionGameScore) () ( int) {
	if  == nil {
		return
	}
	return .Score
}

// MessageActionPaymentSentMe represents TL type `messageActionPaymentSentMe#ffa00ccc`.
// A user just sent a payment to me (a bot)
//
// See https://core.telegram.org/constructor/messageActionPaymentSentMe for reference.
type MessageActionPaymentSentMe struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether this is the first payment of a recurring payment we just subscribed to
	RecurringInit bool
	// Whether this payment is part of a recurring payment
	RecurringUsed bool
	// Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars².
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	//  2) https://core.telegram.org/api/stars
	Currency string
	// Price of the product 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
	// 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
	// Provider payment identifier
	Charge PaymentCharge
	// Expiration date of the Telegram Star subscription »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/stars#star-subscriptions
	//
	// Use SetSubscriptionUntilDate and GetSubscriptionUntilDate helpers.
	SubscriptionUntilDate int
}

// MessageActionPaymentSentMeTypeID is TL type id of MessageActionPaymentSentMe.
const MessageActionPaymentSentMeTypeID = 0xffa00ccc

// construct implements constructor of MessageActionClass.
func ( MessageActionPaymentSentMe) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPaymentSentMe{}
)

func ( *MessageActionPaymentSentMe) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.RecurringInit == false) {
		return false
	}
	if !(.RecurringUsed == false) {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.TotalAmount == 0) {
		return false
	}
	if !(.Payload == nil) {
		return false
	}
	if !(.Info.Zero()) {
		return false
	}
	if !(.ShippingOptionID == "") {
		return false
	}
	if !(.Charge.Zero()) {
		return false
	}
	if !(.SubscriptionUntilDate == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPaymentSentMe from given interface.
func ( *MessageActionPaymentSentMe) ( interface {
	() ( bool)
	() ( bool)
	() ( string)
	() ( int64)
	() ( []byte)
	() ( PaymentRequestedInfo,  bool)
	() ( string,  bool)
	() ( PaymentCharge)
	() ( int,  bool)
}) {
	.RecurringInit = .()
	.RecurringUsed = .()
	.Currency = .()
	.TotalAmount = .()
	.Payload = .()
	if ,  := .();  {
		.Info = 
	}

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

	.Charge = .()
	if ,  := .();  {
		.SubscriptionUntilDate = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPaymentSentMe) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPaymentSentMe",
		ID:   MessageActionPaymentSentMeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "RecurringInit",
			SchemaName: "recurring_init",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "RecurringUsed",
			SchemaName: "recurring_used",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Currency",
			SchemaName: "currency",
		},
		{
			Name:       "TotalAmount",
			SchemaName: "total_amount",
		},
		{
			Name:       "Payload",
			SchemaName: "payload",
		},
		{
			Name:       "Info",
			SchemaName: "info",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "ShippingOptionID",
			SchemaName: "shipping_option_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Charge",
			SchemaName: "charge",
		},
		{
			Name:       "SubscriptionUntilDate",
			SchemaName: "subscription_until_date",
			Null:       !.Flags.Has(4),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionPaymentSentMe) () {
	if !(.RecurringInit == false) {
		.Flags.Set(2)
	}
	if !(.RecurringUsed == false) {
		.Flags.Set(3)
	}
	if !(.Info.Zero()) {
		.Flags.Set(0)
	}
	if !(.ShippingOptionID == "") {
		.Flags.Set(1)
	}
	if !(.SubscriptionUntilDate == 0) {
		.Flags.Set(4)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionPaymentSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaymentSentMe#ffa00ccc as nil")
	}
	.PutID(MessageActionPaymentSentMeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPaymentSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaymentSentMe#ffa00ccc as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPaymentSentMe#ffa00ccc: field flags: %w", )
	}
	.PutString(.Currency)
	.PutLong(.TotalAmount)
	.PutBytes(.Payload)
	if .Flags.Has(0) {
		if  := .Info.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionPaymentSentMe#ffa00ccc: field info: %w", )
		}
	}
	if .Flags.Has(1) {
		.PutString(.ShippingOptionID)
	}
	if  := .Charge.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPaymentSentMe#ffa00ccc: field charge: %w", )
	}
	if .Flags.Has(4) {
		.PutInt(.SubscriptionUntilDate)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPaymentSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPaymentSentMe#ffa00ccc to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSentMe#ffa00ccc: field flags: %w", )
		}
	}
	.RecurringInit = .Flags.Has(2)
	.RecurringUsed = .Flags.Has(3)
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSentMe#ffa00ccc: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSentMe#ffa00ccc: field total_amount: %w", )
		}
		.TotalAmount = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSentMe#ffa00ccc: field payload: %w", )
		}
		.Payload = 
	}
	if .Flags.Has(0) {
		if  := .Info.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSentMe#ffa00ccc: field info: %w", )
		}
	}
	if .Flags.Has(1) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSentMe#ffa00ccc: field shipping_option_id: %w", )
		}
		.ShippingOptionID = 
	}
	{
		if  := .Charge.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSentMe#ffa00ccc: field charge: %w", )
		}
	}
	if .Flags.Has(4) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSentMe#ffa00ccc: field subscription_until_date: %w", )
		}
		.SubscriptionUntilDate = 
	}
	return nil
}

// SetRecurringInit sets value of RecurringInit conditional field.
func ( *MessageActionPaymentSentMe) ( bool) {
	if  {
		.Flags.Set(2)
		.RecurringInit = true
	} else {
		.Flags.Unset(2)
		.RecurringInit = false
	}
}

// GetRecurringInit returns value of RecurringInit conditional field.
func ( *MessageActionPaymentSentMe) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetRecurringUsed sets value of RecurringUsed conditional field.
func ( *MessageActionPaymentSentMe) ( bool) {
	if  {
		.Flags.Set(3)
		.RecurringUsed = true
	} else {
		.Flags.Unset(3)
		.RecurringUsed = false
	}
}

// GetRecurringUsed returns value of RecurringUsed conditional field.
func ( *MessageActionPaymentSentMe) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// GetCurrency returns value of Currency field.
func ( *MessageActionPaymentSentMe) () ( string) {
	if  == nil {
		return
	}
	return .Currency
}

// GetTotalAmount returns value of TotalAmount field.
func ( *MessageActionPaymentSentMe) () ( int64) {
	if  == nil {
		return
	}
	return .TotalAmount
}

// GetPayload returns value of Payload field.
func ( *MessageActionPaymentSentMe) () ( []byte) {
	if  == nil {
		return
	}
	return .Payload
}

// SetInfo sets value of Info conditional field.
func ( *MessageActionPaymentSentMe) ( PaymentRequestedInfo) {
	.Flags.Set(0)
	.Info = 
}

// GetInfo returns value of Info conditional field and
// boolean which is true if field was set.
func ( *MessageActionPaymentSentMe) () ( PaymentRequestedInfo,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Info, true
}

// SetShippingOptionID sets value of ShippingOptionID conditional field.
func ( *MessageActionPaymentSentMe) ( string) {
	.Flags.Set(1)
	.ShippingOptionID = 
}

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

// GetCharge returns value of Charge field.
func ( *MessageActionPaymentSentMe) () ( PaymentCharge) {
	if  == nil {
		return
	}
	return .Charge
}

// SetSubscriptionUntilDate sets value of SubscriptionUntilDate conditional field.
func ( *MessageActionPaymentSentMe) ( int) {
	.Flags.Set(4)
	.SubscriptionUntilDate = 
}

// GetSubscriptionUntilDate returns value of SubscriptionUntilDate conditional field and
// boolean which is true if field was set.
func ( *MessageActionPaymentSentMe) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .SubscriptionUntilDate, true
}

// MessageActionPaymentSent represents TL type `messageActionPaymentSent#c624b16e`.
// A payment was sent
//
// See https://core.telegram.org/constructor/messageActionPaymentSent for reference.
type MessageActionPaymentSent struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether this is the first payment of a recurring payment we just subscribed to
	RecurringInit bool
	// Whether this payment is part of a recurring payment
	RecurringUsed bool
	// Three-letter ISO 4217 currency¹ code, or XTR for Telegram Stars².
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	//  2) https://core.telegram.org/api/stars
	Currency string
	// Price of the product 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
	// An invoice slug taken from an invoice deep link¹ or from the premium_invoice_slug app
	// config parameter »²
	//
	// Links:
	//  1) https://core.telegram.org/api/links#invoice-links
	//  2) https://core.telegram.org/api/config#premium-invoice-slug
	//
	// Use SetInvoiceSlug and GetInvoiceSlug helpers.
	InvoiceSlug string
	// Expiration date of the Telegram Star subscription »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/stars#star-subscriptions
	//
	// Use SetSubscriptionUntilDate and GetSubscriptionUntilDate helpers.
	SubscriptionUntilDate int
}

// MessageActionPaymentSentTypeID is TL type id of MessageActionPaymentSent.
const MessageActionPaymentSentTypeID = 0xc624b16e

// construct implements constructor of MessageActionClass.
func ( MessageActionPaymentSent) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPaymentSent{}
)

func ( *MessageActionPaymentSent) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.RecurringInit == false) {
		return false
	}
	if !(.RecurringUsed == false) {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.TotalAmount == 0) {
		return false
	}
	if !(.InvoiceSlug == "") {
		return false
	}
	if !(.SubscriptionUntilDate == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPaymentSent from given interface.
func ( *MessageActionPaymentSent) ( interface {
	() ( bool)
	() ( bool)
	() ( string)
	() ( int64)
	() ( string,  bool)
	() ( int,  bool)
}) {
	.RecurringInit = .()
	.RecurringUsed = .()
	.Currency = .()
	.TotalAmount = .()
	if ,  := .();  {
		.InvoiceSlug = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPaymentSent) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPaymentSent",
		ID:   MessageActionPaymentSentTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "RecurringInit",
			SchemaName: "recurring_init",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "RecurringUsed",
			SchemaName: "recurring_used",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Currency",
			SchemaName: "currency",
		},
		{
			Name:       "TotalAmount",
			SchemaName: "total_amount",
		},
		{
			Name:       "InvoiceSlug",
			SchemaName: "invoice_slug",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "SubscriptionUntilDate",
			SchemaName: "subscription_until_date",
			Null:       !.Flags.Has(4),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionPaymentSent) () {
	if !(.RecurringInit == false) {
		.Flags.Set(2)
	}
	if !(.RecurringUsed == false) {
		.Flags.Set(3)
	}
	if !(.InvoiceSlug == "") {
		.Flags.Set(0)
	}
	if !(.SubscriptionUntilDate == 0) {
		.Flags.Set(4)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionPaymentSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaymentSent#c624b16e as nil")
	}
	.PutID(MessageActionPaymentSentTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPaymentSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaymentSent#c624b16e as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPaymentSent#c624b16e: field flags: %w", )
	}
	.PutString(.Currency)
	.PutLong(.TotalAmount)
	if .Flags.Has(0) {
		.PutString(.InvoiceSlug)
	}
	if .Flags.Has(4) {
		.PutInt(.SubscriptionUntilDate)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPaymentSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPaymentSent#c624b16e to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#c624b16e: field flags: %w", )
		}
	}
	.RecurringInit = .Flags.Has(2)
	.RecurringUsed = .Flags.Has(3)
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#c624b16e: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#c624b16e: field total_amount: %w", )
		}
		.TotalAmount = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#c624b16e: field invoice_slug: %w", )
		}
		.InvoiceSlug = 
	}
	if .Flags.Has(4) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#c624b16e: field subscription_until_date: %w", )
		}
		.SubscriptionUntilDate = 
	}
	return nil
}

// SetRecurringInit sets value of RecurringInit conditional field.
func ( *MessageActionPaymentSent) ( bool) {
	if  {
		.Flags.Set(2)
		.RecurringInit = true
	} else {
		.Flags.Unset(2)
		.RecurringInit = false
	}
}

// GetRecurringInit returns value of RecurringInit conditional field.
func ( *MessageActionPaymentSent) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetRecurringUsed sets value of RecurringUsed conditional field.
func ( *MessageActionPaymentSent) ( bool) {
	if  {
		.Flags.Set(3)
		.RecurringUsed = true
	} else {
		.Flags.Unset(3)
		.RecurringUsed = false
	}
}

// GetRecurringUsed returns value of RecurringUsed conditional field.
func ( *MessageActionPaymentSent) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// GetCurrency returns value of Currency field.
func ( *MessageActionPaymentSent) () ( string) {
	if  == nil {
		return
	}
	return .Currency
}

// GetTotalAmount returns value of TotalAmount field.
func ( *MessageActionPaymentSent) () ( int64) {
	if  == nil {
		return
	}
	return .TotalAmount
}

// SetInvoiceSlug sets value of InvoiceSlug conditional field.
func ( *MessageActionPaymentSent) ( string) {
	.Flags.Set(0)
	.InvoiceSlug = 
}

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

// SetSubscriptionUntilDate sets value of SubscriptionUntilDate conditional field.
func ( *MessageActionPaymentSent) ( int) {
	.Flags.Set(4)
	.SubscriptionUntilDate = 
}

// GetSubscriptionUntilDate returns value of SubscriptionUntilDate conditional field and
// boolean which is true if field was set.
func ( *MessageActionPaymentSent) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .SubscriptionUntilDate, true
}

// MessageActionPhoneCall represents TL type `messageActionPhoneCall#80e11a7f`.
// A phone call
//
// See https://core.telegram.org/constructor/messageActionPhoneCall for reference.
type MessageActionPhoneCall struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Is this a video call?
	Video bool
	// Call ID
	CallID int64
	// If the call has ended, the reason why it ended
	//
	// Use SetReason and GetReason helpers.
	Reason PhoneCallDiscardReasonClass
	// Duration of the call in seconds
	//
	// Use SetDuration and GetDuration helpers.
	Duration int
}

// MessageActionPhoneCallTypeID is TL type id of MessageActionPhoneCall.
const MessageActionPhoneCallTypeID = 0x80e11a7f

// construct implements constructor of MessageActionClass.
func ( MessageActionPhoneCall) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPhoneCall{}
)

func ( *MessageActionPhoneCall) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Video == false) {
		return false
	}
	if !(.CallID == 0) {
		return false
	}
	if !(.Reason == nil) {
		return false
	}
	if !(.Duration == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPhoneCall from given interface.
func ( *MessageActionPhoneCall) ( interface {
	() ( bool)
	() ( int64)
	() ( PhoneCallDiscardReasonClass,  bool)
	() ( int,  bool)
}) {
	.Video = .()
	.CallID = .()
	if ,  := .();  {
		.Reason = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPhoneCall) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPhoneCall",
		ID:   MessageActionPhoneCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Video",
			SchemaName: "video",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "CallID",
			SchemaName: "call_id",
		},
		{
			Name:       "Reason",
			SchemaName: "reason",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Duration",
			SchemaName: "duration",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionPhoneCall) () {
	if !(.Video == false) {
		.Flags.Set(2)
	}
	if !(.Reason == nil) {
		.Flags.Set(0)
	}
	if !(.Duration == 0) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPhoneCall#80e11a7f as nil")
	}
	.PutID(MessageActionPhoneCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPhoneCall#80e11a7f as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPhoneCall#80e11a7f: field flags: %w", )
	}
	.PutLong(.CallID)
	if .Flags.Has(0) {
		if .Reason == nil {
			return fmt.Errorf("unable to encode messageActionPhoneCall#80e11a7f: field reason is nil")
		}
		if  := .Reason.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionPhoneCall#80e11a7f: field reason: %w", )
		}
	}
	if .Flags.Has(1) {
		.PutInt(.Duration)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPhoneCall#80e11a7f to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPhoneCall#80e11a7f: field flags: %w", )
		}
	}
	.Video = .Flags.Has(2)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPhoneCall#80e11a7f: field call_id: %w", )
		}
		.CallID = 
	}
	if .Flags.Has(0) {
		,  := DecodePhoneCallDiscardReason()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPhoneCall#80e11a7f: field reason: %w", )
		}
		.Reason = 
	}
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPhoneCall#80e11a7f: field duration: %w", )
		}
		.Duration = 
	}
	return nil
}

// SetVideo sets value of Video conditional field.
func ( *MessageActionPhoneCall) ( bool) {
	if  {
		.Flags.Set(2)
		.Video = true
	} else {
		.Flags.Unset(2)
		.Video = false
	}
}

// GetVideo returns value of Video conditional field.
func ( *MessageActionPhoneCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// GetCallID returns value of CallID field.
func ( *MessageActionPhoneCall) () ( int64) {
	if  == nil {
		return
	}
	return .CallID
}

// SetReason sets value of Reason conditional field.
func ( *MessageActionPhoneCall) ( PhoneCallDiscardReasonClass) {
	.Flags.Set(0)
	.Reason = 
}

// GetReason returns value of Reason conditional field and
// boolean which is true if field was set.
func ( *MessageActionPhoneCall) () ( PhoneCallDiscardReasonClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Reason, true
}

// SetDuration sets value of Duration conditional field.
func ( *MessageActionPhoneCall) ( int) {
	.Flags.Set(1)
	.Duration = 
}

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

// MessageActionScreenshotTaken represents TL type `messageActionScreenshotTaken#4792929b`.
// A screenshot of the chat was taken
//
// See https://core.telegram.org/constructor/messageActionScreenshotTaken for reference.
type MessageActionScreenshotTaken struct {
}

// MessageActionScreenshotTakenTypeID is TL type id of MessageActionScreenshotTaken.
const MessageActionScreenshotTakenTypeID = 0x4792929b

// construct implements constructor of MessageActionClass.
func ( MessageActionScreenshotTaken) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionScreenshotTaken{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionScreenshotTaken) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionScreenshotTaken#4792929b as nil")
	}
	.PutID(MessageActionScreenshotTakenTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionScreenshotTaken) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionScreenshotTaken#4792929b as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionScreenshotTaken) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionScreenshotTaken#4792929b to nil")
	}
	return nil
}

// MessageActionCustomAction represents TL type `messageActionCustomAction#fae69f56`.
// Custom action (most likely not supported by the current layer, an upgrade might be
// needed)
//
// See https://core.telegram.org/constructor/messageActionCustomAction for reference.
type MessageActionCustomAction struct {
	// Action message
	Message string
}

// MessageActionCustomActionTypeID is TL type id of MessageActionCustomAction.
const MessageActionCustomActionTypeID = 0xfae69f56

// construct implements constructor of MessageActionClass.
func ( MessageActionCustomAction) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionCustomAction{}
)

func ( *MessageActionCustomAction) () bool {
	if  == nil {
		return true
	}
	if !(.Message == "") {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionCustomAction from given interface.
func ( *MessageActionCustomAction) ( interface {
	() ( string)
}) {
	.Message = .()
}

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionCustomAction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionCustomAction#fae69f56 as nil")
	}
	.PutID(MessageActionCustomActionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionCustomAction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionCustomAction#fae69f56 as nil")
	}
	.PutString(.Message)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionCustomAction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionCustomAction#fae69f56 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionCustomAction#fae69f56: field message: %w", )
		}
		.Message = 
	}
	return nil
}

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

// MessageActionBotAllowed represents TL type `messageActionBotAllowed#c516d679`.
// We have given the bot permission to send us direct messages.
// The optional fields specify how did we authorize the bot to send us messages.
//
// See https://core.telegram.org/constructor/messageActionBotAllowed for reference.
type MessageActionBotAllowed struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// We have authorized the bot to send us messages by installing the bot's attachment
	// menu¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/bots/attach
	AttachMenu bool
	// We have allowed the bot to send us messages using bots.allowSendMessage »¹.
	//
	// Links:
	//  1) https://core.telegram.org/method/bots.allowSendMessage
	FromRequest bool
	// We have authorized the bot to send us messages by logging into a website via Telegram
	// Login »¹; this field contains the domain name of the website on which the user has
	// logged in.
	//
	// Links:
	//  1) https://core.telegram.org/widgets/login
	//
	// Use SetDomain and GetDomain helpers.
	Domain string
	// We have authorized the bot to send us messages by opening the specified bot mini app¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/bots/webapps
	//
	// Use SetApp and GetApp helpers.
	App BotAppClass
}

// MessageActionBotAllowedTypeID is TL type id of MessageActionBotAllowed.
const MessageActionBotAllowedTypeID = 0xc516d679

// construct implements constructor of MessageActionClass.
func ( MessageActionBotAllowed) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionBotAllowed{}
)

func ( *MessageActionBotAllowed) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.AttachMenu == false) {
		return false
	}
	if !(.FromRequest == false) {
		return false
	}
	if !(.Domain == "") {
		return false
	}
	if !(.App == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionBotAllowed from given interface.
func ( *MessageActionBotAllowed) ( interface {
	() ( bool)
	() ( bool)
	() ( string,  bool)
	() ( BotAppClass,  bool)
}) {
	.AttachMenu = .()
	.FromRequest = .()
	if ,  := .();  {
		.Domain = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionBotAllowed) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionBotAllowed",
		ID:   MessageActionBotAllowedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "AttachMenu",
			SchemaName: "attach_menu",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "FromRequest",
			SchemaName: "from_request",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Domain",
			SchemaName: "domain",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "App",
			SchemaName: "app",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionBotAllowed) () {
	if !(.AttachMenu == false) {
		.Flags.Set(1)
	}
	if !(.FromRequest == false) {
		.Flags.Set(3)
	}
	if !(.Domain == "") {
		.Flags.Set(0)
	}
	if !(.App == nil) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionBotAllowed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionBotAllowed#c516d679 as nil")
	}
	.PutID(MessageActionBotAllowedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionBotAllowed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionBotAllowed#c516d679 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionBotAllowed#c516d679: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutString(.Domain)
	}
	if .Flags.Has(2) {
		if .App == nil {
			return fmt.Errorf("unable to encode messageActionBotAllowed#c516d679: field app is nil")
		}
		if  := .App.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionBotAllowed#c516d679: field app: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionBotAllowed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionBotAllowed#c516d679 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionBotAllowed#c516d679: field flags: %w", )
		}
	}
	.AttachMenu = .Flags.Has(1)
	.FromRequest = .Flags.Has(3)
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionBotAllowed#c516d679: field domain: %w", )
		}
		.Domain = 
	}
	if .Flags.Has(2) {
		,  := DecodeBotApp()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionBotAllowed#c516d679: field app: %w", )
		}
		.App = 
	}
	return nil
}

// SetAttachMenu sets value of AttachMenu conditional field.
func ( *MessageActionBotAllowed) ( bool) {
	if  {
		.Flags.Set(1)
		.AttachMenu = true
	} else {
		.Flags.Unset(1)
		.AttachMenu = false
	}
}

// GetAttachMenu returns value of AttachMenu conditional field.
func ( *MessageActionBotAllowed) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetFromRequest sets value of FromRequest conditional field.
func ( *MessageActionBotAllowed) ( bool) {
	if  {
		.Flags.Set(3)
		.FromRequest = true
	} else {
		.Flags.Unset(3)
		.FromRequest = false
	}
}

// GetFromRequest returns value of FromRequest conditional field.
func ( *MessageActionBotAllowed) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// SetDomain sets value of Domain conditional field.
func ( *MessageActionBotAllowed) ( string) {
	.Flags.Set(0)
	.Domain = 
}

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

// SetApp sets value of App conditional field.
func ( *MessageActionBotAllowed) ( BotAppClass) {
	.Flags.Set(2)
	.App = 
}

// GetApp returns value of App conditional field and
// boolean which is true if field was set.
func ( *MessageActionBotAllowed) () ( BotAppClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .App, true
}

// MessageActionSecureValuesSentMe represents TL type `messageActionSecureValuesSentMe#1b287353`.
// Secure telegram passport¹ values were received
//
// Links:
//  1. https://core.telegram.org/passport
//
// See https://core.telegram.org/constructor/messageActionSecureValuesSentMe for reference.
type MessageActionSecureValuesSentMe struct {
	// Vector with information about documents and other Telegram Passport elements that were
	// shared with the bot
	Values []SecureValue
	// Encrypted credentials required to decrypt the data
	Credentials SecureCredentialsEncrypted
}

// MessageActionSecureValuesSentMeTypeID is TL type id of MessageActionSecureValuesSentMe.
const MessageActionSecureValuesSentMeTypeID = 0x1b287353

// construct implements constructor of MessageActionClass.
func ( MessageActionSecureValuesSentMe) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSecureValuesSentMe{}
)

func ( *MessageActionSecureValuesSentMe) () bool {
	if  == nil {
		return true
	}
	if !(.Values == nil) {
		return false
	}
	if !(.Credentials.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSecureValuesSentMe from given interface.
func ( *MessageActionSecureValuesSentMe) ( interface {
	() ( []SecureValue)
	() ( SecureCredentialsEncrypted)
}) {
	.Values = .()
	.Credentials = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSecureValuesSentMe) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSecureValuesSentMe",
		ID:   MessageActionSecureValuesSentMeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Values",
			SchemaName: "values",
		},
		{
			Name:       "Credentials",
			SchemaName: "credentials",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionSecureValuesSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSecureValuesSentMe#1b287353 as nil")
	}
	.PutID(MessageActionSecureValuesSentMeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSecureValuesSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSecureValuesSentMe#1b287353 as nil")
	}
	.PutVectorHeader(len(.Values))
	for ,  := range .Values {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionSecureValuesSentMe#1b287353: field values element with index %d: %w", , )
		}
	}
	if  := .Credentials.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionSecureValuesSentMe#1b287353: field credentials: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSecureValuesSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSecureValuesSentMe#1b287353 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSecureValuesSentMe#1b287353: field values: %w", )
		}

		if  > 0 {
			.Values = make([]SecureValue, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  SecureValue
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode messageActionSecureValuesSentMe#1b287353: field values: %w", )
			}
			.Values = append(.Values, )
		}
	}
	{
		if  := .Credentials.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionSecureValuesSentMe#1b287353: field credentials: %w", )
		}
	}
	return nil
}

// GetValues returns value of Values field.
func ( *MessageActionSecureValuesSentMe) () ( []SecureValue) {
	if  == nil {
		return
	}
	return .Values
}

// GetCredentials returns value of Credentials field.
func ( *MessageActionSecureValuesSentMe) () ( SecureCredentialsEncrypted) {
	if  == nil {
		return
	}
	return .Credentials
}

// MessageActionSecureValuesSent represents TL type `messageActionSecureValuesSent#d95c6154`.
// Request for secure telegram passport¹ values was sent
//
// Links:
//  1. https://core.telegram.org/passport
//
// See https://core.telegram.org/constructor/messageActionSecureValuesSent for reference.
type MessageActionSecureValuesSent struct {
	// Secure value types
	Types []SecureValueTypeClass
}

// MessageActionSecureValuesSentTypeID is TL type id of MessageActionSecureValuesSent.
const MessageActionSecureValuesSentTypeID = 0xd95c6154

// construct implements constructor of MessageActionClass.
func ( MessageActionSecureValuesSent) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSecureValuesSent{}
)

func ( *MessageActionSecureValuesSent) () bool {
	if  == nil {
		return true
	}
	if !(.Types == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSecureValuesSent from given interface.
func ( *MessageActionSecureValuesSent) ( interface {
	() ( []SecureValueTypeClass)
}) {
	.Types = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSecureValuesSent) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSecureValuesSent",
		ID:   MessageActionSecureValuesSentTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Types",
			SchemaName: "types",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionSecureValuesSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSecureValuesSent#d95c6154 as nil")
	}
	.PutID(MessageActionSecureValuesSentTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSecureValuesSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSecureValuesSent#d95c6154 as nil")
	}
	.PutVectorHeader(len(.Types))
	for ,  := range .Types {
		if  == nil {
			return fmt.Errorf("unable to encode messageActionSecureValuesSent#d95c6154: field types element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionSecureValuesSent#d95c6154: field types element with index %d: %w", , )
		}
	}
	return nil
}

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

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

		if  > 0 {
			.Types = make([]SecureValueTypeClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeSecureValueType()
			if  != nil {
				return fmt.Errorf("unable to decode messageActionSecureValuesSent#d95c6154: field types: %w", )
			}
			.Types = append(.Types, )
		}
	}
	return nil
}

// GetTypes returns value of Types field.
func ( *MessageActionSecureValuesSent) () ( []SecureValueTypeClass) {
	if  == nil {
		return
	}
	return .Types
}

// MapTypes returns field Types wrapped in SecureValueTypeClassArray helper.
func ( *MessageActionSecureValuesSent) () ( SecureValueTypeClassArray) {
	return SecureValueTypeClassArray(.Types)
}

// MessageActionContactSignUp represents TL type `messageActionContactSignUp#f3f25f76`.
// A contact just signed up to telegram
//
// See https://core.telegram.org/constructor/messageActionContactSignUp for reference.
type MessageActionContactSignUp struct {
}

// MessageActionContactSignUpTypeID is TL type id of MessageActionContactSignUp.
const MessageActionContactSignUpTypeID = 0xf3f25f76

// construct implements constructor of MessageActionClass.
func ( MessageActionContactSignUp) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionContactSignUp{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionContactSignUp) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionContactSignUp#f3f25f76 as nil")
	}
	.PutID(MessageActionContactSignUpTypeID)
	return .EncodeBare()
}

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

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

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

// MessageActionGeoProximityReached represents TL type `messageActionGeoProximityReached#98e0d697`.
// A user of the chat is now in proximity of another user
//
// See https://core.telegram.org/constructor/messageActionGeoProximityReached for reference.
type MessageActionGeoProximityReached struct {
	// The user or chat that is now in proximity of to_id
	FromID PeerClass
	// The user or chat that subscribed to live geolocation proximity alerts¹
	//
	// Links:
	//  1) https://core.telegram.org/api/live-location#proximity-alert
	ToID PeerClass
	// Distance, in meters (0-100000)
	Distance int
}

// MessageActionGeoProximityReachedTypeID is TL type id of MessageActionGeoProximityReached.
const MessageActionGeoProximityReachedTypeID = 0x98e0d697

// construct implements constructor of MessageActionClass.
func ( MessageActionGeoProximityReached) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGeoProximityReached{}
)

func ( *MessageActionGeoProximityReached) () bool {
	if  == nil {
		return true
	}
	if !(.FromID == nil) {
		return false
	}
	if !(.ToID == nil) {
		return false
	}
	if !(.Distance == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGeoProximityReached from given interface.
func ( *MessageActionGeoProximityReached) ( interface {
	() ( PeerClass)
	() ( PeerClass)
	() ( int)
}) {
	.FromID = .()
	.ToID = .()
	.Distance = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGeoProximityReached) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGeoProximityReached",
		ID:   MessageActionGeoProximityReachedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "FromID",
			SchemaName: "from_id",
		},
		{
			Name:       "ToID",
			SchemaName: "to_id",
		},
		{
			Name:       "Distance",
			SchemaName: "distance",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionGeoProximityReached) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGeoProximityReached#98e0d697 as nil")
	}
	.PutID(MessageActionGeoProximityReachedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGeoProximityReached) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGeoProximityReached#98e0d697 as nil")
	}
	if .FromID == nil {
		return fmt.Errorf("unable to encode messageActionGeoProximityReached#98e0d697: field from_id is nil")
	}
	if  := .FromID.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGeoProximityReached#98e0d697: field from_id: %w", )
	}
	if .ToID == nil {
		return fmt.Errorf("unable to encode messageActionGeoProximityReached#98e0d697: field to_id is nil")
	}
	if  := .ToID.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGeoProximityReached#98e0d697: field to_id: %w", )
	}
	.PutInt(.Distance)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGeoProximityReached) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGeoProximityReached#98e0d697 to nil")
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGeoProximityReached#98e0d697: field from_id: %w", )
		}
		.FromID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGeoProximityReached#98e0d697: field to_id: %w", )
		}
		.ToID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGeoProximityReached#98e0d697: field distance: %w", )
		}
		.Distance = 
	}
	return nil
}

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

// GetToID returns value of ToID field.
func ( *MessageActionGeoProximityReached) () ( PeerClass) {
	if  == nil {
		return
	}
	return .ToID
}

// GetDistance returns value of Distance field.
func ( *MessageActionGeoProximityReached) () ( int) {
	if  == nil {
		return
	}
	return .Distance
}

// MessageActionGroupCall represents TL type `messageActionGroupCall#7a0d7f42`.
// A video chat/livestream¹ was started or terminated.
//
// Links:
//  1. https://core.telegram.org/api/group-calls#video-chats-livestreams
//
// See https://core.telegram.org/constructor/messageActionGroupCall for reference.
type MessageActionGroupCall struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Group call
	Call InputGroupCallClass
	// Duration of the group call in seconds, for terminated calls.
	//
	// Use SetDuration and GetDuration helpers.
	Duration int
}

// MessageActionGroupCallTypeID is TL type id of MessageActionGroupCall.
const MessageActionGroupCallTypeID = 0x7a0d7f42

// construct implements constructor of MessageActionClass.
func ( MessageActionGroupCall) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGroupCall{}
)

func ( *MessageActionGroupCall) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Call == nil) {
		return false
	}
	if !(.Duration == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGroupCall from given interface.
func ( *MessageActionGroupCall) ( interface {
	() ( InputGroupCallClass)
	() ( int,  bool)
}) {
	.Call = .()
	if ,  := .();  {
		.Duration = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGroupCall) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGroupCall",
		ID:   MessageActionGroupCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "Duration",
			SchemaName: "duration",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGroupCall#7a0d7f42 as nil")
	}
	.PutID(MessageActionGroupCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGroupCall#7a0d7f42 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGroupCall#7a0d7f42: field flags: %w", )
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode messageActionGroupCall#7a0d7f42: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGroupCall#7a0d7f42: field call: %w", )
	}
	if .Flags.Has(0) {
		.PutInt(.Duration)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGroupCall#7a0d7f42 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGroupCall#7a0d7f42: field flags: %w", )
		}
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGroupCall#7a0d7f42: field call: %w", )
		}
		.Call = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGroupCall#7a0d7f42: field duration: %w", )
		}
		.Duration = 
	}
	return nil
}

// GetCall returns value of Call field.
func ( *MessageActionGroupCall) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// SetDuration sets value of Duration conditional field.
func ( *MessageActionGroupCall) ( int) {
	.Flags.Set(0)
	.Duration = 
}

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

// MessageActionInviteToGroupCall represents TL type `messageActionInviteToGroupCall#502f92f7`.
// A set of users was invited to a group call¹.
//
// Links:
//  1. https://core.telegram.org/api/group-calls
//
// See https://core.telegram.org/constructor/messageActionInviteToGroupCall for reference.
type MessageActionInviteToGroupCall struct {
	// The group call
	Call InputGroupCallClass
	// The invited users
	Users []int64
}

// MessageActionInviteToGroupCallTypeID is TL type id of MessageActionInviteToGroupCall.
const MessageActionInviteToGroupCallTypeID = 0x502f92f7

// construct implements constructor of MessageActionClass.
func ( MessageActionInviteToGroupCall) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionInviteToGroupCall{}
)

func ( *MessageActionInviteToGroupCall) () bool {
	if  == nil {
		return true
	}
	if !(.Call == nil) {
		return false
	}
	if !(.Users == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionInviteToGroupCall from given interface.
func ( *MessageActionInviteToGroupCall) ( interface {
	() ( InputGroupCallClass)
	() ( []int64)
}) {
	.Call = .()
	.Users = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionInviteToGroupCall) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionInviteToGroupCall",
		ID:   MessageActionInviteToGroupCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "Users",
			SchemaName: "users",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionInviteToGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionInviteToGroupCall#502f92f7 as nil")
	}
	.PutID(MessageActionInviteToGroupCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionInviteToGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionInviteToGroupCall#502f92f7 as nil")
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode messageActionInviteToGroupCall#502f92f7: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionInviteToGroupCall#502f92f7: field call: %w", )
	}
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		.PutLong()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionInviteToGroupCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionInviteToGroupCall#502f92f7 to nil")
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionInviteToGroupCall#502f92f7: field call: %w", )
		}
		.Call = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionInviteToGroupCall#502f92f7: field users: %w", )
		}

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

// GetCall returns value of Call field.
func ( *MessageActionInviteToGroupCall) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

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

// MessageActionSetMessagesTTL represents TL type `messageActionSetMessagesTTL#3c134d7b`.
// The Time-To-Live of messages in this chat was changed.
//
// See https://core.telegram.org/constructor/messageActionSetMessagesTTL for reference.
type MessageActionSetMessagesTTL struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// New Time-To-Live of all messages sent in this chat; if 0, autodeletion was disabled.
	Period int
	// If set, the chat TTL setting was set not due to a manual change by one of participants
	// but automatically because one of the participants has the default TTL settings
	// enabled »¹. For example, when a user writes to us for the first time and we have set
	// a default messages TTL of 1 week, this service message (with
	// auto_setting_from=our_userid) will be emitted before our first message.
	//
	// Links:
	//  1) https://core.telegram.org/method/messages.setDefaultHistoryTTL
	//
	// Use SetAutoSettingFrom and GetAutoSettingFrom helpers.
	AutoSettingFrom int64
}

// MessageActionSetMessagesTTLTypeID is TL type id of MessageActionSetMessagesTTL.
const MessageActionSetMessagesTTLTypeID = 0x3c134d7b

// construct implements constructor of MessageActionClass.
func ( MessageActionSetMessagesTTL) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSetMessagesTTL{}
)

func ( *MessageActionSetMessagesTTL) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Period == 0) {
		return false
	}
	if !(.AutoSettingFrom == 0) {
		return false
	}

	return true
}

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSetMessagesTTL) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSetMessagesTTL",
		ID:   MessageActionSetMessagesTTLTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Period",
			SchemaName: "period",
		},
		{
			Name:       "AutoSettingFrom",
			SchemaName: "auto_setting_from",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionSetMessagesTTL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSetMessagesTTL#3c134d7b as nil")
	}
	.PutID(MessageActionSetMessagesTTLTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSetMessagesTTL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSetMessagesTTL#3c134d7b to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionSetMessagesTTL#3c134d7b: field flags: %w", )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSetMessagesTTL#3c134d7b: field period: %w", )
		}
		.Period = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSetMessagesTTL#3c134d7b: field auto_setting_from: %w", )
		}
		.AutoSettingFrom = 
	}
	return nil
}

// GetPeriod returns value of Period field.
func ( *MessageActionSetMessagesTTL) () ( int) {
	if  == nil {
		return
	}
	return .Period
}

// SetAutoSettingFrom sets value of AutoSettingFrom conditional field.
func ( *MessageActionSetMessagesTTL) ( int64) {
	.Flags.Set(0)
	.AutoSettingFrom = 
}

// GetAutoSettingFrom returns value of AutoSettingFrom conditional field and
// boolean which is true if field was set.
func ( *MessageActionSetMessagesTTL) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .AutoSettingFrom, true
}

// MessageActionGroupCallScheduled represents TL type `messageActionGroupCallScheduled#b3a07661`.
// A video chat/livestream¹ was scheduled.
//
// Links:
//  1. https://core.telegram.org/api/group-calls#video-chats-livestreams
//
// See https://core.telegram.org/constructor/messageActionGroupCallScheduled for reference.
type MessageActionGroupCallScheduled struct {
	// The group call
	Call InputGroupCallClass
	// When is the group call scheduled to start
	ScheduleDate int
}

// MessageActionGroupCallScheduledTypeID is TL type id of MessageActionGroupCallScheduled.
const MessageActionGroupCallScheduledTypeID = 0xb3a07661

// construct implements constructor of MessageActionClass.
func ( MessageActionGroupCallScheduled) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGroupCallScheduled{}
)

func ( *MessageActionGroupCallScheduled) () bool {
	if  == nil {
		return true
	}
	if !(.Call == nil) {
		return false
	}
	if !(.ScheduleDate == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGroupCallScheduled from given interface.
func ( *MessageActionGroupCallScheduled) ( interface {
	() ( InputGroupCallClass)
	() ( int)
}) {
	.Call = .()
	.ScheduleDate = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGroupCallScheduled) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGroupCallScheduled",
		ID:   MessageActionGroupCallScheduledTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "ScheduleDate",
			SchemaName: "schedule_date",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionGroupCallScheduled) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGroupCallScheduled#b3a07661 as nil")
	}
	.PutID(MessageActionGroupCallScheduledTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGroupCallScheduled) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGroupCallScheduled#b3a07661 as nil")
	}
	if .Call == nil {
		return fmt.Errorf("unable to encode messageActionGroupCallScheduled#b3a07661: field call is nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGroupCallScheduled#b3a07661: field call: %w", )
	}
	.PutInt(.ScheduleDate)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGroupCallScheduled) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGroupCallScheduled#b3a07661 to nil")
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGroupCallScheduled#b3a07661: field call: %w", )
		}
		.Call = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGroupCallScheduled#b3a07661: field schedule_date: %w", )
		}
		.ScheduleDate = 
	}
	return nil
}

// GetCall returns value of Call field.
func ( *MessageActionGroupCallScheduled) () ( InputGroupCallClass) {
	if  == nil {
		return
	}
	return .Call
}

// GetScheduleDate returns value of ScheduleDate field.
func ( *MessageActionGroupCallScheduled) () ( int) {
	if  == nil {
		return
	}
	return .ScheduleDate
}

// MessageActionSetChatTheme represents TL type `messageActionSetChatTheme#b91bbd3a`.
// The chat theme was changed
//
// See https://core.telegram.org/constructor/messageActionSetChatTheme for reference.
type MessageActionSetChatTheme struct {
	// The new chat theme.
	Theme ChatThemeClass
}

// MessageActionSetChatThemeTypeID is TL type id of MessageActionSetChatTheme.
const MessageActionSetChatThemeTypeID = 0xb91bbd3a

// construct implements constructor of MessageActionClass.
func ( MessageActionSetChatTheme) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSetChatTheme{}
)

func ( *MessageActionSetChatTheme) () bool {
	if  == nil {
		return true
	}
	if !(.Theme == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSetChatTheme from given interface.
func ( *MessageActionSetChatTheme) ( interface {
	() ( ChatThemeClass)
}) {
	.Theme = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSetChatTheme) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSetChatTheme",
		ID:   MessageActionSetChatThemeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Theme",
			SchemaName: "theme",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionSetChatTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSetChatTheme#b91bbd3a as nil")
	}
	.PutID(MessageActionSetChatThemeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSetChatTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSetChatTheme#b91bbd3a as nil")
	}
	if .Theme == nil {
		return fmt.Errorf("unable to encode messageActionSetChatTheme#b91bbd3a: field theme is nil")
	}
	if  := .Theme.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionSetChatTheme#b91bbd3a: field theme: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSetChatTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSetChatTheme#b91bbd3a to nil")
	}
	{
		,  := DecodeChatTheme()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSetChatTheme#b91bbd3a: field theme: %w", )
		}
		.Theme = 
	}
	return nil
}

// GetTheme returns value of Theme field.
func ( *MessageActionSetChatTheme) () ( ChatThemeClass) {
	if  == nil {
		return
	}
	return .Theme
}

// MessageActionChatJoinedByRequest represents TL type `messageActionChatJoinedByRequest#ebbca3cb`.
// A user was accepted into the group by an admin
//
// See https://core.telegram.org/constructor/messageActionChatJoinedByRequest for reference.
type MessageActionChatJoinedByRequest struct {
}

// MessageActionChatJoinedByRequestTypeID is TL type id of MessageActionChatJoinedByRequest.
const MessageActionChatJoinedByRequestTypeID = 0xebbca3cb

// construct implements constructor of MessageActionClass.
func ( MessageActionChatJoinedByRequest) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChatJoinedByRequest{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessageActionChatJoinedByRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChatJoinedByRequest#ebbca3cb as nil")
	}
	.PutID(MessageActionChatJoinedByRequestTypeID)
	return .EncodeBare()
}

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

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

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

// MessageActionWebViewDataSentMe represents TL type `messageActionWebViewDataSentMe#47dd8079`.
// Data from an opened reply keyboard bot mini app¹ was relayed to the bot that owns it
// (bot side service message).
//
// Links:
//  1. https://core.telegram.org/api/bots/webapps
//
// See https://core.telegram.org/constructor/messageActionWebViewDataSentMe for reference.
type MessageActionWebViewDataSentMe struct {
	// Text of the keyboardButtonSimpleWebView¹ that was pressed to open the web app.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/keyboardButtonSimpleWebView
	Text string
	// Relayed data.
	Data string
}

// MessageActionWebViewDataSentMeTypeID is TL type id of MessageActionWebViewDataSentMe.
const MessageActionWebViewDataSentMeTypeID = 0x47dd8079

// construct implements constructor of MessageActionClass.
func ( MessageActionWebViewDataSentMe) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionWebViewDataSentMe{}
)

func ( *MessageActionWebViewDataSentMe) () bool {
	if  == nil {
		return true
	}
	if !(.Text == "") {
		return false
	}
	if !(.Data == "") {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionWebViewDataSentMe from given interface.
func ( *MessageActionWebViewDataSentMe) ( interface {
	() ( string)
	() ( string)
}) {
	.Text = .()
	.Data = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionWebViewDataSentMe) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionWebViewDataSentMe",
		ID:   MessageActionWebViewDataSentMeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
		{
			Name:       "Data",
			SchemaName: "data",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionWebViewDataSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionWebViewDataSentMe#47dd8079 as nil")
	}
	.PutID(MessageActionWebViewDataSentMeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionWebViewDataSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionWebViewDataSentMe#47dd8079 as nil")
	}
	.PutString(.Text)
	.PutString(.Data)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionWebViewDataSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionWebViewDataSentMe#47dd8079 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionWebViewDataSentMe#47dd8079: field text: %w", )
		}
		.Text = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionWebViewDataSentMe#47dd8079: field data: %w", )
		}
		.Data = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *MessageActionWebViewDataSentMe) () ( string) {
	if  == nil {
		return
	}
	return .Text
}

// GetData returns value of Data field.
func ( *MessageActionWebViewDataSentMe) () ( string) {
	if  == nil {
		return
	}
	return .Data
}

// MessageActionWebViewDataSent represents TL type `messageActionWebViewDataSent#b4c38cb5`.
// Data from an opened reply keyboard bot mini app¹ was relayed to the bot that owns it
// (user side service message).
// Clients should display a service message with the text Data from the «$text» button
// was transferred to the bot.
//
// Links:
//  1. https://core.telegram.org/api/bots/webapps
//
// See https://core.telegram.org/constructor/messageActionWebViewDataSent for reference.
type MessageActionWebViewDataSent struct {
	// Text of the keyboardButtonSimpleWebView¹ that was pressed to open the web app.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/keyboardButtonSimpleWebView
	Text string
}

// MessageActionWebViewDataSentTypeID is TL type id of MessageActionWebViewDataSent.
const MessageActionWebViewDataSentTypeID = 0xb4c38cb5

// construct implements constructor of MessageActionClass.
func ( MessageActionWebViewDataSent) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionWebViewDataSent{}
)

func ( *MessageActionWebViewDataSent) () bool {
	if  == nil {
		return true
	}
	if !(.Text == "") {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionWebViewDataSent from given interface.
func ( *MessageActionWebViewDataSent) ( interface {
	() ( string)
}) {
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionWebViewDataSent) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionWebViewDataSent",
		ID:   MessageActionWebViewDataSentTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionWebViewDataSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionWebViewDataSent#b4c38cb5 as nil")
	}
	.PutID(MessageActionWebViewDataSentTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionWebViewDataSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionWebViewDataSent#b4c38cb5 as nil")
	}
	.PutString(.Text)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionWebViewDataSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionWebViewDataSent#b4c38cb5 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionWebViewDataSent#b4c38cb5: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *MessageActionWebViewDataSent) () ( string) {
	if  == nil {
		return
	}
	return .Text
}

// MessageActionGiftPremium represents TL type `messageActionGiftPremium#48e91302`.
// Info about a gifted Telegram Premium subscription
// This service message should be displayed below the appropriate sticker from the
// inputStickerSetPremiumGifts »¹ stickerset »²:
//
// Links:
//  1. https://core.telegram.org/constructor/inputStickerSetPremiumGifts
//  2. https://core.telegram.org/api/stickers#stickersets
//
// See https://core.telegram.org/constructor/messageActionGiftPremium for reference.
type MessageActionGiftPremium struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Three-letter ISO 4217 currency¹ code
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	Currency string
	// Price of the gift 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
	Amount int64
	// Duration of the gifted Telegram Premium subscription, in days.
	Days int
	// If the gift was bought using a cryptocurrency, the cryptocurrency name.
	//
	// Use SetCryptoCurrency and GetCryptoCurrency helpers.
	CryptoCurrency string
	// If the gift was bought using a cryptocurrency, price of the gift in the smallest units
	// of a cryptocurrency.
	//
	// Use SetCryptoAmount and GetCryptoAmount helpers.
	CryptoAmount int64
	// Message attached with the gift
	//
	// Use SetMessage and GetMessage helpers.
	Message TextWithEntities
}

// MessageActionGiftPremiumTypeID is TL type id of MessageActionGiftPremium.
const MessageActionGiftPremiumTypeID = 0x48e91302

// construct implements constructor of MessageActionClass.
func ( MessageActionGiftPremium) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGiftPremium{}
)

func ( *MessageActionGiftPremium) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.Amount == 0) {
		return false
	}
	if !(.Days == 0) {
		return false
	}
	if !(.CryptoCurrency == "") {
		return false
	}
	if !(.CryptoAmount == 0) {
		return false
	}
	if !(.Message.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGiftPremium from given interface.
func ( *MessageActionGiftPremium) ( interface {
	() ( string)
	() ( int64)
	() ( int)
	() ( string,  bool)
	() ( int64,  bool)
	() ( TextWithEntities,  bool)
}) {
	.Currency = .()
	.Amount = .()
	.Days = .()
	if ,  := .();  {
		.CryptoCurrency = 
	}

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGiftPremium) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGiftPremium",
		ID:   MessageActionGiftPremiumTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Currency",
			SchemaName: "currency",
		},
		{
			Name:       "Amount",
			SchemaName: "amount",
		},
		{
			Name:       "Days",
			SchemaName: "days",
		},
		{
			Name:       "CryptoCurrency",
			SchemaName: "crypto_currency",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "CryptoAmount",
			SchemaName: "crypto_amount",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Message",
			SchemaName: "message",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionGiftPremium) () {
	if !(.CryptoCurrency == "") {
		.Flags.Set(0)
	}
	if !(.CryptoAmount == 0) {
		.Flags.Set(0)
	}
	if !(.Message.Zero()) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionGiftPremium) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftPremium#48e91302 as nil")
	}
	.PutID(MessageActionGiftPremiumTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGiftPremium) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftPremium#48e91302 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGiftPremium#48e91302: field flags: %w", )
	}
	.PutString(.Currency)
	.PutLong(.Amount)
	.PutInt(.Days)
	if .Flags.Has(0) {
		.PutString(.CryptoCurrency)
	}
	if .Flags.Has(0) {
		.PutLong(.CryptoAmount)
	}
	if .Flags.Has(1) {
		if  := .Message.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionGiftPremium#48e91302: field message: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiftPremium) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiftPremium#48e91302 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#48e91302: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#48e91302: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#48e91302: field amount: %w", )
		}
		.Amount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#48e91302: field days: %w", )
		}
		.Days = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#48e91302: field crypto_currency: %w", )
		}
		.CryptoCurrency = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#48e91302: field crypto_amount: %w", )
		}
		.CryptoAmount = 
	}
	if .Flags.Has(1) {
		if  := .Message.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#48e91302: field message: %w", )
		}
	}
	return nil
}

// GetCurrency returns value of Currency field.
func ( *MessageActionGiftPremium) () ( string) {
	if  == nil {
		return
	}
	return .Currency
}

// GetAmount returns value of Amount field.
func ( *MessageActionGiftPremium) () ( int64) {
	if  == nil {
		return
	}
	return .Amount
}

// GetDays returns value of Days field.
func ( *MessageActionGiftPremium) () ( int) {
	if  == nil {
		return
	}
	return .Days
}

// SetCryptoCurrency sets value of CryptoCurrency conditional field.
func ( *MessageActionGiftPremium) ( string) {
	.Flags.Set(0)
	.CryptoCurrency = 
}

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

// SetCryptoAmount sets value of CryptoAmount conditional field.
func ( *MessageActionGiftPremium) ( int64) {
	.Flags.Set(0)
	.CryptoAmount = 
}

// GetCryptoAmount returns value of CryptoAmount conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftPremium) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .CryptoAmount, true
}

// SetMessage sets value of Message conditional field.
func ( *MessageActionGiftPremium) ( TextWithEntities) {
	.Flags.Set(1)
	.Message = 
}

// GetMessage returns value of Message conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftPremium) () ( TextWithEntities,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Message, true
}

// MessageActionTopicCreate represents TL type `messageActionTopicCreate#d999256`.
// A forum topic¹ was created.
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/messageActionTopicCreate for reference.
type MessageActionTopicCreate struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// TitleMissing field of MessageActionTopicCreate.
	TitleMissing bool
	// Topic name.
	Title string
	// If no custom emoji icon is specified, specifies the color of the fallback topic icon
	// (RGB), one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F.
	IconColor int
	// ID of the custom emoji¹ used as topic icon.
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	//
	// Use SetIconEmojiID and GetIconEmojiID helpers.
	IconEmojiID int64
}

// MessageActionTopicCreateTypeID is TL type id of MessageActionTopicCreate.
const MessageActionTopicCreateTypeID = 0xd999256

// construct implements constructor of MessageActionClass.
func ( MessageActionTopicCreate) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionTopicCreate{}
)

func ( *MessageActionTopicCreate) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.TitleMissing == false) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.IconColor == 0) {
		return false
	}
	if !(.IconEmojiID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionTopicCreate from given interface.
func ( *MessageActionTopicCreate) ( interface {
	() ( bool)
	() ( string)
	() ( int)
	() ( int64,  bool)
}) {
	.TitleMissing = .()
	.Title = .()
	.IconColor = .()
	if ,  := .();  {
		.IconEmojiID = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionTopicCreate) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionTopicCreate",
		ID:   MessageActionTopicCreateTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "TitleMissing",
			SchemaName: "title_missing",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "IconColor",
			SchemaName: "icon_color",
		},
		{
			Name:       "IconEmojiID",
			SchemaName: "icon_emoji_id",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionTopicCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionTopicCreate#d999256 as nil")
	}
	.PutID(MessageActionTopicCreateTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionTopicCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionTopicCreate#d999256 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionTopicCreate#d999256: field flags: %w", )
	}
	.PutString(.Title)
	.PutInt(.IconColor)
	if .Flags.Has(0) {
		.PutLong(.IconEmojiID)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionTopicCreate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionTopicCreate#d999256 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionTopicCreate#d999256: field flags: %w", )
		}
	}
	.TitleMissing = .Flags.Has(1)
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionTopicCreate#d999256: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionTopicCreate#d999256: field icon_color: %w", )
		}
		.IconColor = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionTopicCreate#d999256: field icon_emoji_id: %w", )
		}
		.IconEmojiID = 
	}
	return nil
}

// SetTitleMissing sets value of TitleMissing conditional field.
func ( *MessageActionTopicCreate) ( bool) {
	if  {
		.Flags.Set(1)
		.TitleMissing = true
	} else {
		.Flags.Unset(1)
		.TitleMissing = false
	}
}

// GetTitleMissing returns value of TitleMissing conditional field.
func ( *MessageActionTopicCreate) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

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

// GetIconColor returns value of IconColor field.
func ( *MessageActionTopicCreate) () ( int) {
	if  == nil {
		return
	}
	return .IconColor
}

// SetIconEmojiID sets value of IconEmojiID conditional field.
func ( *MessageActionTopicCreate) ( int64) {
	.Flags.Set(0)
	.IconEmojiID = 
}

// GetIconEmojiID returns value of IconEmojiID conditional field and
// boolean which is true if field was set.
func ( *MessageActionTopicCreate) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .IconEmojiID, true
}

// MessageActionTopicEdit represents TL type `messageActionTopicEdit#c0944820`.
// Forum topic¹ information was edited.
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/messageActionTopicEdit for reference.
type MessageActionTopicEdit struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// New topic title.
	//
	// Use SetTitle and GetTitle helpers.
	Title string
	// ID of the new custom emoji¹ used as topic icon, or if it was removed.
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	//
	// Use SetIconEmojiID and GetIconEmojiID helpers.
	IconEmojiID int64
	// Whether the topic was opened or closed.
	//
	// Use SetClosed and GetClosed helpers.
	Closed bool
	// Whether the topic was hidden or unhidden (only valid for the "General" topic, id=1).
	//
	// Use SetHidden and GetHidden helpers.
	Hidden bool
}

// MessageActionTopicEditTypeID is TL type id of MessageActionTopicEdit.
const MessageActionTopicEditTypeID = 0xc0944820

// construct implements constructor of MessageActionClass.
func ( MessageActionTopicEdit) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionTopicEdit{}
)

func ( *MessageActionTopicEdit) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.IconEmojiID == 0) {
		return false
	}
	if !(.Closed == false) {
		return false
	}
	if !(.Hidden == false) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionTopicEdit from given interface.
func ( *MessageActionTopicEdit) ( interface {
	() ( string,  bool)
	() ( int64,  bool)
	() ( bool,  bool)
	() ( bool,  bool)
}) {
	if ,  := .();  {
		.Title = 
	}

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

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionTopicEdit) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionTopicEdit",
		ID:   MessageActionTopicEditTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "IconEmojiID",
			SchemaName: "icon_emoji_id",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Closed",
			SchemaName: "closed",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Hidden",
			SchemaName: "hidden",
			Null:       !.Flags.Has(3),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionTopicEdit) () {
	if !(.Title == "") {
		.Flags.Set(0)
	}
	if !(.IconEmojiID == 0) {
		.Flags.Set(1)
	}
	if !(.Closed == false) {
		.Flags.Set(2)
	}
	if !(.Hidden == false) {
		.Flags.Set(3)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionTopicEdit) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionTopicEdit#c0944820 as nil")
	}
	.PutID(MessageActionTopicEditTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionTopicEdit) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionTopicEdit#c0944820 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionTopicEdit#c0944820: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutString(.Title)
	}
	if .Flags.Has(1) {
		.PutLong(.IconEmojiID)
	}
	if .Flags.Has(2) {
		.PutBool(.Closed)
	}
	if .Flags.Has(3) {
		.PutBool(.Hidden)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionTopicEdit) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionTopicEdit#c0944820 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionTopicEdit#c0944820: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionTopicEdit#c0944820: field title: %w", )
		}
		.Title = 
	}
	if .Flags.Has(1) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionTopicEdit#c0944820: field icon_emoji_id: %w", )
		}
		.IconEmojiID = 
	}
	if .Flags.Has(2) {
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionTopicEdit#c0944820: field closed: %w", )
		}
		.Closed = 
	}
	if .Flags.Has(3) {
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionTopicEdit#c0944820: field hidden: %w", )
		}
		.Hidden = 
	}
	return nil
}

// SetTitle sets value of Title conditional field.
func ( *MessageActionTopicEdit) ( string) {
	.Flags.Set(0)
	.Title = 
}

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

// SetIconEmojiID sets value of IconEmojiID conditional field.
func ( *MessageActionTopicEdit) ( int64) {
	.Flags.Set(1)
	.IconEmojiID = 
}

// GetIconEmojiID returns value of IconEmojiID conditional field and
// boolean which is true if field was set.
func ( *MessageActionTopicEdit) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .IconEmojiID, true
}

// SetClosed sets value of Closed conditional field.
func ( *MessageActionTopicEdit) ( bool) {
	.Flags.Set(2)
	.Closed = 
}

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

// SetHidden sets value of Hidden conditional field.
func ( *MessageActionTopicEdit) ( bool) {
	.Flags.Set(3)
	.Hidden = 
}

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

// MessageActionSuggestProfilePhoto represents TL type `messageActionSuggestProfilePhoto#57de635e`.
// A new profile picture was suggested using photos.uploadContactProfilePhoto¹.
//
// Links:
//  1. https://core.telegram.org/method/photos.uploadContactProfilePhoto
//
// See https://core.telegram.org/constructor/messageActionSuggestProfilePhoto for reference.
type MessageActionSuggestProfilePhoto struct {
	// The photo that the user suggested we set as profile picture.
	Photo PhotoClass
}

// MessageActionSuggestProfilePhotoTypeID is TL type id of MessageActionSuggestProfilePhoto.
const MessageActionSuggestProfilePhotoTypeID = 0x57de635e

// construct implements constructor of MessageActionClass.
func ( MessageActionSuggestProfilePhoto) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSuggestProfilePhoto{}
)

func ( *MessageActionSuggestProfilePhoto) () bool {
	if  == nil {
		return true
	}
	if !(.Photo == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSuggestProfilePhoto from given interface.
func ( *MessageActionSuggestProfilePhoto) ( interface {
	() ( PhotoClass)
}) {
	.Photo = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSuggestProfilePhoto) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSuggestProfilePhoto",
		ID:   MessageActionSuggestProfilePhotoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Photo",
			SchemaName: "photo",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionSuggestProfilePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestProfilePhoto#57de635e as nil")
	}
	.PutID(MessageActionSuggestProfilePhotoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSuggestProfilePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestProfilePhoto#57de635e as nil")
	}
	if .Photo == nil {
		return fmt.Errorf("unable to encode messageActionSuggestProfilePhoto#57de635e: field photo is nil")
	}
	if  := .Photo.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionSuggestProfilePhoto#57de635e: field photo: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSuggestProfilePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSuggestProfilePhoto#57de635e to nil")
	}
	{
		,  := DecodePhoto()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSuggestProfilePhoto#57de635e: field photo: %w", )
		}
		.Photo = 
	}
	return nil
}

// GetPhoto returns value of Photo field.
func ( *MessageActionSuggestProfilePhoto) () ( PhotoClass) {
	if  == nil {
		return
	}
	return .Photo
}

// MessageActionRequestedPeer represents TL type `messageActionRequestedPeer#31518e9b`.
// Contains info about one or more peers that the we (the user) shared with the bot after
// clicking on a keyboardButtonRequestPeer¹ button (service message sent by the user).
//
// Links:
//  1. https://core.telegram.org/constructor/keyboardButtonRequestPeer
//
// See https://core.telegram.org/constructor/messageActionRequestedPeer for reference.
type MessageActionRequestedPeer struct {
	// button_id contained in the keyboardButtonRequestPeer¹
	//
	// Links:
	//  1) https://core.telegram.org/constructor/keyboardButtonRequestPeer
	ButtonID int
	// The shared peers
	Peers []PeerClass
}

// MessageActionRequestedPeerTypeID is TL type id of MessageActionRequestedPeer.
const MessageActionRequestedPeerTypeID = 0x31518e9b

// construct implements constructor of MessageActionClass.
func ( MessageActionRequestedPeer) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionRequestedPeer{}
)

func ( *MessageActionRequestedPeer) () bool {
	if  == nil {
		return true
	}
	if !(.ButtonID == 0) {
		return false
	}
	if !(.Peers == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionRequestedPeer from given interface.
func ( *MessageActionRequestedPeer) ( interface {
	() ( int)
	() ( []PeerClass)
}) {
	.ButtonID = .()
	.Peers = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionRequestedPeer) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionRequestedPeer",
		ID:   MessageActionRequestedPeerTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ButtonID",
			SchemaName: "button_id",
		},
		{
			Name:       "Peers",
			SchemaName: "peers",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionRequestedPeer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionRequestedPeer#31518e9b as nil")
	}
	.PutID(MessageActionRequestedPeerTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionRequestedPeer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionRequestedPeer#31518e9b as nil")
	}
	.PutInt(.ButtonID)
	.PutVectorHeader(len(.Peers))
	for ,  := range .Peers {
		if  == nil {
			return fmt.Errorf("unable to encode messageActionRequestedPeer#31518e9b: field peers element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionRequestedPeer#31518e9b: field peers element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionRequestedPeer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionRequestedPeer#31518e9b to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionRequestedPeer#31518e9b: field button_id: %w", )
		}
		.ButtonID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionRequestedPeer#31518e9b: field peers: %w", )
		}

		if  > 0 {
			.Peers = make([]PeerClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePeer()
			if  != nil {
				return fmt.Errorf("unable to decode messageActionRequestedPeer#31518e9b: field peers: %w", )
			}
			.Peers = append(.Peers, )
		}
	}
	return nil
}

// GetButtonID returns value of ButtonID field.
func ( *MessageActionRequestedPeer) () ( int) {
	if  == nil {
		return
	}
	return .ButtonID
}

// GetPeers returns value of Peers field.
func ( *MessageActionRequestedPeer) () ( []PeerClass) {
	if  == nil {
		return
	}
	return .Peers
}

// MapPeers returns field Peers wrapped in PeerClassArray helper.
func ( *MessageActionRequestedPeer) () ( PeerClassArray) {
	return PeerClassArray(.Peers)
}

// MessageActionSetChatWallPaper represents TL type `messageActionSetChatWallPaper#5060a3f4`.
// The wallpaper »¹ of the current chat was changed.
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// See https://core.telegram.org/constructor/messageActionSetChatWallPaper for reference.
type MessageActionSetChatWallPaper struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, indicates the user applied a wallpaper »¹ previously sent by the other user
	// in a messageActionSetChatWallPaper² message.
	//
	// Links:
	//  1) https://core.telegram.org/api/wallpapers
	//  2) https://core.telegram.org/constructor/messageActionSetChatWallPaper
	Same bool
	// If set, indicates the wallpaper was forcefully applied for both sides, without
	// explicit confirmation from the other side. If the message is incoming, and we did not
	// like the new wallpaper the other user has chosen for us, we can re-set our previous
	// wallpaper just on our side, by invoking messages.setChatWallPaper¹, providing only
	// the revert flag (and obviously the peer parameter).
	//
	// Links:
	//  1) https://core.telegram.org/method/messages.setChatWallPaper
	ForBoth bool
	// New wallpaper¹
	//
	// Links:
	//  1) https://core.telegram.org/api/wallpapers
	Wallpaper WallPaperClass
}

// MessageActionSetChatWallPaperTypeID is TL type id of MessageActionSetChatWallPaper.
const MessageActionSetChatWallPaperTypeID = 0x5060a3f4

// construct implements constructor of MessageActionClass.
func ( MessageActionSetChatWallPaper) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSetChatWallPaper{}
)

func ( *MessageActionSetChatWallPaper) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Same == false) {
		return false
	}
	if !(.ForBoth == false) {
		return false
	}
	if !(.Wallpaper == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSetChatWallPaper from given interface.
func ( *MessageActionSetChatWallPaper) ( interface {
	() ( bool)
	() ( bool)
	() ( WallPaperClass)
}) {
	.Same = .()
	.ForBoth = .()
	.Wallpaper = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSetChatWallPaper) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSetChatWallPaper",
		ID:   MessageActionSetChatWallPaperTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Same",
			SchemaName: "same",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "ForBoth",
			SchemaName: "for_both",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Wallpaper",
			SchemaName: "wallpaper",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionSetChatWallPaper) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSetChatWallPaper#5060a3f4 as nil")
	}
	.PutID(MessageActionSetChatWallPaperTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSetChatWallPaper) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSetChatWallPaper#5060a3f4 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionSetChatWallPaper#5060a3f4: field flags: %w", )
	}
	if .Wallpaper == nil {
		return fmt.Errorf("unable to encode messageActionSetChatWallPaper#5060a3f4: field wallpaper is nil")
	}
	if  := .Wallpaper.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionSetChatWallPaper#5060a3f4: field wallpaper: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSetChatWallPaper) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSetChatWallPaper#5060a3f4 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionSetChatWallPaper#5060a3f4: field flags: %w", )
		}
	}
	.Same = .Flags.Has(0)
	.ForBoth = .Flags.Has(1)
	{
		,  := DecodeWallPaper()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSetChatWallPaper#5060a3f4: field wallpaper: %w", )
		}
		.Wallpaper = 
	}
	return nil
}

// SetSame sets value of Same conditional field.
func ( *MessageActionSetChatWallPaper) ( bool) {
	if  {
		.Flags.Set(0)
		.Same = true
	} else {
		.Flags.Unset(0)
		.Same = false
	}
}

// GetSame returns value of Same conditional field.
func ( *MessageActionSetChatWallPaper) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetForBoth sets value of ForBoth conditional field.
func ( *MessageActionSetChatWallPaper) ( bool) {
	if  {
		.Flags.Set(1)
		.ForBoth = true
	} else {
		.Flags.Unset(1)
		.ForBoth = false
	}
}

// GetForBoth returns value of ForBoth conditional field.
func ( *MessageActionSetChatWallPaper) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetWallpaper returns value of Wallpaper field.
func ( *MessageActionSetChatWallPaper) () ( WallPaperClass) {
	if  == nil {
		return
	}
	return .Wallpaper
}

// MessageActionGiftCode represents TL type `messageActionGiftCode#31c48347`.
// Contains a Telegram Premium giftcode link¹.
//
// Links:
//  1. https://core.telegram.org/api/links#premium-giftcode-links
//
// See https://core.telegram.org/constructor/messageActionGiftCode for reference.
type MessageActionGiftCode struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, this gift code was received from a giveaway »¹ started by a
	// channel/supergroup we're subscribed to.
	//
	// Links:
	//  1) https://core.telegram.org/api/giveaways
	ViaGiveaway bool
	// If set, the link was not redeemed¹ yet.
	//
	// Links:
	//  1) https://core.telegram.org/api/links#premium-giftcode-links
	Unclaimed bool
	// Identifier of the channel/supergroup that created the gift code either directly or
	// through a giveaway¹: if we import this giftcode link, we will also automatically
	// boost² this channel/supergroup.
	//
	// Links:
	//  1) https://core.telegram.org/api/giveaways
	//  2) https://core.telegram.org/api/boost
	//
	// Use SetBoostPeer and GetBoostPeer helpers.
	BoostPeer PeerClass
	// Duration of the gifted Telegram Premium subscription, in days.
	Days int
	// Slug of the Telegram Premium giftcode link¹
	//
	// Links:
	//  1) https://core.telegram.org/api/links#premium-giftcode-links
	Slug string
	// Three-letter ISO 4217 currency¹ code
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	//
	// Use SetCurrency and GetCurrency helpers.
	Currency string
	// Total price 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
	//
	// Use SetAmount and GetAmount helpers.
	Amount int64
	// If set, the gift was made using the specified cryptocurrency.
	//
	// Use SetCryptoCurrency and GetCryptoCurrency helpers.
	CryptoCurrency string
	// If crypto_currency is set, contains the paid amount, in the smallest units of the
	// cryptocurrency.
	//
	// Use SetCryptoAmount and GetCryptoAmount helpers.
	CryptoAmount int64
	// Message attached with the gift
	//
	// Use SetMessage and GetMessage helpers.
	Message TextWithEntities
}

// MessageActionGiftCodeTypeID is TL type id of MessageActionGiftCode.
const MessageActionGiftCodeTypeID = 0x31c48347

// construct implements constructor of MessageActionClass.
func ( MessageActionGiftCode) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGiftCode{}
)

func ( *MessageActionGiftCode) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ViaGiveaway == false) {
		return false
	}
	if !(.Unclaimed == false) {
		return false
	}
	if !(.BoostPeer == nil) {
		return false
	}
	if !(.Days == 0) {
		return false
	}
	if !(.Slug == "") {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.Amount == 0) {
		return false
	}
	if !(.CryptoCurrency == "") {
		return false
	}
	if !(.CryptoAmount == 0) {
		return false
	}
	if !(.Message.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGiftCode from given interface.
func ( *MessageActionGiftCode) ( interface {
	() ( bool)
	() ( bool)
	() ( PeerClass,  bool)
	() ( int)
	() ( string)
	() ( string,  bool)
	() ( int64,  bool)
	() ( string,  bool)
	() ( int64,  bool)
	() ( TextWithEntities,  bool)
}) {
	.ViaGiveaway = .()
	.Unclaimed = .()
	if ,  := .();  {
		.BoostPeer = 
	}

	.Days = .()
	.Slug = .()
	if ,  := .();  {
		.Currency = 
	}

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

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

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGiftCode) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGiftCode",
		ID:   MessageActionGiftCodeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ViaGiveaway",
			SchemaName: "via_giveaway",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Unclaimed",
			SchemaName: "unclaimed",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "BoostPeer",
			SchemaName: "boost_peer",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Days",
			SchemaName: "days",
		},
		{
			Name:       "Slug",
			SchemaName: "slug",
		},
		{
			Name:       "Currency",
			SchemaName: "currency",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Amount",
			SchemaName: "amount",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "CryptoCurrency",
			SchemaName: "crypto_currency",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "CryptoAmount",
			SchemaName: "crypto_amount",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Message",
			SchemaName: "message",
			Null:       !.Flags.Has(4),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionGiftCode) () {
	if !(.ViaGiveaway == false) {
		.Flags.Set(0)
	}
	if !(.Unclaimed == false) {
		.Flags.Set(5)
	}
	if !(.BoostPeer == nil) {
		.Flags.Set(1)
	}
	if !(.Currency == "") {
		.Flags.Set(2)
	}
	if !(.Amount == 0) {
		.Flags.Set(2)
	}
	if !(.CryptoCurrency == "") {
		.Flags.Set(3)
	}
	if !(.CryptoAmount == 0) {
		.Flags.Set(3)
	}
	if !(.Message.Zero()) {
		.Flags.Set(4)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionGiftCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftCode#31c48347 as nil")
	}
	.PutID(MessageActionGiftCodeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGiftCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftCode#31c48347 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGiftCode#31c48347: field flags: %w", )
	}
	if .Flags.Has(1) {
		if .BoostPeer == nil {
			return fmt.Errorf("unable to encode messageActionGiftCode#31c48347: field boost_peer is nil")
		}
		if  := .BoostPeer.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionGiftCode#31c48347: field boost_peer: %w", )
		}
	}
	.PutInt(.Days)
	.PutString(.Slug)
	if .Flags.Has(2) {
		.PutString(.Currency)
	}
	if .Flags.Has(2) {
		.PutLong(.Amount)
	}
	if .Flags.Has(3) {
		.PutString(.CryptoCurrency)
	}
	if .Flags.Has(3) {
		.PutLong(.CryptoAmount)
	}
	if .Flags.Has(4) {
		if  := .Message.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionGiftCode#31c48347: field message: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiftCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiftCode#31c48347 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field flags: %w", )
		}
	}
	.ViaGiveaway = .Flags.Has(0)
	.Unclaimed = .Flags.Has(5)
	if .Flags.Has(1) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field boost_peer: %w", )
		}
		.BoostPeer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field days: %w", )
		}
		.Days = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field slug: %w", )
		}
		.Slug = 
	}
	if .Flags.Has(2) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field currency: %w", )
		}
		.Currency = 
	}
	if .Flags.Has(2) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field amount: %w", )
		}
		.Amount = 
	}
	if .Flags.Has(3) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field crypto_currency: %w", )
		}
		.CryptoCurrency = 
	}
	if .Flags.Has(3) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field crypto_amount: %w", )
		}
		.CryptoAmount = 
	}
	if .Flags.Has(4) {
		if  := .Message.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#31c48347: field message: %w", )
		}
	}
	return nil
}

// SetViaGiveaway sets value of ViaGiveaway conditional field.
func ( *MessageActionGiftCode) ( bool) {
	if  {
		.Flags.Set(0)
		.ViaGiveaway = true
	} else {
		.Flags.Unset(0)
		.ViaGiveaway = false
	}
}

// GetViaGiveaway returns value of ViaGiveaway conditional field.
func ( *MessageActionGiftCode) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetUnclaimed sets value of Unclaimed conditional field.
func ( *MessageActionGiftCode) ( bool) {
	if  {
		.Flags.Set(5)
		.Unclaimed = true
	} else {
		.Flags.Unset(5)
		.Unclaimed = false
	}
}

// GetUnclaimed returns value of Unclaimed conditional field.
func ( *MessageActionGiftCode) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(5)
}

// SetBoostPeer sets value of BoostPeer conditional field.
func ( *MessageActionGiftCode) ( PeerClass) {
	.Flags.Set(1)
	.BoostPeer = 
}

// GetBoostPeer returns value of BoostPeer conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftCode) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .BoostPeer, true
}

// GetDays returns value of Days field.
func ( *MessageActionGiftCode) () ( int) {
	if  == nil {
		return
	}
	return .Days
}

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

// SetCurrency sets value of Currency conditional field.
func ( *MessageActionGiftCode) ( string) {
	.Flags.Set(2)
	.Currency = 
}

// GetCurrency returns value of Currency conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftCode) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .Currency, true
}

// SetAmount sets value of Amount conditional field.
func ( *MessageActionGiftCode) ( int64) {
	.Flags.Set(2)
	.Amount = 
}

// GetAmount returns value of Amount conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftCode) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .Amount, true
}

// SetCryptoCurrency sets value of CryptoCurrency conditional field.
func ( *MessageActionGiftCode) ( string) {
	.Flags.Set(3)
	.CryptoCurrency = 
}

// GetCryptoCurrency returns value of CryptoCurrency conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftCode) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .CryptoCurrency, true
}

// SetCryptoAmount sets value of CryptoAmount conditional field.
func ( *MessageActionGiftCode) ( int64) {
	.Flags.Set(3)
	.CryptoAmount = 
}

// GetCryptoAmount returns value of CryptoAmount conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftCode) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .CryptoAmount, true
}

// SetMessage sets value of Message conditional field.
func ( *MessageActionGiftCode) ( TextWithEntities) {
	.Flags.Set(4)
	.Message = 
}

// GetMessage returns value of Message conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftCode) () ( TextWithEntities,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .Message, true
}

// MessageActionGiveawayLaunch represents TL type `messageActionGiveawayLaunch#a80f51e4`.
// A giveaway¹ was started.
//
// Links:
//  1. https://core.telegram.org/api/giveaways
//
// See https://core.telegram.org/constructor/messageActionGiveawayLaunch for reference.
type MessageActionGiveawayLaunch struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// For Telegram Star giveaways¹, the total number of Telegram Stars being given away.
	//
	// Links:
	//  1) https://core.telegram.org/api/stars#star-giveaways
	//
	// Use SetStars and GetStars helpers.
	Stars int64
}

// MessageActionGiveawayLaunchTypeID is TL type id of MessageActionGiveawayLaunch.
const MessageActionGiveawayLaunchTypeID = 0xa80f51e4

// construct implements constructor of MessageActionClass.
func ( MessageActionGiveawayLaunch) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGiveawayLaunch{}
)

func ( *MessageActionGiveawayLaunch) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Stars == 0) {
		return false
	}

	return true
}

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGiveawayLaunch) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGiveawayLaunch",
		ID:   MessageActionGiveawayLaunchTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Stars",
			SchemaName: "stars",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionGiveawayLaunch) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiveawayLaunch#a80f51e4 as nil")
	}
	.PutID(MessageActionGiveawayLaunchTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiveawayLaunch) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiveawayLaunch#a80f51e4 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiveawayLaunch#a80f51e4: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiveawayLaunch#a80f51e4: field stars: %w", )
		}
		.Stars = 
	}
	return nil
}

// SetStars sets value of Stars conditional field.
func ( *MessageActionGiveawayLaunch) ( int64) {
	.Flags.Set(0)
	.Stars = 
}

// GetStars returns value of Stars conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiveawayLaunch) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Stars, true
}

// MessageActionGiveawayResults represents TL type `messageActionGiveawayResults#87e2f155`.
// A giveaway¹ has ended.
//
// Links:
//  1. https://core.telegram.org/api/giveaways
//
// See https://core.telegram.org/constructor/messageActionGiveawayResults for reference.
type MessageActionGiveawayResults struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, this is a Telegram Star giveaway¹
	//
	// Links:
	//  1) https://core.telegram.org/api/stars#star-giveaways
	Stars bool
	// Number of winners in the giveaway
	WinnersCount int
	// Number of undistributed prizes
	UnclaimedCount int
}

// MessageActionGiveawayResultsTypeID is TL type id of MessageActionGiveawayResults.
const MessageActionGiveawayResultsTypeID = 0x87e2f155

// construct implements constructor of MessageActionClass.
func ( MessageActionGiveawayResults) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGiveawayResults{}
)

func ( *MessageActionGiveawayResults) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Stars == false) {
		return false
	}
	if !(.WinnersCount == 0) {
		return false
	}
	if !(.UnclaimedCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGiveawayResults from given interface.
func ( *MessageActionGiveawayResults) ( interface {
	() ( bool)
	() ( int)
	() ( int)
}) {
	.Stars = .()
	.WinnersCount = .()
	.UnclaimedCount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGiveawayResults) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGiveawayResults",
		ID:   MessageActionGiveawayResultsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Stars",
			SchemaName: "stars",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "WinnersCount",
			SchemaName: "winners_count",
		},
		{
			Name:       "UnclaimedCount",
			SchemaName: "unclaimed_count",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionGiveawayResults) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiveawayResults#87e2f155 as nil")
	}
	.PutID(MessageActionGiveawayResultsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGiveawayResults) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiveawayResults#87e2f155 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGiveawayResults#87e2f155: field flags: %w", )
	}
	.PutInt(.WinnersCount)
	.PutInt(.UnclaimedCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiveawayResults) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiveawayResults#87e2f155 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiveawayResults#87e2f155: field flags: %w", )
		}
	}
	.Stars = .Flags.Has(0)
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiveawayResults#87e2f155: field winners_count: %w", )
		}
		.WinnersCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiveawayResults#87e2f155: field unclaimed_count: %w", )
		}
		.UnclaimedCount = 
	}
	return nil
}

// SetStars sets value of Stars conditional field.
func ( *MessageActionGiveawayResults) ( bool) {
	if  {
		.Flags.Set(0)
		.Stars = true
	} else {
		.Flags.Unset(0)
		.Stars = false
	}
}

// GetStars returns value of Stars conditional field.
func ( *MessageActionGiveawayResults) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetWinnersCount returns value of WinnersCount field.
func ( *MessageActionGiveawayResults) () ( int) {
	if  == nil {
		return
	}
	return .WinnersCount
}

// GetUnclaimedCount returns value of UnclaimedCount field.
func ( *MessageActionGiveawayResults) () ( int) {
	if  == nil {
		return
	}
	return .UnclaimedCount
}

// MessageActionBoostApply represents TL type `messageActionBoostApply#cc02aa6d`.
// Some boosts »¹ were applied to the channel or supergroup.
//
// Links:
//  1. https://core.telegram.org/api/boost
//
// See https://core.telegram.org/constructor/messageActionBoostApply for reference.
type MessageActionBoostApply struct {
	// Number of applied boosts¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/boost
	Boosts int
}

// MessageActionBoostApplyTypeID is TL type id of MessageActionBoostApply.
const MessageActionBoostApplyTypeID = 0xcc02aa6d

// construct implements constructor of MessageActionClass.
func ( MessageActionBoostApply) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionBoostApply{}
)

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

	return true
}

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

// FillFrom fills MessageActionBoostApply from given interface.
func ( *MessageActionBoostApply) ( interface {
	() ( int)
}) {
	.Boosts = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionBoostApply) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionBoostApply",
		ID:   MessageActionBoostApplyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Boosts",
			SchemaName: "boosts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionBoostApply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionBoostApply#cc02aa6d as nil")
	}
	.PutID(MessageActionBoostApplyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionBoostApply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionBoostApply#cc02aa6d as nil")
	}
	.PutInt(.Boosts)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionBoostApply) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionBoostApply#cc02aa6d to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionBoostApply#cc02aa6d: field boosts: %w", )
		}
		.Boosts = 
	}
	return nil
}

// GetBoosts returns value of Boosts field.
func ( *MessageActionBoostApply) () ( int) {
	if  == nil {
		return
	}
	return .Boosts
}

// MessageActionRequestedPeerSentMe represents TL type `messageActionRequestedPeerSentMe#93b31848`.
// Contains info about one or more peers that the a user shared with the me (the bot)
// after clicking on a keyboardButtonRequestPeer¹ button (service message received by
// the bot).
//
// Links:
//  1. https://core.telegram.org/constructor/keyboardButtonRequestPeer
//
// See https://core.telegram.org/constructor/messageActionRequestedPeerSentMe for reference.
type MessageActionRequestedPeerSentMe struct {
	// button_id contained in the keyboardButtonRequestPeer¹
	//
	// Links:
	//  1) https://core.telegram.org/constructor/keyboardButtonRequestPeer
	ButtonID int
	// Info about the shared peers.
	Peers []RequestedPeerClass
}

// MessageActionRequestedPeerSentMeTypeID is TL type id of MessageActionRequestedPeerSentMe.
const MessageActionRequestedPeerSentMeTypeID = 0x93b31848

// construct implements constructor of MessageActionClass.
func ( MessageActionRequestedPeerSentMe) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionRequestedPeerSentMe{}
)

func ( *MessageActionRequestedPeerSentMe) () bool {
	if  == nil {
		return true
	}
	if !(.ButtonID == 0) {
		return false
	}
	if !(.Peers == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionRequestedPeerSentMe from given interface.
func ( *MessageActionRequestedPeerSentMe) ( interface {
	() ( int)
	() ( []RequestedPeerClass)
}) {
	.ButtonID = .()
	.Peers = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionRequestedPeerSentMe) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionRequestedPeerSentMe",
		ID:   MessageActionRequestedPeerSentMeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ButtonID",
			SchemaName: "button_id",
		},
		{
			Name:       "Peers",
			SchemaName: "peers",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionRequestedPeerSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionRequestedPeerSentMe#93b31848 as nil")
	}
	.PutID(MessageActionRequestedPeerSentMeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionRequestedPeerSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionRequestedPeerSentMe#93b31848 as nil")
	}
	.PutInt(.ButtonID)
	.PutVectorHeader(len(.Peers))
	for ,  := range .Peers {
		if  == nil {
			return fmt.Errorf("unable to encode messageActionRequestedPeerSentMe#93b31848: field peers element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionRequestedPeerSentMe#93b31848: field peers element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionRequestedPeerSentMe) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionRequestedPeerSentMe#93b31848 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionRequestedPeerSentMe#93b31848: field button_id: %w", )
		}
		.ButtonID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionRequestedPeerSentMe#93b31848: field peers: %w", )
		}

		if  > 0 {
			.Peers = make([]RequestedPeerClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeRequestedPeer()
			if  != nil {
				return fmt.Errorf("unable to decode messageActionRequestedPeerSentMe#93b31848: field peers: %w", )
			}
			.Peers = append(.Peers, )
		}
	}
	return nil
}

// GetButtonID returns value of ButtonID field.
func ( *MessageActionRequestedPeerSentMe) () ( int) {
	if  == nil {
		return
	}
	return .ButtonID
}

// GetPeers returns value of Peers field.
func ( *MessageActionRequestedPeerSentMe) () ( []RequestedPeerClass) {
	if  == nil {
		return
	}
	return .Peers
}

// MapPeers returns field Peers wrapped in RequestedPeerClassArray helper.
func ( *MessageActionRequestedPeerSentMe) () ( RequestedPeerClassArray) {
	return RequestedPeerClassArray(.Peers)
}

// MessageActionPaymentRefunded represents TL type `messageActionPaymentRefunded#41b3e202`.
// Describes a payment refund (service message received by both users and bots).
//
// See https://core.telegram.org/constructor/messageActionPaymentRefunded for reference.
type MessageActionPaymentRefunded struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Identifier of the peer that returned the funds.
	Peer PeerClass
	// Currency, XTR for Telegram Stars.
	Currency string
	// Total price 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
	// Bot specified invoice payload (only received by bots).
	//
	// Use SetPayload and GetPayload helpers.
	Payload []byte
	// Provider payment identifier
	Charge PaymentCharge
}

// MessageActionPaymentRefundedTypeID is TL type id of MessageActionPaymentRefunded.
const MessageActionPaymentRefundedTypeID = 0x41b3e202

// construct implements constructor of MessageActionClass.
func ( MessageActionPaymentRefunded) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPaymentRefunded{}
)

func ( *MessageActionPaymentRefunded) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.TotalAmount == 0) {
		return false
	}
	if !(.Payload == nil) {
		return false
	}
	if !(.Charge.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPaymentRefunded from given interface.
func ( *MessageActionPaymentRefunded) ( interface {
	() ( PeerClass)
	() ( string)
	() ( int64)
	() ( []byte,  bool)
	() ( PaymentCharge)
}) {
	.Peer = .()
	.Currency = .()
	.TotalAmount = .()
	if ,  := .();  {
		.Payload = 
	}

	.Charge = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPaymentRefunded) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPaymentRefunded",
		ID:   MessageActionPaymentRefundedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Currency",
			SchemaName: "currency",
		},
		{
			Name:       "TotalAmount",
			SchemaName: "total_amount",
		},
		{
			Name:       "Payload",
			SchemaName: "payload",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Charge",
			SchemaName: "charge",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionPaymentRefunded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaymentRefunded#41b3e202 as nil")
	}
	.PutID(MessageActionPaymentRefundedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPaymentRefunded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaymentRefunded#41b3e202 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPaymentRefunded#41b3e202: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode messageActionPaymentRefunded#41b3e202: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPaymentRefunded#41b3e202: field peer: %w", )
	}
	.PutString(.Currency)
	.PutLong(.TotalAmount)
	if .Flags.Has(0) {
		.PutBytes(.Payload)
	}
	if  := .Charge.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPaymentRefunded#41b3e202: field charge: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPaymentRefunded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPaymentRefunded#41b3e202 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentRefunded#41b3e202: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentRefunded#41b3e202: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentRefunded#41b3e202: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentRefunded#41b3e202: field total_amount: %w", )
		}
		.TotalAmount = 
	}
	if .Flags.Has(0) {
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentRefunded#41b3e202: field payload: %w", )
		}
		.Payload = 
	}
	{
		if  := .Charge.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentRefunded#41b3e202: field charge: %w", )
		}
	}
	return nil
}

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

// GetCurrency returns value of Currency field.
func ( *MessageActionPaymentRefunded) () ( string) {
	if  == nil {
		return
	}
	return .Currency
}

// GetTotalAmount returns value of TotalAmount field.
func ( *MessageActionPaymentRefunded) () ( int64) {
	if  == nil {
		return
	}
	return .TotalAmount
}

// SetPayload sets value of Payload conditional field.
func ( *MessageActionPaymentRefunded) ( []byte) {
	.Flags.Set(0)
	.Payload = 
}

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

// GetCharge returns value of Charge field.
func ( *MessageActionPaymentRefunded) () ( PaymentCharge) {
	if  == nil {
		return
	}
	return .Charge
}

// MessageActionGiftStars represents TL type `messageActionGiftStars#45d5b021`.
// You gifted or were gifted some Telegram Stars¹.
// This service message should be displayed below the appropriate sticker from the
// inputStickerSetPremiumGifts »¹ stickerset »²:
//
// Links:
//  1. https://core.telegram.org/api/stars
//  2. https://core.telegram.org/constructor/inputStickerSetPremiumGifts
//  3. https://core.telegram.org/api/stickers#stickersets
//
// See https://core.telegram.org/constructor/messageActionGiftStars for reference.
type MessageActionGiftStars struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Three-letter ISO 4217 currency¹ code
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	Currency string
	// Price of the gift 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
	Amount int64
	// Amount of gifted stars
	Stars int64
	// If the gift was bought using a cryptocurrency, the cryptocurrency name.
	//
	// Use SetCryptoCurrency and GetCryptoCurrency helpers.
	CryptoCurrency string
	// If the gift was bought using a cryptocurrency, price of the gift in the smallest units
	// of a cryptocurrency.
	//
	// Use SetCryptoAmount and GetCryptoAmount helpers.
	CryptoAmount int64
	// Identifier of the transaction, only visible to the receiver of the gift.
	//
	// Use SetTransactionID and GetTransactionID helpers.
	TransactionID string
}

// MessageActionGiftStarsTypeID is TL type id of MessageActionGiftStars.
const MessageActionGiftStarsTypeID = 0x45d5b021

// construct implements constructor of MessageActionClass.
func ( MessageActionGiftStars) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGiftStars{}
)

func ( *MessageActionGiftStars) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.Amount == 0) {
		return false
	}
	if !(.Stars == 0) {
		return false
	}
	if !(.CryptoCurrency == "") {
		return false
	}
	if !(.CryptoAmount == 0) {
		return false
	}
	if !(.TransactionID == "") {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGiftStars from given interface.
func ( *MessageActionGiftStars) ( interface {
	() ( string)
	() ( int64)
	() ( int64)
	() ( string,  bool)
	() ( int64,  bool)
	() ( string,  bool)
}) {
	.Currency = .()
	.Amount = .()
	.Stars = .()
	if ,  := .();  {
		.CryptoCurrency = 
	}

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGiftStars) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGiftStars",
		ID:   MessageActionGiftStarsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Currency",
			SchemaName: "currency",
		},
		{
			Name:       "Amount",
			SchemaName: "amount",
		},
		{
			Name:       "Stars",
			SchemaName: "stars",
		},
		{
			Name:       "CryptoCurrency",
			SchemaName: "crypto_currency",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "CryptoAmount",
			SchemaName: "crypto_amount",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "TransactionID",
			SchemaName: "transaction_id",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionGiftStars) () {
	if !(.CryptoCurrency == "") {
		.Flags.Set(0)
	}
	if !(.CryptoAmount == 0) {
		.Flags.Set(0)
	}
	if !(.TransactionID == "") {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionGiftStars) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftStars#45d5b021 as nil")
	}
	.PutID(MessageActionGiftStarsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGiftStars) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftStars#45d5b021 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGiftStars#45d5b021: field flags: %w", )
	}
	.PutString(.Currency)
	.PutLong(.Amount)
	.PutLong(.Stars)
	if .Flags.Has(0) {
		.PutString(.CryptoCurrency)
	}
	if .Flags.Has(0) {
		.PutLong(.CryptoAmount)
	}
	if .Flags.Has(1) {
		.PutString(.TransactionID)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiftStars) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiftStars#45d5b021 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiftStars#45d5b021: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftStars#45d5b021: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftStars#45d5b021: field amount: %w", )
		}
		.Amount = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftStars#45d5b021: field stars: %w", )
		}
		.Stars = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftStars#45d5b021: field crypto_currency: %w", )
		}
		.CryptoCurrency = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftStars#45d5b021: field crypto_amount: %w", )
		}
		.CryptoAmount = 
	}
	if .Flags.Has(1) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftStars#45d5b021: field transaction_id: %w", )
		}
		.TransactionID = 
	}
	return nil
}

// GetCurrency returns value of Currency field.
func ( *MessageActionGiftStars) () ( string) {
	if  == nil {
		return
	}
	return .Currency
}

// GetAmount returns value of Amount field.
func ( *MessageActionGiftStars) () ( int64) {
	if  == nil {
		return
	}
	return .Amount
}

// GetStars returns value of Stars field.
func ( *MessageActionGiftStars) () ( int64) {
	if  == nil {
		return
	}
	return .Stars
}

// SetCryptoCurrency sets value of CryptoCurrency conditional field.
func ( *MessageActionGiftStars) ( string) {
	.Flags.Set(0)
	.CryptoCurrency = 
}

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

// SetCryptoAmount sets value of CryptoAmount conditional field.
func ( *MessageActionGiftStars) ( int64) {
	.Flags.Set(0)
	.CryptoAmount = 
}

// GetCryptoAmount returns value of CryptoAmount conditional field and
// boolean which is true if field was set.
func ( *MessageActionGiftStars) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .CryptoAmount, true
}

// SetTransactionID sets value of TransactionID conditional field.
func ( *MessageActionGiftStars) ( string) {
	.Flags.Set(1)
	.TransactionID = 
}

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

// MessageActionPrizeStars represents TL type `messageActionPrizeStars#b00c47a2`.
// You won some Telegram Stars¹ in a Telegram Star giveaway »².
// This service message should be displayed below the appropriate sticker from the
// inputStickerSetPremiumGifts »¹ stickerset »²:
//
// Links:
//  1. https://core.telegram.org/api/stars
//  2. https://core.telegram.org/api/giveaways#star-giveaways
//  3. https://core.telegram.org/constructor/inputStickerSetPremiumGifts
//  4. https://core.telegram.org/api/stickers#stickersets
//
// See https://core.telegram.org/constructor/messageActionPrizeStars for reference.
type MessageActionPrizeStars struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, this indicates the reverse transaction that refunds the remaining stars to the
	// creator of a giveaway if, when the giveaway ends, the number of members in the channel
	// is smaller than the number of winners in the giveaway.
	Unclaimed bool
	// The number of Telegram Stars you won
	Stars int64
	// ID of the telegram star transaction.
	TransactionID string
	// Identifier of the peer that was automatically boosted by the winners of the giveaway.
	BoostPeer PeerClass
	// ID of the message containing the messageMediaGiveaway¹
	//
	// Links:
	//  1) https://core.telegram.org/constructor/messageMediaGiveaway
	GiveawayMsgID int
}

// MessageActionPrizeStarsTypeID is TL type id of MessageActionPrizeStars.
const MessageActionPrizeStarsTypeID = 0xb00c47a2

// construct implements constructor of MessageActionClass.
func ( MessageActionPrizeStars) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPrizeStars{}
)

func ( *MessageActionPrizeStars) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Unclaimed == false) {
		return false
	}
	if !(.Stars == 0) {
		return false
	}
	if !(.TransactionID == "") {
		return false
	}
	if !(.BoostPeer == nil) {
		return false
	}
	if !(.GiveawayMsgID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPrizeStars from given interface.
func ( *MessageActionPrizeStars) ( interface {
	() ( bool)
	() ( int64)
	() ( string)
	() ( PeerClass)
	() ( int)
}) {
	.Unclaimed = .()
	.Stars = .()
	.TransactionID = .()
	.BoostPeer = .()
	.GiveawayMsgID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPrizeStars) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPrizeStars",
		ID:   MessageActionPrizeStarsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Unclaimed",
			SchemaName: "unclaimed",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Stars",
			SchemaName: "stars",
		},
		{
			Name:       "TransactionID",
			SchemaName: "transaction_id",
		},
		{
			Name:       "BoostPeer",
			SchemaName: "boost_peer",
		},
		{
			Name:       "GiveawayMsgID",
			SchemaName: "giveaway_msg_id",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionPrizeStars) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPrizeStars#b00c47a2 as nil")
	}
	.PutID(MessageActionPrizeStarsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPrizeStars) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPrizeStars#b00c47a2 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPrizeStars#b00c47a2: field flags: %w", )
	}
	.PutLong(.Stars)
	.PutString(.TransactionID)
	if .BoostPeer == nil {
		return fmt.Errorf("unable to encode messageActionPrizeStars#b00c47a2: field boost_peer is nil")
	}
	if  := .BoostPeer.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPrizeStars#b00c47a2: field boost_peer: %w", )
	}
	.PutInt(.GiveawayMsgID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPrizeStars) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPrizeStars#b00c47a2 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPrizeStars#b00c47a2: field flags: %w", )
		}
	}
	.Unclaimed = .Flags.Has(0)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPrizeStars#b00c47a2: field stars: %w", )
		}
		.Stars = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPrizeStars#b00c47a2: field transaction_id: %w", )
		}
		.TransactionID = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPrizeStars#b00c47a2: field boost_peer: %w", )
		}
		.BoostPeer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPrizeStars#b00c47a2: field giveaway_msg_id: %w", )
		}
		.GiveawayMsgID = 
	}
	return nil
}

// SetUnclaimed sets value of Unclaimed conditional field.
func ( *MessageActionPrizeStars) ( bool) {
	if  {
		.Flags.Set(0)
		.Unclaimed = true
	} else {
		.Flags.Unset(0)
		.Unclaimed = false
	}
}

// GetUnclaimed returns value of Unclaimed conditional field.
func ( *MessageActionPrizeStars) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetStars returns value of Stars field.
func ( *MessageActionPrizeStars) () ( int64) {
	if  == nil {
		return
	}
	return .Stars
}

// GetTransactionID returns value of TransactionID field.
func ( *MessageActionPrizeStars) () ( string) {
	if  == nil {
		return
	}
	return .TransactionID
}

// GetBoostPeer returns value of BoostPeer field.
func ( *MessageActionPrizeStars) () ( PeerClass) {
	if  == nil {
		return
	}
	return .BoostPeer
}

// GetGiveawayMsgID returns value of GiveawayMsgID field.
func ( *MessageActionPrizeStars) () ( int) {
	if  == nil {
		return
	}
	return .GiveawayMsgID
}

// MessageActionStarGift represents TL type `messageActionStarGift#ea2c31d3`.
// You received a gift, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/gifts
//
// See https://core.telegram.org/constructor/messageActionStarGift for reference.
type MessageActionStarGift struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, the name of the sender of the gift will be hidden if the destination user
	// decides to display the gift on their profile
	NameHidden bool
	// Whether this gift was added to the destination user's profile (may be toggled using
	// payments.saveStarGift¹ and fetched using payments.getSavedStarGifts²)
	//
	// Links:
	//  1) https://core.telegram.org/method/payments.saveStarGift
	//  2) https://core.telegram.org/method/payments.getSavedStarGifts
	Saved bool
	// Whether this gift was converted to Telegram Stars¹ and cannot be displayed on the
	// profile anymore.
	//
	// Links:
	//  1) https://core.telegram.org/api/stars
	Converted bool
	// This gift was upgraded to a collectible gift »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#collectible-gifts
	Upgraded bool
	// This gift is not available anymore because a request to refund the payment related to
	// this gift was made, and the money was returned.
	Refunded bool
	// If set, this gift can be upgraded to a collectible gift¹; can only be set for the
	// receiver of a gift.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#upgrade-a-gift-to-a-collectible-gift
	CanUpgrade bool
	// The sender has already pre-paid for the upgrade of this gift to a collectible gift.
	PrepaidUpgrade bool
	// This service message is the notification of a separate pre-payment for the upgrade of
	// a gift we own¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade
	UpgradeSeparate bool
	// If set, this gift was acquired in a collectible gifts auction »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/auctions
	AuctionAcquired bool
	// Info about the gift
	Gift StarGiftClass
	// Additional message from the sender of the gift
	//
	// Use SetMessage and GetMessage helpers.
	Message TextWithEntities
	// The receiver of this gift may convert it to this many Telegram Stars, instead of
	// displaying it on their profile page.convert_stars will be equal to stars only if the
	// gift was bought using recently bought Telegram Stars, otherwise it will be less than
	// stars.
	//
	// Use SetConvertStars and GetConvertStars helpers.
	ConvertStars int64
	// If set, this gift was upgraded to a collectible gift¹, and the corresponding
	// messageActionStarGiftUnique² is available at the specified message ID.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#upgrade-a-gift-to-a-collectible-gift
	//  2) https://core.telegram.org/constructor/messageActionStarGiftUnique
	//
	// Use SetUpgradeMsgID and GetUpgradeMsgID helpers.
	UpgradeMsgID int
	// The number of Telegram Stars the user can pay to convert the gift into a collectible
	// gift »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#collectible-gifts
	//
	// Use SetUpgradeStars and GetUpgradeStars helpers.
	UpgradeStars int64
	// Sender of the gift (unset for anonymous gifts).
	//
	// Use SetFromID and GetFromID helpers.
	FromID PeerClass
	// Receiver of the gift.
	//
	// Use SetPeer and GetPeer helpers.
	Peer PeerClass
	// For channel gifts, ID to use in inputSavedStarGiftChat¹ constructors.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/inputSavedStarGiftChat
	//
	// Use SetSavedID and GetSavedID helpers.
	SavedID int64
	// Hash to prepay for a gift upgrade separately »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade
	//
	// Use SetPrepaidUpgradeHash and GetPrepaidUpgradeHash helpers.
	PrepaidUpgradeHash string
	// For separate upgrades¹, the identifier of the message with the gift whose upgrade was
	// prepaid (only valid for the receiver of the service message).
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade
	//
	// Use SetGiftMsgID and GetGiftMsgID helpers.
	GiftMsgID int
	// ToID field of MessageActionStarGift.
	//
	// Use SetToID and GetToID helpers.
	ToID PeerClass
	// GiftNum field of MessageActionStarGift.
	//
	// Use SetGiftNum and GetGiftNum helpers.
	GiftNum int
}

// MessageActionStarGiftTypeID is TL type id of MessageActionStarGift.
const MessageActionStarGiftTypeID = 0xea2c31d3

// construct implements constructor of MessageActionClass.
func ( MessageActionStarGift) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionStarGift{}
)

func ( *MessageActionStarGift) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.NameHidden == false) {
		return false
	}
	if !(.Saved == false) {
		return false
	}
	if !(.Converted == false) {
		return false
	}
	if !(.Upgraded == false) {
		return false
	}
	if !(.Refunded == false) {
		return false
	}
	if !(.CanUpgrade == false) {
		return false
	}
	if !(.PrepaidUpgrade == false) {
		return false
	}
	if !(.UpgradeSeparate == false) {
		return false
	}
	if !(.AuctionAcquired == false) {
		return false
	}
	if !(.Gift == nil) {
		return false
	}
	if !(.Message.Zero()) {
		return false
	}
	if !(.ConvertStars == 0) {
		return false
	}
	if !(.UpgradeMsgID == 0) {
		return false
	}
	if !(.UpgradeStars == 0) {
		return false
	}
	if !(.FromID == nil) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.SavedID == 0) {
		return false
	}
	if !(.PrepaidUpgradeHash == "") {
		return false
	}
	if !(.GiftMsgID == 0) {
		return false
	}
	if !(.ToID == nil) {
		return false
	}
	if !(.GiftNum == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionStarGift from given interface.
func ( *MessageActionStarGift) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( StarGiftClass)
	() ( TextWithEntities,  bool)
	() ( int64,  bool)
	() ( int,  bool)
	() ( int64,  bool)
	() ( PeerClass,  bool)
	() ( PeerClass,  bool)
	() ( int64,  bool)
	() ( string,  bool)
	() ( int,  bool)
	() ( PeerClass,  bool)
	() ( int,  bool)
}) {
	.NameHidden = .()
	.Saved = .()
	.Converted = .()
	.Upgraded = .()
	.Refunded = .()
	.CanUpgrade = .()
	.PrepaidUpgrade = .()
	.UpgradeSeparate = .()
	.AuctionAcquired = .()
	.Gift = .()
	if ,  := .();  {
		.Message = 
	}

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

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

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

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

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

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

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

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

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionStarGift) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionStarGift",
		ID:   MessageActionStarGiftTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "NameHidden",
			SchemaName: "name_hidden",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Saved",
			SchemaName: "saved",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Converted",
			SchemaName: "converted",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Upgraded",
			SchemaName: "upgraded",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "Refunded",
			SchemaName: "refunded",
			Null:       !.Flags.Has(9),
		},
		{
			Name:       "CanUpgrade",
			SchemaName: "can_upgrade",
			Null:       !.Flags.Has(10),
		},
		{
			Name:       "PrepaidUpgrade",
			SchemaName: "prepaid_upgrade",
			Null:       !.Flags.Has(13),
		},
		{
			Name:       "UpgradeSeparate",
			SchemaName: "upgrade_separate",
			Null:       !.Flags.Has(16),
		},
		{
			Name:       "AuctionAcquired",
			SchemaName: "auction_acquired",
			Null:       !.Flags.Has(17),
		},
		{
			Name:       "Gift",
			SchemaName: "gift",
		},
		{
			Name:       "Message",
			SchemaName: "message",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "ConvertStars",
			SchemaName: "convert_stars",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "UpgradeMsgID",
			SchemaName: "upgrade_msg_id",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "UpgradeStars",
			SchemaName: "upgrade_stars",
			Null:       !.Flags.Has(8),
		},
		{
			Name:       "FromID",
			SchemaName: "from_id",
			Null:       !.Flags.Has(11),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
			Null:       !.Flags.Has(12),
		},
		{
			Name:       "SavedID",
			SchemaName: "saved_id",
			Null:       !.Flags.Has(12),
		},
		{
			Name:       "PrepaidUpgradeHash",
			SchemaName: "prepaid_upgrade_hash",
			Null:       !.Flags.Has(14),
		},
		{
			Name:       "GiftMsgID",
			SchemaName: "gift_msg_id",
			Null:       !.Flags.Has(15),
		},
		{
			Name:       "ToID",
			SchemaName: "to_id",
			Null:       !.Flags.Has(18),
		},
		{
			Name:       "GiftNum",
			SchemaName: "gift_num",
			Null:       !.Flags.Has(19),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionStarGift) () {
	if !(.NameHidden == false) {
		.Flags.Set(0)
	}
	if !(.Saved == false) {
		.Flags.Set(2)
	}
	if !(.Converted == false) {
		.Flags.Set(3)
	}
	if !(.Upgraded == false) {
		.Flags.Set(5)
	}
	if !(.Refunded == false) {
		.Flags.Set(9)
	}
	if !(.CanUpgrade == false) {
		.Flags.Set(10)
	}
	if !(.PrepaidUpgrade == false) {
		.Flags.Set(13)
	}
	if !(.UpgradeSeparate == false) {
		.Flags.Set(16)
	}
	if !(.AuctionAcquired == false) {
		.Flags.Set(17)
	}
	if !(.Message.Zero()) {
		.Flags.Set(1)
	}
	if !(.ConvertStars == 0) {
		.Flags.Set(4)
	}
	if !(.UpgradeMsgID == 0) {
		.Flags.Set(5)
	}
	if !(.UpgradeStars == 0) {
		.Flags.Set(8)
	}
	if !(.FromID == nil) {
		.Flags.Set(11)
	}
	if !(.Peer == nil) {
		.Flags.Set(12)
	}
	if !(.SavedID == 0) {
		.Flags.Set(12)
	}
	if !(.PrepaidUpgradeHash == "") {
		.Flags.Set(14)
	}
	if !(.GiftMsgID == 0) {
		.Flags.Set(15)
	}
	if !(.ToID == nil) {
		.Flags.Set(18)
	}
	if !(.GiftNum == 0) {
		.Flags.Set(19)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionStarGift) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionStarGift#ea2c31d3 as nil")
	}
	.PutID(MessageActionStarGiftTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionStarGift) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionStarGift#ea2c31d3 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field flags: %w", )
	}
	if .Gift == nil {
		return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field gift is nil")
	}
	if  := .Gift.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field gift: %w", )
	}
	if .Flags.Has(1) {
		if  := .Message.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field message: %w", )
		}
	}
	if .Flags.Has(4) {
		.PutLong(.ConvertStars)
	}
	if .Flags.Has(5) {
		.PutInt(.UpgradeMsgID)
	}
	if .Flags.Has(8) {
		.PutLong(.UpgradeStars)
	}
	if .Flags.Has(11) {
		if .FromID == nil {
			return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field from_id is nil")
		}
		if  := .FromID.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field from_id: %w", )
		}
	}
	if .Flags.Has(12) {
		if .Peer == nil {
			return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field peer is nil")
		}
		if  := .Peer.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field peer: %w", )
		}
	}
	if .Flags.Has(12) {
		.PutLong(.SavedID)
	}
	if .Flags.Has(14) {
		.PutString(.PrepaidUpgradeHash)
	}
	if .Flags.Has(15) {
		.PutInt(.GiftMsgID)
	}
	if .Flags.Has(18) {
		if .ToID == nil {
			return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field to_id is nil")
		}
		if  := .ToID.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionStarGift#ea2c31d3: field to_id: %w", )
		}
	}
	if .Flags.Has(19) {
		.PutInt(.GiftNum)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionStarGift) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionStarGift#ea2c31d3 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field flags: %w", )
		}
	}
	.NameHidden = .Flags.Has(0)
	.Saved = .Flags.Has(2)
	.Converted = .Flags.Has(3)
	.Upgraded = .Flags.Has(5)
	.Refunded = .Flags.Has(9)
	.CanUpgrade = .Flags.Has(10)
	.PrepaidUpgrade = .Flags.Has(13)
	.UpgradeSeparate = .Flags.Has(16)
	.AuctionAcquired = .Flags.Has(17)
	{
		,  := DecodeStarGift()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field gift: %w", )
		}
		.Gift = 
	}
	if .Flags.Has(1) {
		if  := .Message.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field message: %w", )
		}
	}
	if .Flags.Has(4) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field convert_stars: %w", )
		}
		.ConvertStars = 
	}
	if .Flags.Has(5) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field upgrade_msg_id: %w", )
		}
		.UpgradeMsgID = 
	}
	if .Flags.Has(8) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field upgrade_stars: %w", )
		}
		.UpgradeStars = 
	}
	if .Flags.Has(11) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field from_id: %w", )
		}
		.FromID = 
	}
	if .Flags.Has(12) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(12) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field saved_id: %w", )
		}
		.SavedID = 
	}
	if .Flags.Has(14) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field prepaid_upgrade_hash: %w", )
		}
		.PrepaidUpgradeHash = 
	}
	if .Flags.Has(15) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field gift_msg_id: %w", )
		}
		.GiftMsgID = 
	}
	if .Flags.Has(18) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field to_id: %w", )
		}
		.ToID = 
	}
	if .Flags.Has(19) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGift#ea2c31d3: field gift_num: %w", )
		}
		.GiftNum = 
	}
	return nil
}

// SetNameHidden sets value of NameHidden conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(0)
		.NameHidden = true
	} else {
		.Flags.Unset(0)
		.NameHidden = false
	}
}

// GetNameHidden returns value of NameHidden conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetSaved sets value of Saved conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(2)
		.Saved = true
	} else {
		.Flags.Unset(2)
		.Saved = false
	}
}

// GetSaved returns value of Saved conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetConverted sets value of Converted conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(3)
		.Converted = true
	} else {
		.Flags.Unset(3)
		.Converted = false
	}
}

// GetConverted returns value of Converted conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// SetUpgraded sets value of Upgraded conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(5)
		.Upgraded = true
	} else {
		.Flags.Unset(5)
		.Upgraded = false
	}
}

// GetUpgraded returns value of Upgraded conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(5)
}

// SetRefunded sets value of Refunded conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(9)
		.Refunded = true
	} else {
		.Flags.Unset(9)
		.Refunded = false
	}
}

// GetRefunded returns value of Refunded conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(9)
}

// SetCanUpgrade sets value of CanUpgrade conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(10)
		.CanUpgrade = true
	} else {
		.Flags.Unset(10)
		.CanUpgrade = false
	}
}

// GetCanUpgrade returns value of CanUpgrade conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(10)
}

// SetPrepaidUpgrade sets value of PrepaidUpgrade conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(13)
		.PrepaidUpgrade = true
	} else {
		.Flags.Unset(13)
		.PrepaidUpgrade = false
	}
}

// GetPrepaidUpgrade returns value of PrepaidUpgrade conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(13)
}

// SetUpgradeSeparate sets value of UpgradeSeparate conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(16)
		.UpgradeSeparate = true
	} else {
		.Flags.Unset(16)
		.UpgradeSeparate = false
	}
}

// GetUpgradeSeparate returns value of UpgradeSeparate conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(16)
}

// SetAuctionAcquired sets value of AuctionAcquired conditional field.
func ( *MessageActionStarGift) ( bool) {
	if  {
		.Flags.Set(17)
		.AuctionAcquired = true
	} else {
		.Flags.Unset(17)
		.AuctionAcquired = false
	}
}

// GetAuctionAcquired returns value of AuctionAcquired conditional field.
func ( *MessageActionStarGift) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(17)
}

// GetGift returns value of Gift field.
func ( *MessageActionStarGift) () ( StarGiftClass) {
	if  == nil {
		return
	}
	return .Gift
}

// SetMessage sets value of Message conditional field.
func ( *MessageActionStarGift) ( TextWithEntities) {
	.Flags.Set(1)
	.Message = 
}

// GetMessage returns value of Message conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( TextWithEntities,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Message, true
}

// SetConvertStars sets value of ConvertStars conditional field.
func ( *MessageActionStarGift) ( int64) {
	.Flags.Set(4)
	.ConvertStars = 
}

// GetConvertStars returns value of ConvertStars conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .ConvertStars, true
}

// SetUpgradeMsgID sets value of UpgradeMsgID conditional field.
func ( *MessageActionStarGift) ( int) {
	.Flags.Set(5)
	.UpgradeMsgID = 
}

// GetUpgradeMsgID returns value of UpgradeMsgID conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(5) {
		return , false
	}
	return .UpgradeMsgID, true
}

// SetUpgradeStars sets value of UpgradeStars conditional field.
func ( *MessageActionStarGift) ( int64) {
	.Flags.Set(8)
	.UpgradeStars = 
}

// GetUpgradeStars returns value of UpgradeStars conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(8) {
		return , false
	}
	return .UpgradeStars, true
}

// SetFromID sets value of FromID conditional field.
func ( *MessageActionStarGift) ( PeerClass) {
	.Flags.Set(11)
	.FromID = 
}

// GetFromID returns value of FromID conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(11) {
		return , false
	}
	return .FromID, true
}

// SetPeer sets value of Peer conditional field.
func ( *MessageActionStarGift) ( PeerClass) {
	.Flags.Set(12)
	.Peer = 
}

// GetPeer returns value of Peer conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(12) {
		return , false
	}
	return .Peer, true
}

// SetSavedID sets value of SavedID conditional field.
func ( *MessageActionStarGift) ( int64) {
	.Flags.Set(12)
	.SavedID = 
}

// GetSavedID returns value of SavedID conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(12) {
		return , false
	}
	return .SavedID, true
}

// SetPrepaidUpgradeHash sets value of PrepaidUpgradeHash conditional field.
func ( *MessageActionStarGift) ( string) {
	.Flags.Set(14)
	.PrepaidUpgradeHash = 
}

// GetPrepaidUpgradeHash returns value of PrepaidUpgradeHash conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(14) {
		return , false
	}
	return .PrepaidUpgradeHash, true
}

// SetGiftMsgID sets value of GiftMsgID conditional field.
func ( *MessageActionStarGift) ( int) {
	.Flags.Set(15)
	.GiftMsgID = 
}

// GetGiftMsgID returns value of GiftMsgID conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(15) {
		return , false
	}
	return .GiftMsgID, true
}

// SetToID sets value of ToID conditional field.
func ( *MessageActionStarGift) ( PeerClass) {
	.Flags.Set(18)
	.ToID = 
}

// GetToID returns value of ToID conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(18) {
		return , false
	}
	return .ToID, true
}

// SetGiftNum sets value of GiftNum conditional field.
func ( *MessageActionStarGift) ( int) {
	.Flags.Set(19)
	.GiftNum = 
}

// GetGiftNum returns value of GiftNum conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGift) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(19) {
		return , false
	}
	return .GiftNum, true
}

// MessageActionStarGiftUnique represents TL type `messageActionStarGiftUnique#e6c31522`.
// A gift »¹ was upgraded to a collectible gift »².
//
// Links:
//  1. https://core.telegram.org/api/gifts
//  2. https://core.telegram.org/api/gifts#collectible-gifts
//
// See https://core.telegram.org/constructor/messageActionStarGiftUnique for reference.
type MessageActionStarGiftUnique struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, this collectible was upgraded »¹ to a collectible gift from a previously
	// received or sent (depending on the out flag of the containing messageService²)
	// non-collectible gift.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#collectible-gifts
	//  2) https://core.telegram.org/constructor/messageService
	Upgrade bool
	// If set, this collectible was transferred (either to the current user or by the current
	// user to the other user in the private chat, depending on the out flag of the
	// containing messageService¹).
	//
	// Links:
	//  1) https://core.telegram.org/constructor/messageService
	Transferred bool
	// If set, this gift is visible on the user or channel's profile page; can only be set
	// for the receiver of a gift.
	Saved bool
	// This gift was upgraded to a collectible gift »¹ and then re-downgraded to a regular
	// gift because a request to refund the payment related to the upgrade was made, and the
	// money was returned.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#collectible-gifts
	Refunded bool
	// The sender has pre-paid for the upgrade of this gift to a collectible gift.
	PrepaidUpgrade bool
	// This collectible gift was assigned from the TON blockchain »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#withdraw-a-collectible-gift-to-the-ton-blockchain
	Assigned bool
	// This collectible gift was transferred after a purchase offer »¹ was accepted.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#collectible-gift-purchase-offers
	FromOffer bool
	// This collectible gift was obtained by crafting »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#crafting-collectible-gifts
	Craft bool
	// The collectible gift.
	Gift StarGiftClass
	// If set, indicates that the current gift can't be exported to the TON blockchain »¹
	// yet: the owner will be able to export it at the specified unixtime.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#withdraw-a-collectible-gift-to-the-ton-blockchain
	//
	// Use SetCanExportAt and GetCanExportAt helpers.
	CanExportAt int
	// If set, indicates that the gift can be transferred »¹ to another user by paying the
	// specified amount of stars.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#transferring-collectible-gifts
	//
	// Use SetTransferStars and GetTransferStars helpers.
	TransferStars int64
	// Sender of the gift (unset for anonymous gifts).
	//
	// Use SetFromID and GetFromID helpers.
	FromID PeerClass
	// Receiver of the gift.
	//
	// Use SetPeer and GetPeer helpers.
	Peer PeerClass
	// For channel gifts, ID to use in inputSavedStarGiftChat¹ constructors.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/inputSavedStarGiftChat
	//
	// Use SetSavedID and GetSavedID helpers.
	SavedID int64
	// Resale price of the gift.
	//
	// Use SetResaleAmount and GetResaleAmount helpers.
	ResaleAmount StarsAmountClass
	// If set, indicates that the current gift can't be transferred »¹ yet: the owner will
	// be able to transfer it at the specified unixtime.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#transferring-collectible-gifts
	//
	// Use SetCanTransferAt and GetCanTransferAt helpers.
	CanTransferAt int
	// If set, indicates that the current gift can't be resold »¹ yet: the owner will be
	// able to put it up for sale at the specified unixtime.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#reselling-collectible-gifts
	//
	// Use SetCanResellAt and GetCanResellAt helpers.
	CanResellAt int
	// If set, the starGiftAttributeOriginalDetails¹ attribute of this gift may be removed
	// by paying the specified amount of stars, see here »² for the full flow.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftAttributeOriginalDetails
	//  2) https://core.telegram.org/api/gifts#dropping-the-original-details-of-an-upgraded-gift
	//
	// Use SetDropOriginalDetailsStars and GetDropOriginalDetailsStars helpers.
	DropOriginalDetailsStars int64
	// If set, this gift can be used for crafting »¹ only starting from the specified
	// unixtime.
	//
	// Links:
	//  1) https://core.telegram.org/api/gifts#crafting-collectible-gifts
	//
	// Use SetCanCraftAt and GetCanCraftAt helpers.
	CanCraftAt int
}

// MessageActionStarGiftUniqueTypeID is TL type id of MessageActionStarGiftUnique.
const MessageActionStarGiftUniqueTypeID = 0xe6c31522

// construct implements constructor of MessageActionClass.
func ( MessageActionStarGiftUnique) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionStarGiftUnique{}
)

func ( *MessageActionStarGiftUnique) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Upgrade == false) {
		return false
	}
	if !(.Transferred == false) {
		return false
	}
	if !(.Saved == false) {
		return false
	}
	if !(.Refunded == false) {
		return false
	}
	if !(.PrepaidUpgrade == false) {
		return false
	}
	if !(.Assigned == false) {
		return false
	}
	if !(.FromOffer == false) {
		return false
	}
	if !(.Craft == false) {
		return false
	}
	if !(.Gift == nil) {
		return false
	}
	if !(.CanExportAt == 0) {
		return false
	}
	if !(.TransferStars == 0) {
		return false
	}
	if !(.FromID == nil) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.SavedID == 0) {
		return false
	}
	if !(.ResaleAmount == nil) {
		return false
	}
	if !(.CanTransferAt == 0) {
		return false
	}
	if !(.CanResellAt == 0) {
		return false
	}
	if !(.DropOriginalDetailsStars == 0) {
		return false
	}
	if !(.CanCraftAt == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionStarGiftUnique from given interface.
func ( *MessageActionStarGiftUnique) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( StarGiftClass)
	() ( int,  bool)
	() ( int64,  bool)
	() ( PeerClass,  bool)
	() ( PeerClass,  bool)
	() ( int64,  bool)
	() ( StarsAmountClass,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( int64,  bool)
	() ( int,  bool)
}) {
	.Upgrade = .()
	.Transferred = .()
	.Saved = .()
	.Refunded = .()
	.PrepaidUpgrade = .()
	.Assigned = .()
	.FromOffer = .()
	.Craft = .()
	.Gift = .()
	if ,  := .();  {
		.CanExportAt = 
	}

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

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

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

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

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

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

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

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionStarGiftUnique) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionStarGiftUnique",
		ID:   MessageActionStarGiftUniqueTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Upgrade",
			SchemaName: "upgrade",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Transferred",
			SchemaName: "transferred",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Saved",
			SchemaName: "saved",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Refunded",
			SchemaName: "refunded",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "PrepaidUpgrade",
			SchemaName: "prepaid_upgrade",
			Null:       !.Flags.Has(11),
		},
		{
			Name:       "Assigned",
			SchemaName: "assigned",
			Null:       !.Flags.Has(13),
		},
		{
			Name:       "FromOffer",
			SchemaName: "from_offer",
			Null:       !.Flags.Has(14),
		},
		{
			Name:       "Craft",
			SchemaName: "craft",
			Null:       !.Flags.Has(16),
		},
		{
			Name:       "Gift",
			SchemaName: "gift",
		},
		{
			Name:       "CanExportAt",
			SchemaName: "can_export_at",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "TransferStars",
			SchemaName: "transfer_stars",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "FromID",
			SchemaName: "from_id",
			Null:       !.Flags.Has(6),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
			Null:       !.Flags.Has(7),
		},
		{
			Name:       "SavedID",
			SchemaName: "saved_id",
			Null:       !.Flags.Has(7),
		},
		{
			Name:       "ResaleAmount",
			SchemaName: "resale_amount",
			Null:       !.Flags.Has(8),
		},
		{
			Name:       "CanTransferAt",
			SchemaName: "can_transfer_at",
			Null:       !.Flags.Has(9),
		},
		{
			Name:       "CanResellAt",
			SchemaName: "can_resell_at",
			Null:       !.Flags.Has(10),
		},
		{
			Name:       "DropOriginalDetailsStars",
			SchemaName: "drop_original_details_stars",
			Null:       !.Flags.Has(12),
		},
		{
			Name:       "CanCraftAt",
			SchemaName: "can_craft_at",
			Null:       !.Flags.Has(15),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionStarGiftUnique) () {
	if !(.Upgrade == false) {
		.Flags.Set(0)
	}
	if !(.Transferred == false) {
		.Flags.Set(1)
	}
	if !(.Saved == false) {
		.Flags.Set(2)
	}
	if !(.Refunded == false) {
		.Flags.Set(5)
	}
	if !(.PrepaidUpgrade == false) {
		.Flags.Set(11)
	}
	if !(.Assigned == false) {
		.Flags.Set(13)
	}
	if !(.FromOffer == false) {
		.Flags.Set(14)
	}
	if !(.Craft == false) {
		.Flags.Set(16)
	}
	if !(.CanExportAt == 0) {
		.Flags.Set(3)
	}
	if !(.TransferStars == 0) {
		.Flags.Set(4)
	}
	if !(.FromID == nil) {
		.Flags.Set(6)
	}
	if !(.Peer == nil) {
		.Flags.Set(7)
	}
	if !(.SavedID == 0) {
		.Flags.Set(7)
	}
	if !(.ResaleAmount == nil) {
		.Flags.Set(8)
	}
	if !(.CanTransferAt == 0) {
		.Flags.Set(9)
	}
	if !(.CanResellAt == 0) {
		.Flags.Set(10)
	}
	if !(.DropOriginalDetailsStars == 0) {
		.Flags.Set(12)
	}
	if !(.CanCraftAt == 0) {
		.Flags.Set(15)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionStarGiftUnique) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionStarGiftUnique#e6c31522 as nil")
	}
	.PutID(MessageActionStarGiftUniqueTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionStarGiftUnique) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionStarGiftUnique#e6c31522 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field flags: %w", )
	}
	if .Gift == nil {
		return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field gift is nil")
	}
	if  := .Gift.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field gift: %w", )
	}
	if .Flags.Has(3) {
		.PutInt(.CanExportAt)
	}
	if .Flags.Has(4) {
		.PutLong(.TransferStars)
	}
	if .Flags.Has(6) {
		if .FromID == nil {
			return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field from_id is nil")
		}
		if  := .FromID.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field from_id: %w", )
		}
	}
	if .Flags.Has(7) {
		if .Peer == nil {
			return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field peer is nil")
		}
		if  := .Peer.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field peer: %w", )
		}
	}
	if .Flags.Has(7) {
		.PutLong(.SavedID)
	}
	if .Flags.Has(8) {
		if .ResaleAmount == nil {
			return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field resale_amount is nil")
		}
		if  := .ResaleAmount.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionStarGiftUnique#e6c31522: field resale_amount: %w", )
		}
	}
	if .Flags.Has(9) {
		.PutInt(.CanTransferAt)
	}
	if .Flags.Has(10) {
		.PutInt(.CanResellAt)
	}
	if .Flags.Has(12) {
		.PutLong(.DropOriginalDetailsStars)
	}
	if .Flags.Has(15) {
		.PutInt(.CanCraftAt)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionStarGiftUnique) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionStarGiftUnique#e6c31522 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field flags: %w", )
		}
	}
	.Upgrade = .Flags.Has(0)
	.Transferred = .Flags.Has(1)
	.Saved = .Flags.Has(2)
	.Refunded = .Flags.Has(5)
	.PrepaidUpgrade = .Flags.Has(11)
	.Assigned = .Flags.Has(13)
	.FromOffer = .Flags.Has(14)
	.Craft = .Flags.Has(16)
	{
		,  := DecodeStarGift()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field gift: %w", )
		}
		.Gift = 
	}
	if .Flags.Has(3) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field can_export_at: %w", )
		}
		.CanExportAt = 
	}
	if .Flags.Has(4) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field transfer_stars: %w", )
		}
		.TransferStars = 
	}
	if .Flags.Has(6) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field from_id: %w", )
		}
		.FromID = 
	}
	if .Flags.Has(7) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field peer: %w", )
		}
		.Peer = 
	}
	if .Flags.Has(7) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field saved_id: %w", )
		}
		.SavedID = 
	}
	if .Flags.Has(8) {
		,  := DecodeStarsAmount()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field resale_amount: %w", )
		}
		.ResaleAmount = 
	}
	if .Flags.Has(9) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field can_transfer_at: %w", )
		}
		.CanTransferAt = 
	}
	if .Flags.Has(10) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field can_resell_at: %w", )
		}
		.CanResellAt = 
	}
	if .Flags.Has(12) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field drop_original_details_stars: %w", )
		}
		.DropOriginalDetailsStars = 
	}
	if .Flags.Has(15) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftUnique#e6c31522: field can_craft_at: %w", )
		}
		.CanCraftAt = 
	}
	return nil
}

// SetUpgrade sets value of Upgrade conditional field.
func ( *MessageActionStarGiftUnique) ( bool) {
	if  {
		.Flags.Set(0)
		.Upgrade = true
	} else {
		.Flags.Unset(0)
		.Upgrade = false
	}
}

// GetUpgrade returns value of Upgrade conditional field.
func ( *MessageActionStarGiftUnique) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetTransferred sets value of Transferred conditional field.
func ( *MessageActionStarGiftUnique) ( bool) {
	if  {
		.Flags.Set(1)
		.Transferred = true
	} else {
		.Flags.Unset(1)
		.Transferred = false
	}
}

// GetTransferred returns value of Transferred conditional field.
func ( *MessageActionStarGiftUnique) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetSaved sets value of Saved conditional field.
func ( *MessageActionStarGiftUnique) ( bool) {
	if  {
		.Flags.Set(2)
		.Saved = true
	} else {
		.Flags.Unset(2)
		.Saved = false
	}
}

// GetSaved returns value of Saved conditional field.
func ( *MessageActionStarGiftUnique) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetRefunded sets value of Refunded conditional field.
func ( *MessageActionStarGiftUnique) ( bool) {
	if  {
		.Flags.Set(5)
		.Refunded = true
	} else {
		.Flags.Unset(5)
		.Refunded = false
	}
}

// GetRefunded returns value of Refunded conditional field.
func ( *MessageActionStarGiftUnique) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(5)
}

// SetPrepaidUpgrade sets value of PrepaidUpgrade conditional field.
func ( *MessageActionStarGiftUnique) ( bool) {
	if  {
		.Flags.Set(11)
		.PrepaidUpgrade = true
	} else {
		.Flags.Unset(11)
		.PrepaidUpgrade = false
	}
}

// GetPrepaidUpgrade returns value of PrepaidUpgrade conditional field.
func ( *MessageActionStarGiftUnique) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(11)
}

// SetAssigned sets value of Assigned conditional field.
func ( *MessageActionStarGiftUnique) ( bool) {
	if  {
		.Flags.Set(13)
		.Assigned = true
	} else {
		.Flags.Unset(13)
		.Assigned = false
	}
}

// GetAssigned returns value of Assigned conditional field.
func ( *MessageActionStarGiftUnique) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(13)
}

// SetFromOffer sets value of FromOffer conditional field.
func ( *MessageActionStarGiftUnique) ( bool) {
	if  {
		.Flags.Set(14)
		.FromOffer = true
	} else {
		.Flags.Unset(14)
		.FromOffer = false
	}
}

// GetFromOffer returns value of FromOffer conditional field.
func ( *MessageActionStarGiftUnique) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(14)
}

// SetCraft sets value of Craft conditional field.
func ( *MessageActionStarGiftUnique) ( bool) {
	if  {
		.Flags.Set(16)
		.Craft = true
	} else {
		.Flags.Unset(16)
		.Craft = false
	}
}

// GetCraft returns value of Craft conditional field.
func ( *MessageActionStarGiftUnique) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(16)
}

// GetGift returns value of Gift field.
func ( *MessageActionStarGiftUnique) () ( StarGiftClass) {
	if  == nil {
		return
	}
	return .Gift
}

// SetCanExportAt sets value of CanExportAt conditional field.
func ( *MessageActionStarGiftUnique) ( int) {
	.Flags.Set(3)
	.CanExportAt = 
}

// GetCanExportAt returns value of CanExportAt conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .CanExportAt, true
}

// SetTransferStars sets value of TransferStars conditional field.
func ( *MessageActionStarGiftUnique) ( int64) {
	.Flags.Set(4)
	.TransferStars = 
}

// GetTransferStars returns value of TransferStars conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .TransferStars, true
}

// SetFromID sets value of FromID conditional field.
func ( *MessageActionStarGiftUnique) ( PeerClass) {
	.Flags.Set(6)
	.FromID = 
}

// GetFromID returns value of FromID conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(6) {
		return , false
	}
	return .FromID, true
}

// SetPeer sets value of Peer conditional field.
func ( *MessageActionStarGiftUnique) ( PeerClass) {
	.Flags.Set(7)
	.Peer = 
}

// GetPeer returns value of Peer conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(7) {
		return , false
	}
	return .Peer, true
}

// SetSavedID sets value of SavedID conditional field.
func ( *MessageActionStarGiftUnique) ( int64) {
	.Flags.Set(7)
	.SavedID = 
}

// GetSavedID returns value of SavedID conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(7) {
		return , false
	}
	return .SavedID, true
}

// SetResaleAmount sets value of ResaleAmount conditional field.
func ( *MessageActionStarGiftUnique) ( StarsAmountClass) {
	.Flags.Set(8)
	.ResaleAmount = 
}

// GetResaleAmount returns value of ResaleAmount conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( StarsAmountClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(8) {
		return , false
	}
	return .ResaleAmount, true
}

// SetCanTransferAt sets value of CanTransferAt conditional field.
func ( *MessageActionStarGiftUnique) ( int) {
	.Flags.Set(9)
	.CanTransferAt = 
}

// GetCanTransferAt returns value of CanTransferAt conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(9) {
		return , false
	}
	return .CanTransferAt, true
}

// SetCanResellAt sets value of CanResellAt conditional field.
func ( *MessageActionStarGiftUnique) ( int) {
	.Flags.Set(10)
	.CanResellAt = 
}

// GetCanResellAt returns value of CanResellAt conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(10) {
		return , false
	}
	return .CanResellAt, true
}

// SetDropOriginalDetailsStars sets value of DropOriginalDetailsStars conditional field.
func ( *MessageActionStarGiftUnique) ( int64) {
	.Flags.Set(12)
	.DropOriginalDetailsStars = 
}

// GetDropOriginalDetailsStars returns value of DropOriginalDetailsStars conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(12) {
		return , false
	}
	return .DropOriginalDetailsStars, true
}

// SetCanCraftAt sets value of CanCraftAt conditional field.
func ( *MessageActionStarGiftUnique) ( int) {
	.Flags.Set(15)
	.CanCraftAt = 
}

// GetCanCraftAt returns value of CanCraftAt conditional field and
// boolean which is true if field was set.
func ( *MessageActionStarGiftUnique) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(15) {
		return , false
	}
	return .CanCraftAt, true
}

// MessageActionPaidMessagesRefunded represents TL type `messageActionPaidMessagesRefunded#ac1f1fcd`.
// Sent from peer A to B, indicates that A refunded all stars¹ B previously paid to send
// messages to A, see here »² for more info on paid messages.
//
// Links:
//  1. https://core.telegram.org/api/stars
//  2. https://core.telegram.org/api/paid-messages
//
// See https://core.telegram.org/constructor/messageActionPaidMessagesRefunded for reference.
type MessageActionPaidMessagesRefunded struct {
	// Number of paid messages affected by the refund.
	Count int
	// Number of refunded stars.
	Stars int64
}

// MessageActionPaidMessagesRefundedTypeID is TL type id of MessageActionPaidMessagesRefunded.
const MessageActionPaidMessagesRefundedTypeID = 0xac1f1fcd

// construct implements constructor of MessageActionClass.
func ( MessageActionPaidMessagesRefunded) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPaidMessagesRefunded{}
)

func ( *MessageActionPaidMessagesRefunded) () bool {
	if  == nil {
		return true
	}
	if !(.Count == 0) {
		return false
	}
	if !(.Stars == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPaidMessagesRefunded from given interface.
func ( *MessageActionPaidMessagesRefunded) ( interface {
	() ( int)
	() ( int64)
}) {
	.Count = .()
	.Stars = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPaidMessagesRefunded) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPaidMessagesRefunded",
		ID:   MessageActionPaidMessagesRefundedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Count",
			SchemaName: "count",
		},
		{
			Name:       "Stars",
			SchemaName: "stars",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionPaidMessagesRefunded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaidMessagesRefunded#ac1f1fcd as nil")
	}
	.PutID(MessageActionPaidMessagesRefundedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPaidMessagesRefunded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaidMessagesRefunded#ac1f1fcd as nil")
	}
	.PutInt(.Count)
	.PutLong(.Stars)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPaidMessagesRefunded) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPaidMessagesRefunded#ac1f1fcd to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaidMessagesRefunded#ac1f1fcd: field count: %w", )
		}
		.Count = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaidMessagesRefunded#ac1f1fcd: field stars: %w", )
		}
		.Stars = 
	}
	return nil
}

// GetCount returns value of Count field.
func ( *MessageActionPaidMessagesRefunded) () ( int) {
	if  == nil {
		return
	}
	return .Count
}

// GetStars returns value of Stars field.
func ( *MessageActionPaidMessagesRefunded) () ( int64) {
	if  == nil {
		return
	}
	return .Stars
}

// MessageActionPaidMessagesPrice represents TL type `messageActionPaidMessagesPrice#84b88578`.
// The price of paid messages »¹ in this chat was changed.
//
// Links:
//  1. https://core.telegram.org/api/paid-messages
//
// See https://core.telegram.org/constructor/messageActionPaidMessagesPrice for reference.
type MessageActionPaidMessagesPrice struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Can only be set for channels, if set indicates that direct messages were enabled »¹,
	// otherwise indicates that direct messages were disabled; the price of paid messages is
	// related to the price of direct messages (aka those sent to the associated monoforum²).
	//
	// Links:
	//  1) https://core.telegram.org/api/monoforum
	//  2) https://core.telegram.org/api/monoforum
	BroadcastMessagesAllowed bool
	// The new price in Telegram Stars¹, can be 0 if messages are now free.
	//
	// Links:
	//  1) https://core.telegram.org/api/stars
	Stars int64
}

// MessageActionPaidMessagesPriceTypeID is TL type id of MessageActionPaidMessagesPrice.
const MessageActionPaidMessagesPriceTypeID = 0x84b88578

// construct implements constructor of MessageActionClass.
func ( MessageActionPaidMessagesPrice) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPaidMessagesPrice{}
)

func ( *MessageActionPaidMessagesPrice) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.BroadcastMessagesAllowed == false) {
		return false
	}
	if !(.Stars == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPaidMessagesPrice from given interface.
func ( *MessageActionPaidMessagesPrice) ( interface {
	() ( bool)
	() ( int64)
}) {
	.BroadcastMessagesAllowed = .()
	.Stars = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPaidMessagesPrice) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPaidMessagesPrice",
		ID:   MessageActionPaidMessagesPriceTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "BroadcastMessagesAllowed",
			SchemaName: "broadcast_messages_allowed",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Stars",
			SchemaName: "stars",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionPaidMessagesPrice) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPaidMessagesPrice#84b88578 as nil")
	}
	.PutID(MessageActionPaidMessagesPriceTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPaidMessagesPrice) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPaidMessagesPrice#84b88578 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPaidMessagesPrice#84b88578: field flags: %w", )
		}
	}
	.BroadcastMessagesAllowed = .Flags.Has(0)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaidMessagesPrice#84b88578: field stars: %w", )
		}
		.Stars = 
	}
	return nil
}

// SetBroadcastMessagesAllowed sets value of BroadcastMessagesAllowed conditional field.
func ( *MessageActionPaidMessagesPrice) ( bool) {
	if  {
		.Flags.Set(0)
		.BroadcastMessagesAllowed = true
	} else {
		.Flags.Unset(0)
		.BroadcastMessagesAllowed = false
	}
}

// GetBroadcastMessagesAllowed returns value of BroadcastMessagesAllowed conditional field.
func ( *MessageActionPaidMessagesPrice) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetStars returns value of Stars field.
func ( *MessageActionPaidMessagesPrice) () ( int64) {
	if  == nil {
		return
	}
	return .Stars
}

// MessageActionConferenceCall represents TL type `messageActionConferenceCall#2ffe2f7a`.
// Represents a conference call¹ (or an invitation to a conference call, if neither the
// missed nor active flags are set).
// If call_requests_disabled¹ is not set or false, an incoming
// messageActionConferenceCall² with the missed and active flags not set should trigger
// ringing and an incoming call screen, just like for one-on-one calls.
//
// Links:
//  1. https://core.telegram.org/api/end-to-end/group-calls
//  2. https://core.telegram.org/api/config#call-requests-disabled
//  3. https://core.telegram.org/constructor/messageActionConferenceCall
//
// See https://core.telegram.org/constructor/messageActionConferenceCall for reference.
type MessageActionConferenceCall struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the conference call has ended and the user hasn't joined.
	Missed bool
	// Whether the user is currently in the conference call.
	Active bool
	// Whether this is a video conference call.
	Video bool
	// Call ID.
	CallID int64
	// Call duration, for left calls only.
	//
	// Use SetDuration and GetDuration helpers.
	Duration int
	// Identifiers of some other call participants.
	//
	// Use SetOtherParticipants and GetOtherParticipants helpers.
	OtherParticipants []PeerClass
}

// MessageActionConferenceCallTypeID is TL type id of MessageActionConferenceCall.
const MessageActionConferenceCallTypeID = 0x2ffe2f7a

// construct implements constructor of MessageActionClass.
func ( MessageActionConferenceCall) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionConferenceCall{}
)

func ( *MessageActionConferenceCall) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Missed == false) {
		return false
	}
	if !(.Active == false) {
		return false
	}
	if !(.Video == false) {
		return false
	}
	if !(.CallID == 0) {
		return false
	}
	if !(.Duration == 0) {
		return false
	}
	if !(.OtherParticipants == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionConferenceCall from given interface.
func ( *MessageActionConferenceCall) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( int64)
	() ( int,  bool)
	() ( []PeerClass,  bool)
}) {
	.Missed = .()
	.Active = .()
	.Video = .()
	.CallID = .()
	if ,  := .();  {
		.Duration = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionConferenceCall) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionConferenceCall",
		ID:   MessageActionConferenceCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Missed",
			SchemaName: "missed",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Active",
			SchemaName: "active",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Video",
			SchemaName: "video",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "CallID",
			SchemaName: "call_id",
		},
		{
			Name:       "Duration",
			SchemaName: "duration",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "OtherParticipants",
			SchemaName: "other_participants",
			Null:       !.Flags.Has(3),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionConferenceCall) () {
	if !(.Missed == false) {
		.Flags.Set(0)
	}
	if !(.Active == false) {
		.Flags.Set(1)
	}
	if !(.Video == false) {
		.Flags.Set(4)
	}
	if !(.Duration == 0) {
		.Flags.Set(2)
	}
	if !(.OtherParticipants == nil) {
		.Flags.Set(3)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionConferenceCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionConferenceCall#2ffe2f7a as nil")
	}
	.PutID(MessageActionConferenceCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionConferenceCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionConferenceCall#2ffe2f7a as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionConferenceCall#2ffe2f7a: field flags: %w", )
	}
	.PutLong(.CallID)
	if .Flags.Has(2) {
		.PutInt(.Duration)
	}
	if .Flags.Has(3) {
		.PutVectorHeader(len(.OtherParticipants))
		for ,  := range .OtherParticipants {
			if  == nil {
				return fmt.Errorf("unable to encode messageActionConferenceCall#2ffe2f7a: field other_participants element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode messageActionConferenceCall#2ffe2f7a: field other_participants element with index %d: %w", , )
			}
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionConferenceCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionConferenceCall#2ffe2f7a to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionConferenceCall#2ffe2f7a: field flags: %w", )
		}
	}
	.Missed = .Flags.Has(0)
	.Active = .Flags.Has(1)
	.Video = .Flags.Has(4)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionConferenceCall#2ffe2f7a: field call_id: %w", )
		}
		.CallID = 
	}
	if .Flags.Has(2) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionConferenceCall#2ffe2f7a: field duration: %w", )
		}
		.Duration = 
	}
	if .Flags.Has(3) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionConferenceCall#2ffe2f7a: field other_participants: %w", )
		}

		if  > 0 {
			.OtherParticipants = make([]PeerClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePeer()
			if  != nil {
				return fmt.Errorf("unable to decode messageActionConferenceCall#2ffe2f7a: field other_participants: %w", )
			}
			.OtherParticipants = append(.OtherParticipants, )
		}
	}
	return nil
}

// SetMissed sets value of Missed conditional field.
func ( *MessageActionConferenceCall) ( bool) {
	if  {
		.Flags.Set(0)
		.Missed = true
	} else {
		.Flags.Unset(0)
		.Missed = false
	}
}

// GetMissed returns value of Missed conditional field.
func ( *MessageActionConferenceCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetActive sets value of Active conditional field.
func ( *MessageActionConferenceCall) ( bool) {
	if  {
		.Flags.Set(1)
		.Active = true
	} else {
		.Flags.Unset(1)
		.Active = false
	}
}

// GetActive returns value of Active conditional field.
func ( *MessageActionConferenceCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetVideo sets value of Video conditional field.
func ( *MessageActionConferenceCall) ( bool) {
	if  {
		.Flags.Set(4)
		.Video = true
	} else {
		.Flags.Unset(4)
		.Video = false
	}
}

// GetVideo returns value of Video conditional field.
func ( *MessageActionConferenceCall) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(4)
}

// GetCallID returns value of CallID field.
func ( *MessageActionConferenceCall) () ( int64) {
	if  == nil {
		return
	}
	return .CallID
}

// SetDuration sets value of Duration conditional field.
func ( *MessageActionConferenceCall) ( int) {
	.Flags.Set(2)
	.Duration = 
}

// GetDuration returns value of Duration conditional field and
// boolean which is true if field was set.
func ( *MessageActionConferenceCall) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .Duration, true
}

// SetOtherParticipants sets value of OtherParticipants conditional field.
func ( *MessageActionConferenceCall) ( []PeerClass) {
	.Flags.Set(3)
	.OtherParticipants = 
}

// GetOtherParticipants returns value of OtherParticipants conditional field and
// boolean which is true if field was set.
func ( *MessageActionConferenceCall) () ( []PeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .OtherParticipants, true
}

// MapOtherParticipants returns field OtherParticipants wrapped in PeerClassArray helper.
func ( *MessageActionConferenceCall) () ( PeerClassArray,  bool) {
	if !.Flags.Has(3) {
		return , false
	}
	return PeerClassArray(.OtherParticipants), true
}

// MessageActionTodoCompletions represents TL type `messageActionTodoCompletions#cc7c5c89`.
// Items were marked as completed or not completed in a todo list »¹.
//
// Links:
//  1. https://core.telegram.org/api/todo
//
// See https://core.telegram.org/constructor/messageActionTodoCompletions for reference.
type MessageActionTodoCompletions struct {
	// Items marked as completed.
	Completed []int
	// Items marked as not completed.
	Incompleted []int
}

// MessageActionTodoCompletionsTypeID is TL type id of MessageActionTodoCompletions.
const MessageActionTodoCompletionsTypeID = 0xcc7c5c89

// construct implements constructor of MessageActionClass.
func ( MessageActionTodoCompletions) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionTodoCompletions{}
)

func ( *MessageActionTodoCompletions) () bool {
	if  == nil {
		return true
	}
	if !(.Completed == nil) {
		return false
	}
	if !(.Incompleted == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionTodoCompletions from given interface.
func ( *MessageActionTodoCompletions) ( interface {
	() ( []int)
	() ( []int)
}) {
	.Completed = .()
	.Incompleted = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionTodoCompletions) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionTodoCompletions",
		ID:   MessageActionTodoCompletionsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Completed",
			SchemaName: "completed",
		},
		{
			Name:       "Incompleted",
			SchemaName: "incompleted",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionTodoCompletions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionTodoCompletions#cc7c5c89 as nil")
	}
	.PutID(MessageActionTodoCompletionsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionTodoCompletions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionTodoCompletions#cc7c5c89 as nil")
	}
	.PutVectorHeader(len(.Completed))
	for ,  := range .Completed {
		.PutInt()
	}
	.PutVectorHeader(len(.Incompleted))
	for ,  := range .Incompleted {
		.PutInt()
	}
	return nil
}

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

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

		if  > 0 {
			.Completed = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode messageActionTodoCompletions#cc7c5c89: field completed: %w", )
			}
			.Completed = append(.Completed, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionTodoCompletions#cc7c5c89: field incompleted: %w", )
		}

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

// GetCompleted returns value of Completed field.
func ( *MessageActionTodoCompletions) () ( []int) {
	if  == nil {
		return
	}
	return .Completed
}

// GetIncompleted returns value of Incompleted field.
func ( *MessageActionTodoCompletions) () ( []int) {
	if  == nil {
		return
	}
	return .Incompleted
}

// MessageActionTodoAppendTasks represents TL type `messageActionTodoAppendTasks#c7edbc83`.
// Items were appended to the todo list »¹.
//
// Links:
//  1. https://core.telegram.org/api/todo
//
// See https://core.telegram.org/constructor/messageActionTodoAppendTasks for reference.
type MessageActionTodoAppendTasks struct {
	// Appended items.
	List []TodoItem
}

// MessageActionTodoAppendTasksTypeID is TL type id of MessageActionTodoAppendTasks.
const MessageActionTodoAppendTasksTypeID = 0xc7edbc83

// construct implements constructor of MessageActionClass.
func ( MessageActionTodoAppendTasks) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionTodoAppendTasks{}
)

func ( *MessageActionTodoAppendTasks) () bool {
	if  == nil {
		return true
	}
	if !(.List == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionTodoAppendTasks from given interface.
func ( *MessageActionTodoAppendTasks) ( interface {
	() ( []TodoItem)
}) {
	.List = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionTodoAppendTasks) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionTodoAppendTasks",
		ID:   MessageActionTodoAppendTasksTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "List",
			SchemaName: "list",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionTodoAppendTasks) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionTodoAppendTasks#c7edbc83 as nil")
	}
	.PutID(MessageActionTodoAppendTasksTypeID)
	return .EncodeBare()
}

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

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

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

		if  > 0 {
			.List = make([]TodoItem, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  TodoItem
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode messageActionTodoAppendTasks#c7edbc83: field list: %w", )
			}
			.List = append(.List, )
		}
	}
	return nil
}

// GetList returns value of List field.
func ( *MessageActionTodoAppendTasks) () ( []TodoItem) {
	if  == nil {
		return
	}
	return .List
}

// MessageActionSuggestedPostApproval represents TL type `messageActionSuggestedPostApproval#ee7a1596`.
// A suggested post »¹ was approved or rejected.
//
// Links:
//  1. https://core.telegram.org/api/suggested-posts
//
// See https://core.telegram.org/constructor/messageActionSuggestedPostApproval for reference.
type MessageActionSuggestedPostApproval struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the suggested post was rejected.
	Rejected bool
	// If set, the post was approved but the user's balance is too low to pay for the
	// suggested post.
	BalanceTooLow bool
	// If the suggested post was rejected, can optionally contain a rejection comment.
	//
	// Use SetRejectComment and GetRejectComment helpers.
	RejectComment string
	// Scheduling date.
	//
	// Use SetScheduleDate and GetScheduleDate helpers.
	ScheduleDate int
	// Price for the suggested post.
	//
	// Use SetPrice and GetPrice helpers.
	Price StarsAmountClass
}

// MessageActionSuggestedPostApprovalTypeID is TL type id of MessageActionSuggestedPostApproval.
const MessageActionSuggestedPostApprovalTypeID = 0xee7a1596

// construct implements constructor of MessageActionClass.
func ( MessageActionSuggestedPostApproval) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSuggestedPostApproval{}
)

func ( *MessageActionSuggestedPostApproval) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Rejected == false) {
		return false
	}
	if !(.BalanceTooLow == false) {
		return false
	}
	if !(.RejectComment == "") {
		return false
	}
	if !(.ScheduleDate == 0) {
		return false
	}
	if !(.Price == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSuggestedPostApproval from given interface.
func ( *MessageActionSuggestedPostApproval) ( interface {
	() ( bool)
	() ( bool)
	() ( string,  bool)
	() ( int,  bool)
	() ( StarsAmountClass,  bool)
}) {
	.Rejected = .()
	.BalanceTooLow = .()
	if ,  := .();  {
		.RejectComment = 
	}

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

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

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSuggestedPostApproval) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSuggestedPostApproval",
		ID:   MessageActionSuggestedPostApprovalTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Rejected",
			SchemaName: "rejected",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "BalanceTooLow",
			SchemaName: "balance_too_low",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "RejectComment",
			SchemaName: "reject_comment",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "ScheduleDate",
			SchemaName: "schedule_date",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Price",
			SchemaName: "price",
			Null:       !.Flags.Has(4),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionSuggestedPostApproval) () {
	if !(.Rejected == false) {
		.Flags.Set(0)
	}
	if !(.BalanceTooLow == false) {
		.Flags.Set(1)
	}
	if !(.RejectComment == "") {
		.Flags.Set(2)
	}
	if !(.ScheduleDate == 0) {
		.Flags.Set(3)
	}
	if !(.Price == nil) {
		.Flags.Set(4)
	}
}

// Encode implements bin.Encoder.
func ( *MessageActionSuggestedPostApproval) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestedPostApproval#ee7a1596 as nil")
	}
	.PutID(MessageActionSuggestedPostApprovalTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSuggestedPostApproval) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestedPostApproval#ee7a1596 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionSuggestedPostApproval#ee7a1596: field flags: %w", )
	}
	if .Flags.Has(2) {
		.PutString(.RejectComment)
	}
	if .Flags.Has(3) {
		.PutInt(.ScheduleDate)
	}
	if .Flags.Has(4) {
		if .Price == nil {
			return fmt.Errorf("unable to encode messageActionSuggestedPostApproval#ee7a1596: field price is nil")
		}
		if  := .Price.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionSuggestedPostApproval#ee7a1596: field price: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSuggestedPostApproval) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSuggestedPostApproval#ee7a1596 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionSuggestedPostApproval#ee7a1596: field flags: %w", )
		}
	}
	.Rejected = .Flags.Has(0)
	.BalanceTooLow = .Flags.Has(1)
	if .Flags.Has(2) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSuggestedPostApproval#ee7a1596: field reject_comment: %w", )
		}
		.RejectComment = 
	}
	if .Flags.Has(3) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSuggestedPostApproval#ee7a1596: field schedule_date: %w", )
		}
		.ScheduleDate = 
	}
	if .Flags.Has(4) {
		,  := DecodeStarsAmount()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSuggestedPostApproval#ee7a1596: field price: %w", )
		}
		.Price = 
	}
	return nil
}

// SetRejected sets value of Rejected conditional field.
func ( *MessageActionSuggestedPostApproval) ( bool) {
	if  {
		.Flags.Set(0)
		.Rejected = true
	} else {
		.Flags.Unset(0)
		.Rejected = false
	}
}

// GetRejected returns value of Rejected conditional field.
func ( *MessageActionSuggestedPostApproval) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetBalanceTooLow sets value of BalanceTooLow conditional field.
func ( *MessageActionSuggestedPostApproval) ( bool) {
	if  {
		.Flags.Set(1)
		.BalanceTooLow = true
	} else {
		.Flags.Unset(1)
		.BalanceTooLow = false
	}
}

// GetBalanceTooLow returns value of BalanceTooLow conditional field.
func ( *MessageActionSuggestedPostApproval) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetRejectComment sets value of RejectComment conditional field.
func ( *MessageActionSuggestedPostApproval) ( string) {
	.Flags.Set(2)
	.RejectComment = 
}

// GetRejectComment returns value of RejectComment conditional field and
// boolean which is true if field was set.
func ( *MessageActionSuggestedPostApproval) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .RejectComment, true
}

// SetScheduleDate sets value of ScheduleDate conditional field.
func ( *MessageActionSuggestedPostApproval) ( int) {
	.Flags.Set(3)
	.ScheduleDate = 
}

// GetScheduleDate returns value of ScheduleDate conditional field and
// boolean which is true if field was set.
func ( *MessageActionSuggestedPostApproval) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(3) {
		return , false
	}
	return .ScheduleDate, true
}

// SetPrice sets value of Price conditional field.
func ( *MessageActionSuggestedPostApproval) ( StarsAmountClass) {
	.Flags.Set(4)
	.Price = 
}

// GetPrice returns value of Price conditional field and
// boolean which is true if field was set.
func ( *MessageActionSuggestedPostApproval) () ( StarsAmountClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .Price, true
}

// MessageActionSuggestedPostSuccess represents TL type `messageActionSuggestedPostSuccess#95ddcf69`.
// A suggested post »¹ was successfully posted, and payment for it was successfully
// received.
//
// Links:
//  1. https://core.telegram.org/api/suggested-posts
//
// See https://core.telegram.org/constructor/messageActionSuggestedPostSuccess for reference.
type MessageActionSuggestedPostSuccess struct {
	// The price.
	Price StarsAmountClass
}

// MessageActionSuggestedPostSuccessTypeID is TL type id of MessageActionSuggestedPostSuccess.
const MessageActionSuggestedPostSuccessTypeID = 0x95ddcf69

// construct implements constructor of MessageActionClass.
func ( MessageActionSuggestedPostSuccess) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSuggestedPostSuccess{}
)

func ( *MessageActionSuggestedPostSuccess) () bool {
	if  == nil {
		return true
	}
	if !(.Price == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSuggestedPostSuccess from given interface.
func ( *MessageActionSuggestedPostSuccess) ( interface {
	() ( StarsAmountClass)
}) {
	.Price = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSuggestedPostSuccess) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSuggestedPostSuccess",
		ID:   MessageActionSuggestedPostSuccessTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Price",
			SchemaName: "price",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionSuggestedPostSuccess) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestedPostSuccess#95ddcf69 as nil")
	}
	.PutID(MessageActionSuggestedPostSuccessTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSuggestedPostSuccess) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestedPostSuccess#95ddcf69 as nil")
	}
	if .Price == nil {
		return fmt.Errorf("unable to encode messageActionSuggestedPostSuccess#95ddcf69: field price is nil")
	}
	if  := .Price.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionSuggestedPostSuccess#95ddcf69: field price: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSuggestedPostSuccess) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSuggestedPostSuccess#95ddcf69 to nil")
	}
	{
		,  := DecodeStarsAmount()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionSuggestedPostSuccess#95ddcf69: field price: %w", )
		}
		.Price = 
	}
	return nil
}

// GetPrice returns value of Price field.
func ( *MessageActionSuggestedPostSuccess) () ( StarsAmountClass) {
	if  == nil {
		return
	}
	return .Price
}

// MessageActionSuggestedPostRefund represents TL type `messageActionSuggestedPostRefund#69f916f8`.
// A suggested post »¹ was accepted and posted or scheduled, but either the channel
// deleted the posted/scheduled post before stars_suggested_post_age_min² seconds have
// elapsed, or the user refunded the payment for the stars used to pay for the suggested
// post.
//
// Links:
//  1. https://core.telegram.org/api/suggested-posts
//  2. https://core.telegram.org/api/config#stars-suggested-post-age-min
//
// See https://core.telegram.org/constructor/messageActionSuggestedPostRefund for reference.
type MessageActionSuggestedPostRefund struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, the user refunded the payment for the stars used to pay for the suggested post.
	PayerInitiated bool
}

// MessageActionSuggestedPostRefundTypeID is TL type id of MessageActionSuggestedPostRefund.
const MessageActionSuggestedPostRefundTypeID = 0x69f916f8

// construct implements constructor of MessageActionClass.
func ( MessageActionSuggestedPostRefund) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSuggestedPostRefund{}
)

func ( *MessageActionSuggestedPostRefund) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.PayerInitiated == false) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSuggestedPostRefund from given interface.
func ( *MessageActionSuggestedPostRefund) ( interface {
	() ( bool)
}) {
	.PayerInitiated = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSuggestedPostRefund) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSuggestedPostRefund",
		ID:   MessageActionSuggestedPostRefundTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PayerInitiated",
			SchemaName: "payer_initiated",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionSuggestedPostRefund) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestedPostRefund#69f916f8 as nil")
	}
	.PutID(MessageActionSuggestedPostRefundTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSuggestedPostRefund) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSuggestedPostRefund#69f916f8 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionSuggestedPostRefund#69f916f8: field flags: %w", )
		}
	}
	.PayerInitiated = .Flags.Has(0)
	return nil
}

// SetPayerInitiated sets value of PayerInitiated conditional field.
func ( *MessageActionSuggestedPostRefund) ( bool) {
	if  {
		.Flags.Set(0)
		.PayerInitiated = true
	} else {
		.Flags.Unset(0)
		.PayerInitiated = false
	}
}

// GetPayerInitiated returns value of PayerInitiated conditional field.
func ( *MessageActionSuggestedPostRefund) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// MessageActionGiftTon represents TL type `messageActionGiftTon#a8a3c699`.
// You were gifted some toncoins.
// This service message should be displayed below the appropriate sticker from the
// inputStickerSetTonGifts »¹ stickerset »²:
//
// Links:
//  1. https://core.telegram.org/constructor/inputStickerSetTonGifts
//  2. https://core.telegram.org/api/stickers#stickersets
//
// See https://core.telegram.org/constructor/messageActionGiftTon for reference.
type MessageActionGiftTon struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Name of a localized FIAT currency.
	Currency string
	// FIAT currency equivalent (in the currency specified in currency) of the amount
	// specified in crypto_amount.
	Amount int64
	// Name of the cryptocurrency.
	CryptoCurrency string
	// Amount in the smallest unit of the cryptocurrency (for TONs, one billionth of a ton,
	// AKA a nanoton).
	CryptoAmount int64
	// Transaction ID.
	//
	// Use SetTransactionID and GetTransactionID helpers.
	TransactionID string
}

// MessageActionGiftTonTypeID is TL type id of MessageActionGiftTon.
const MessageActionGiftTonTypeID = 0xa8a3c699

// construct implements constructor of MessageActionClass.
func ( MessageActionGiftTon) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionGiftTon{}
)

func ( *MessageActionGiftTon) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.Amount == 0) {
		return false
	}
	if !(.CryptoCurrency == "") {
		return false
	}
	if !(.CryptoAmount == 0) {
		return false
	}
	if !(.TransactionID == "") {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionGiftTon from given interface.
func ( *MessageActionGiftTon) ( interface {
	() ( string)
	() ( int64)
	() ( string)
	() ( int64)
	() ( string,  bool)
}) {
	.Currency = .()
	.Amount = .()
	.CryptoCurrency = .()
	.CryptoAmount = .()
	if ,  := .();  {
		.TransactionID = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionGiftTon) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionGiftTon",
		ID:   MessageActionGiftTonTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Currency",
			SchemaName: "currency",
		},
		{
			Name:       "Amount",
			SchemaName: "amount",
		},
		{
			Name:       "CryptoCurrency",
			SchemaName: "crypto_currency",
		},
		{
			Name:       "CryptoAmount",
			SchemaName: "crypto_amount",
		},
		{
			Name:       "TransactionID",
			SchemaName: "transaction_id",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionGiftTon) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftTon#a8a3c699 as nil")
	}
	.PutID(MessageActionGiftTonTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGiftTon) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftTon#a8a3c699 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGiftTon#a8a3c699: field flags: %w", )
	}
	.PutString(.Currency)
	.PutLong(.Amount)
	.PutString(.CryptoCurrency)
	.PutLong(.CryptoAmount)
	if .Flags.Has(0) {
		.PutString(.TransactionID)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiftTon) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiftTon#a8a3c699 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiftTon#a8a3c699: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftTon#a8a3c699: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftTon#a8a3c699: field amount: %w", )
		}
		.Amount = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftTon#a8a3c699: field crypto_currency: %w", )
		}
		.CryptoCurrency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftTon#a8a3c699: field crypto_amount: %w", )
		}
		.CryptoAmount = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftTon#a8a3c699: field transaction_id: %w", )
		}
		.TransactionID = 
	}
	return nil
}

// GetCurrency returns value of Currency field.
func ( *MessageActionGiftTon) () ( string) {
	if  == nil {
		return
	}
	return .Currency
}

// GetAmount returns value of Amount field.
func ( *MessageActionGiftTon) () ( int64) {
	if  == nil {
		return
	}
	return .Amount
}

// GetCryptoCurrency returns value of CryptoCurrency field.
func ( *MessageActionGiftTon) () ( string) {
	if  == nil {
		return
	}
	return .CryptoCurrency
}

// GetCryptoAmount returns value of CryptoAmount field.
func ( *MessageActionGiftTon) () ( int64) {
	if  == nil {
		return
	}
	return .CryptoAmount
}

// SetTransactionID sets value of TransactionID conditional field.
func ( *MessageActionGiftTon) ( string) {
	.Flags.Set(0)
	.TransactionID = 
}

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

// MessageActionSuggestBirthday represents TL type `messageActionSuggestBirthday#2c8f2a25`.
// A new birthday was suggested using users.suggestBirthday¹, see here »² for more
// info on birthdays in the API.
//
// Links:
//  1. https://core.telegram.org/method/users.suggestBirthday
//  2. https://core.telegram.org/api/profile#birthday
//
// See https://core.telegram.org/constructor/messageActionSuggestBirthday for reference.
type MessageActionSuggestBirthday struct {
	// The suggested birthday.
	Birthday Birthday
}

// MessageActionSuggestBirthdayTypeID is TL type id of MessageActionSuggestBirthday.
const MessageActionSuggestBirthdayTypeID = 0x2c8f2a25

// construct implements constructor of MessageActionClass.
func ( MessageActionSuggestBirthday) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionSuggestBirthday{}
)

func ( *MessageActionSuggestBirthday) () bool {
	if  == nil {
		return true
	}
	if !(.Birthday.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionSuggestBirthday from given interface.
func ( *MessageActionSuggestBirthday) ( interface {
	() ( Birthday)
}) {
	.Birthday = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionSuggestBirthday) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionSuggestBirthday",
		ID:   MessageActionSuggestBirthdayTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Birthday",
			SchemaName: "birthday",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionSuggestBirthday) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestBirthday#2c8f2a25 as nil")
	}
	.PutID(MessageActionSuggestBirthdayTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSuggestBirthday) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSuggestBirthday#2c8f2a25 as nil")
	}
	if  := .Birthday.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionSuggestBirthday#2c8f2a25: field birthday: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionSuggestBirthday) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionSuggestBirthday#2c8f2a25 to nil")
	}
	{
		if  := .Birthday.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionSuggestBirthday#2c8f2a25: field birthday: %w", )
		}
	}
	return nil
}

// GetBirthday returns value of Birthday field.
func ( *MessageActionSuggestBirthday) () ( Birthday) {
	if  == nil {
		return
	}
	return .Birthday
}

// MessageActionStarGiftPurchaseOffer represents TL type `messageActionStarGiftPurchaseOffer#774278d4`.
// Contains an offer to purchase a collectible gift »¹, see here »² for the full flow.
//
// Links:
//  1. https://core.telegram.org/api/gifts#collectible-gift-purchase-offers
//  2. https://core.telegram.org/api/gifts#collectible-gift-purchase-offers
//
// See https://core.telegram.org/constructor/messageActionStarGiftPurchaseOffer for reference.
type MessageActionStarGiftPurchaseOffer struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, the gift owner accepted this offer.
	Accepted bool
	// If set, the gift owner declined this offer.
	Declined bool
	// The collectible gift the offer is about.
	Gift StarGiftClass
	// Offered price.
	Price StarsAmountClass
	// Offer expiration date (UNIX timestamp): if the owner doesn't act before this date, the
	// offer will expire and the buyer will be refunded automatically.
	ExpiresAt int
}

// MessageActionStarGiftPurchaseOfferTypeID is TL type id of MessageActionStarGiftPurchaseOffer.
const MessageActionStarGiftPurchaseOfferTypeID = 0x774278d4

// construct implements constructor of MessageActionClass.
func ( MessageActionStarGiftPurchaseOffer) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionStarGiftPurchaseOffer{}
)

func ( *MessageActionStarGiftPurchaseOffer) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Accepted == false) {
		return false
	}
	if !(.Declined == false) {
		return false
	}
	if !(.Gift == nil) {
		return false
	}
	if !(.Price == nil) {
		return false
	}
	if !(.ExpiresAt == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionStarGiftPurchaseOffer from given interface.
func ( *MessageActionStarGiftPurchaseOffer) ( interface {
	() ( bool)
	() ( bool)
	() ( StarGiftClass)
	() ( StarsAmountClass)
	() ( int)
}) {
	.Accepted = .()
	.Declined = .()
	.Gift = .()
	.Price = .()
	.ExpiresAt = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionStarGiftPurchaseOffer) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionStarGiftPurchaseOffer",
		ID:   MessageActionStarGiftPurchaseOfferTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Accepted",
			SchemaName: "accepted",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Declined",
			SchemaName: "declined",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Gift",
			SchemaName: "gift",
		},
		{
			Name:       "Price",
			SchemaName: "price",
		},
		{
			Name:       "ExpiresAt",
			SchemaName: "expires_at",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionStarGiftPurchaseOffer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionStarGiftPurchaseOffer#774278d4 as nil")
	}
	.PutID(MessageActionStarGiftPurchaseOfferTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionStarGiftPurchaseOffer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionStarGiftPurchaseOffer#774278d4 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOffer#774278d4: field flags: %w", )
	}
	if .Gift == nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOffer#774278d4: field gift is nil")
	}
	if  := .Gift.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOffer#774278d4: field gift: %w", )
	}
	if .Price == nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOffer#774278d4: field price is nil")
	}
	if  := .Price.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOffer#774278d4: field price: %w", )
	}
	.PutInt(.ExpiresAt)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionStarGiftPurchaseOffer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionStarGiftPurchaseOffer#774278d4 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftPurchaseOffer#774278d4: field flags: %w", )
		}
	}
	.Accepted = .Flags.Has(0)
	.Declined = .Flags.Has(1)
	{
		,  := DecodeStarGift()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftPurchaseOffer#774278d4: field gift: %w", )
		}
		.Gift = 
	}
	{
		,  := DecodeStarsAmount()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftPurchaseOffer#774278d4: field price: %w", )
		}
		.Price = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftPurchaseOffer#774278d4: field expires_at: %w", )
		}
		.ExpiresAt = 
	}
	return nil
}

// SetAccepted sets value of Accepted conditional field.
func ( *MessageActionStarGiftPurchaseOffer) ( bool) {
	if  {
		.Flags.Set(0)
		.Accepted = true
	} else {
		.Flags.Unset(0)
		.Accepted = false
	}
}

// GetAccepted returns value of Accepted conditional field.
func ( *MessageActionStarGiftPurchaseOffer) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetDeclined sets value of Declined conditional field.
func ( *MessageActionStarGiftPurchaseOffer) ( bool) {
	if  {
		.Flags.Set(1)
		.Declined = true
	} else {
		.Flags.Unset(1)
		.Declined = false
	}
}

// GetDeclined returns value of Declined conditional field.
func ( *MessageActionStarGiftPurchaseOffer) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetGift returns value of Gift field.
func ( *MessageActionStarGiftPurchaseOffer) () ( StarGiftClass) {
	if  == nil {
		return
	}
	return .Gift
}

// GetPrice returns value of Price field.
func ( *MessageActionStarGiftPurchaseOffer) () ( StarsAmountClass) {
	if  == nil {
		return
	}
	return .Price
}

// GetExpiresAt returns value of ExpiresAt field.
func ( *MessageActionStarGiftPurchaseOffer) () ( int) {
	if  == nil {
		return
	}
	return .ExpiresAt
}

// MessageActionStarGiftPurchaseOfferDeclined represents TL type `messageActionStarGiftPurchaseOfferDeclined#73ada76b`.
// A collectible gift purchase offer »¹ was declined, or the offer expired, see here
// »² for the full flow.
//
// Links:
//  1. https://core.telegram.org/api/gifts#collectible-gift-purchase-offers
//  2. https://core.telegram.org/api/gifts#collectible-gift-purchase-offers
//
// See https://core.telegram.org/constructor/messageActionStarGiftPurchaseOfferDeclined for reference.
type MessageActionStarGiftPurchaseOfferDeclined struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, the owner didn't act before the messageActionStarGiftPurchaseOffer¹
	// expires_at deadline and the offer expired automatically; otherwise, the owner
	// explicitly declined the offer.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/messageActionStarGiftPurchaseOffer
	Expired bool
	// The collectible gift the declined or expired offer was about.
	Gift StarGiftClass
	// Offered price that is refunded automatically to the buyer.
	Price StarsAmountClass
}

// MessageActionStarGiftPurchaseOfferDeclinedTypeID is TL type id of MessageActionStarGiftPurchaseOfferDeclined.
const MessageActionStarGiftPurchaseOfferDeclinedTypeID = 0x73ada76b

// construct implements constructor of MessageActionClass.
func ( MessageActionStarGiftPurchaseOfferDeclined) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionStarGiftPurchaseOfferDeclined{}
)

func ( *MessageActionStarGiftPurchaseOfferDeclined) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Expired == false) {
		return false
	}
	if !(.Gift == nil) {
		return false
	}
	if !(.Price == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionStarGiftPurchaseOfferDeclined from given interface.
func ( *MessageActionStarGiftPurchaseOfferDeclined) ( interface {
	() ( bool)
	() ( StarGiftClass)
	() ( StarsAmountClass)
}) {
	.Expired = .()
	.Gift = .()
	.Price = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionStarGiftPurchaseOfferDeclined) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionStarGiftPurchaseOfferDeclined",
		ID:   MessageActionStarGiftPurchaseOfferDeclinedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Expired",
			SchemaName: "expired",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Gift",
			SchemaName: "gift",
		},
		{
			Name:       "Price",
			SchemaName: "price",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionStarGiftPurchaseOfferDeclined) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionStarGiftPurchaseOfferDeclined#73ada76b as nil")
	}
	.PutID(MessageActionStarGiftPurchaseOfferDeclinedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionStarGiftPurchaseOfferDeclined) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionStarGiftPurchaseOfferDeclined#73ada76b as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOfferDeclined#73ada76b: field flags: %w", )
	}
	if .Gift == nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOfferDeclined#73ada76b: field gift is nil")
	}
	if  := .Gift.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOfferDeclined#73ada76b: field gift: %w", )
	}
	if .Price == nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOfferDeclined#73ada76b: field price is nil")
	}
	if  := .Price.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionStarGiftPurchaseOfferDeclined#73ada76b: field price: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionStarGiftPurchaseOfferDeclined) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionStarGiftPurchaseOfferDeclined#73ada76b to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftPurchaseOfferDeclined#73ada76b: field flags: %w", )
		}
	}
	.Expired = .Flags.Has(0)
	{
		,  := DecodeStarGift()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftPurchaseOfferDeclined#73ada76b: field gift: %w", )
		}
		.Gift = 
	}
	{
		,  := DecodeStarsAmount()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionStarGiftPurchaseOfferDeclined#73ada76b: field price: %w", )
		}
		.Price = 
	}
	return nil
}

// SetExpired sets value of Expired conditional field.
func ( *MessageActionStarGiftPurchaseOfferDeclined) ( bool) {
	if  {
		.Flags.Set(0)
		.Expired = true
	} else {
		.Flags.Unset(0)
		.Expired = false
	}
}

// GetExpired returns value of Expired conditional field.
func ( *MessageActionStarGiftPurchaseOfferDeclined) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetGift returns value of Gift field.
func ( *MessageActionStarGiftPurchaseOfferDeclined) () ( StarGiftClass) {
	if  == nil {
		return
	}
	return .Gift
}

// GetPrice returns value of Price field.
func ( *MessageActionStarGiftPurchaseOfferDeclined) () ( StarsAmountClass) {
	if  == nil {
		return
	}
	return .Price
}

// MessageActionNewCreatorPending represents TL type `messageActionNewCreatorPending#b07ed085`.
// Service message: emitted to a supergroup when the group/channel creator leaves the
// group »¹, indicating that ownership transfer is pending. The new_creator_id user
// will become the new owner after 7 days if the old owner does not rejoin.
// Sent from the user ID of the old owner.
//
// Links:
//  1. https://core.telegram.org/api/channel#leaving-groups-channels
//
// See https://core.telegram.org/constructor/messageActionNewCreatorPending for reference.
type MessageActionNewCreatorPending struct {
	// The ID of the user who will become the new owner of the group/channel after 7 days if
	// the old owner does not rejoin.
	NewCreatorID int64
}

// MessageActionNewCreatorPendingTypeID is TL type id of MessageActionNewCreatorPending.
const MessageActionNewCreatorPendingTypeID = 0xb07ed085

// construct implements constructor of MessageActionClass.
func ( MessageActionNewCreatorPending) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionNewCreatorPending{}
)

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

	return true
}

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

// FillFrom fills MessageActionNewCreatorPending from given interface.
func ( *MessageActionNewCreatorPending) ( interface {
	() ( int64)
}) {
	.NewCreatorID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionNewCreatorPending) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionNewCreatorPending",
		ID:   MessageActionNewCreatorPendingTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "NewCreatorID",
			SchemaName: "new_creator_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionNewCreatorPending) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionNewCreatorPending#b07ed085 as nil")
	}
	.PutID(MessageActionNewCreatorPendingTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionNewCreatorPending) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionNewCreatorPending#b07ed085 as nil")
	}
	.PutLong(.NewCreatorID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionNewCreatorPending) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionNewCreatorPending#b07ed085 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionNewCreatorPending#b07ed085: field new_creator_id: %w", )
		}
		.NewCreatorID = 
	}
	return nil
}

// GetNewCreatorID returns value of NewCreatorID field.
func ( *MessageActionNewCreatorPending) () ( int64) {
	if  == nil {
		return
	}
	return .NewCreatorID
}

// MessageActionChangeCreator represents TL type `messageActionChangeCreator#e188503b`.
// Service message: emitted to a supergroup when ownership transfer completes after the
// old owner left the group »¹ (7 days after the old owner left without rejoining),
// indicating that ownership has been transferred to a new owner.
// Sent from the user ID of the old owner.
//
// Links:
//  1. https://core.telegram.org/api/channel#leaving-groups-channels
//
// See https://core.telegram.org/constructor/messageActionChangeCreator for reference.
type MessageActionChangeCreator struct {
	// The ID of the user who became the new owner of the group/channel.
	NewCreatorID int64
}

// MessageActionChangeCreatorTypeID is TL type id of MessageActionChangeCreator.
const MessageActionChangeCreatorTypeID = 0xe188503b

// construct implements constructor of MessageActionClass.
func ( MessageActionChangeCreator) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionChangeCreator{}
)

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

	return true
}

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

// FillFrom fills MessageActionChangeCreator from given interface.
func ( *MessageActionChangeCreator) ( interface {
	() ( int64)
}) {
	.NewCreatorID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionChangeCreator) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionChangeCreator",
		ID:   MessageActionChangeCreatorTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "NewCreatorID",
			SchemaName: "new_creator_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionChangeCreator) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChangeCreator#e188503b as nil")
	}
	.PutID(MessageActionChangeCreatorTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionChangeCreator) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionChangeCreator#e188503b as nil")
	}
	.PutLong(.NewCreatorID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionChangeCreator) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionChangeCreator#e188503b to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionChangeCreator#e188503b: field new_creator_id: %w", )
		}
		.NewCreatorID = 
	}
	return nil
}

// GetNewCreatorID returns value of NewCreatorID field.
func ( *MessageActionChangeCreator) () ( int64) {
	if  == nil {
		return
	}
	return .NewCreatorID
}

// MessageActionNoForwardsToggle represents TL type `messageActionNoForwardsToggle#bf7d6572`.
// Emitted only in private chats when enabling or disabling content protection »¹.
//
// Links:
//  1. https://core.telegram.org/api/content-protection#for-users
//
// See https://core.telegram.org/constructor/messageActionNoForwardsToggle for reference.
type MessageActionNoForwardsToggle struct {
	// Previous protection status (if true, the chat was protected). May be equal to
	// new_value when replying to requests, see here »¹ for more info on the full flow.
	//
	// Links:
	//  1) https://core.telegram.org/api/content-protection#for-users
	PrevValue bool
	// New protection status.
	NewValue bool
}

// MessageActionNoForwardsToggleTypeID is TL type id of MessageActionNoForwardsToggle.
const MessageActionNoForwardsToggleTypeID = 0xbf7d6572

// construct implements constructor of MessageActionClass.
func ( MessageActionNoForwardsToggle) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionNoForwardsToggle{}
)

func ( *MessageActionNoForwardsToggle) () bool {
	if  == nil {
		return true
	}
	if !(.PrevValue == false) {
		return false
	}
	if !(.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionNoForwardsToggle from given interface.
func ( *MessageActionNoForwardsToggle) ( interface {
	() ( bool)
	() ( bool)
}) {
	.PrevValue = .()
	.NewValue = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionNoForwardsToggle) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionNoForwardsToggle",
		ID:   MessageActionNoForwardsToggleTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionNoForwardsToggle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionNoForwardsToggle#bf7d6572 as nil")
	}
	.PutID(MessageActionNoForwardsToggleTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionNoForwardsToggle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionNoForwardsToggle#bf7d6572 as nil")
	}
	.PutBool(.PrevValue)
	.PutBool(.NewValue)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionNoForwardsToggle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionNoForwardsToggle#bf7d6572 to nil")
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionNoForwardsToggle#bf7d6572: field prev_value: %w", )
		}
		.PrevValue = 
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionNoForwardsToggle#bf7d6572: field new_value: %w", )
		}
		.NewValue = 
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func ( *MessageActionNoForwardsToggle) () ( bool) {
	if  == nil {
		return
	}
	return .PrevValue
}

// GetNewValue returns value of NewValue field.
func ( *MessageActionNoForwardsToggle) () ( bool) {
	if  == nil {
		return
	}
	return .NewValue
}

// MessageActionNoForwardsRequest represents TL type `messageActionNoForwardsRequest#3e2793ba`.
// Emitted only in private chats if the other side requested to disable content
// protection »¹.
//
// Links:
//  1. https://core.telegram.org/api/content-protection#for-users
//
// See https://core.telegram.org/constructor/messageActionNoForwardsRequest for reference.
type MessageActionNoForwardsRequest struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, this request was accepted or rejected by the other user and thus cannot be
	// used anymore.
	Expired bool
	// Previous protection status.
	PrevValue bool
	// New requested protection status.
	NewValue bool
}

// MessageActionNoForwardsRequestTypeID is TL type id of MessageActionNoForwardsRequest.
const MessageActionNoForwardsRequestTypeID = 0x3e2793ba

// construct implements constructor of MessageActionClass.
func ( MessageActionNoForwardsRequest) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionNoForwardsRequest{}
)

func ( *MessageActionNoForwardsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Expired == false) {
		return false
	}
	if !(.PrevValue == false) {
		return false
	}
	if !(.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionNoForwardsRequest from given interface.
func ( *MessageActionNoForwardsRequest) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
}) {
	.Expired = .()
	.PrevValue = .()
	.NewValue = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionNoForwardsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionNoForwardsRequest",
		ID:   MessageActionNoForwardsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Expired",
			SchemaName: "expired",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MessageActionNoForwardsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionNoForwardsRequest#3e2793ba as nil")
	}
	.PutID(MessageActionNoForwardsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionNoForwardsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionNoForwardsRequest#3e2793ba as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionNoForwardsRequest#3e2793ba: field flags: %w", )
	}
	.PutBool(.PrevValue)
	.PutBool(.NewValue)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionNoForwardsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionNoForwardsRequest#3e2793ba to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionNoForwardsRequest#3e2793ba: field flags: %w", )
		}
	}
	.Expired = .Flags.Has(0)
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionNoForwardsRequest#3e2793ba: field prev_value: %w", )
		}
		.PrevValue = 
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionNoForwardsRequest#3e2793ba: field new_value: %w", )
		}
		.NewValue = 
	}
	return nil
}

// SetExpired sets value of Expired conditional field.
func ( *MessageActionNoForwardsRequest) ( bool) {
	if  {
		.Flags.Set(0)
		.Expired = true
	} else {
		.Flags.Unset(0)
		.Expired = false
	}
}

// GetExpired returns value of Expired conditional field.
func ( *MessageActionNoForwardsRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetPrevValue returns value of PrevValue field.
func ( *MessageActionNoForwardsRequest) () ( bool) {
	if  == nil {
		return
	}
	return .PrevValue
}

// GetNewValue returns value of NewValue field.
func ( *MessageActionNoForwardsRequest) () ( bool) {
	if  == nil {
		return
	}
	return .NewValue
}

// MessageActionPollAppendAnswer represents TL type `messageActionPollAppendAnswer#9da1cd6c`.
//
// See https://core.telegram.org/constructor/messageActionPollAppendAnswer for reference.
type MessageActionPollAppendAnswer struct {
	// Answer field of MessageActionPollAppendAnswer.
	Answer PollAnswerClass
}

// MessageActionPollAppendAnswerTypeID is TL type id of MessageActionPollAppendAnswer.
const MessageActionPollAppendAnswerTypeID = 0x9da1cd6c

// construct implements constructor of MessageActionClass.
func ( MessageActionPollAppendAnswer) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPollAppendAnswer{}
)

func ( *MessageActionPollAppendAnswer) () bool {
	if  == nil {
		return true
	}
	if !(.Answer == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPollAppendAnswer from given interface.
func ( *MessageActionPollAppendAnswer) ( interface {
	() ( PollAnswerClass)
}) {
	.Answer = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPollAppendAnswer) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPollAppendAnswer",
		ID:   MessageActionPollAppendAnswerTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Answer",
			SchemaName: "answer",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionPollAppendAnswer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPollAppendAnswer#9da1cd6c as nil")
	}
	.PutID(MessageActionPollAppendAnswerTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPollAppendAnswer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPollAppendAnswer#9da1cd6c as nil")
	}
	if .Answer == nil {
		return fmt.Errorf("unable to encode messageActionPollAppendAnswer#9da1cd6c: field answer is nil")
	}
	if  := .Answer.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPollAppendAnswer#9da1cd6c: field answer: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPollAppendAnswer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPollAppendAnswer#9da1cd6c to nil")
	}
	{
		,  := DecodePollAnswer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPollAppendAnswer#9da1cd6c: field answer: %w", )
		}
		.Answer = 
	}
	return nil
}

// GetAnswer returns value of Answer field.
func ( *MessageActionPollAppendAnswer) () ( PollAnswerClass) {
	if  == nil {
		return
	}
	return .Answer
}

// MessageActionPollDeleteAnswer represents TL type `messageActionPollDeleteAnswer#399674dc`.
//
// See https://core.telegram.org/constructor/messageActionPollDeleteAnswer for reference.
type MessageActionPollDeleteAnswer struct {
	// Answer field of MessageActionPollDeleteAnswer.
	Answer PollAnswerClass
}

// MessageActionPollDeleteAnswerTypeID is TL type id of MessageActionPollDeleteAnswer.
const MessageActionPollDeleteAnswerTypeID = 0x399674dc

// construct implements constructor of MessageActionClass.
func ( MessageActionPollDeleteAnswer) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionPollDeleteAnswer{}
)

func ( *MessageActionPollDeleteAnswer) () bool {
	if  == nil {
		return true
	}
	if !(.Answer == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessageActionPollDeleteAnswer from given interface.
func ( *MessageActionPollDeleteAnswer) ( interface {
	() ( PollAnswerClass)
}) {
	.Answer = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionPollDeleteAnswer) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionPollDeleteAnswer",
		ID:   MessageActionPollDeleteAnswerTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Answer",
			SchemaName: "answer",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionPollDeleteAnswer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPollDeleteAnswer#399674dc as nil")
	}
	.PutID(MessageActionPollDeleteAnswerTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionPollDeleteAnswer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionPollDeleteAnswer#399674dc as nil")
	}
	if .Answer == nil {
		return fmt.Errorf("unable to encode messageActionPollDeleteAnswer#399674dc: field answer is nil")
	}
	if  := .Answer.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionPollDeleteAnswer#399674dc: field answer: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPollDeleteAnswer) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPollDeleteAnswer#399674dc to nil")
	}
	{
		,  := DecodePollAnswer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPollDeleteAnswer#399674dc: field answer: %w", )
		}
		.Answer = 
	}
	return nil
}

// GetAnswer returns value of Answer field.
func ( *MessageActionPollDeleteAnswer) () ( PollAnswerClass) {
	if  == nil {
		return
	}
	return .Answer
}

// MessageActionManagedBotCreated represents TL type `messageActionManagedBotCreated#16605e3e`.
//
// See https://core.telegram.org/constructor/messageActionManagedBotCreated for reference.
type MessageActionManagedBotCreated struct {
	// BotID field of MessageActionManagedBotCreated.
	BotID int64
}

// MessageActionManagedBotCreatedTypeID is TL type id of MessageActionManagedBotCreated.
const MessageActionManagedBotCreatedTypeID = 0x16605e3e

// construct implements constructor of MessageActionClass.
func ( MessageActionManagedBotCreated) () MessageActionClass { return & }

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

	_ MessageActionClass = &MessageActionManagedBotCreated{}
)

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

	return true
}

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

// FillFrom fills MessageActionManagedBotCreated from given interface.
func ( *MessageActionManagedBotCreated) ( interface {
	() ( int64)
}) {
	.BotID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessageActionManagedBotCreated) () tdp.Type {
	 := tdp.Type{
		Name: "messageActionManagedBotCreated",
		ID:   MessageActionManagedBotCreatedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "BotID",
			SchemaName: "bot_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageActionManagedBotCreated) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionManagedBotCreated#16605e3e as nil")
	}
	.PutID(MessageActionManagedBotCreatedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionManagedBotCreated) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionManagedBotCreated#16605e3e as nil")
	}
	.PutLong(.BotID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionManagedBotCreated) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionManagedBotCreated#16605e3e to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionManagedBotCreated#16605e3e: field bot_id: %w", )
		}
		.BotID = 
	}
	return nil
}

// GetBotID returns value of BotID field.
func ( *MessageActionManagedBotCreated) () ( int64) {
	if  == nil {
		return
	}
	return .BotID
}

// MessageActionClassName is schema name of MessageActionClass.
const MessageActionClassName = "MessageAction"

// MessageActionClass represents MessageAction generic type.
//
// See https://core.telegram.org/type/MessageAction for reference.
//
// Constructors:
//   - [MessageActionEmpty]
//   - [MessageActionChatCreate]
//   - [MessageActionChatEditTitle]
//   - [MessageActionChatEditPhoto]
//   - [MessageActionChatDeletePhoto]
//   - [MessageActionChatAddUser]
//   - [MessageActionChatDeleteUser]
//   - [MessageActionChatJoinedByLink]
//   - [MessageActionChannelCreate]
//   - [MessageActionChatMigrateTo]
//   - [MessageActionChannelMigrateFrom]
//   - [MessageActionPinMessage]
//   - [MessageActionHistoryClear]
//   - [MessageActionGameScore]
//   - [MessageActionPaymentSentMe]
//   - [MessageActionPaymentSent]
//   - [MessageActionPhoneCall]
//   - [MessageActionScreenshotTaken]
//   - [MessageActionCustomAction]
//   - [MessageActionBotAllowed]
//   - [MessageActionSecureValuesSentMe]
//   - [MessageActionSecureValuesSent]
//   - [MessageActionContactSignUp]
//   - [MessageActionGeoProximityReached]
//   - [MessageActionGroupCall]
//   - [MessageActionInviteToGroupCall]
//   - [MessageActionSetMessagesTTL]
//   - [MessageActionGroupCallScheduled]
//   - [MessageActionSetChatTheme]
//   - [MessageActionChatJoinedByRequest]
//   - [MessageActionWebViewDataSentMe]
//   - [MessageActionWebViewDataSent]
//   - [MessageActionGiftPremium]
//   - [MessageActionTopicCreate]
//   - [MessageActionTopicEdit]
//   - [MessageActionSuggestProfilePhoto]
//   - [MessageActionRequestedPeer]
//   - [MessageActionSetChatWallPaper]
//   - [MessageActionGiftCode]
//   - [MessageActionGiveawayLaunch]
//   - [MessageActionGiveawayResults]
//   - [MessageActionBoostApply]
//   - [MessageActionRequestedPeerSentMe]
//   - [MessageActionPaymentRefunded]
//   - [MessageActionGiftStars]
//   - [MessageActionPrizeStars]
//   - [MessageActionStarGift]
//   - [MessageActionStarGiftUnique]
//   - [MessageActionPaidMessagesRefunded]
//   - [MessageActionPaidMessagesPrice]
//   - [MessageActionConferenceCall]
//   - [MessageActionTodoCompletions]
//   - [MessageActionTodoAppendTasks]
//   - [MessageActionSuggestedPostApproval]
//   - [MessageActionSuggestedPostSuccess]
//   - [MessageActionSuggestedPostRefund]
//   - [MessageActionGiftTon]
//   - [MessageActionSuggestBirthday]
//   - [MessageActionStarGiftPurchaseOffer]
//   - [MessageActionStarGiftPurchaseOfferDeclined]
//   - [MessageActionNewCreatorPending]
//   - [MessageActionChangeCreator]
//   - [MessageActionNoForwardsToggle]
//   - [MessageActionNoForwardsRequest]
//   - [MessageActionPollAppendAnswer]
//   - [MessageActionPollDeleteAnswer]
//   - [MessageActionManagedBotCreated]
//
// Example:
//
//	g, err := tg.DecodeMessageAction(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.MessageActionEmpty: // messageActionEmpty#b6aef7b0
//	case *tg.MessageActionChatCreate: // messageActionChatCreate#bd47cbad
//	case *tg.MessageActionChatEditTitle: // messageActionChatEditTitle#b5a1ce5a
//	case *tg.MessageActionChatEditPhoto: // messageActionChatEditPhoto#7fcb13a8
//	case *tg.MessageActionChatDeletePhoto: // messageActionChatDeletePhoto#95e3fbef
//	case *tg.MessageActionChatAddUser: // messageActionChatAddUser#15cefd00
//	case *tg.MessageActionChatDeleteUser: // messageActionChatDeleteUser#a43f30cc
//	case *tg.MessageActionChatJoinedByLink: // messageActionChatJoinedByLink#31224c3
//	case *tg.MessageActionChannelCreate: // messageActionChannelCreate#95d2ac92
//	case *tg.MessageActionChatMigrateTo: // messageActionChatMigrateTo#e1037f92
//	case *tg.MessageActionChannelMigrateFrom: // messageActionChannelMigrateFrom#ea3948e9
//	case *tg.MessageActionPinMessage: // messageActionPinMessage#94bd38ed
//	case *tg.MessageActionHistoryClear: // messageActionHistoryClear#9fbab604
//	case *tg.MessageActionGameScore: // messageActionGameScore#92a72876
//	case *tg.MessageActionPaymentSentMe: // messageActionPaymentSentMe#ffa00ccc
//	case *tg.MessageActionPaymentSent: // messageActionPaymentSent#c624b16e
//	case *tg.MessageActionPhoneCall: // messageActionPhoneCall#80e11a7f
//	case *tg.MessageActionScreenshotTaken: // messageActionScreenshotTaken#4792929b
//	case *tg.MessageActionCustomAction: // messageActionCustomAction#fae69f56
//	case *tg.MessageActionBotAllowed: // messageActionBotAllowed#c516d679
//	case *tg.MessageActionSecureValuesSentMe: // messageActionSecureValuesSentMe#1b287353
//	case *tg.MessageActionSecureValuesSent: // messageActionSecureValuesSent#d95c6154
//	case *tg.MessageActionContactSignUp: // messageActionContactSignUp#f3f25f76
//	case *tg.MessageActionGeoProximityReached: // messageActionGeoProximityReached#98e0d697
//	case *tg.MessageActionGroupCall: // messageActionGroupCall#7a0d7f42
//	case *tg.MessageActionInviteToGroupCall: // messageActionInviteToGroupCall#502f92f7
//	case *tg.MessageActionSetMessagesTTL: // messageActionSetMessagesTTL#3c134d7b
//	case *tg.MessageActionGroupCallScheduled: // messageActionGroupCallScheduled#b3a07661
//	case *tg.MessageActionSetChatTheme: // messageActionSetChatTheme#b91bbd3a
//	case *tg.MessageActionChatJoinedByRequest: // messageActionChatJoinedByRequest#ebbca3cb
//	case *tg.MessageActionWebViewDataSentMe: // messageActionWebViewDataSentMe#47dd8079
//	case *tg.MessageActionWebViewDataSent: // messageActionWebViewDataSent#b4c38cb5
//	case *tg.MessageActionGiftPremium: // messageActionGiftPremium#48e91302
//	case *tg.MessageActionTopicCreate: // messageActionTopicCreate#d999256
//	case *tg.MessageActionTopicEdit: // messageActionTopicEdit#c0944820
//	case *tg.MessageActionSuggestProfilePhoto: // messageActionSuggestProfilePhoto#57de635e
//	case *tg.MessageActionRequestedPeer: // messageActionRequestedPeer#31518e9b
//	case *tg.MessageActionSetChatWallPaper: // messageActionSetChatWallPaper#5060a3f4
//	case *tg.MessageActionGiftCode: // messageActionGiftCode#31c48347
//	case *tg.MessageActionGiveawayLaunch: // messageActionGiveawayLaunch#a80f51e4
//	case *tg.MessageActionGiveawayResults: // messageActionGiveawayResults#87e2f155
//	case *tg.MessageActionBoostApply: // messageActionBoostApply#cc02aa6d
//	case *tg.MessageActionRequestedPeerSentMe: // messageActionRequestedPeerSentMe#93b31848
//	case *tg.MessageActionPaymentRefunded: // messageActionPaymentRefunded#41b3e202
//	case *tg.MessageActionGiftStars: // messageActionGiftStars#45d5b021
//	case *tg.MessageActionPrizeStars: // messageActionPrizeStars#b00c47a2
//	case *tg.MessageActionStarGift: // messageActionStarGift#ea2c31d3
//	case *tg.MessageActionStarGiftUnique: // messageActionStarGiftUnique#e6c31522
//	case *tg.MessageActionPaidMessagesRefunded: // messageActionPaidMessagesRefunded#ac1f1fcd
//	case *tg.MessageActionPaidMessagesPrice: // messageActionPaidMessagesPrice#84b88578
//	case *tg.MessageActionConferenceCall: // messageActionConferenceCall#2ffe2f7a
//	case *tg.MessageActionTodoCompletions: // messageActionTodoCompletions#cc7c5c89
//	case *tg.MessageActionTodoAppendTasks: // messageActionTodoAppendTasks#c7edbc83
//	case *tg.MessageActionSuggestedPostApproval: // messageActionSuggestedPostApproval#ee7a1596
//	case *tg.MessageActionSuggestedPostSuccess: // messageActionSuggestedPostSuccess#95ddcf69
//	case *tg.MessageActionSuggestedPostRefund: // messageActionSuggestedPostRefund#69f916f8
//	case *tg.MessageActionGiftTon: // messageActionGiftTon#a8a3c699
//	case *tg.MessageActionSuggestBirthday: // messageActionSuggestBirthday#2c8f2a25
//	case *tg.MessageActionStarGiftPurchaseOffer: // messageActionStarGiftPurchaseOffer#774278d4
//	case *tg.MessageActionStarGiftPurchaseOfferDeclined: // messageActionStarGiftPurchaseOfferDeclined#73ada76b
//	case *tg.MessageActionNewCreatorPending: // messageActionNewCreatorPending#b07ed085
//	case *tg.MessageActionChangeCreator: // messageActionChangeCreator#e188503b
//	case *tg.MessageActionNoForwardsToggle: // messageActionNoForwardsToggle#bf7d6572
//	case *tg.MessageActionNoForwardsRequest: // messageActionNoForwardsRequest#3e2793ba
//	case *tg.MessageActionPollAppendAnswer: // messageActionPollAppendAnswer#9da1cd6c
//	case *tg.MessageActionPollDeleteAnswer: // messageActionPollDeleteAnswer#399674dc
//	case *tg.MessageActionManagedBotCreated: // messageActionManagedBotCreated#16605e3e
//	default: panic(v)
//	}
type MessageActionClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() MessageActionClass

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

// DecodeMessageAction implements binary de-serialization for MessageActionClass.
func ( *bin.Buffer) (MessageActionClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case MessageActionEmptyTypeID:
		// Decoding messageActionEmpty#b6aef7b0.
		 := MessageActionEmpty{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatCreateTypeID:
		// Decoding messageActionChatCreate#bd47cbad.
		 := MessageActionChatCreate{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatEditTitleTypeID:
		// Decoding messageActionChatEditTitle#b5a1ce5a.
		 := MessageActionChatEditTitle{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatEditPhotoTypeID:
		// Decoding messageActionChatEditPhoto#7fcb13a8.
		 := MessageActionChatEditPhoto{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatDeletePhotoTypeID:
		// Decoding messageActionChatDeletePhoto#95e3fbef.
		 := MessageActionChatDeletePhoto{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatAddUserTypeID:
		// Decoding messageActionChatAddUser#15cefd00.
		 := MessageActionChatAddUser{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatDeleteUserTypeID:
		// Decoding messageActionChatDeleteUser#a43f30cc.
		 := MessageActionChatDeleteUser{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatJoinedByLinkTypeID:
		// Decoding messageActionChatJoinedByLink#31224c3.
		 := MessageActionChatJoinedByLink{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChannelCreateTypeID:
		// Decoding messageActionChannelCreate#95d2ac92.
		 := MessageActionChannelCreate{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatMigrateToTypeID:
		// Decoding messageActionChatMigrateTo#e1037f92.
		 := MessageActionChatMigrateTo{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChannelMigrateFromTypeID:
		// Decoding messageActionChannelMigrateFrom#ea3948e9.
		 := MessageActionChannelMigrateFrom{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPinMessageTypeID:
		// Decoding messageActionPinMessage#94bd38ed.
		 := MessageActionPinMessage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionHistoryClearTypeID:
		// Decoding messageActionHistoryClear#9fbab604.
		 := MessageActionHistoryClear{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGameScoreTypeID:
		// Decoding messageActionGameScore#92a72876.
		 := MessageActionGameScore{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPaymentSentMeTypeID:
		// Decoding messageActionPaymentSentMe#ffa00ccc.
		 := MessageActionPaymentSentMe{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPaymentSentTypeID:
		// Decoding messageActionPaymentSent#c624b16e.
		 := MessageActionPaymentSent{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPhoneCallTypeID:
		// Decoding messageActionPhoneCall#80e11a7f.
		 := MessageActionPhoneCall{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionScreenshotTakenTypeID:
		// Decoding messageActionScreenshotTaken#4792929b.
		 := MessageActionScreenshotTaken{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionCustomActionTypeID:
		// Decoding messageActionCustomAction#fae69f56.
		 := MessageActionCustomAction{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionBotAllowedTypeID:
		// Decoding messageActionBotAllowed#c516d679.
		 := MessageActionBotAllowed{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSecureValuesSentMeTypeID:
		// Decoding messageActionSecureValuesSentMe#1b287353.
		 := MessageActionSecureValuesSentMe{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSecureValuesSentTypeID:
		// Decoding messageActionSecureValuesSent#d95c6154.
		 := MessageActionSecureValuesSent{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionContactSignUpTypeID:
		// Decoding messageActionContactSignUp#f3f25f76.
		 := MessageActionContactSignUp{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGeoProximityReachedTypeID:
		// Decoding messageActionGeoProximityReached#98e0d697.
		 := MessageActionGeoProximityReached{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGroupCallTypeID:
		// Decoding messageActionGroupCall#7a0d7f42.
		 := MessageActionGroupCall{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionInviteToGroupCallTypeID:
		// Decoding messageActionInviteToGroupCall#502f92f7.
		 := MessageActionInviteToGroupCall{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSetMessagesTTLTypeID:
		// Decoding messageActionSetMessagesTTL#3c134d7b.
		 := MessageActionSetMessagesTTL{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGroupCallScheduledTypeID:
		// Decoding messageActionGroupCallScheduled#b3a07661.
		 := MessageActionGroupCallScheduled{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSetChatThemeTypeID:
		// Decoding messageActionSetChatTheme#b91bbd3a.
		 := MessageActionSetChatTheme{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChatJoinedByRequestTypeID:
		// Decoding messageActionChatJoinedByRequest#ebbca3cb.
		 := MessageActionChatJoinedByRequest{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionWebViewDataSentMeTypeID:
		// Decoding messageActionWebViewDataSentMe#47dd8079.
		 := MessageActionWebViewDataSentMe{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionWebViewDataSentTypeID:
		// Decoding messageActionWebViewDataSent#b4c38cb5.
		 := MessageActionWebViewDataSent{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGiftPremiumTypeID:
		// Decoding messageActionGiftPremium#48e91302.
		 := MessageActionGiftPremium{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionTopicCreateTypeID:
		// Decoding messageActionTopicCreate#d999256.
		 := MessageActionTopicCreate{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionTopicEditTypeID:
		// Decoding messageActionTopicEdit#c0944820.
		 := MessageActionTopicEdit{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSuggestProfilePhotoTypeID:
		// Decoding messageActionSuggestProfilePhoto#57de635e.
		 := MessageActionSuggestProfilePhoto{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionRequestedPeerTypeID:
		// Decoding messageActionRequestedPeer#31518e9b.
		 := MessageActionRequestedPeer{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSetChatWallPaperTypeID:
		// Decoding messageActionSetChatWallPaper#5060a3f4.
		 := MessageActionSetChatWallPaper{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGiftCodeTypeID:
		// Decoding messageActionGiftCode#31c48347.
		 := MessageActionGiftCode{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGiveawayLaunchTypeID:
		// Decoding messageActionGiveawayLaunch#a80f51e4.
		 := MessageActionGiveawayLaunch{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGiveawayResultsTypeID:
		// Decoding messageActionGiveawayResults#87e2f155.
		 := MessageActionGiveawayResults{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionBoostApplyTypeID:
		// Decoding messageActionBoostApply#cc02aa6d.
		 := MessageActionBoostApply{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionRequestedPeerSentMeTypeID:
		// Decoding messageActionRequestedPeerSentMe#93b31848.
		 := MessageActionRequestedPeerSentMe{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPaymentRefundedTypeID:
		// Decoding messageActionPaymentRefunded#41b3e202.
		 := MessageActionPaymentRefunded{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGiftStarsTypeID:
		// Decoding messageActionGiftStars#45d5b021.
		 := MessageActionGiftStars{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPrizeStarsTypeID:
		// Decoding messageActionPrizeStars#b00c47a2.
		 := MessageActionPrizeStars{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionStarGiftTypeID:
		// Decoding messageActionStarGift#ea2c31d3.
		 := MessageActionStarGift{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionStarGiftUniqueTypeID:
		// Decoding messageActionStarGiftUnique#e6c31522.
		 := MessageActionStarGiftUnique{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPaidMessagesRefundedTypeID:
		// Decoding messageActionPaidMessagesRefunded#ac1f1fcd.
		 := MessageActionPaidMessagesRefunded{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPaidMessagesPriceTypeID:
		// Decoding messageActionPaidMessagesPrice#84b88578.
		 := MessageActionPaidMessagesPrice{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionConferenceCallTypeID:
		// Decoding messageActionConferenceCall#2ffe2f7a.
		 := MessageActionConferenceCall{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionTodoCompletionsTypeID:
		// Decoding messageActionTodoCompletions#cc7c5c89.
		 := MessageActionTodoCompletions{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionTodoAppendTasksTypeID:
		// Decoding messageActionTodoAppendTasks#c7edbc83.
		 := MessageActionTodoAppendTasks{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSuggestedPostApprovalTypeID:
		// Decoding messageActionSuggestedPostApproval#ee7a1596.
		 := MessageActionSuggestedPostApproval{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSuggestedPostSuccessTypeID:
		// Decoding messageActionSuggestedPostSuccess#95ddcf69.
		 := MessageActionSuggestedPostSuccess{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSuggestedPostRefundTypeID:
		// Decoding messageActionSuggestedPostRefund#69f916f8.
		 := MessageActionSuggestedPostRefund{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGiftTonTypeID:
		// Decoding messageActionGiftTon#a8a3c699.
		 := MessageActionGiftTon{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionSuggestBirthdayTypeID:
		// Decoding messageActionSuggestBirthday#2c8f2a25.
		 := MessageActionSuggestBirthday{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionStarGiftPurchaseOfferTypeID:
		// Decoding messageActionStarGiftPurchaseOffer#774278d4.
		 := MessageActionStarGiftPurchaseOffer{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionStarGiftPurchaseOfferDeclinedTypeID:
		// Decoding messageActionStarGiftPurchaseOfferDeclined#73ada76b.
		 := MessageActionStarGiftPurchaseOfferDeclined{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionNewCreatorPendingTypeID:
		// Decoding messageActionNewCreatorPending#b07ed085.
		 := MessageActionNewCreatorPending{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionChangeCreatorTypeID:
		// Decoding messageActionChangeCreator#e188503b.
		 := MessageActionChangeCreator{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionNoForwardsToggleTypeID:
		// Decoding messageActionNoForwardsToggle#bf7d6572.
		 := MessageActionNoForwardsToggle{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionNoForwardsRequestTypeID:
		// Decoding messageActionNoForwardsRequest#3e2793ba.
		 := MessageActionNoForwardsRequest{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPollAppendAnswerTypeID:
		// Decoding messageActionPollAppendAnswer#9da1cd6c.
		 := MessageActionPollAppendAnswer{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPollDeleteAnswerTypeID:
		// Decoding messageActionPollDeleteAnswer#399674dc.
		 := MessageActionPollDeleteAnswer{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionManagedBotCreatedTypeID:
		// Decoding messageActionManagedBotCreated#16605e3e.
		 := MessageActionManagedBotCreated{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode MessageActionClass: %w", bin.NewUnexpectedID())
	}
}

// MessageAction boxes the MessageActionClass providing a helper.
type MessageActionBox struct {
	MessageAction MessageActionClass
}

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

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