// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	"context"
	"errors"
	"fmt"
	"sort"
	"strings"

	"go.uber.org/multierr"

	"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
)

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

// ChannelAdminLogEventActionChangeTitle represents TL type `channelAdminLogEventActionChangeTitle#e6dfb825`.
// Channel/supergroup title was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeTitle for reference.
type ChannelAdminLogEventActionChangeTitle struct {
	// Previous title
	PrevValue string
	// New title
	NewValue string
}

// ChannelAdminLogEventActionChangeTitleTypeID is TL type id of ChannelAdminLogEventActionChangeTitle.
const ChannelAdminLogEventActionChangeTitleTypeID = 0xe6dfb825

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeTitle) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeTitle{}
)

func (c *ChannelAdminLogEventActionChangeTitle) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == "") {
		return false
	}
	if !(c.NewValue == "") {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeTitle from given interface.
func (c *ChannelAdminLogEventActionChangeTitle) FillFrom(from interface {
	GetPrevValue() (value string)
	GetNewValue() (value string)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeTitle) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeTitle",
		ID:   ChannelAdminLogEventActionChangeTitleTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeTitle) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeTitle#e6dfb825 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeTitleTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeTitle) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeTitle#e6dfb825 as nil")
	}
	b.PutString(c.PrevValue)
	b.PutString(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeTitle) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeTitle#e6dfb825 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeTitleTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeTitle#e6dfb825: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeTitle) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeTitle#e6dfb825 to nil")
	}
	{
		value, err := b.String()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeTitle#e6dfb825: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := b.String()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeTitle#e6dfb825: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeTitle) GetPrevValue() (value string) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeTitle) GetNewValue() (value string) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangeAbout represents TL type `channelAdminLogEventActionChangeAbout#55188a2e`.
// The description was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeAbout for reference.
type ChannelAdminLogEventActionChangeAbout struct {
	// Previous description
	PrevValue string
	// New description
	NewValue string
}

// ChannelAdminLogEventActionChangeAboutTypeID is TL type id of ChannelAdminLogEventActionChangeAbout.
const ChannelAdminLogEventActionChangeAboutTypeID = 0x55188a2e

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeAbout) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeAbout{}
)

func (c *ChannelAdminLogEventActionChangeAbout) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == "") {
		return false
	}
	if !(c.NewValue == "") {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeAbout from given interface.
func (c *ChannelAdminLogEventActionChangeAbout) FillFrom(from interface {
	GetPrevValue() (value string)
	GetNewValue() (value string)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeAbout) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeAbout",
		ID:   ChannelAdminLogEventActionChangeAboutTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeAbout) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeAbout#55188a2e as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeAboutTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeAbout) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeAbout#55188a2e as nil")
	}
	b.PutString(c.PrevValue)
	b.PutString(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeAbout) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeAbout#55188a2e to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeAboutTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeAbout#55188a2e: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeAbout) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeAbout#55188a2e to nil")
	}
	{
		value, err := b.String()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeAbout#55188a2e: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := b.String()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeAbout#55188a2e: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeAbout) GetPrevValue() (value string) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeAbout) GetNewValue() (value string) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangeUsername represents TL type `channelAdminLogEventActionChangeUsername#6a4afc38`.
// Channel/supergroup username was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeUsername for reference.
type ChannelAdminLogEventActionChangeUsername struct {
	// Old username
	PrevValue string
	// New username
	NewValue string
}

// ChannelAdminLogEventActionChangeUsernameTypeID is TL type id of ChannelAdminLogEventActionChangeUsername.
const ChannelAdminLogEventActionChangeUsernameTypeID = 0x6a4afc38

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeUsername) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeUsername{}
)

func (c *ChannelAdminLogEventActionChangeUsername) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == "") {
		return false
	}
	if !(c.NewValue == "") {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeUsername from given interface.
func (c *ChannelAdminLogEventActionChangeUsername) FillFrom(from interface {
	GetPrevValue() (value string)
	GetNewValue() (value string)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeUsername) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeUsername",
		ID:   ChannelAdminLogEventActionChangeUsernameTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeUsername) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeUsername#6a4afc38 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeUsernameTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeUsername) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeUsername#6a4afc38 as nil")
	}
	b.PutString(c.PrevValue)
	b.PutString(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeUsername) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeUsername#6a4afc38 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeUsernameTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeUsername#6a4afc38: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeUsername) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeUsername#6a4afc38 to nil")
	}
	{
		value, err := b.String()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeUsername#6a4afc38: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := b.String()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeUsername#6a4afc38: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeUsername) GetPrevValue() (value string) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeUsername) GetNewValue() (value string) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangePhoto represents TL type `channelAdminLogEventActionChangePhoto#434bd2af`.
// The channel/supergroup's picture was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangePhoto for reference.
type ChannelAdminLogEventActionChangePhoto struct {
	// Previous picture
	PrevPhoto PhotoClass
	// New picture
	NewPhoto PhotoClass
}

// ChannelAdminLogEventActionChangePhotoTypeID is TL type id of ChannelAdminLogEventActionChangePhoto.
const ChannelAdminLogEventActionChangePhotoTypeID = 0x434bd2af

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangePhoto) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangePhoto{}
)

func (c *ChannelAdminLogEventActionChangePhoto) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevPhoto == nil) {
		return false
	}
	if !(c.NewPhoto == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangePhoto from given interface.
func (c *ChannelAdminLogEventActionChangePhoto) FillFrom(from interface {
	GetPrevPhoto() (value PhotoClass)
	GetNewPhoto() (value PhotoClass)
}) {
	c.PrevPhoto = from.GetPrevPhoto()
	c.NewPhoto = from.GetNewPhoto()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangePhoto) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangePhoto",
		ID:   ChannelAdminLogEventActionChangePhotoTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevPhoto",
			SchemaName: "prev_photo",
		},
		{
			Name:       "NewPhoto",
			SchemaName: "new_photo",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangePhoto) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangePhoto#434bd2af as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangePhotoTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangePhoto) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangePhoto#434bd2af as nil")
	}
	if c.PrevPhoto == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangePhoto#434bd2af: field prev_photo is nil")
	}
	if err := c.PrevPhoto.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangePhoto#434bd2af: field prev_photo: %w", err)
	}
	if c.NewPhoto == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangePhoto#434bd2af: field new_photo is nil")
	}
	if err := c.NewPhoto.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangePhoto#434bd2af: field new_photo: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangePhoto) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangePhoto#434bd2af to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangePhotoTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangePhoto#434bd2af: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangePhoto) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangePhoto#434bd2af to nil")
	}
	{
		value, err := DecodePhoto(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangePhoto#434bd2af: field prev_photo: %w", err)
		}
		c.PrevPhoto = value
	}
	{
		value, err := DecodePhoto(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangePhoto#434bd2af: field new_photo: %w", err)
		}
		c.NewPhoto = value
	}
	return nil
}

// GetPrevPhoto returns value of PrevPhoto field.
func (c *ChannelAdminLogEventActionChangePhoto) GetPrevPhoto() (value PhotoClass) {
	if c == nil {
		return
	}
	return c.PrevPhoto
}

// GetNewPhoto returns value of NewPhoto field.
func (c *ChannelAdminLogEventActionChangePhoto) GetNewPhoto() (value PhotoClass) {
	if c == nil {
		return
	}
	return c.NewPhoto
}

// ChannelAdminLogEventActionToggleInvites represents TL type `channelAdminLogEventActionToggleInvites#1b7907ae`.
// Invites were enabled/disabled
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleInvites for reference.
type ChannelAdminLogEventActionToggleInvites struct {
	// New value
	NewValue bool
}

// ChannelAdminLogEventActionToggleInvitesTypeID is TL type id of ChannelAdminLogEventActionToggleInvites.
const ChannelAdminLogEventActionToggleInvitesTypeID = 0x1b7907ae

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleInvites) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleInvites{}
)

func (c *ChannelAdminLogEventActionToggleInvites) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleInvites from given interface.
func (c *ChannelAdminLogEventActionToggleInvites) FillFrom(from interface {
	GetNewValue() (value bool)
}) {
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleInvites) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleInvites",
		ID:   ChannelAdminLogEventActionToggleInvitesTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleInvites) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleInvites#1b7907ae as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleInvitesTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleInvites) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleInvites#1b7907ae as nil")
	}
	b.PutBool(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleInvites) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleInvites#1b7907ae to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleInvitesTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleInvites#1b7907ae: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleInvites) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleInvites#1b7907ae to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleInvites#1b7907ae: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionToggleInvites) GetNewValue() (value bool) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionToggleSignatures represents TL type `channelAdminLogEventActionToggleSignatures#26ae0971`.
// Channel signatures were enabled/disabled
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleSignatures for reference.
type ChannelAdminLogEventActionToggleSignatures struct {
	// New value
	NewValue bool
}

// ChannelAdminLogEventActionToggleSignaturesTypeID is TL type id of ChannelAdminLogEventActionToggleSignatures.
const ChannelAdminLogEventActionToggleSignaturesTypeID = 0x26ae0971

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleSignatures) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleSignatures{}
)

func (c *ChannelAdminLogEventActionToggleSignatures) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleSignatures from given interface.
func (c *ChannelAdminLogEventActionToggleSignatures) FillFrom(from interface {
	GetNewValue() (value bool)
}) {
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleSignatures) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleSignatures",
		ID:   ChannelAdminLogEventActionToggleSignaturesTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleSignatures) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleSignatures#26ae0971 as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleSignaturesTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleSignatures) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleSignatures#26ae0971 as nil")
	}
	b.PutBool(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleSignatures) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleSignatures#26ae0971 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleSignaturesTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleSignatures#26ae0971: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleSignatures) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleSignatures#26ae0971 to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleSignatures#26ae0971: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionToggleSignatures) GetNewValue() (value bool) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionUpdatePinned represents TL type `channelAdminLogEventActionUpdatePinned#e9e82c18`.
// A message was pinned
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionUpdatePinned for reference.
type ChannelAdminLogEventActionUpdatePinned struct {
	// The message that was pinned
	Message MessageClass
}

// ChannelAdminLogEventActionUpdatePinnedTypeID is TL type id of ChannelAdminLogEventActionUpdatePinned.
const ChannelAdminLogEventActionUpdatePinnedTypeID = 0xe9e82c18

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionUpdatePinned) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionUpdatePinned{}
)

func (c *ChannelAdminLogEventActionUpdatePinned) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Message == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionUpdatePinned from given interface.
func (c *ChannelAdminLogEventActionUpdatePinned) FillFrom(from interface {
	GetMessage() (value MessageClass)
}) {
	c.Message = from.GetMessage()
}

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

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

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

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionUpdatePinned) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionUpdatePinned#e9e82c18 as nil")
	}
	b.PutID(ChannelAdminLogEventActionUpdatePinnedTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionUpdatePinned) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionUpdatePinned#e9e82c18 as nil")
	}
	if c.Message == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionUpdatePinned#e9e82c18: field message is nil")
	}
	if err := c.Message.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionUpdatePinned#e9e82c18: field message: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionUpdatePinned) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionUpdatePinned#e9e82c18 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionUpdatePinnedTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionUpdatePinned#e9e82c18: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionUpdatePinned) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionUpdatePinned#e9e82c18 to nil")
	}
	{
		value, err := DecodeMessage(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionUpdatePinned#e9e82c18: field message: %w", err)
		}
		c.Message = value
	}
	return nil
}

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

// ChannelAdminLogEventActionEditMessage represents TL type `channelAdminLogEventActionEditMessage#709b2405`.
// A message was edited
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionEditMessage for reference.
type ChannelAdminLogEventActionEditMessage struct {
	// Old message
	PrevMessage MessageClass
	// New message
	NewMessage MessageClass
}

// ChannelAdminLogEventActionEditMessageTypeID is TL type id of ChannelAdminLogEventActionEditMessage.
const ChannelAdminLogEventActionEditMessageTypeID = 0x709b2405

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionEditMessage) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionEditMessage{}
)

func (c *ChannelAdminLogEventActionEditMessage) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevMessage == nil) {
		return false
	}
	if !(c.NewMessage == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionEditMessage from given interface.
func (c *ChannelAdminLogEventActionEditMessage) FillFrom(from interface {
	GetPrevMessage() (value MessageClass)
	GetNewMessage() (value MessageClass)
}) {
	c.PrevMessage = from.GetPrevMessage()
	c.NewMessage = from.GetNewMessage()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionEditMessage) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionEditMessage",
		ID:   ChannelAdminLogEventActionEditMessageTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevMessage",
			SchemaName: "prev_message",
		},
		{
			Name:       "NewMessage",
			SchemaName: "new_message",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionEditMessage) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionEditMessage#709b2405 as nil")
	}
	b.PutID(ChannelAdminLogEventActionEditMessageTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionEditMessage) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionEditMessage#709b2405 as nil")
	}
	if c.PrevMessage == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionEditMessage#709b2405: field prev_message is nil")
	}
	if err := c.PrevMessage.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionEditMessage#709b2405: field prev_message: %w", err)
	}
	if c.NewMessage == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionEditMessage#709b2405: field new_message is nil")
	}
	if err := c.NewMessage.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionEditMessage#709b2405: field new_message: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionEditMessage) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionEditMessage#709b2405 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionEditMessageTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionEditMessage#709b2405: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionEditMessage) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionEditMessage#709b2405 to nil")
	}
	{
		value, err := DecodeMessage(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionEditMessage#709b2405: field prev_message: %w", err)
		}
		c.PrevMessage = value
	}
	{
		value, err := DecodeMessage(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionEditMessage#709b2405: field new_message: %w", err)
		}
		c.NewMessage = value
	}
	return nil
}

// GetPrevMessage returns value of PrevMessage field.
func (c *ChannelAdminLogEventActionEditMessage) GetPrevMessage() (value MessageClass) {
	if c == nil {
		return
	}
	return c.PrevMessage
}

// GetNewMessage returns value of NewMessage field.
func (c *ChannelAdminLogEventActionEditMessage) GetNewMessage() (value MessageClass) {
	if c == nil {
		return
	}
	return c.NewMessage
}

// ChannelAdminLogEventActionDeleteMessage represents TL type `channelAdminLogEventActionDeleteMessage#42e047bb`.
// A message was deleted
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionDeleteMessage for reference.
type ChannelAdminLogEventActionDeleteMessage struct {
	// The message that was deleted
	Message MessageClass
}

// ChannelAdminLogEventActionDeleteMessageTypeID is TL type id of ChannelAdminLogEventActionDeleteMessage.
const ChannelAdminLogEventActionDeleteMessageTypeID = 0x42e047bb

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionDeleteMessage) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionDeleteMessage{}
)

func (c *ChannelAdminLogEventActionDeleteMessage) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Message == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionDeleteMessage from given interface.
func (c *ChannelAdminLogEventActionDeleteMessage) FillFrom(from interface {
	GetMessage() (value MessageClass)
}) {
	c.Message = from.GetMessage()
}

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

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

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

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionDeleteMessage) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionDeleteMessage#42e047bb as nil")
	}
	b.PutID(ChannelAdminLogEventActionDeleteMessageTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionDeleteMessage) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionDeleteMessage#42e047bb as nil")
	}
	if c.Message == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionDeleteMessage#42e047bb: field message is nil")
	}
	if err := c.Message.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionDeleteMessage#42e047bb: field message: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionDeleteMessage) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionDeleteMessage#42e047bb to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionDeleteMessageTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionDeleteMessage#42e047bb: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionDeleteMessage) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionDeleteMessage#42e047bb to nil")
	}
	{
		value, err := DecodeMessage(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionDeleteMessage#42e047bb: field message: %w", err)
		}
		c.Message = value
	}
	return nil
}

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

