// 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#8f31b327`.
// 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
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	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
}

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

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

	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)
}) {
	.RecurringInit = .()
	.RecurringUsed = .()
	.Currency = .()
	.TotalAmount = .()
	.Payload = .()
	if ,  := .();  {
		.Info = 
	}

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

	.Charge = .()
}

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

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

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

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

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

// MessageActionPaymentSent represents TL type `messageActionPaymentSent#96163f56`.
// 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
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	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
}

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

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

	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)
}) {
	.RecurringInit = .()
	.RecurringUsed = .()
	.Currency = .()
	.TotalAmount = .()
	if ,  := .();  {
		.InvoiceSlug = 
	}

}

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

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

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

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionPaymentSent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionPaymentSent#96163f56 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#96163f56: field flags: %w", )
		}
	}
	.RecurringInit = .Flags.Has(2)
	.RecurringUsed = .Flags.Has(3)
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#96163f56: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#96163f56: field total_amount: %w", )
		}
		.TotalAmount = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionPaymentSent#96163f56: field invoice_slug: %w", )
		}
		.InvoiceSlug = 
	}
	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
}

// 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`.
// The group call has ended
//
// 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 InputGroupCall
	// Group call duration
	//
	// 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.Zero()) {
		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 {
	() ( InputGroupCall)
	() ( 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.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", )
		}
	}
	{
		if  := .Call.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGroupCall#7a0d7f42: field call: %w", )
		}
	}
	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) () ( InputGroupCall) {
	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 the group call
//
// See https://core.telegram.org/constructor/messageActionInviteToGroupCall for reference.
type MessageActionInviteToGroupCall struct {
	// The group call
	Call InputGroupCall
	// 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.Zero()) {
		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 {
	() ( InputGroupCall)
	() ( []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.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")
	}
	{
		if  := .Call.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionInviteToGroupCall#502f92f7: field call: %w", )
		}
	}
	{
		,  := .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) () ( InputGroupCall) {
	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 group call was scheduled
//
// See https://core.telegram.org/constructor/messageActionGroupCallScheduled for reference.
type MessageActionGroupCallScheduled struct {
	// The group call
	Call InputGroupCall
	// When is this 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.Zero()) {
		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 {
	() ( InputGroupCall)
	() ( 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.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")
	}
	{
		if  := .Call.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGroupCallScheduled#b3a07661: field call: %w", )
		}
	}
	{
		,  := .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) () ( InputGroupCall) {
	if  == nil {
		return
	}
	return .Call
}

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

// MessageActionSetChatTheme represents TL type `messageActionSetChatTheme#aa786345`.
// The chat theme was changed
//
// See https://core.telegram.org/constructor/messageActionSetChatTheme for reference.
type MessageActionSetChatTheme struct {
	// The emoji that identifies a chat theme
	Emoticon string
}

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

// 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 !(.Emoticon == "") {
		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 {
	() ( string)
}) {
	.Emoticon = .()
}

// 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:       "Emoticon",
			SchemaName: "emoticon",
		},
	}
	return 
}

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

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionSetChatTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionSetChatTheme#aa786345 as nil")
	}
	.PutString(.Emoticon)
	return nil
}

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

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

// GetEmoticon returns value of Emoticon field.
func ( *MessageActionSetChatTheme) () ( string) {
	if  == nil {
		return
	}
	return .Emoticon
}

// 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#c83d6aec`.
// Info about a gifted Telegram Premium subscription
//
// 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
	Months 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
}

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

// 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 !(.Months == 0) {
		return false
	}
	if !(.CryptoCurrency == "") {
		return false
	}
	if !(.CryptoAmount == 0) {
		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)
}) {
	.Currency = .()
	.Amount = .()
	.Months = .()
	if ,  := .();  {
		.CryptoCurrency = 
	}

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

}