// ChannelAdminLogEventActionParticipantJoin represents TL type `channelAdminLogEventActionParticipantJoin#183040d3`.
// A user has joined the group (in the case of big groups, info of the user that has
// joined isn't shown)
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantJoin for reference.
type ChannelAdminLogEventActionParticipantJoin struct {
}

// ChannelAdminLogEventActionParticipantJoinTypeID is TL type id of ChannelAdminLogEventActionParticipantJoin.
const ChannelAdminLogEventActionParticipantJoinTypeID = 0x183040d3

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantJoin) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantJoin{}
)

func (c *ChannelAdminLogEventActionParticipantJoin) Zero() bool {
	if c == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantJoin) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantJoin",
		ID:   ChannelAdminLogEventActionParticipantJoinTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantJoin) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantJoin#183040d3 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantJoinTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantJoin) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantJoin#183040d3 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantJoin) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantJoin#183040d3 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantJoinTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantJoin#183040d3: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantJoin) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantJoin#183040d3 to nil")
	}
	return nil
}

// ChannelAdminLogEventActionParticipantLeave represents TL type `channelAdminLogEventActionParticipantLeave#f89777f2`.
// A user left the channel/supergroup (in the case of big groups, info of the user that
// has joined isn't shown)
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantLeave for reference.
type ChannelAdminLogEventActionParticipantLeave struct {
}

// ChannelAdminLogEventActionParticipantLeaveTypeID is TL type id of ChannelAdminLogEventActionParticipantLeave.
const ChannelAdminLogEventActionParticipantLeaveTypeID = 0xf89777f2

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantLeave) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantLeave{}
)

func (c *ChannelAdminLogEventActionParticipantLeave) Zero() bool {
	if c == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantLeave) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantLeave",
		ID:   ChannelAdminLogEventActionParticipantLeaveTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantLeave) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantLeave#f89777f2 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantLeaveTypeID)
	return c.EncodeBare(b)
}

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

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantLeave) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantLeave#f89777f2 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantLeaveTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantLeave#f89777f2: %w", err)
	}
	return c.DecodeBare(b)
}

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

// ChannelAdminLogEventActionParticipantInvite represents TL type `channelAdminLogEventActionParticipantInvite#e31c34d8`.
// A user was invited to the group
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantInvite for reference.
type ChannelAdminLogEventActionParticipantInvite struct {
	// The user that was invited
	Participant ChannelParticipantClass
}

// ChannelAdminLogEventActionParticipantInviteTypeID is TL type id of ChannelAdminLogEventActionParticipantInvite.
const ChannelAdminLogEventActionParticipantInviteTypeID = 0xe31c34d8

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantInvite) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantInvite{}
)

func (c *ChannelAdminLogEventActionParticipantInvite) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Participant == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantInvite from given interface.
func (c *ChannelAdminLogEventActionParticipantInvite) FillFrom(from interface {
	GetParticipant() (value ChannelParticipantClass)
}) {
	c.Participant = from.GetParticipant()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantInvite) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantInvite",
		ID:   ChannelAdminLogEventActionParticipantInviteTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Participant",
			SchemaName: "participant",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantInvite) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantInvite#e31c34d8 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantInviteTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantInvite) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantInvite#e31c34d8 as nil")
	}
	if c.Participant == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantInvite#e31c34d8: field participant is nil")
	}
	if err := c.Participant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantInvite#e31c34d8: field participant: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantInvite) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantInvite#e31c34d8 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantInviteTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantInvite#e31c34d8: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantInvite) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantInvite#e31c34d8 to nil")
	}
	{
		value, err := DecodeChannelParticipant(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantInvite#e31c34d8: field participant: %w", err)
		}
		c.Participant = value
	}
	return nil
}

// GetParticipant returns value of Participant field.
func (c *ChannelAdminLogEventActionParticipantInvite) GetParticipant() (value ChannelParticipantClass) {
	if c == nil {
		return
	}
	return c.Participant
}

// ChannelAdminLogEventActionParticipantToggleBan represents TL type `channelAdminLogEventActionParticipantToggleBan#e6d83d7e`.
// The banned rights¹ of a user were changed
//
// Links:
//  1. https://core.telegram.org/api/rights
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantToggleBan for reference.
type ChannelAdminLogEventActionParticipantToggleBan struct {
	// Old banned rights of user
	PrevParticipant ChannelParticipantClass
	// New banned rights of user
	NewParticipant ChannelParticipantClass
}

// ChannelAdminLogEventActionParticipantToggleBanTypeID is TL type id of ChannelAdminLogEventActionParticipantToggleBan.
const ChannelAdminLogEventActionParticipantToggleBanTypeID = 0xe6d83d7e

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantToggleBan) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantToggleBan{}
)

func (c *ChannelAdminLogEventActionParticipantToggleBan) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevParticipant == nil) {
		return false
	}
	if !(c.NewParticipant == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantToggleBan from given interface.
func (c *ChannelAdminLogEventActionParticipantToggleBan) FillFrom(from interface {
	GetPrevParticipant() (value ChannelParticipantClass)
	GetNewParticipant() (value ChannelParticipantClass)
}) {
	c.PrevParticipant = from.GetPrevParticipant()
	c.NewParticipant = from.GetNewParticipant()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantToggleBan) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantToggleBan",
		ID:   ChannelAdminLogEventActionParticipantToggleBanTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevParticipant",
			SchemaName: "prev_participant",
		},
		{
			Name:       "NewParticipant",
			SchemaName: "new_participant",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantToggleBan) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantToggleBan#e6d83d7e as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantToggleBanTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantToggleBan) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantToggleBan#e6d83d7e as nil")
	}
	if c.PrevParticipant == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantToggleBan#e6d83d7e: field prev_participant is nil")
	}
	if err := c.PrevParticipant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantToggleBan#e6d83d7e: field prev_participant: %w", err)
	}
	if c.NewParticipant == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantToggleBan#e6d83d7e: field new_participant is nil")
	}
	if err := c.NewParticipant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantToggleBan#e6d83d7e: field new_participant: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantToggleBan) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantToggleBan#e6d83d7e to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantToggleBanTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantToggleBan#e6d83d7e: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantToggleBan) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantToggleBan#e6d83d7e to nil")
	}
	{
		value, err := DecodeChannelParticipant(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantToggleBan#e6d83d7e: field prev_participant: %w", err)
		}
		c.PrevParticipant = value
	}
	{
		value, err := DecodeChannelParticipant(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantToggleBan#e6d83d7e: field new_participant: %w", err)
		}
		c.NewParticipant = value
	}
	return nil
}

// GetPrevParticipant returns value of PrevParticipant field.
func (c *ChannelAdminLogEventActionParticipantToggleBan) GetPrevParticipant() (value ChannelParticipantClass) {
	if c == nil {
		return
	}
	return c.PrevParticipant
}

// GetNewParticipant returns value of NewParticipant field.
func (c *ChannelAdminLogEventActionParticipantToggleBan) GetNewParticipant() (value ChannelParticipantClass) {
	if c == nil {
		return
	}
	return c.NewParticipant
}

// ChannelAdminLogEventActionParticipantToggleAdmin represents TL type `channelAdminLogEventActionParticipantToggleAdmin#d5676710`.
// The admin rights¹ of a user were changed
//
// Links:
//  1. https://core.telegram.org/api/rights
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantToggleAdmin for reference.
type ChannelAdminLogEventActionParticipantToggleAdmin struct {
	// Previous admin rights
	PrevParticipant ChannelParticipantClass
	// New admin rights
	NewParticipant ChannelParticipantClass
}

// ChannelAdminLogEventActionParticipantToggleAdminTypeID is TL type id of ChannelAdminLogEventActionParticipantToggleAdmin.
const ChannelAdminLogEventActionParticipantToggleAdminTypeID = 0xd5676710

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantToggleAdmin) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantToggleAdmin{}
)

func (c *ChannelAdminLogEventActionParticipantToggleAdmin) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevParticipant == nil) {
		return false
	}
	if !(c.NewParticipant == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantToggleAdmin from given interface.
func (c *ChannelAdminLogEventActionParticipantToggleAdmin) FillFrom(from interface {
	GetPrevParticipant() (value ChannelParticipantClass)
	GetNewParticipant() (value ChannelParticipantClass)
}) {
	c.PrevParticipant = from.GetPrevParticipant()
	c.NewParticipant = from.GetNewParticipant()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantToggleAdmin) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantToggleAdmin",
		ID:   ChannelAdminLogEventActionParticipantToggleAdminTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevParticipant",
			SchemaName: "prev_participant",
		},
		{
			Name:       "NewParticipant",
			SchemaName: "new_participant",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantToggleAdmin) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantToggleAdmin#d5676710 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantToggleAdminTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantToggleAdmin) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantToggleAdmin#d5676710 as nil")
	}
	if c.PrevParticipant == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantToggleAdmin#d5676710: field prev_participant is nil")
	}
	if err := c.PrevParticipant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantToggleAdmin#d5676710: field prev_participant: %w", err)
	}
	if c.NewParticipant == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantToggleAdmin#d5676710: field new_participant is nil")
	}
	if err := c.NewParticipant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantToggleAdmin#d5676710: field new_participant: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantToggleAdmin) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantToggleAdmin#d5676710 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantToggleAdminTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantToggleAdmin#d5676710: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantToggleAdmin) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantToggleAdmin#d5676710 to nil")
	}
	{
		value, err := DecodeChannelParticipant(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantToggleAdmin#d5676710: field prev_participant: %w", err)
		}
		c.PrevParticipant = value
	}
	{
		value, err := DecodeChannelParticipant(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantToggleAdmin#d5676710: field new_participant: %w", err)
		}
		c.NewParticipant = value
	}
	return nil
}

// GetPrevParticipant returns value of PrevParticipant field.
func (c *ChannelAdminLogEventActionParticipantToggleAdmin) GetPrevParticipant() (value ChannelParticipantClass) {
	if c == nil {
		return
	}
	return c.PrevParticipant
}

// GetNewParticipant returns value of NewParticipant field.
func (c *ChannelAdminLogEventActionParticipantToggleAdmin) GetNewParticipant() (value ChannelParticipantClass) {
	if c == nil {
		return
	}
	return c.NewParticipant
}

// ChannelAdminLogEventActionChangeStickerSet represents TL type `channelAdminLogEventActionChangeStickerSet#b1c3caa7`.
// The supergroup's stickerset was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeStickerSet for reference.
type ChannelAdminLogEventActionChangeStickerSet struct {
	// Previous stickerset
	PrevStickerset InputStickerSetClass
	// New stickerset
	NewStickerset InputStickerSetClass
}

// ChannelAdminLogEventActionChangeStickerSetTypeID is TL type id of ChannelAdminLogEventActionChangeStickerSet.
const ChannelAdminLogEventActionChangeStickerSetTypeID = 0xb1c3caa7

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeStickerSet) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeStickerSet{}
)

func (c *ChannelAdminLogEventActionChangeStickerSet) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevStickerset == nil) {
		return false
	}
	if !(c.NewStickerset == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeStickerSet from given interface.
func (c *ChannelAdminLogEventActionChangeStickerSet) FillFrom(from interface {
	GetPrevStickerset() (value InputStickerSetClass)
	GetNewStickerset() (value InputStickerSetClass)
}) {
	c.PrevStickerset = from.GetPrevStickerset()
	c.NewStickerset = from.GetNewStickerset()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeStickerSet) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeStickerSet",
		ID:   ChannelAdminLogEventActionChangeStickerSetTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevStickerset",
			SchemaName: "prev_stickerset",
		},
		{
			Name:       "NewStickerset",
			SchemaName: "new_stickerset",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeStickerSet) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeStickerSet#b1c3caa7 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeStickerSetTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeStickerSet) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeStickerSet#b1c3caa7 as nil")
	}
	if c.PrevStickerset == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeStickerSet#b1c3caa7: field prev_stickerset is nil")
	}
	if err := c.PrevStickerset.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeStickerSet#b1c3caa7: field prev_stickerset: %w", err)
	}
	if c.NewStickerset == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeStickerSet#b1c3caa7: field new_stickerset is nil")
	}
	if err := c.NewStickerset.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeStickerSet#b1c3caa7: field new_stickerset: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeStickerSet) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeStickerSet#b1c3caa7 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeStickerSetTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeStickerSet#b1c3caa7: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeStickerSet) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeStickerSet#b1c3caa7 to nil")
	}
	{
		value, err := DecodeInputStickerSet(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeStickerSet#b1c3caa7: field prev_stickerset: %w", err)
		}
		c.PrevStickerset = value
	}
	{
		value, err := DecodeInputStickerSet(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeStickerSet#b1c3caa7: field new_stickerset: %w", err)
		}
		c.NewStickerset = value
	}
	return nil
}

// GetPrevStickerset returns value of PrevStickerset field.
func (c *ChannelAdminLogEventActionChangeStickerSet) GetPrevStickerset() (value InputStickerSetClass) {
	if c == nil {
		return
	}
	return c.PrevStickerset
}

// GetNewStickerset returns value of NewStickerset field.
func (c *ChannelAdminLogEventActionChangeStickerSet) GetNewStickerset() (value InputStickerSetClass) {
	if c == nil {
		return
	}
	return c.NewStickerset
}

// ChannelAdminLogEventActionTogglePreHistoryHidden represents TL type `channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1`.
// The hidden prehistory setting was changed¹
//
// Links:
//  1. https://core.telegram.org/method/channels.togglePreHistoryHidden
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionTogglePreHistoryHidden for reference.
type ChannelAdminLogEventActionTogglePreHistoryHidden struct {
	// New value
	NewValue bool
}

// ChannelAdminLogEventActionTogglePreHistoryHiddenTypeID is TL type id of ChannelAdminLogEventActionTogglePreHistoryHidden.
const ChannelAdminLogEventActionTogglePreHistoryHiddenTypeID = 0x5f5c95f1

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionTogglePreHistoryHidden) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionTogglePreHistoryHidden{}
)

func (c *ChannelAdminLogEventActionTogglePreHistoryHidden) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionTogglePreHistoryHidden from given interface.
func (c *ChannelAdminLogEventActionTogglePreHistoryHidden) FillFrom(from interface {
	GetNewValue() (value bool)
}) {
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionTogglePreHistoryHidden) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionTogglePreHistoryHidden",
		ID:   ChannelAdminLogEventActionTogglePreHistoryHiddenTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionTogglePreHistoryHidden) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 as nil")
	}
	b.PutID(ChannelAdminLogEventActionTogglePreHistoryHiddenTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionTogglePreHistoryHidden) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 as nil")
	}
	b.PutBool(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionTogglePreHistoryHidden) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionTogglePreHistoryHiddenTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionTogglePreHistoryHidden) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionTogglePreHistoryHidden) GetNewValue() (value bool) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionDefaultBannedRights represents TL type `channelAdminLogEventActionDefaultBannedRights#2df5fc0a`.
// The default banned rights were modified
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionDefaultBannedRights for reference.
type ChannelAdminLogEventActionDefaultBannedRights struct {
	// Previous global banned rights¹
	//
	// Links:
	//  1) https://core.telegram.org/api/rights
	PrevBannedRights ChatBannedRights
	// New global banned rights¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/rights
	NewBannedRights ChatBannedRights
}

// ChannelAdminLogEventActionDefaultBannedRightsTypeID is TL type id of ChannelAdminLogEventActionDefaultBannedRights.
const ChannelAdminLogEventActionDefaultBannedRightsTypeID = 0x2df5fc0a

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionDefaultBannedRights) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionDefaultBannedRights{}
)

func (c *ChannelAdminLogEventActionDefaultBannedRights) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevBannedRights.Zero()) {
		return false
	}
	if !(c.NewBannedRights.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionDefaultBannedRights from given interface.
func (c *ChannelAdminLogEventActionDefaultBannedRights) FillFrom(from interface {
	GetPrevBannedRights() (value ChatBannedRights)
	GetNewBannedRights() (value ChatBannedRights)
}) {
	c.PrevBannedRights = from.GetPrevBannedRights()
	c.NewBannedRights = from.GetNewBannedRights()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionDefaultBannedRights) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionDefaultBannedRights",
		ID:   ChannelAdminLogEventActionDefaultBannedRightsTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevBannedRights",
			SchemaName: "prev_banned_rights",
		},
		{
			Name:       "NewBannedRights",
			SchemaName: "new_banned_rights",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionDefaultBannedRights) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionDefaultBannedRights#2df5fc0a as nil")
	}
	b.PutID(ChannelAdminLogEventActionDefaultBannedRightsTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionDefaultBannedRights) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionDefaultBannedRights#2df5fc0a as nil")
	}
	if err := c.PrevBannedRights.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionDefaultBannedRights#2df5fc0a: field prev_banned_rights: %w", err)
	}
	if err := c.NewBannedRights.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionDefaultBannedRights#2df5fc0a: field new_banned_rights: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionDefaultBannedRights) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionDefaultBannedRights#2df5fc0a to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionDefaultBannedRightsTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionDefaultBannedRights#2df5fc0a: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionDefaultBannedRights) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionDefaultBannedRights#2df5fc0a to nil")
	}
	{
		if err := c.PrevBannedRights.Decode(b); err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionDefaultBannedRights#2df5fc0a: field prev_banned_rights: %w", err)
		}
	}
	{
		if err := c.NewBannedRights.Decode(b); err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionDefaultBannedRights#2df5fc0a: field new_banned_rights: %w", err)
		}
	}
	return nil
}

// GetPrevBannedRights returns value of PrevBannedRights field.
func (c *ChannelAdminLogEventActionDefaultBannedRights) GetPrevBannedRights() (value ChatBannedRights) {
	if c == nil {
		return
	}
	return c.PrevBannedRights
}

// GetNewBannedRights returns value of NewBannedRights field.
func (c *ChannelAdminLogEventActionDefaultBannedRights) GetNewBannedRights() (value ChatBannedRights) {
	if c == nil {
		return
	}
	return c.NewBannedRights
}

// ChannelAdminLogEventActionStopPoll represents TL type `channelAdminLogEventActionStopPoll#8f079643`.
// A poll was stopped
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionStopPoll for reference.
type ChannelAdminLogEventActionStopPoll struct {
	// The poll that was stopped
	Message MessageClass
}

// ChannelAdminLogEventActionStopPollTypeID is TL type id of ChannelAdminLogEventActionStopPoll.
const ChannelAdminLogEventActionStopPollTypeID = 0x8f079643

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionStopPoll) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionStopPoll{}
)

func (c *ChannelAdminLogEventActionStopPoll) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Message == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionStopPoll from given interface.
func (c *ChannelAdminLogEventActionStopPoll) FillFrom(from interface {
	GetMessage() (value MessageClass)
}) {
	c.Message = from.GetMessage()
}

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

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

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

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionStopPoll) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionStopPoll#8f079643 as nil")
	}
	b.PutID(ChannelAdminLogEventActionStopPollTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionStopPoll) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionStopPoll#8f079643 as nil")
	}
	if c.Message == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionStopPoll#8f079643: field message is nil")
	}
	if err := c.Message.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionStopPoll#8f079643: field message: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionStopPoll) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionStopPoll#8f079643 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionStopPollTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionStopPoll#8f079643: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionStopPoll) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionStopPoll#8f079643 to nil")
	}
	{
		value, err := DecodeMessage(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionStopPoll#8f079643: field message: %w", err)
		}
		c.Message = value
	}
	return nil
}

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

// ChannelAdminLogEventActionChangeLinkedChat represents TL type `channelAdminLogEventActionChangeLinkedChat#50c7ac8`.
// The linked chat was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeLinkedChat for reference.
type ChannelAdminLogEventActionChangeLinkedChat struct {
	// Previous linked chat
	PrevValue int64
	// New linked chat
	NewValue int64
}

// ChannelAdminLogEventActionChangeLinkedChatTypeID is TL type id of ChannelAdminLogEventActionChangeLinkedChat.
const ChannelAdminLogEventActionChangeLinkedChatTypeID = 0x50c7ac8

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeLinkedChat) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeLinkedChat{}
)

func (c *ChannelAdminLogEventActionChangeLinkedChat) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == 0) {
		return false
	}
	if !(c.NewValue == 0) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeLinkedChat from given interface.
func (c *ChannelAdminLogEventActionChangeLinkedChat) FillFrom(from interface {
	GetPrevValue() (value int64)
	GetNewValue() (value int64)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeLinkedChat) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeLinkedChat",
		ID:   ChannelAdminLogEventActionChangeLinkedChatTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeLinkedChat) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeLinkedChat#50c7ac8 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeLinkedChatTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeLinkedChat) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeLinkedChat#50c7ac8 as nil")
	}
	b.PutLong(c.PrevValue)
	b.PutLong(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeLinkedChat) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeLinkedChat#50c7ac8 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeLinkedChatTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#50c7ac8: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeLinkedChat) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeLinkedChat#50c7ac8 to nil")
	}
	{
		value, err := b.Long()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#50c7ac8: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := b.Long()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLinkedChat#50c7ac8: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeLinkedChat) GetPrevValue() (value int64) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeLinkedChat) GetNewValue() (value int64) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangeLocation represents TL type `channelAdminLogEventActionChangeLocation#e6b76ae`.
// The geogroup location was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeLocation for reference.
type ChannelAdminLogEventActionChangeLocation struct {
	// Previous location
	PrevValue ChannelLocationClass
	// New location
	NewValue ChannelLocationClass
}

// ChannelAdminLogEventActionChangeLocationTypeID is TL type id of ChannelAdminLogEventActionChangeLocation.
const ChannelAdminLogEventActionChangeLocationTypeID = 0xe6b76ae

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeLocation) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeLocation{}
)

func (c *ChannelAdminLogEventActionChangeLocation) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == nil) {
		return false
	}
	if !(c.NewValue == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeLocation from given interface.
func (c *ChannelAdminLogEventActionChangeLocation) FillFrom(from interface {
	GetPrevValue() (value ChannelLocationClass)
	GetNewValue() (value ChannelLocationClass)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeLocation) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeLocation",
		ID:   ChannelAdminLogEventActionChangeLocationTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeLocation) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeLocation#e6b76ae as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeLocationTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeLocation) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeLocation#e6b76ae as nil")
	}
	if c.PrevValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeLocation#e6b76ae: field prev_value is nil")
	}
	if err := c.PrevValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeLocation#e6b76ae: field prev_value: %w", err)
	}
	if c.NewValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeLocation#e6b76ae: field new_value is nil")
	}
	if err := c.NewValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeLocation#e6b76ae: field new_value: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeLocation) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeLocation#e6b76ae to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeLocationTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLocation#e6b76ae: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeLocation) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeLocation#e6b76ae to nil")
	}
	{
		value, err := DecodeChannelLocation(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLocation#e6b76ae: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := DecodeChannelLocation(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeLocation#e6b76ae: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeLocation) GetPrevValue() (value ChannelLocationClass) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeLocation) GetNewValue() (value ChannelLocationClass) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionToggleSlowMode represents TL type `channelAdminLogEventActionToggleSlowMode#53909779`.
// Slow mode setting for supergroups was changed¹
//
// Links:
//  1. https://core.telegram.org/method/channels.toggleSlowMode
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleSlowMode for reference.
type ChannelAdminLogEventActionToggleSlowMode struct {
	// Previous slow mode value
	PrevValue int
	// New slow mode value
	NewValue int
}

// ChannelAdminLogEventActionToggleSlowModeTypeID is TL type id of ChannelAdminLogEventActionToggleSlowMode.
const ChannelAdminLogEventActionToggleSlowModeTypeID = 0x53909779

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleSlowMode) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleSlowMode{}
)

func (c *ChannelAdminLogEventActionToggleSlowMode) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == 0) {
		return false
	}
	if !(c.NewValue == 0) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleSlowMode from given interface.
func (c *ChannelAdminLogEventActionToggleSlowMode) FillFrom(from interface {
	GetPrevValue() (value int)
	GetNewValue() (value int)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleSlowMode) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleSlowMode",
		ID:   ChannelAdminLogEventActionToggleSlowModeTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleSlowMode) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleSlowMode#53909779 as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleSlowModeTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleSlowMode) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleSlowMode#53909779 as nil")
	}
	b.PutInt(c.PrevValue)
	b.PutInt(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleSlowMode) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleSlowMode#53909779 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleSlowModeTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleSlowMode#53909779: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleSlowMode) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleSlowMode#53909779 to nil")
	}
	{
		value, err := b.Int()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleSlowMode#53909779: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := b.Int()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleSlowMode#53909779: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionToggleSlowMode) GetPrevValue() (value int) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionToggleSlowMode) GetNewValue() (value int) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionStartGroupCall represents TL type `channelAdminLogEventActionStartGroupCall#23209745`.
// A group call was started
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionStartGroupCall for reference.
type ChannelAdminLogEventActionStartGroupCall struct {
	// Group call
	Call InputGroupCallClass
}

// ChannelAdminLogEventActionStartGroupCallTypeID is TL type id of ChannelAdminLogEventActionStartGroupCall.
const ChannelAdminLogEventActionStartGroupCallTypeID = 0x23209745

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionStartGroupCall) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionStartGroupCall{}
)

func (c *ChannelAdminLogEventActionStartGroupCall) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Call == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionStartGroupCall from given interface.
func (c *ChannelAdminLogEventActionStartGroupCall) FillFrom(from interface {
	GetCall() (value InputGroupCallClass)
}) {
	c.Call = from.GetCall()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionStartGroupCall) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionStartGroupCall",
		ID:   ChannelAdminLogEventActionStartGroupCallTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionStartGroupCall) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionStartGroupCall#23209745 as nil")
	}
	b.PutID(ChannelAdminLogEventActionStartGroupCallTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionStartGroupCall) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionStartGroupCall#23209745 as nil")
	}
	if c.Call == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionStartGroupCall#23209745: field call is nil")
	}
	if err := c.Call.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionStartGroupCall#23209745: field call: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionStartGroupCall) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionStartGroupCall#23209745 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionStartGroupCallTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionStartGroupCall#23209745: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionStartGroupCall) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionStartGroupCall#23209745 to nil")
	}
	{
		value, err := DecodeInputGroupCall(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionStartGroupCall#23209745: field call: %w", err)
		}
		c.Call = value
	}
	return nil
}

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

// ChannelAdminLogEventActionDiscardGroupCall represents TL type `channelAdminLogEventActionDiscardGroupCall#db9f9140`.
// A group call was terminated
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionDiscardGroupCall for reference.
type ChannelAdminLogEventActionDiscardGroupCall struct {
	// The group call that was terminated
	Call InputGroupCallClass
}

// ChannelAdminLogEventActionDiscardGroupCallTypeID is TL type id of ChannelAdminLogEventActionDiscardGroupCall.
const ChannelAdminLogEventActionDiscardGroupCallTypeID = 0xdb9f9140

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionDiscardGroupCall) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionDiscardGroupCall{}
)

func (c *ChannelAdminLogEventActionDiscardGroupCall) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Call == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionDiscardGroupCall from given interface.
func (c *ChannelAdminLogEventActionDiscardGroupCall) FillFrom(from interface {
	GetCall() (value InputGroupCallClass)
}) {
	c.Call = from.GetCall()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionDiscardGroupCall) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionDiscardGroupCall",
		ID:   ChannelAdminLogEventActionDiscardGroupCallTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionDiscardGroupCall) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionDiscardGroupCall#db9f9140 as nil")
	}
	b.PutID(ChannelAdminLogEventActionDiscardGroupCallTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionDiscardGroupCall) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionDiscardGroupCall#db9f9140 as nil")
	}
	if c.Call == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionDiscardGroupCall#db9f9140: field call is nil")
	}
	if err := c.Call.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionDiscardGroupCall#db9f9140: field call: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionDiscardGroupCall) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionDiscardGroupCall#db9f9140 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionDiscardGroupCallTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionDiscardGroupCall#db9f9140: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionDiscardGroupCall) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionDiscardGroupCall#db9f9140 to nil")
	}
	{
		value, err := DecodeInputGroupCall(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionDiscardGroupCall#db9f9140: field call: %w", err)
		}
		c.Call = value
	}
	return nil
}

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

// ChannelAdminLogEventActionParticipantMute represents TL type `channelAdminLogEventActionParticipantMute#f92424d2`.
// A group call participant was muted
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantMute for reference.
type ChannelAdminLogEventActionParticipantMute struct {
	// The participant that was muted
	Participant GroupCallParticipant
}

// ChannelAdminLogEventActionParticipantMuteTypeID is TL type id of ChannelAdminLogEventActionParticipantMute.
const ChannelAdminLogEventActionParticipantMuteTypeID = 0xf92424d2

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantMute) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantMute{}
)

func (c *ChannelAdminLogEventActionParticipantMute) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Participant.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantMute from given interface.
func (c *ChannelAdminLogEventActionParticipantMute) FillFrom(from interface {
	GetParticipant() (value GroupCallParticipant)
}) {
	c.Participant = from.GetParticipant()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantMute) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantMute",
		ID:   ChannelAdminLogEventActionParticipantMuteTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Participant",
			SchemaName: "participant",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantMute) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantMute#f92424d2 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantMuteTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantMute) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantMute#f92424d2 as nil")
	}
	if err := c.Participant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantMute#f92424d2: field participant: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantMute) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantMute#f92424d2 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantMuteTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantMute#f92424d2: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantMute) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantMute#f92424d2 to nil")
	}
	{
		if err := c.Participant.Decode(b); err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantMute#f92424d2: field participant: %w", err)
		}
	}
	return nil
}

// GetParticipant returns value of Participant field.
func (c *ChannelAdminLogEventActionParticipantMute) GetParticipant() (value GroupCallParticipant) {
	if c == nil {
		return
	}
	return c.Participant
}

// ChannelAdminLogEventActionParticipantUnmute represents TL type `channelAdminLogEventActionParticipantUnmute#e64429c0`.
// A group call participant was unmuted
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantUnmute for reference.
type ChannelAdminLogEventActionParticipantUnmute struct {
	// The participant that was unmuted
	Participant GroupCallParticipant
}

// ChannelAdminLogEventActionParticipantUnmuteTypeID is TL type id of ChannelAdminLogEventActionParticipantUnmute.
const ChannelAdminLogEventActionParticipantUnmuteTypeID = 0xe64429c0

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantUnmute) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantUnmute{}
)

func (c *ChannelAdminLogEventActionParticipantUnmute) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Participant.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantUnmute from given interface.
func (c *ChannelAdminLogEventActionParticipantUnmute) FillFrom(from interface {
	GetParticipant() (value GroupCallParticipant)
}) {
	c.Participant = from.GetParticipant()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantUnmute) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantUnmute",
		ID:   ChannelAdminLogEventActionParticipantUnmuteTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Participant",
			SchemaName: "participant",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantUnmute) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantUnmute#e64429c0 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantUnmuteTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantUnmute) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantUnmute#e64429c0 as nil")
	}
	if err := c.Participant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantUnmute#e64429c0: field participant: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantUnmute) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantUnmute#e64429c0 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantUnmuteTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantUnmute#e64429c0: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantUnmute) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantUnmute#e64429c0 to nil")
	}
	{
		if err := c.Participant.Decode(b); err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantUnmute#e64429c0: field participant: %w", err)
		}
	}
	return nil
}

// GetParticipant returns value of Participant field.
func (c *ChannelAdminLogEventActionParticipantUnmute) GetParticipant() (value GroupCallParticipant) {
	if c == nil {
		return
	}
	return c.Participant
}