// 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:       "Months",
			SchemaName: "months",
		},
		{
			Name:       "CryptoCurrency",
			SchemaName: "crypto_currency",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "CryptoAmount",
			SchemaName: "crypto_amount",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

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

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

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

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiftPremium) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiftPremium#c83d6aec to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#c83d6aec: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#c83d6aec: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#c83d6aec: field amount: %w", )
		}
		.Amount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#c83d6aec: field months: %w", )
		}
		.Months = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#c83d6aec: field crypto_currency: %w", )
		}
		.CryptoCurrency = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftPremium#c83d6aec: field crypto_amount: %w", )
		}
		.CryptoAmount = 
	}
	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
}

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

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

// 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
	// 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 !(.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 {
	() ( string)
	() ( int)
	() ( int64,  bool)
}) {
	.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:       "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 !(.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", )
		}
	}
	{
		,  := .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
}

// 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 a peer that the user shared with the bot after clicking on a
// keyboardButtonRequestPeer¹ button.
//
// 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
	// Peers field of MessageActionRequestedPeer.
	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#678c2e09`.
// 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 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 that created the gift code either directly or through a
	// giveaway¹: if we import this giftcode link, we will also automatically boost² this
	// channel.
	//
	// Links:
	//  1) https://core.telegram.org/api/giveaways
	//  2) https://core.telegram.org/api/boost
	//
	// Use SetBoostPeer and GetBoostPeer helpers.
	BoostPeer PeerClass
	// Duration in months of the gifted Telegram Premium subscription¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/premium
	Months int
	// Slug of the Telegram Premium giftcode link¹
	//
	// Links:
	//  1) https://core.telegram.org/api/links#premium-giftcode-links
	Slug string
	// Currency field of MessageActionGiftCode.
	//
	// Use SetCurrency and GetCurrency helpers.
	Currency string
	// Amount field of MessageActionGiftCode.
	//
	// Use SetAmount and GetAmount helpers.
	Amount int64
	// CryptoCurrency field of MessageActionGiftCode.
	//
	// Use SetCryptoCurrency and GetCryptoCurrency helpers.
	CryptoCurrency string
	// CryptoAmount field of MessageActionGiftCode.
	//
	// Use SetCryptoAmount and GetCryptoAmount helpers.
	CryptoAmount int64
}

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

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

	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)
}) {
	.ViaGiveaway = .()
	.Unclaimed = .()
	if ,  := .();  {
		.BoostPeer = 
	}

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

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

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

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

}

// 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(2),
		},
		{
			Name:       "BoostPeer",
			SchemaName: "boost_peer",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Months",
			SchemaName: "months",
		},
		{
			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),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *MessageActionGiftCode) () {
	if !(.ViaGiveaway == false) {
		.Flags.Set(0)
	}
	if !(.Unclaimed == false) {
		.Flags.Set(2)
	}
	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)
	}
}

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

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGiftCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiftCode#678c2e09 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode messageActionGiftCode#678c2e09: field flags: %w", )
	}
	if .Flags.Has(1) {
		if .BoostPeer == nil {
			return fmt.Errorf("unable to encode messageActionGiftCode#678c2e09: field boost_peer is nil")
		}
		if  := .BoostPeer.Encode();  != nil {
			return fmt.Errorf("unable to encode messageActionGiftCode#678c2e09: field boost_peer: %w", )
		}
	}
	.PutInt(.Months)
	.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)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiftCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiftCode#678c2e09 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field flags: %w", )
		}
	}
	.ViaGiveaway = .Flags.Has(0)
	.Unclaimed = .Flags.Has(2)
	if .Flags.Has(1) {
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field boost_peer: %w", )
		}
		.BoostPeer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field months: %w", )
		}
		.Months = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field slug: %w", )
		}
		.Slug = 
	}
	if .Flags.Has(2) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field currency: %w", )
		}
		.Currency = 
	}
	if .Flags.Has(2) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field amount: %w", )
		}
		.Amount = 
	}
	if .Flags.Has(3) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field crypto_currency: %w", )
		}
		.CryptoCurrency = 
	}
	if .Flags.Has(3) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field crypto_amount: %w", )
		}
		.CryptoAmount = 
	}
	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(2)
		.Unclaimed = true
	} else {
		.Flags.Unset(2)
		.Unclaimed = false
	}
}

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

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

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

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