// ChannelAdminLogEventActionToggleGroupCallSetting represents TL type `channelAdminLogEventActionToggleGroupCallSetting#56d6a247`.
// Group call settings were changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleGroupCallSetting for reference.
type ChannelAdminLogEventActionToggleGroupCallSetting struct {
	// Whether all users are muted by default upon joining
	JoinMuted bool
}

// ChannelAdminLogEventActionToggleGroupCallSettingTypeID is TL type id of ChannelAdminLogEventActionToggleGroupCallSetting.
const ChannelAdminLogEventActionToggleGroupCallSettingTypeID = 0x56d6a247

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleGroupCallSetting) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleGroupCallSetting{}
)

func (c *ChannelAdminLogEventActionToggleGroupCallSetting) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.JoinMuted == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleGroupCallSetting from given interface.
func (c *ChannelAdminLogEventActionToggleGroupCallSetting) FillFrom(from interface {
	GetJoinMuted() (value bool)
}) {
	c.JoinMuted = from.GetJoinMuted()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleGroupCallSetting) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleGroupCallSetting",
		ID:   ChannelAdminLogEventActionToggleGroupCallSettingTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "JoinMuted",
			SchemaName: "join_muted",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleGroupCallSetting) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleGroupCallSetting#56d6a247 as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleGroupCallSettingTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleGroupCallSetting) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleGroupCallSetting#56d6a247 as nil")
	}
	b.PutBool(c.JoinMuted)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleGroupCallSetting) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleGroupCallSetting#56d6a247 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleGroupCallSettingTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleGroupCallSetting#56d6a247: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleGroupCallSetting) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleGroupCallSetting#56d6a247 to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleGroupCallSetting#56d6a247: field join_muted: %w", err)
		}
		c.JoinMuted = value
	}
	return nil
}

// GetJoinMuted returns value of JoinMuted field.
func (c *ChannelAdminLogEventActionToggleGroupCallSetting) GetJoinMuted() (value bool) {
	if c == nil {
		return
	}
	return c.JoinMuted
}

// ChannelAdminLogEventActionParticipantJoinByInvite represents TL type `channelAdminLogEventActionParticipantJoinByInvite#fe9fc158`.
// A user joined the supergroup/channel¹ using a specific invite link
//
// Links:
//  1. https://core.telegram.org/api/channel
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantJoinByInvite for reference.
type ChannelAdminLogEventActionParticipantJoinByInvite struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// The participant joined by importing a chat folder deep link »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/links#chat-folder-links
	ViaChatlist bool
	// The invite link used to join the supergroup/channel¹
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	Invite ExportedChatInviteClass
}

// ChannelAdminLogEventActionParticipantJoinByInviteTypeID is TL type id of ChannelAdminLogEventActionParticipantJoinByInvite.
const ChannelAdminLogEventActionParticipantJoinByInviteTypeID = 0xfe9fc158

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantJoinByInvite) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantJoinByInvite{}
)

func (c *ChannelAdminLogEventActionParticipantJoinByInvite) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Flags.Zero()) {
		return false
	}
	if !(c.ViaChatlist == false) {
		return false
	}
	if !(c.Invite == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantJoinByInvite from given interface.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) FillFrom(from interface {
	GetViaChatlist() (value bool)
	GetInvite() (value ExportedChatInviteClass)
}) {
	c.ViaChatlist = from.GetViaChatlist()
	c.Invite = from.GetInvite()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantJoinByInvite",
		ID:   ChannelAdminLogEventActionParticipantJoinByInviteTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "ViaChatlist",
			SchemaName: "via_chatlist",
			Null:       !c.Flags.Has(0),
		},
		{
			Name:       "Invite",
			SchemaName: "invite",
		},
	}
	return typ
}

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

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantJoinByInviteTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 as nil")
	}
	c.SetFlags()
	if err := c.Flags.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158: field flags: %w", err)
	}
	if c.Invite == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158: field invite is nil")
	}
	if err := c.Invite.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158: field invite: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantJoinByInviteTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158 to nil")
	}
	{
		if err := c.Flags.Decode(b); err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158: field flags: %w", err)
		}
	}
	c.ViaChatlist = c.Flags.Has(0)
	{
		value, err := DecodeExportedChatInvite(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantJoinByInvite#fe9fc158: field invite: %w", err)
		}
		c.Invite = value
	}
	return nil
}

// SetViaChatlist sets value of ViaChatlist conditional field.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) SetViaChatlist(value bool) {
	if value {
		c.Flags.Set(0)
		c.ViaChatlist = true
	} else {
		c.Flags.Unset(0)
		c.ViaChatlist = false
	}
}

// GetViaChatlist returns value of ViaChatlist conditional field.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) GetViaChatlist() (value bool) {
	if c == nil {
		return
	}
	return c.Flags.Has(0)
}

// GetInvite returns value of Invite field.
func (c *ChannelAdminLogEventActionParticipantJoinByInvite) GetInvite() (value ExportedChatInviteClass) {
	if c == nil {
		return
	}
	return c.Invite
}

// ChannelAdminLogEventActionExportedInviteDelete represents TL type `channelAdminLogEventActionExportedInviteDelete#5a50fca4`.
// A chat invite was deleted
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionExportedInviteDelete for reference.
type ChannelAdminLogEventActionExportedInviteDelete struct {
	// The deleted chat invite
	Invite ExportedChatInviteClass
}

// ChannelAdminLogEventActionExportedInviteDeleteTypeID is TL type id of ChannelAdminLogEventActionExportedInviteDelete.
const ChannelAdminLogEventActionExportedInviteDeleteTypeID = 0x5a50fca4

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionExportedInviteDelete) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionExportedInviteDelete{}
)

func (c *ChannelAdminLogEventActionExportedInviteDelete) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Invite == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionExportedInviteDelete from given interface.
func (c *ChannelAdminLogEventActionExportedInviteDelete) FillFrom(from interface {
	GetInvite() (value ExportedChatInviteClass)
}) {
	c.Invite = from.GetInvite()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionExportedInviteDelete) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionExportedInviteDelete",
		ID:   ChannelAdminLogEventActionExportedInviteDeleteTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Invite",
			SchemaName: "invite",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionExportedInviteDelete) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionExportedInviteDelete#5a50fca4 as nil")
	}
	b.PutID(ChannelAdminLogEventActionExportedInviteDeleteTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionExportedInviteDelete) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionExportedInviteDelete#5a50fca4 as nil")
	}
	if c.Invite == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionExportedInviteDelete#5a50fca4: field invite is nil")
	}
	if err := c.Invite.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionExportedInviteDelete#5a50fca4: field invite: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionExportedInviteDelete) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionExportedInviteDelete#5a50fca4 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionExportedInviteDeleteTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionExportedInviteDelete#5a50fca4: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionExportedInviteDelete) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionExportedInviteDelete#5a50fca4 to nil")
	}
	{
		value, err := DecodeExportedChatInvite(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionExportedInviteDelete#5a50fca4: field invite: %w", err)
		}
		c.Invite = value
	}
	return nil
}

// GetInvite returns value of Invite field.
func (c *ChannelAdminLogEventActionExportedInviteDelete) GetInvite() (value ExportedChatInviteClass) {
	if c == nil {
		return
	}
	return c.Invite
}

// ChannelAdminLogEventActionExportedInviteRevoke represents TL type `channelAdminLogEventActionExportedInviteRevoke#410a134e`.
// A specific invite link was revoked
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionExportedInviteRevoke for reference.
type ChannelAdminLogEventActionExportedInviteRevoke struct {
	// The invite link that was revoked
	Invite ExportedChatInviteClass
}

// ChannelAdminLogEventActionExportedInviteRevokeTypeID is TL type id of ChannelAdminLogEventActionExportedInviteRevoke.
const ChannelAdminLogEventActionExportedInviteRevokeTypeID = 0x410a134e

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionExportedInviteRevoke) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionExportedInviteRevoke{}
)

func (c *ChannelAdminLogEventActionExportedInviteRevoke) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Invite == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionExportedInviteRevoke from given interface.
func (c *ChannelAdminLogEventActionExportedInviteRevoke) FillFrom(from interface {
	GetInvite() (value ExportedChatInviteClass)
}) {
	c.Invite = from.GetInvite()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionExportedInviteRevoke) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionExportedInviteRevoke",
		ID:   ChannelAdminLogEventActionExportedInviteRevokeTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Invite",
			SchemaName: "invite",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionExportedInviteRevoke) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionExportedInviteRevoke#410a134e as nil")
	}
	b.PutID(ChannelAdminLogEventActionExportedInviteRevokeTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionExportedInviteRevoke) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionExportedInviteRevoke#410a134e as nil")
	}
	if c.Invite == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionExportedInviteRevoke#410a134e: field invite is nil")
	}
	if err := c.Invite.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionExportedInviteRevoke#410a134e: field invite: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionExportedInviteRevoke) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionExportedInviteRevoke#410a134e to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionExportedInviteRevokeTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionExportedInviteRevoke#410a134e: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionExportedInviteRevoke) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionExportedInviteRevoke#410a134e to nil")
	}
	{
		value, err := DecodeExportedChatInvite(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionExportedInviteRevoke#410a134e: field invite: %w", err)
		}
		c.Invite = value
	}
	return nil
}

// GetInvite returns value of Invite field.
func (c *ChannelAdminLogEventActionExportedInviteRevoke) GetInvite() (value ExportedChatInviteClass) {
	if c == nil {
		return
	}
	return c.Invite
}

// ChannelAdminLogEventActionExportedInviteEdit represents TL type `channelAdminLogEventActionExportedInviteEdit#e90ebb59`.
// A chat invite was edited
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionExportedInviteEdit for reference.
type ChannelAdminLogEventActionExportedInviteEdit struct {
	// Previous chat invite information
	PrevInvite ExportedChatInviteClass
	// New chat invite information
	NewInvite ExportedChatInviteClass
}

// ChannelAdminLogEventActionExportedInviteEditTypeID is TL type id of ChannelAdminLogEventActionExportedInviteEdit.
const ChannelAdminLogEventActionExportedInviteEditTypeID = 0xe90ebb59

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionExportedInviteEdit) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionExportedInviteEdit{}
)

func (c *ChannelAdminLogEventActionExportedInviteEdit) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevInvite == nil) {
		return false
	}
	if !(c.NewInvite == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionExportedInviteEdit from given interface.
func (c *ChannelAdminLogEventActionExportedInviteEdit) FillFrom(from interface {
	GetPrevInvite() (value ExportedChatInviteClass)
	GetNewInvite() (value ExportedChatInviteClass)
}) {
	c.PrevInvite = from.GetPrevInvite()
	c.NewInvite = from.GetNewInvite()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionExportedInviteEdit) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionExportedInviteEdit",
		ID:   ChannelAdminLogEventActionExportedInviteEditTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevInvite",
			SchemaName: "prev_invite",
		},
		{
			Name:       "NewInvite",
			SchemaName: "new_invite",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionExportedInviteEdit) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionExportedInviteEdit#e90ebb59 as nil")
	}
	b.PutID(ChannelAdminLogEventActionExportedInviteEditTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionExportedInviteEdit) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionExportedInviteEdit#e90ebb59 as nil")
	}
	if c.PrevInvite == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionExportedInviteEdit#e90ebb59: field prev_invite is nil")
	}
	if err := c.PrevInvite.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionExportedInviteEdit#e90ebb59: field prev_invite: %w", err)
	}
	if c.NewInvite == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionExportedInviteEdit#e90ebb59: field new_invite is nil")
	}
	if err := c.NewInvite.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionExportedInviteEdit#e90ebb59: field new_invite: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionExportedInviteEdit) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionExportedInviteEdit#e90ebb59 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionExportedInviteEditTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionExportedInviteEdit#e90ebb59: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionExportedInviteEdit) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionExportedInviteEdit#e90ebb59 to nil")
	}
	{
		value, err := DecodeExportedChatInvite(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionExportedInviteEdit#e90ebb59: field prev_invite: %w", err)
		}
		c.PrevInvite = value
	}
	{
		value, err := DecodeExportedChatInvite(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionExportedInviteEdit#e90ebb59: field new_invite: %w", err)
		}
		c.NewInvite = value
	}
	return nil
}

// GetPrevInvite returns value of PrevInvite field.
func (c *ChannelAdminLogEventActionExportedInviteEdit) GetPrevInvite() (value ExportedChatInviteClass) {
	if c == nil {
		return
	}
	return c.PrevInvite
}

// GetNewInvite returns value of NewInvite field.
func (c *ChannelAdminLogEventActionExportedInviteEdit) GetNewInvite() (value ExportedChatInviteClass) {
	if c == nil {
		return
	}
	return c.NewInvite
}

// ChannelAdminLogEventActionParticipantVolume represents TL type `channelAdminLogEventActionParticipantVolume#3e7f6847`.
// channelAdminLogEvent.user_id has set the volume of participant.peer to participant
// volume
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantVolume for reference.
type ChannelAdminLogEventActionParticipantVolume struct {
	// The participant whose volume was changed
	Participant GroupCallParticipant
}

// ChannelAdminLogEventActionParticipantVolumeTypeID is TL type id of ChannelAdminLogEventActionParticipantVolume.
const ChannelAdminLogEventActionParticipantVolumeTypeID = 0x3e7f6847

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantVolume) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantVolume{}
)

func (c *ChannelAdminLogEventActionParticipantVolume) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Participant.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantVolume from given interface.
func (c *ChannelAdminLogEventActionParticipantVolume) FillFrom(from interface {
	GetParticipant() (value GroupCallParticipant)
}) {
	c.Participant = from.GetParticipant()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantVolume) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantVolume",
		ID:   ChannelAdminLogEventActionParticipantVolumeTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Participant",
			SchemaName: "participant",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantVolume) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantVolume#3e7f6847 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantVolumeTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantVolume) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantVolume#3e7f6847 as nil")
	}
	if err := c.Participant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantVolume#3e7f6847: field participant: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantVolume) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantVolume#3e7f6847 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantVolumeTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantVolume#3e7f6847: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantVolume) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantVolume#3e7f6847 to nil")
	}
	{
		if err := c.Participant.Decode(b); err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantVolume#3e7f6847: field participant: %w", err)
		}
	}
	return nil
}

// GetParticipant returns value of Participant field.
func (c *ChannelAdminLogEventActionParticipantVolume) GetParticipant() (value GroupCallParticipant) {
	if c == nil {
		return
	}
	return c.Participant
}

// ChannelAdminLogEventActionChangeHistoryTTL represents TL type `channelAdminLogEventActionChangeHistoryTTL#6e941a38`.
// The Time-To-Live of messages in this chat was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeHistoryTTL for reference.
type ChannelAdminLogEventActionChangeHistoryTTL struct {
	// Previous value
	PrevValue int
	// New value
	NewValue int
}

// ChannelAdminLogEventActionChangeHistoryTTLTypeID is TL type id of ChannelAdminLogEventActionChangeHistoryTTL.
const ChannelAdminLogEventActionChangeHistoryTTLTypeID = 0x6e941a38

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeHistoryTTL) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeHistoryTTL{}
)

func (c *ChannelAdminLogEventActionChangeHistoryTTL) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == 0) {
		return false
	}
	if !(c.NewValue == 0) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeHistoryTTL from given interface.
func (c *ChannelAdminLogEventActionChangeHistoryTTL) FillFrom(from interface {
	GetPrevValue() (value int)
	GetNewValue() (value int)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeHistoryTTL) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeHistoryTTL",
		ID:   ChannelAdminLogEventActionChangeHistoryTTLTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeHistoryTTL) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeHistoryTTL#6e941a38 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeHistoryTTLTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeHistoryTTL) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeHistoryTTL#6e941a38 as nil")
	}
	b.PutInt(c.PrevValue)
	b.PutInt(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeHistoryTTL) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeHistoryTTL#6e941a38 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeHistoryTTLTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeHistoryTTL#6e941a38: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeHistoryTTL) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeHistoryTTL#6e941a38 to nil")
	}
	{
		value, err := b.Int()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeHistoryTTL#6e941a38: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := b.Int()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeHistoryTTL#6e941a38: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeHistoryTTL) GetPrevValue() (value int) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeHistoryTTL) GetNewValue() (value int) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionParticipantJoinByRequest represents TL type `channelAdminLogEventActionParticipantJoinByRequest#afb6144a`.
// A new member was accepted to the chat by an admin
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantJoinByRequest for reference.
type ChannelAdminLogEventActionParticipantJoinByRequest struct {
	// The invite link that was used to join the chat
	Invite ExportedChatInviteClass
	// ID of the admin that approved the invite
	ApprovedBy int64
}

// ChannelAdminLogEventActionParticipantJoinByRequestTypeID is TL type id of ChannelAdminLogEventActionParticipantJoinByRequest.
const ChannelAdminLogEventActionParticipantJoinByRequestTypeID = 0xafb6144a

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantJoinByRequest) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantJoinByRequest{}
)

func (c *ChannelAdminLogEventActionParticipantJoinByRequest) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Invite == nil) {
		return false
	}
	if !(c.ApprovedBy == 0) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantJoinByRequest from given interface.
func (c *ChannelAdminLogEventActionParticipantJoinByRequest) FillFrom(from interface {
	GetInvite() (value ExportedChatInviteClass)
	GetApprovedBy() (value int64)
}) {
	c.Invite = from.GetInvite()
	c.ApprovedBy = from.GetApprovedBy()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantJoinByRequest) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantJoinByRequest",
		ID:   ChannelAdminLogEventActionParticipantJoinByRequestTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Invite",
			SchemaName: "invite",
		},
		{
			Name:       "ApprovedBy",
			SchemaName: "approved_by",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantJoinByRequest) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantJoinByRequest#afb6144a as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantJoinByRequestTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantJoinByRequest) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantJoinByRequest#afb6144a as nil")
	}
	if c.Invite == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantJoinByRequest#afb6144a: field invite is nil")
	}
	if err := c.Invite.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantJoinByRequest#afb6144a: field invite: %w", err)
	}
	b.PutLong(c.ApprovedBy)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantJoinByRequest) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantJoinByRequest#afb6144a to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantJoinByRequestTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantJoinByRequest#afb6144a: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantJoinByRequest) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantJoinByRequest#afb6144a to nil")
	}
	{
		value, err := DecodeExportedChatInvite(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantJoinByRequest#afb6144a: field invite: %w", err)
		}
		c.Invite = value
	}
	{
		value, err := b.Long()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantJoinByRequest#afb6144a: field approved_by: %w", err)
		}
		c.ApprovedBy = value
	}
	return nil
}

// GetInvite returns value of Invite field.
func (c *ChannelAdminLogEventActionParticipantJoinByRequest) GetInvite() (value ExportedChatInviteClass) {
	if c == nil {
		return
	}
	return c.Invite
}

// GetApprovedBy returns value of ApprovedBy field.
func (c *ChannelAdminLogEventActionParticipantJoinByRequest) GetApprovedBy() (value int64) {
	if c == nil {
		return
	}
	return c.ApprovedBy
}

// ChannelAdminLogEventActionToggleNoForwards represents TL type `channelAdminLogEventActionToggleNoForwards#cb2ac766`.
// Forwards were enabled or disabled
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleNoForwards for reference.
type ChannelAdminLogEventActionToggleNoForwards struct {
	// Old value
	NewValue bool
}

// ChannelAdminLogEventActionToggleNoForwardsTypeID is TL type id of ChannelAdminLogEventActionToggleNoForwards.
const ChannelAdminLogEventActionToggleNoForwardsTypeID = 0xcb2ac766

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleNoForwards) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleNoForwards{}
)

func (c *ChannelAdminLogEventActionToggleNoForwards) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleNoForwards from given interface.
func (c *ChannelAdminLogEventActionToggleNoForwards) FillFrom(from interface {
	GetNewValue() (value bool)
}) {
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleNoForwards) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleNoForwards",
		ID:   ChannelAdminLogEventActionToggleNoForwardsTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleNoForwards) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleNoForwards#cb2ac766 as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleNoForwardsTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleNoForwards) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleNoForwards#cb2ac766 as nil")
	}
	b.PutBool(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleNoForwards) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleNoForwards#cb2ac766 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleNoForwardsTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleNoForwards#cb2ac766: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleNoForwards) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleNoForwards#cb2ac766 to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleNoForwards#cb2ac766: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionToggleNoForwards) GetNewValue() (value bool) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionSendMessage represents TL type `channelAdminLogEventActionSendMessage#278f2868`.
// A message was posted in a channel
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionSendMessage for reference.
type ChannelAdminLogEventActionSendMessage struct {
	// The message that was sent
	Message MessageClass
}

// ChannelAdminLogEventActionSendMessageTypeID is TL type id of ChannelAdminLogEventActionSendMessage.
const ChannelAdminLogEventActionSendMessageTypeID = 0x278f2868

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionSendMessage) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionSendMessage{}
)

func (c *ChannelAdminLogEventActionSendMessage) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Message == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionSendMessage from given interface.
func (c *ChannelAdminLogEventActionSendMessage) FillFrom(from interface {
	GetMessage() (value MessageClass)
}) {
	c.Message = from.GetMessage()
}

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

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

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

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionSendMessage) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionSendMessage#278f2868 as nil")
	}
	b.PutID(ChannelAdminLogEventActionSendMessageTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionSendMessage) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionSendMessage#278f2868 as nil")
	}
	if c.Message == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionSendMessage#278f2868: field message is nil")
	}
	if err := c.Message.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionSendMessage#278f2868: field message: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionSendMessage) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionSendMessage#278f2868 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionSendMessageTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionSendMessage#278f2868: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionSendMessage) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionSendMessage#278f2868 to nil")
	}
	{
		value, err := DecodeMessage(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionSendMessage#278f2868: field message: %w", err)
		}
		c.Message = value
	}
	return nil
}

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

// ChannelAdminLogEventActionChangeAvailableReactions represents TL type `channelAdminLogEventActionChangeAvailableReactions#be4e0ef8`.
// The set of allowed message reactions »¹ for this channel has changed
//
// Links:
//  1. https://core.telegram.org/api/reactions
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeAvailableReactions for reference.
type ChannelAdminLogEventActionChangeAvailableReactions struct {
	// Previously allowed reaction emojis
	PrevValue ChatReactionsClass
	// New allowed reaction emojis
	NewValue ChatReactionsClass
}

// ChannelAdminLogEventActionChangeAvailableReactionsTypeID is TL type id of ChannelAdminLogEventActionChangeAvailableReactions.
const ChannelAdminLogEventActionChangeAvailableReactionsTypeID = 0xbe4e0ef8

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeAvailableReactions) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeAvailableReactions{}
)

func (c *ChannelAdminLogEventActionChangeAvailableReactions) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == nil) {
		return false
	}
	if !(c.NewValue == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeAvailableReactions from given interface.
func (c *ChannelAdminLogEventActionChangeAvailableReactions) FillFrom(from interface {
	GetPrevValue() (value ChatReactionsClass)
	GetNewValue() (value ChatReactionsClass)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeAvailableReactions) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeAvailableReactions",
		ID:   ChannelAdminLogEventActionChangeAvailableReactionsTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeAvailableReactions) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeAvailableReactionsTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeAvailableReactions) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8 as nil")
	}
	if c.PrevValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8: field prev_value is nil")
	}
	if err := c.PrevValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8: field prev_value: %w", err)
	}
	if c.NewValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8: field new_value is nil")
	}
	if err := c.NewValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8: field new_value: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeAvailableReactions) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeAvailableReactionsTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeAvailableReactions) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8 to nil")
	}
	{
		value, err := DecodeChatReactions(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := DecodeChatReactions(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeAvailableReactions#be4e0ef8: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeAvailableReactions) GetPrevValue() (value ChatReactionsClass) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeAvailableReactions) GetNewValue() (value ChatReactionsClass) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangeUsernames represents TL type `channelAdminLogEventActionChangeUsernames#f04fb3a9`.
// The list of usernames associated with the channel was changed
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeUsernames for reference.
type ChannelAdminLogEventActionChangeUsernames struct {
	// Previous set of usernames
	PrevValue []string
	// New set of usernames
	NewValue []string
}

// ChannelAdminLogEventActionChangeUsernamesTypeID is TL type id of ChannelAdminLogEventActionChangeUsernames.
const ChannelAdminLogEventActionChangeUsernamesTypeID = 0xf04fb3a9

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeUsernames) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeUsernames{}
)

func (c *ChannelAdminLogEventActionChangeUsernames) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == nil) {
		return false
	}
	if !(c.NewValue == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeUsernames from given interface.
func (c *ChannelAdminLogEventActionChangeUsernames) FillFrom(from interface {
	GetPrevValue() (value []string)
	GetNewValue() (value []string)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeUsernames) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeUsernames",
		ID:   ChannelAdminLogEventActionChangeUsernamesTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeUsernames) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeUsernames#f04fb3a9 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeUsernamesTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeUsernames) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeUsernames#f04fb3a9 as nil")
	}
	b.PutVectorHeader(len(c.PrevValue))
	for _, v := range c.PrevValue {
		b.PutString(v)
	}
	b.PutVectorHeader(len(c.NewValue))
	for _, v := range c.NewValue {
		b.PutString(v)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeUsernames) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeUsernames#f04fb3a9 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeUsernamesTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeUsernames#f04fb3a9: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeUsernames) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeUsernames#f04fb3a9 to nil")
	}
	{
		headerLen, err := b.VectorHeader()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeUsernames#f04fb3a9: field prev_value: %w", err)
		}

		if headerLen > 0 {
			c.PrevValue = make([]string, 0, headerLen%bin.PreallocateLimit)
		}
		for idx := 0; idx < headerLen; idx++ {
			value, err := b.String()
			if err != nil {
				return fmt.Errorf("unable to decode channelAdminLogEventActionChangeUsernames#f04fb3a9: field prev_value: %w", err)
			}
			c.PrevValue = append(c.PrevValue, value)
		}
	}
	{
		headerLen, err := b.VectorHeader()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeUsernames#f04fb3a9: field new_value: %w", err)
		}

		if headerLen > 0 {
			c.NewValue = make([]string, 0, headerLen%bin.PreallocateLimit)
		}
		for idx := 0; idx < headerLen; idx++ {
			value, err := b.String()
			if err != nil {
				return fmt.Errorf("unable to decode channelAdminLogEventActionChangeUsernames#f04fb3a9: field new_value: %w", err)
			}
			c.NewValue = append(c.NewValue, value)
		}
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeUsernames) GetPrevValue() (value []string) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeUsernames) GetNewValue() (value []string) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionToggleForum represents TL type `channelAdminLogEventActionToggleForum#2cc6383`.
// Forum¹ functionality was enabled or disabled.
//
// Links:
//  1. https://core.telegram.org/api/forum
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleForum for reference.
type ChannelAdminLogEventActionToggleForum struct {
	// Whether forum¹ functionality was enabled or disabled.
	//
	// Links:
	//  1) https://core.telegram.org/api/forum
	NewValue bool
}

// ChannelAdminLogEventActionToggleForumTypeID is TL type id of ChannelAdminLogEventActionToggleForum.
const ChannelAdminLogEventActionToggleForumTypeID = 0x2cc6383

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleForum) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleForum{}
)

func (c *ChannelAdminLogEventActionToggleForum) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleForum from given interface.
func (c *ChannelAdminLogEventActionToggleForum) FillFrom(from interface {
	GetNewValue() (value bool)
}) {
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleForum) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleForum",
		ID:   ChannelAdminLogEventActionToggleForumTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleForum) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleForum#2cc6383 as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleForumTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleForum) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleForum#2cc6383 as nil")
	}
	b.PutBool(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleForum) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleForum#2cc6383 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleForumTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleForum#2cc6383: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleForum) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleForum#2cc6383 to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleForum#2cc6383: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionToggleForum) GetNewValue() (value bool) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionCreateTopic represents TL type `channelAdminLogEventActionCreateTopic#58707d28`.
// A forum topic¹ was created
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionCreateTopic for reference.
type ChannelAdminLogEventActionCreateTopic struct {
	// The forum topic¹ that was created
	//
	// Links:
	//  1) https://core.telegram.org/api/forum#forum-topics
	Topic ForumTopicClass
}

// ChannelAdminLogEventActionCreateTopicTypeID is TL type id of ChannelAdminLogEventActionCreateTopic.
const ChannelAdminLogEventActionCreateTopicTypeID = 0x58707d28

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionCreateTopic) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionCreateTopic{}
)

func (c *ChannelAdminLogEventActionCreateTopic) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Topic == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionCreateTopic from given interface.
func (c *ChannelAdminLogEventActionCreateTopic) FillFrom(from interface {
	GetTopic() (value ForumTopicClass)
}) {
	c.Topic = from.GetTopic()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionCreateTopic) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionCreateTopic",
		ID:   ChannelAdminLogEventActionCreateTopicTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Topic",
			SchemaName: "topic",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionCreateTopic) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionCreateTopic#58707d28 as nil")
	}
	b.PutID(ChannelAdminLogEventActionCreateTopicTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionCreateTopic) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionCreateTopic#58707d28 as nil")
	}
	if c.Topic == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionCreateTopic#58707d28: field topic is nil")
	}
	if err := c.Topic.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionCreateTopic#58707d28: field topic: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionCreateTopic) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionCreateTopic#58707d28 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionCreateTopicTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionCreateTopic#58707d28: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionCreateTopic) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionCreateTopic#58707d28 to nil")
	}
	{
		value, err := DecodeForumTopic(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionCreateTopic#58707d28: field topic: %w", err)
		}
		c.Topic = value
	}
	return nil
}

// GetTopic returns value of Topic field.
func (c *ChannelAdminLogEventActionCreateTopic) GetTopic() (value ForumTopicClass) {
	if c == nil {
		return
	}
	return c.Topic
}

// ChannelAdminLogEventActionEditTopic represents TL type `channelAdminLogEventActionEditTopic#f06fe208`.
// A forum topic¹ was edited
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionEditTopic for reference.
type ChannelAdminLogEventActionEditTopic struct {
	// Previous topic information
	PrevTopic ForumTopicClass
	// New topic information
	NewTopic ForumTopicClass
}

// ChannelAdminLogEventActionEditTopicTypeID is TL type id of ChannelAdminLogEventActionEditTopic.
const ChannelAdminLogEventActionEditTopicTypeID = 0xf06fe208

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionEditTopic) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionEditTopic{}
)

func (c *ChannelAdminLogEventActionEditTopic) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevTopic == nil) {
		return false
	}
	if !(c.NewTopic == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionEditTopic from given interface.
func (c *ChannelAdminLogEventActionEditTopic) FillFrom(from interface {
	GetPrevTopic() (value ForumTopicClass)
	GetNewTopic() (value ForumTopicClass)
}) {
	c.PrevTopic = from.GetPrevTopic()
	c.NewTopic = from.GetNewTopic()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionEditTopic) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionEditTopic",
		ID:   ChannelAdminLogEventActionEditTopicTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevTopic",
			SchemaName: "prev_topic",
		},
		{
			Name:       "NewTopic",
			SchemaName: "new_topic",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionEditTopic) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionEditTopic#f06fe208 as nil")
	}
	b.PutID(ChannelAdminLogEventActionEditTopicTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionEditTopic) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionEditTopic#f06fe208 as nil")
	}
	if c.PrevTopic == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionEditTopic#f06fe208: field prev_topic is nil")
	}
	if err := c.PrevTopic.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionEditTopic#f06fe208: field prev_topic: %w", err)
	}
	if c.NewTopic == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionEditTopic#f06fe208: field new_topic is nil")
	}
	if err := c.NewTopic.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionEditTopic#f06fe208: field new_topic: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionEditTopic) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionEditTopic#f06fe208 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionEditTopicTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionEditTopic#f06fe208: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionEditTopic) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionEditTopic#f06fe208 to nil")
	}
	{
		value, err := DecodeForumTopic(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionEditTopic#f06fe208: field prev_topic: %w", err)
		}
		c.PrevTopic = value
	}
	{
		value, err := DecodeForumTopic(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionEditTopic#f06fe208: field new_topic: %w", err)
		}
		c.NewTopic = value
	}
	return nil
}