// MessageActionGiveawayLaunch represents TL type `messageActionGiveawayLaunch#332ba9ed`.
// A giveaway¹ was started.
//
// Links:
//  1. https://core.telegram.org/api/giveaways
//
// See https://core.telegram.org/constructor/messageActionGiveawayLaunch for reference.
type MessageActionGiveawayLaunch struct {
}

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

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

	return true
}

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

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

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

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGiveawayLaunch) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiveawayLaunch#332ba9ed as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiveawayLaunch) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiveawayLaunch#332ba9ed to nil")
	}
	return nil
}

// MessageActionGiveawayResults represents TL type `messageActionGiveawayResults#2a9fadc5`.
// A giveaway¹ has ended.
//
// Links:
//  1. https://core.telegram.org/api/giveaways
//
// See https://core.telegram.org/constructor/messageActionGiveawayResults for reference.
type MessageActionGiveawayResults struct {
	// Number of winners in the giveaway
	WinnersCount int
	// Number of undistributed prizes
	UnclaimedCount int
}

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

// 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 !(.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 {
	() ( int)
	() ( int)
}) {
	.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:       "WinnersCount",
			SchemaName: "winners_count",
		},
		{
			Name:       "UnclaimedCount",
			SchemaName: "unclaimed_count",
		},
	}
	return 
}

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

// EncodeBare implements bin.BareEncoder.
func ( *MessageActionGiveawayResults) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageActionGiveawayResults#2a9fadc5 as nil")
	}
	.PutInt(.WinnersCount)
	.PutInt(.UnclaimedCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessageActionGiveawayResults) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageActionGiveawayResults#2a9fadc5 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiveawayResults#2a9fadc5: field winners_count: %w", )
		}
		.WinnersCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageActionGiveawayResults#2a9fadc5: field unclaimed_count: %w", )
		}
		.UnclaimedCount = 
	}
	return nil
}

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

// MessageActionClassName is schema name of MessageActionClass.
const MessageActionClassName = "MessageAction"

// MessageActionClass represents MessageAction generic type.
//
// See https://core.telegram.org/type/MessageAction for reference.
//
// 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#8f31b327
//	case *tg.MessageActionPaymentSent: // messageActionPaymentSent#96163f56
//	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#aa786345
//	case *tg.MessageActionChatJoinedByRequest: // messageActionChatJoinedByRequest#ebbca3cb
//	case *tg.MessageActionWebViewDataSentMe: // messageActionWebViewDataSentMe#47dd8079
//	case *tg.MessageActionWebViewDataSent: // messageActionWebViewDataSent#b4c38cb5
//	case *tg.MessageActionGiftPremium: // messageActionGiftPremium#c83d6aec
//	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#678c2e09
//	case *tg.MessageActionGiveawayLaunch: // messageActionGiveawayLaunch#332ba9ed
//	case *tg.MessageActionGiveawayResults: // messageActionGiveawayResults#2a9fadc5
//	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#8f31b327.
		 := MessageActionPaymentSentMe{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionPaymentSentTypeID:
		// Decoding messageActionPaymentSent#96163f56.
		 := 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#aa786345.
		 := 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#c83d6aec.
		 := 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#678c2e09.
		 := MessageActionGiftCode{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGiveawayLaunchTypeID:
		// Decoding messageActionGiveawayLaunch#332ba9ed.
		 := MessageActionGiveawayLaunch{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageActionClass: %w", )
		}
		return &, nil
	case MessageActionGiveawayResultsTypeID:
		// Decoding messageActionGiveawayResults#2a9fadc5.
		 := MessageActionGiveawayResults{}
		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()
}