// GetPrevTopic returns value of PrevTopic field.
func (c *ChannelAdminLogEventActionEditTopic) GetPrevTopic() (value ForumTopicClass) {
	if c == nil {
		return
	}
	return c.PrevTopic
}

// GetNewTopic returns value of NewTopic field.
func (c *ChannelAdminLogEventActionEditTopic) GetNewTopic() (value ForumTopicClass) {
	if c == nil {
		return
	}
	return c.NewTopic
}

// ChannelAdminLogEventActionDeleteTopic represents TL type `channelAdminLogEventActionDeleteTopic#ae168909`.
// A forum topic¹ was deleted
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionDeleteTopic for reference.
type ChannelAdminLogEventActionDeleteTopic struct {
	// The forum topic¹ that was deleted
	//
	// Links:
	//  1) https://core.telegram.org/api/forum#forum-topics
	Topic ForumTopicClass
}

// ChannelAdminLogEventActionDeleteTopicTypeID is TL type id of ChannelAdminLogEventActionDeleteTopic.
const ChannelAdminLogEventActionDeleteTopicTypeID = 0xae168909

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionDeleteTopic) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionDeleteTopic{}
)

func (c *ChannelAdminLogEventActionDeleteTopic) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Topic == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionDeleteTopic from given interface.
func (c *ChannelAdminLogEventActionDeleteTopic) FillFrom(from interface {
	GetTopic() (value ForumTopicClass)
}) {
	c.Topic = from.GetTopic()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionDeleteTopic) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionDeleteTopic",
		ID:   ChannelAdminLogEventActionDeleteTopicTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "Topic",
			SchemaName: "topic",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionDeleteTopic) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionDeleteTopic#ae168909 as nil")
	}
	b.PutID(ChannelAdminLogEventActionDeleteTopicTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionDeleteTopic) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionDeleteTopic#ae168909 as nil")
	}
	if c.Topic == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionDeleteTopic#ae168909: field topic is nil")
	}
	if err := c.Topic.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionDeleteTopic#ae168909: field topic: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionDeleteTopic) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionDeleteTopic#ae168909 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionDeleteTopicTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionDeleteTopic#ae168909: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionDeleteTopic) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionDeleteTopic#ae168909 to nil")
	}
	{
		value, err := DecodeForumTopic(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionDeleteTopic#ae168909: field topic: %w", err)
		}
		c.Topic = value
	}
	return nil
}

// GetTopic returns value of Topic field.
func (c *ChannelAdminLogEventActionDeleteTopic) GetTopic() (value ForumTopicClass) {
	if c == nil {
		return
	}
	return c.Topic
}

// ChannelAdminLogEventActionPinTopic represents TL type `channelAdminLogEventActionPinTopic#5d8d353b`.
// A forum topic¹ was pinned or unpinned
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionPinTopic for reference.
type ChannelAdminLogEventActionPinTopic struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Previous topic information
	//
	// Use SetPrevTopic and GetPrevTopic helpers.
	PrevTopic ForumTopicClass
	// New topic information
	//
	// Use SetNewTopic and GetNewTopic helpers.
	NewTopic ForumTopicClass
}

// ChannelAdminLogEventActionPinTopicTypeID is TL type id of ChannelAdminLogEventActionPinTopic.
const ChannelAdminLogEventActionPinTopicTypeID = 0x5d8d353b

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionPinTopic) construct() ChannelAdminLogEventActionClass { return &c }

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionPinTopic{}
)

func (c *ChannelAdminLogEventActionPinTopic) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.Flags.Zero()) {
		return false
	}
	if !(c.PrevTopic == nil) {
		return false
	}
	if !(c.NewTopic == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionPinTopic from given interface.
func (c *ChannelAdminLogEventActionPinTopic) FillFrom(from interface {
	GetPrevTopic() (value ForumTopicClass, ok bool)
	GetNewTopic() (value ForumTopicClass, ok bool)
}) {
	if val, ok := from.GetPrevTopic(); ok {
		c.PrevTopic = val
	}

	if val, ok := from.GetNewTopic(); ok {
		c.NewTopic = val
	}

}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionPinTopic) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionPinTopic",
		ID:   ChannelAdminLogEventActionPinTopicTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevTopic",
			SchemaName: "prev_topic",
			Null:       !c.Flags.Has(0),
		},
		{
			Name:       "NewTopic",
			SchemaName: "new_topic",
			Null:       !c.Flags.Has(1),
		},
	}
	return typ
}

// SetFlags sets flags for non-zero fields.
func (c *ChannelAdminLogEventActionPinTopic) SetFlags() {
	if !(c.PrevTopic == nil) {
		c.Flags.Set(0)
	}
	if !(c.NewTopic == nil) {
		c.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionPinTopic) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionPinTopic#5d8d353b as nil")
	}
	b.PutID(ChannelAdminLogEventActionPinTopicTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionPinTopic) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionPinTopic#5d8d353b as nil")
	}
	c.SetFlags()
	if err := c.Flags.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionPinTopic#5d8d353b: field flags: %w", err)
	}
	if c.Flags.Has(0) {
		if c.PrevTopic == nil {
			return fmt.Errorf("unable to encode channelAdminLogEventActionPinTopic#5d8d353b: field prev_topic is nil")
		}
		if err := c.PrevTopic.Encode(b); err != nil {
			return fmt.Errorf("unable to encode channelAdminLogEventActionPinTopic#5d8d353b: field prev_topic: %w", err)
		}
	}
	if c.Flags.Has(1) {
		if c.NewTopic == nil {
			return fmt.Errorf("unable to encode channelAdminLogEventActionPinTopic#5d8d353b: field new_topic is nil")
		}
		if err := c.NewTopic.Encode(b); err != nil {
			return fmt.Errorf("unable to encode channelAdminLogEventActionPinTopic#5d8d353b: field new_topic: %w", err)
		}
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionPinTopic) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionPinTopic#5d8d353b to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionPinTopicTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionPinTopic#5d8d353b: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionPinTopic) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionPinTopic#5d8d353b to nil")
	}
	{
		if err := c.Flags.Decode(b); err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionPinTopic#5d8d353b: field flags: %w", err)
		}
	}
	if c.Flags.Has(0) {
		value, err := DecodeForumTopic(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionPinTopic#5d8d353b: field prev_topic: %w", err)
		}
		c.PrevTopic = value
	}
	if c.Flags.Has(1) {
		value, err := DecodeForumTopic(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionPinTopic#5d8d353b: field new_topic: %w", err)
		}
		c.NewTopic = value
	}
	return nil
}

// SetPrevTopic sets value of PrevTopic conditional field.
func (c *ChannelAdminLogEventActionPinTopic) SetPrevTopic(value ForumTopicClass) {
	c.Flags.Set(0)
	c.PrevTopic = value
}

// GetPrevTopic returns value of PrevTopic conditional field and
// boolean which is true if field was set.
func (c *ChannelAdminLogEventActionPinTopic) GetPrevTopic() (value ForumTopicClass, ok bool) {
	if c == nil {
		return
	}
	if !c.Flags.Has(0) {
		return value, false
	}
	return c.PrevTopic, true
}

// SetNewTopic sets value of NewTopic conditional field.
func (c *ChannelAdminLogEventActionPinTopic) SetNewTopic(value ForumTopicClass) {
	c.Flags.Set(1)
	c.NewTopic = value
}

// GetNewTopic returns value of NewTopic conditional field and
// boolean which is true if field was set.
func (c *ChannelAdminLogEventActionPinTopic) GetNewTopic() (value ForumTopicClass, ok bool) {
	if c == nil {
		return
	}
	if !c.Flags.Has(1) {
		return value, false
	}
	return c.NewTopic, true
}

// ChannelAdminLogEventActionToggleAntiSpam represents TL type `channelAdminLogEventActionToggleAntiSpam#64f36dfc`.
// Native antispam¹ functionality was enabled or disabled.
//
// Links:
//  1. https://core.telegram.org/api/antispam
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleAntiSpam for reference.
type ChannelAdminLogEventActionToggleAntiSpam struct {
	// Whether antispam functionality was enabled or disabled.
	NewValue bool
}

// ChannelAdminLogEventActionToggleAntiSpamTypeID is TL type id of ChannelAdminLogEventActionToggleAntiSpam.
const ChannelAdminLogEventActionToggleAntiSpamTypeID = 0x64f36dfc

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleAntiSpam) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleAntiSpam{}
)

func (c *ChannelAdminLogEventActionToggleAntiSpam) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleAntiSpam from given interface.
func (c *ChannelAdminLogEventActionToggleAntiSpam) FillFrom(from interface {
	GetNewValue() (value bool)
}) {
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleAntiSpam) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleAntiSpam",
		ID:   ChannelAdminLogEventActionToggleAntiSpamTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleAntiSpam) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleAntiSpam#64f36dfc as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleAntiSpamTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleAntiSpam) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleAntiSpam#64f36dfc as nil")
	}
	b.PutBool(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleAntiSpam) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleAntiSpam#64f36dfc to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleAntiSpamTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleAntiSpam#64f36dfc: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleAntiSpam) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleAntiSpam#64f36dfc to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleAntiSpam#64f36dfc: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionToggleAntiSpam) GetNewValue() (value bool) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangePeerColor represents TL type `channelAdminLogEventActionChangePeerColor#5796e780`.
// The message accent color¹ was changed
//
// Links:
//  1. https://core.telegram.org/api/colors
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangePeerColor for reference.
type ChannelAdminLogEventActionChangePeerColor struct {
	// Previous accent palette
	PrevValue PeerColorClass
	// New accent palette
	NewValue PeerColorClass
}

// ChannelAdminLogEventActionChangePeerColorTypeID is TL type id of ChannelAdminLogEventActionChangePeerColor.
const ChannelAdminLogEventActionChangePeerColorTypeID = 0x5796e780

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangePeerColor) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangePeerColor{}
)

func (c *ChannelAdminLogEventActionChangePeerColor) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == nil) {
		return false
	}
	if !(c.NewValue == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangePeerColor from given interface.
func (c *ChannelAdminLogEventActionChangePeerColor) FillFrom(from interface {
	GetPrevValue() (value PeerColorClass)
	GetNewValue() (value PeerColorClass)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangePeerColor) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangePeerColor",
		ID:   ChannelAdminLogEventActionChangePeerColorTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangePeerColor) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangePeerColor#5796e780 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangePeerColorTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangePeerColor) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangePeerColor#5796e780 as nil")
	}
	if c.PrevValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangePeerColor#5796e780: field prev_value is nil")
	}
	if err := c.PrevValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangePeerColor#5796e780: field prev_value: %w", err)
	}
	if c.NewValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangePeerColor#5796e780: field new_value is nil")
	}
	if err := c.NewValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangePeerColor#5796e780: field new_value: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangePeerColor) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangePeerColor#5796e780 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangePeerColorTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangePeerColor#5796e780: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangePeerColor) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangePeerColor#5796e780 to nil")
	}
	{
		value, err := DecodePeerColor(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangePeerColor#5796e780: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := DecodePeerColor(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangePeerColor#5796e780: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangePeerColor) GetPrevValue() (value PeerColorClass) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangePeerColor) GetNewValue() (value PeerColorClass) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangeProfilePeerColor represents TL type `channelAdminLogEventActionChangeProfilePeerColor#5e477b25`.
// The profile accent color¹ was changed
//
// Links:
//  1. https://core.telegram.org/api/colors
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeProfilePeerColor for reference.
type ChannelAdminLogEventActionChangeProfilePeerColor struct {
	// Previous accent palette
	PrevValue PeerColorClass
	// New accent palette
	NewValue PeerColorClass
}

// ChannelAdminLogEventActionChangeProfilePeerColorTypeID is TL type id of ChannelAdminLogEventActionChangeProfilePeerColor.
const ChannelAdminLogEventActionChangeProfilePeerColorTypeID = 0x5e477b25

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeProfilePeerColor) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeProfilePeerColor{}
)

func (c *ChannelAdminLogEventActionChangeProfilePeerColor) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == nil) {
		return false
	}
	if !(c.NewValue == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeProfilePeerColor from given interface.
func (c *ChannelAdminLogEventActionChangeProfilePeerColor) FillFrom(from interface {
	GetPrevValue() (value PeerColorClass)
	GetNewValue() (value PeerColorClass)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeProfilePeerColor) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeProfilePeerColor",
		ID:   ChannelAdminLogEventActionChangeProfilePeerColorTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeProfilePeerColor) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeProfilePeerColorTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeProfilePeerColor) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25 as nil")
	}
	if c.PrevValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field prev_value is nil")
	}
	if err := c.PrevValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field prev_value: %w", err)
	}
	if c.NewValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field new_value is nil")
	}
	if err := c.NewValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field new_value: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeProfilePeerColor) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeProfilePeerColorTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeProfilePeerColor) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25 to nil")
	}
	{
		value, err := DecodePeerColor(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := DecodePeerColor(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeProfilePeerColor) GetPrevValue() (value PeerColorClass) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeProfilePeerColor) GetNewValue() (value PeerColorClass) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangeWallpaper represents TL type `channelAdminLogEventActionChangeWallpaper#31bb5d52`.
// The wallpaper¹ was changed
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeWallpaper for reference.
type ChannelAdminLogEventActionChangeWallpaper struct {
	// Previous wallpaper
	PrevValue WallPaperClass
	// New wallpaper
	NewValue WallPaperClass
}

// ChannelAdminLogEventActionChangeWallpaperTypeID is TL type id of ChannelAdminLogEventActionChangeWallpaper.
const ChannelAdminLogEventActionChangeWallpaperTypeID = 0x31bb5d52

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeWallpaper) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeWallpaper{}
)

func (c *ChannelAdminLogEventActionChangeWallpaper) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == nil) {
		return false
	}
	if !(c.NewValue == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeWallpaper from given interface.
func (c *ChannelAdminLogEventActionChangeWallpaper) FillFrom(from interface {
	GetPrevValue() (value WallPaperClass)
	GetNewValue() (value WallPaperClass)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeWallpaper) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeWallpaper",
		ID:   ChannelAdminLogEventActionChangeWallpaperTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeWallpaper) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeWallpaper#31bb5d52 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeWallpaperTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeWallpaper) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeWallpaper#31bb5d52 as nil")
	}
	if c.PrevValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeWallpaper#31bb5d52: field prev_value is nil")
	}
	if err := c.PrevValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeWallpaper#31bb5d52: field prev_value: %w", err)
	}
	if c.NewValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeWallpaper#31bb5d52: field new_value is nil")
	}
	if err := c.NewValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeWallpaper#31bb5d52: field new_value: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeWallpaper) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeWallpaper#31bb5d52 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeWallpaperTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeWallpaper#31bb5d52: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeWallpaper) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeWallpaper#31bb5d52 to nil")
	}
	{
		value, err := DecodeWallPaper(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeWallpaper#31bb5d52: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := DecodeWallPaper(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeWallpaper#31bb5d52: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeWallpaper) GetPrevValue() (value WallPaperClass) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeWallpaper) GetNewValue() (value WallPaperClass) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangeEmojiStatus represents TL type `channelAdminLogEventActionChangeEmojiStatus#3ea9feb1`.
// The emoji status¹ was changed
//
// Links:
//  1. https://core.telegram.org/api/emoji-status
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeEmojiStatus for reference.
type ChannelAdminLogEventActionChangeEmojiStatus struct {
	// Previous emoji status
	PrevValue EmojiStatusClass
	// New emoji status
	NewValue EmojiStatusClass
}

// ChannelAdminLogEventActionChangeEmojiStatusTypeID is TL type id of ChannelAdminLogEventActionChangeEmojiStatus.
const ChannelAdminLogEventActionChangeEmojiStatusTypeID = 0x3ea9feb1

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeEmojiStatus) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeEmojiStatus{}
)

func (c *ChannelAdminLogEventActionChangeEmojiStatus) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevValue == nil) {
		return false
	}
	if !(c.NewValue == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeEmojiStatus from given interface.
func (c *ChannelAdminLogEventActionChangeEmojiStatus) FillFrom(from interface {
	GetPrevValue() (value EmojiStatusClass)
	GetNewValue() (value EmojiStatusClass)
}) {
	c.PrevValue = from.GetPrevValue()
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeEmojiStatus) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeEmojiStatus",
		ID:   ChannelAdminLogEventActionChangeEmojiStatusTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevValue",
			SchemaName: "prev_value",
		},
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeEmojiStatus) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeEmojiStatusTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeEmojiStatus) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 as nil")
	}
	if c.PrevValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field prev_value is nil")
	}
	if err := c.PrevValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field prev_value: %w", err)
	}
	if c.NewValue == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field new_value is nil")
	}
	if err := c.NewValue.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field new_value: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeEmojiStatus) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeEmojiStatusTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeEmojiStatus) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 to nil")
	}
	{
		value, err := DecodeEmojiStatus(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field prev_value: %w", err)
		}
		c.PrevValue = value
	}
	{
		value, err := DecodeEmojiStatus(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetPrevValue returns value of PrevValue field.
func (c *ChannelAdminLogEventActionChangeEmojiStatus) GetPrevValue() (value EmojiStatusClass) {
	if c == nil {
		return
	}
	return c.PrevValue
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionChangeEmojiStatus) GetNewValue() (value EmojiStatusClass) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionChangeEmojiStickerSet represents TL type `channelAdminLogEventActionChangeEmojiStickerSet#46d840ab`.
// The supergroup's custom emoji stickerset¹ was changed.
//
// Links:
//  1. https://core.telegram.org/api/boost#setting-a-custom-emoji-stickerset-for-supergroups
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeEmojiStickerSet for reference.
type ChannelAdminLogEventActionChangeEmojiStickerSet struct {
	// Old value
	PrevStickerset InputStickerSetClass
	// New value
	NewStickerset InputStickerSetClass
}

// ChannelAdminLogEventActionChangeEmojiStickerSetTypeID is TL type id of ChannelAdminLogEventActionChangeEmojiStickerSet.
const ChannelAdminLogEventActionChangeEmojiStickerSetTypeID = 0x46d840ab

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionChangeEmojiStickerSet) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeEmojiStickerSet{}
)

func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevStickerset == nil) {
		return false
	}
	if !(c.NewStickerset == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionChangeEmojiStickerSet from given interface.
func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) FillFrom(from interface {
	GetPrevStickerset() (value InputStickerSetClass)
	GetNewStickerset() (value InputStickerSetClass)
}) {
	c.PrevStickerset = from.GetPrevStickerset()
	c.NewStickerset = from.GetNewStickerset()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionChangeEmojiStickerSet",
		ID:   ChannelAdminLogEventActionChangeEmojiStickerSetTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevStickerset",
			SchemaName: "prev_stickerset",
		},
		{
			Name:       "NewStickerset",
			SchemaName: "new_stickerset",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab as nil")
	}
	b.PutID(ChannelAdminLogEventActionChangeEmojiStickerSetTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab as nil")
	}
	if c.PrevStickerset == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab: field prev_stickerset is nil")
	}
	if err := c.PrevStickerset.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab: field prev_stickerset: %w", err)
	}
	if c.NewStickerset == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab: field new_stickerset is nil")
	}
	if err := c.NewStickerset.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab: field new_stickerset: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionChangeEmojiStickerSetTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab to nil")
	}
	{
		value, err := DecodeInputStickerSet(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab: field prev_stickerset: %w", err)
		}
		c.PrevStickerset = value
	}
	{
		value, err := DecodeInputStickerSet(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStickerSet#46d840ab: field new_stickerset: %w", err)
		}
		c.NewStickerset = value
	}
	return nil
}

// GetPrevStickerset returns value of PrevStickerset field.
func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) GetPrevStickerset() (value InputStickerSetClass) {
	if c == nil {
		return
	}
	return c.PrevStickerset
}

// GetNewStickerset returns value of NewStickerset field.
func (c *ChannelAdminLogEventActionChangeEmojiStickerSet) GetNewStickerset() (value InputStickerSetClass) {
	if c == nil {
		return
	}
	return c.NewStickerset
}

// ChannelAdminLogEventActionToggleSignatureProfiles represents TL type `channelAdminLogEventActionToggleSignatureProfiles#60a79c79`.
// Channel signature profiles were enabled/disabled.
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleSignatureProfiles for reference.
type ChannelAdminLogEventActionToggleSignatureProfiles struct {
	// New value
	NewValue bool
}

// ChannelAdminLogEventActionToggleSignatureProfilesTypeID is TL type id of ChannelAdminLogEventActionToggleSignatureProfiles.
const ChannelAdminLogEventActionToggleSignatureProfilesTypeID = 0x60a79c79

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleSignatureProfiles) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleSignatureProfiles{}
)

func (c *ChannelAdminLogEventActionToggleSignatureProfiles) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleSignatureProfiles from given interface.
func (c *ChannelAdminLogEventActionToggleSignatureProfiles) FillFrom(from interface {
	GetNewValue() (value bool)
}) {
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleSignatureProfiles) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleSignatureProfiles",
		ID:   ChannelAdminLogEventActionToggleSignatureProfilesTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleSignatureProfiles) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleSignatureProfiles#60a79c79 as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleSignatureProfilesTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleSignatureProfiles) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleSignatureProfiles#60a79c79 as nil")
	}
	b.PutBool(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleSignatureProfiles) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleSignatureProfiles#60a79c79 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleSignatureProfilesTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleSignatureProfiles#60a79c79: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleSignatureProfiles) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleSignatureProfiles#60a79c79 to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleSignatureProfiles#60a79c79: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionToggleSignatureProfiles) GetNewValue() (value bool) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionParticipantSubExtend represents TL type `channelAdminLogEventActionParticipantSubExtend#64642db3`.
// A paid subscriber has extended their Telegram Star subscription »¹.
//
// Links:
//  1. https://core.telegram.org/api/stars#star-subscriptions
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionParticipantSubExtend for reference.
type ChannelAdminLogEventActionParticipantSubExtend struct {
	// Same as new_participant.
	PrevParticipant ChannelParticipantClass
	// The subscriber that extended the subscription.
	NewParticipant ChannelParticipantClass
}

// ChannelAdminLogEventActionParticipantSubExtendTypeID is TL type id of ChannelAdminLogEventActionParticipantSubExtend.
const ChannelAdminLogEventActionParticipantSubExtendTypeID = 0x64642db3

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionParticipantSubExtend) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionParticipantSubExtend{}
)

func (c *ChannelAdminLogEventActionParticipantSubExtend) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.PrevParticipant == nil) {
		return false
	}
	if !(c.NewParticipant == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionParticipantSubExtend from given interface.
func (c *ChannelAdminLogEventActionParticipantSubExtend) FillFrom(from interface {
	GetPrevParticipant() (value ChannelParticipantClass)
	GetNewParticipant() (value ChannelParticipantClass)
}) {
	c.PrevParticipant = from.GetPrevParticipant()
	c.NewParticipant = from.GetNewParticipant()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionParticipantSubExtend) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionParticipantSubExtend",
		ID:   ChannelAdminLogEventActionParticipantSubExtendTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "PrevParticipant",
			SchemaName: "prev_participant",
		},
		{
			Name:       "NewParticipant",
			SchemaName: "new_participant",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionParticipantSubExtend) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantSubExtend#64642db3 as nil")
	}
	b.PutID(ChannelAdminLogEventActionParticipantSubExtendTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionParticipantSubExtend) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionParticipantSubExtend#64642db3 as nil")
	}
	if c.PrevParticipant == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantSubExtend#64642db3: field prev_participant is nil")
	}
	if err := c.PrevParticipant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantSubExtend#64642db3: field prev_participant: %w", err)
	}
	if c.NewParticipant == nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantSubExtend#64642db3: field new_participant is nil")
	}
	if err := c.NewParticipant.Encode(b); err != nil {
		return fmt.Errorf("unable to encode channelAdminLogEventActionParticipantSubExtend#64642db3: field new_participant: %w", err)
	}
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionParticipantSubExtend) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantSubExtend#64642db3 to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionParticipantSubExtendTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantSubExtend#64642db3: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionParticipantSubExtend) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionParticipantSubExtend#64642db3 to nil")
	}
	{
		value, err := DecodeChannelParticipant(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantSubExtend#64642db3: field prev_participant: %w", err)
		}
		c.PrevParticipant = value
	}
	{
		value, err := DecodeChannelParticipant(b)
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionParticipantSubExtend#64642db3: field new_participant: %w", err)
		}
		c.NewParticipant = value
	}
	return nil
}

// GetPrevParticipant returns value of PrevParticipant field.
func (c *ChannelAdminLogEventActionParticipantSubExtend) GetPrevParticipant() (value ChannelParticipantClass) {
	if c == nil {
		return
	}
	return c.PrevParticipant
}

// GetNewParticipant returns value of NewParticipant field.
func (c *ChannelAdminLogEventActionParticipantSubExtend) GetNewParticipant() (value ChannelParticipantClass) {
	if c == nil {
		return
	}
	return c.NewParticipant
}

// ChannelAdminLogEventActionToggleAutotranslation represents TL type `channelAdminLogEventActionToggleAutotranslation#c517f77e`.
// Channel autotranslation was toggled »¹.
//
// Links:
//  1. https://core.telegram.org/api/translation#autotranslation-for-channels
//
// See https://core.telegram.org/constructor/channelAdminLogEventActionToggleAutotranslation for reference.
type ChannelAdminLogEventActionToggleAutotranslation struct {
	// New value of the toggle
	NewValue bool
}

// ChannelAdminLogEventActionToggleAutotranslationTypeID is TL type id of ChannelAdminLogEventActionToggleAutotranslation.
const ChannelAdminLogEventActionToggleAutotranslationTypeID = 0xc517f77e

// construct implements constructor of ChannelAdminLogEventActionClass.
func (c ChannelAdminLogEventActionToggleAutotranslation) construct() ChannelAdminLogEventActionClass {
	return &c
}

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

	_ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionToggleAutotranslation{}
)

func (c *ChannelAdminLogEventActionToggleAutotranslation) Zero() bool {
	if c == nil {
		return true
	}
	if !(c.NewValue == false) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelAdminLogEventActionToggleAutotranslation from given interface.
func (c *ChannelAdminLogEventActionToggleAutotranslation) FillFrom(from interface {
	GetNewValue() (value bool)
}) {
	c.NewValue = from.GetNewValue()
}

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

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

// TypeInfo returns info about TL type.
func (c *ChannelAdminLogEventActionToggleAutotranslation) TypeInfo() tdp.Type {
	typ := tdp.Type{
		Name: "channelAdminLogEventActionToggleAutotranslation",
		ID:   ChannelAdminLogEventActionToggleAutotranslationTypeID,
	}
	if c == nil {
		typ.Null = true
		return typ
	}
	typ.Fields = []tdp.Field{
		{
			Name:       "NewValue",
			SchemaName: "new_value",
		},
	}
	return typ
}

// Encode implements bin.Encoder.
func (c *ChannelAdminLogEventActionToggleAutotranslation) Encode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleAutotranslation#c517f77e as nil")
	}
	b.PutID(ChannelAdminLogEventActionToggleAutotranslationTypeID)
	return c.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (c *ChannelAdminLogEventActionToggleAutotranslation) EncodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't encode channelAdminLogEventActionToggleAutotranslation#c517f77e as nil")
	}
	b.PutBool(c.NewValue)
	return nil
}

// Decode implements bin.Decoder.
func (c *ChannelAdminLogEventActionToggleAutotranslation) Decode(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleAutotranslation#c517f77e to nil")
	}
	if err := b.ConsumeID(ChannelAdminLogEventActionToggleAutotranslationTypeID); err != nil {
		return fmt.Errorf("unable to decode channelAdminLogEventActionToggleAutotranslation#c517f77e: %w", err)
	}
	return c.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (c *ChannelAdminLogEventActionToggleAutotranslation) DecodeBare(b *bin.Buffer) error {
	if c == nil {
		return fmt.Errorf("can't decode channelAdminLogEventActionToggleAutotranslation#c517f77e to nil")
	}
	{
		value, err := b.Bool()
		if err != nil {
			return fmt.Errorf("unable to decode channelAdminLogEventActionToggleAutotranslation#c517f77e: field new_value: %w", err)
		}
		c.NewValue = value
	}
	return nil
}

// GetNewValue returns value of NewValue field.
func (c *ChannelAdminLogEventActionToggleAutotranslation) GetNewValue() (value bool) {
	if c == nil {
		return
	}
	return c.NewValue
}

// ChannelAdminLogEventActionClassName is schema name of ChannelAdminLogEventActionClass.
const ChannelAdminLogEventActionClassName = "ChannelAdminLogEventAction"

// ChannelAdminLogEventActionClass represents ChannelAdminLogEventAction generic type.
//
// See https://core.telegram.org/type/ChannelAdminLogEventAction for reference.
//
// Example:
//
//	g, err := tg.DecodeChannelAdminLogEventAction(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.ChannelAdminLogEventActionChangeTitle: // channelAdminLogEventActionChangeTitle#e6dfb825
//	case *tg.ChannelAdminLogEventActionChangeAbout: // channelAdminLogEventActionChangeAbout#55188a2e
//	case *tg.ChannelAdminLogEventActionChangeUsername: // channelAdminLogEventActionChangeUsername#6a4afc38
//	case *tg.ChannelAdminLogEventActionChangePhoto: // channelAdminLogEventActionChangePhoto#434bd2af
//	case *tg.ChannelAdminLogEventActionToggleInvites: // channelAdminLogEventActionToggleInvites#1b7907ae
//	case *tg.ChannelAdminLogEventActionToggleSignatures: // channelAdminLogEventActionToggleSignatures#26ae0971
//	case *tg.ChannelAdminLogEventActionUpdatePinned: // channelAdminLogEventActionUpdatePinned#e9e82c18
//	case *tg.ChannelAdminLogEventActionEditMessage: // channelAdminLogEventActionEditMessage#709b2405
//	case *tg.ChannelAdminLogEventActionDeleteMessage: // channelAdminLogEventActionDeleteMessage#42e047bb
//	case *tg.ChannelAdminLogEventActionParticipantJoin: // channelAdminLogEventActionParticipantJoin#183040d3
//	case *tg.ChannelAdminLogEventActionParticipantLeave: // channelAdminLogEventActionParticipantLeave#f89777f2
//	case *tg.ChannelAdminLogEventActionParticipantInvite: // channelAdminLogEventActionParticipantInvite#e31c34d8
//	case *tg.ChannelAdminLogEventActionParticipantToggleBan: // channelAdminLogEventActionParticipantToggleBan#e6d83d7e
//	case *tg.ChannelAdminLogEventActionParticipantToggleAdmin: // channelAdminLogEventActionParticipantToggleAdmin#d5676710
//	case *tg.ChannelAdminLogEventActionChangeStickerSet: // channelAdminLogEventActionChangeStickerSet#b1c3caa7
//	case *tg.ChannelAdminLogEventActionTogglePreHistoryHidden: // channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1
//	case *tg.ChannelAdminLogEventActionDefaultBannedRights: // channelAdminLogEventActionDefaultBannedRights#2df5fc0a
//	case *tg.ChannelAdminLogEventActionStopPoll: // channelAdminLogEventActionStopPoll#8f079643
//	case *tg.ChannelAdminLogEventActionChangeLinkedChat: // channelAdminLogEventActionChangeLinkedChat#50c7ac8
//	case *tg.ChannelAdminLogEventActionChangeLocation: // channelAdminLogEventActionChangeLocation#e6b76ae
//	case *tg.ChannelAdminLogEventActionToggleSlowMode: // channelAdminLogEventActionToggleSlowMode#53909779
//	case *tg.ChannelAdminLogEventActionStartGroupCall: // channelAdminLogEventActionStartGroupCall#23209745
//	case *tg.ChannelAdminLogEventActionDiscardGroupCall: // channelAdminLogEventActionDiscardGroupCall#db9f9140
//	case *tg.ChannelAdminLogEventActionParticipantMute: // channelAdminLogEventActionParticipantMute#f92424d2
//	case *tg.ChannelAdminLogEventActionParticipantUnmute: // channelAdminLogEventActionParticipantUnmute#e64429c0
//	case *tg.ChannelAdminLogEventActionToggleGroupCallSetting: // channelAdminLogEventActionToggleGroupCallSetting#56d6a247
//	case *tg.ChannelAdminLogEventActionParticipantJoinByInvite: // channelAdminLogEventActionParticipantJoinByInvite#fe9fc158
//	case *tg.ChannelAdminLogEventActionExportedInviteDelete: // channelAdminLogEventActionExportedInviteDelete#5a50fca4
//	case *tg.ChannelAdminLogEventActionExportedInviteRevoke: // channelAdminLogEventActionExportedInviteRevoke#410a134e
//	case *tg.ChannelAdminLogEventActionExportedInviteEdit: // channelAdminLogEventActionExportedInviteEdit#e90ebb59
//	case *tg.ChannelAdminLogEventActionParticipantVolume: // channelAdminLogEventActionParticipantVolume#3e7f6847
//	case *tg.ChannelAdminLogEventActionChangeHistoryTTL: // channelAdminLogEventActionChangeHistoryTTL#6e941a38
//	case *tg.ChannelAdminLogEventActionParticipantJoinByRequest: // channelAdminLogEventActionParticipantJoinByRequest#afb6144a
//	case *tg.ChannelAdminLogEventActionToggleNoForwards: // channelAdminLogEventActionToggleNoForwards#cb2ac766
//	case *tg.ChannelAdminLogEventActionSendMessage: // channelAdminLogEventActionSendMessage#278f2868
//	case *tg.ChannelAdminLogEventActionChangeAvailableReactions: // channelAdminLogEventActionChangeAvailableReactions#be4e0ef8
//	case *tg.ChannelAdminLogEventActionChangeUsernames: // channelAdminLogEventActionChangeUsernames#f04fb3a9
//	case *tg.ChannelAdminLogEventActionToggleForum: // channelAdminLogEventActionToggleForum#2cc6383
//	case *tg.ChannelAdminLogEventActionCreateTopic: // channelAdminLogEventActionCreateTopic#58707d28
//	case *tg.ChannelAdminLogEventActionEditTopic: // channelAdminLogEventActionEditTopic#f06fe208
//	case *tg.ChannelAdminLogEventActionDeleteTopic: // channelAdminLogEventActionDeleteTopic#ae168909
//	case *tg.ChannelAdminLogEventActionPinTopic: // channelAdminLogEventActionPinTopic#5d8d353b
//	case *tg.ChannelAdminLogEventActionToggleAntiSpam: // channelAdminLogEventActionToggleAntiSpam#64f36dfc
//	case *tg.ChannelAdminLogEventActionChangePeerColor: // channelAdminLogEventActionChangePeerColor#5796e780
//	case *tg.ChannelAdminLogEventActionChangeProfilePeerColor: // channelAdminLogEventActionChangeProfilePeerColor#5e477b25
//	case *tg.ChannelAdminLogEventActionChangeWallpaper: // channelAdminLogEventActionChangeWallpaper#31bb5d52
//	case *tg.ChannelAdminLogEventActionChangeEmojiStatus: // channelAdminLogEventActionChangeEmojiStatus#3ea9feb1
//	case *tg.ChannelAdminLogEventActionChangeEmojiStickerSet: // channelAdminLogEventActionChangeEmojiStickerSet#46d840ab
//	case *tg.ChannelAdminLogEventActionToggleSignatureProfiles: // channelAdminLogEventActionToggleSignatureProfiles#60a79c79
//	case *tg.ChannelAdminLogEventActionParticipantSubExtend: // channelAdminLogEventActionParticipantSubExtend#64642db3
//	case *tg.ChannelAdminLogEventActionToggleAutotranslation: // channelAdminLogEventActionToggleAutotranslation#c517f77e
//	default: panic(v)
//	}
type ChannelAdminLogEventActionClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() ChannelAdminLogEventActionClass

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

// DecodeChannelAdminLogEventAction implements binary de-serialization for ChannelAdminLogEventActionClass.
func DecodeChannelAdminLogEventAction(buf *bin.Buffer) (ChannelAdminLogEventActionClass, error) {
	id, err := buf.PeekID()
	if err != nil {
		return nil, err
	}
	switch id {
	case ChannelAdminLogEventActionChangeTitleTypeID:
		// Decoding channelAdminLogEventActionChangeTitle#e6dfb825.
		v := ChannelAdminLogEventActionChangeTitle{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeAboutTypeID:
		// Decoding channelAdminLogEventActionChangeAbout#55188a2e.
		v := ChannelAdminLogEventActionChangeAbout{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeUsernameTypeID:
		// Decoding channelAdminLogEventActionChangeUsername#6a4afc38.
		v := ChannelAdminLogEventActionChangeUsername{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangePhotoTypeID:
		// Decoding channelAdminLogEventActionChangePhoto#434bd2af.
		v := ChannelAdminLogEventActionChangePhoto{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleInvitesTypeID:
		// Decoding channelAdminLogEventActionToggleInvites#1b7907ae.
		v := ChannelAdminLogEventActionToggleInvites{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleSignaturesTypeID:
		// Decoding channelAdminLogEventActionToggleSignatures#26ae0971.
		v := ChannelAdminLogEventActionToggleSignatures{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionUpdatePinnedTypeID:
		// Decoding channelAdminLogEventActionUpdatePinned#e9e82c18.
		v := ChannelAdminLogEventActionUpdatePinned{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionEditMessageTypeID:
		// Decoding channelAdminLogEventActionEditMessage#709b2405.
		v := ChannelAdminLogEventActionEditMessage{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionDeleteMessageTypeID:
		// Decoding channelAdminLogEventActionDeleteMessage#42e047bb.
		v := ChannelAdminLogEventActionDeleteMessage{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantJoinTypeID:
		// Decoding channelAdminLogEventActionParticipantJoin#183040d3.
		v := ChannelAdminLogEventActionParticipantJoin{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantLeaveTypeID:
		// Decoding channelAdminLogEventActionParticipantLeave#f89777f2.
		v := ChannelAdminLogEventActionParticipantLeave{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantInviteTypeID:
		// Decoding channelAdminLogEventActionParticipantInvite#e31c34d8.
		v := ChannelAdminLogEventActionParticipantInvite{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantToggleBanTypeID:
		// Decoding channelAdminLogEventActionParticipantToggleBan#e6d83d7e.
		v := ChannelAdminLogEventActionParticipantToggleBan{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantToggleAdminTypeID:
		// Decoding channelAdminLogEventActionParticipantToggleAdmin#d5676710.
		v := ChannelAdminLogEventActionParticipantToggleAdmin{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeStickerSetTypeID:
		// Decoding channelAdminLogEventActionChangeStickerSet#b1c3caa7.
		v := ChannelAdminLogEventActionChangeStickerSet{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionTogglePreHistoryHiddenTypeID:
		// Decoding channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1.
		v := ChannelAdminLogEventActionTogglePreHistoryHidden{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionDefaultBannedRightsTypeID:
		// Decoding channelAdminLogEventActionDefaultBannedRights#2df5fc0a.
		v := ChannelAdminLogEventActionDefaultBannedRights{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionStopPollTypeID:
		// Decoding channelAdminLogEventActionStopPoll#8f079643.
		v := ChannelAdminLogEventActionStopPoll{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeLinkedChatTypeID:
		// Decoding channelAdminLogEventActionChangeLinkedChat#50c7ac8.
		v := ChannelAdminLogEventActionChangeLinkedChat{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeLocationTypeID:
		// Decoding channelAdminLogEventActionChangeLocation#e6b76ae.
		v := ChannelAdminLogEventActionChangeLocation{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleSlowModeTypeID:
		// Decoding channelAdminLogEventActionToggleSlowMode#53909779.
		v := ChannelAdminLogEventActionToggleSlowMode{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionStartGroupCallTypeID:
		// Decoding channelAdminLogEventActionStartGroupCall#23209745.
		v := ChannelAdminLogEventActionStartGroupCall{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionDiscardGroupCallTypeID:
		// Decoding channelAdminLogEventActionDiscardGroupCall#db9f9140.
		v := ChannelAdminLogEventActionDiscardGroupCall{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantMuteTypeID:
		// Decoding channelAdminLogEventActionParticipantMute#f92424d2.
		v := ChannelAdminLogEventActionParticipantMute{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantUnmuteTypeID:
		// Decoding channelAdminLogEventActionParticipantUnmute#e64429c0.
		v := ChannelAdminLogEventActionParticipantUnmute{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleGroupCallSettingTypeID:
		// Decoding channelAdminLogEventActionToggleGroupCallSetting#56d6a247.
		v := ChannelAdminLogEventActionToggleGroupCallSetting{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantJoinByInviteTypeID:
		// Decoding channelAdminLogEventActionParticipantJoinByInvite#fe9fc158.
		v := ChannelAdminLogEventActionParticipantJoinByInvite{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionExportedInviteDeleteTypeID:
		// Decoding channelAdminLogEventActionExportedInviteDelete#5a50fca4.
		v := ChannelAdminLogEventActionExportedInviteDelete{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionExportedInviteRevokeTypeID:
		// Decoding channelAdminLogEventActionExportedInviteRevoke#410a134e.
		v := ChannelAdminLogEventActionExportedInviteRevoke{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionExportedInviteEditTypeID:
		// Decoding channelAdminLogEventActionExportedInviteEdit#e90ebb59.
		v := ChannelAdminLogEventActionExportedInviteEdit{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantVolumeTypeID:
		// Decoding channelAdminLogEventActionParticipantVolume#3e7f6847.
		v := ChannelAdminLogEventActionParticipantVolume{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeHistoryTTLTypeID:
		// Decoding channelAdminLogEventActionChangeHistoryTTL#6e941a38.
		v := ChannelAdminLogEventActionChangeHistoryTTL{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantJoinByRequestTypeID:
		// Decoding channelAdminLogEventActionParticipantJoinByRequest#afb6144a.
		v := ChannelAdminLogEventActionParticipantJoinByRequest{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleNoForwardsTypeID:
		// Decoding channelAdminLogEventActionToggleNoForwards#cb2ac766.
		v := ChannelAdminLogEventActionToggleNoForwards{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionSendMessageTypeID:
		// Decoding channelAdminLogEventActionSendMessage#278f2868.
		v := ChannelAdminLogEventActionSendMessage{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeAvailableReactionsTypeID:
		// Decoding channelAdminLogEventActionChangeAvailableReactions#be4e0ef8.
		v := ChannelAdminLogEventActionChangeAvailableReactions{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeUsernamesTypeID:
		// Decoding channelAdminLogEventActionChangeUsernames#f04fb3a9.
		v := ChannelAdminLogEventActionChangeUsernames{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleForumTypeID:
		// Decoding channelAdminLogEventActionToggleForum#2cc6383.
		v := ChannelAdminLogEventActionToggleForum{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionCreateTopicTypeID:
		// Decoding channelAdminLogEventActionCreateTopic#58707d28.
		v := ChannelAdminLogEventActionCreateTopic{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionEditTopicTypeID:
		// Decoding channelAdminLogEventActionEditTopic#f06fe208.
		v := ChannelAdminLogEventActionEditTopic{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionDeleteTopicTypeID:
		// Decoding channelAdminLogEventActionDeleteTopic#ae168909.
		v := ChannelAdminLogEventActionDeleteTopic{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionPinTopicTypeID:
		// Decoding channelAdminLogEventActionPinTopic#5d8d353b.
		v := ChannelAdminLogEventActionPinTopic{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleAntiSpamTypeID:
		// Decoding channelAdminLogEventActionToggleAntiSpam#64f36dfc.
		v := ChannelAdminLogEventActionToggleAntiSpam{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangePeerColorTypeID:
		// Decoding channelAdminLogEventActionChangePeerColor#5796e780.
		v := ChannelAdminLogEventActionChangePeerColor{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeProfilePeerColorTypeID:
		// Decoding channelAdminLogEventActionChangeProfilePeerColor#5e477b25.
		v := ChannelAdminLogEventActionChangeProfilePeerColor{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeWallpaperTypeID:
		// Decoding channelAdminLogEventActionChangeWallpaper#31bb5d52.
		v := ChannelAdminLogEventActionChangeWallpaper{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeEmojiStatusTypeID:
		// Decoding channelAdminLogEventActionChangeEmojiStatus#3ea9feb1.
		v := ChannelAdminLogEventActionChangeEmojiStatus{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionChangeEmojiStickerSetTypeID:
		// Decoding channelAdminLogEventActionChangeEmojiStickerSet#46d840ab.
		v := ChannelAdminLogEventActionChangeEmojiStickerSet{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleSignatureProfilesTypeID:
		// Decoding channelAdminLogEventActionToggleSignatureProfiles#60a79c79.
		v := ChannelAdminLogEventActionToggleSignatureProfiles{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionParticipantSubExtendTypeID:
		// Decoding channelAdminLogEventActionParticipantSubExtend#64642db3.
		v := ChannelAdminLogEventActionParticipantSubExtend{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	case ChannelAdminLogEventActionToggleAutotranslationTypeID:
		// Decoding channelAdminLogEventActionToggleAutotranslation#c517f77e.
		v := ChannelAdminLogEventActionToggleAutotranslation{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err)
		}
		return &v, nil
	default:
		return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", bin.NewUnexpectedID(id))
	}
}

// ChannelAdminLogEventAction boxes the ChannelAdminLogEventActionClass providing a helper.
type ChannelAdminLogEventActionBox struct {
	ChannelAdminLogEventAction ChannelAdminLogEventActionClass
}

// Decode implements bin.Decoder for ChannelAdminLogEventActionBox.
func (b *ChannelAdminLogEventActionBox) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("unable to decode ChannelAdminLogEventActionBox to nil")
	}
	v, err := DecodeChannelAdminLogEventAction(buf)
	if err != nil {
		return fmt.Errorf("unable to decode boxed value: %w", err)
	}
	b.ChannelAdminLogEventAction = v
	return nil
}

// Encode implements bin.Encode for ChannelAdminLogEventActionBox.
func (b *ChannelAdminLogEventActionBox) Encode(buf *bin.Buffer) error {
	if b == nil || b.ChannelAdminLogEventAction == nil {
		return fmt.Errorf("unable to encode ChannelAdminLogEventActionClass as nil")
	}
	return b.ChannelAdminLogEventAction.Encode(buf)
}
