// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// ChannelParticipantsRecent represents TL type `channelParticipantsRecent#de3f3c79`.
// Fetch only recent participants
//
// See https://core.telegram.org/constructor/channelParticipantsRecent for reference.
type ChannelParticipantsRecent struct {
}

// ChannelParticipantsRecentTypeID is TL type id of ChannelParticipantsRecent.
const ChannelParticipantsRecentTypeID = 0xde3f3c79

// construct implements constructor of ChannelParticipantsFilterClass.
func ( ChannelParticipantsRecent) () ChannelParticipantsFilterClass { return & }

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

	_ ChannelParticipantsFilterClass = &ChannelParticipantsRecent{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *ChannelParticipantsRecent) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsRecent#de3f3c79 as nil")
	}
	.PutID(ChannelParticipantsRecentTypeID)
	return .EncodeBare()
}

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

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

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

// ChannelParticipantsAdmins represents TL type `channelParticipantsAdmins#b4608969`.
// Fetch only admin participants
//
// See https://core.telegram.org/constructor/channelParticipantsAdmins for reference.
type ChannelParticipantsAdmins struct {
}

// ChannelParticipantsAdminsTypeID is TL type id of ChannelParticipantsAdmins.
const ChannelParticipantsAdminsTypeID = 0xb4608969

// construct implements constructor of ChannelParticipantsFilterClass.
func ( ChannelParticipantsAdmins) () ChannelParticipantsFilterClass { return & }

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

	_ ChannelParticipantsFilterClass = &ChannelParticipantsAdmins{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *ChannelParticipantsAdmins) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsAdmins#b4608969 as nil")
	}
	.PutID(ChannelParticipantsAdminsTypeID)
	return .EncodeBare()
}

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

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

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

// ChannelParticipantsKicked represents TL type `channelParticipantsKicked#a3b54985`.
// Fetch only kicked participants
//
// See https://core.telegram.org/constructor/channelParticipantsKicked for reference.
type ChannelParticipantsKicked struct {
	// Optional filter for searching kicked participants by name (otherwise empty)
	Q string
}

// ChannelParticipantsKickedTypeID is TL type id of ChannelParticipantsKicked.
const ChannelParticipantsKickedTypeID = 0xa3b54985

// construct implements constructor of ChannelParticipantsFilterClass.
func ( ChannelParticipantsKicked) () ChannelParticipantsFilterClass { return & }

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

	_ ChannelParticipantsFilterClass = &ChannelParticipantsKicked{}
)

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

	return true
}

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

// FillFrom fills ChannelParticipantsKicked from given interface.
func ( *ChannelParticipantsKicked) ( interface {
	() ( string)
}) {
	.Q = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ChannelParticipantsKicked) () tdp.Type {
	 := tdp.Type{
		Name: "channelParticipantsKicked",
		ID:   ChannelParticipantsKickedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Q",
			SchemaName: "q",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChannelParticipantsKicked) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsKicked#a3b54985 as nil")
	}
	.PutID(ChannelParticipantsKickedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChannelParticipantsKicked) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsKicked#a3b54985 as nil")
	}
	.PutString(.Q)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChannelParticipantsKicked) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode channelParticipantsKicked#a3b54985 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode channelParticipantsKicked#a3b54985: field q: %w", )
		}
		.Q = 
	}
	return nil
}

// GetQ returns value of Q field.
func ( *ChannelParticipantsKicked) () ( string) {
	if  == nil {
		return
	}
	return .Q
}

// ChannelParticipantsBots represents TL type `channelParticipantsBots#b0d1865b`.
// Fetch only bot participants
//
// See https://core.telegram.org/constructor/channelParticipantsBots for reference.
type ChannelParticipantsBots struct {
}

// ChannelParticipantsBotsTypeID is TL type id of ChannelParticipantsBots.
const ChannelParticipantsBotsTypeID = 0xb0d1865b

// construct implements constructor of ChannelParticipantsFilterClass.
func ( ChannelParticipantsBots) () ChannelParticipantsFilterClass { return & }

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

	_ ChannelParticipantsFilterClass = &ChannelParticipantsBots{}
)

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *ChannelParticipantsBots) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsBots#b0d1865b as nil")
	}
	.PutID(ChannelParticipantsBotsTypeID)
	return .EncodeBare()
}

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

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

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

// ChannelParticipantsBanned represents TL type `channelParticipantsBanned#1427a5e1`.
// Fetch only banned participants
//
// See https://core.telegram.org/constructor/channelParticipantsBanned for reference.
type ChannelParticipantsBanned struct {
	// Optional filter for searching banned participants by name (otherwise empty)
	Q string
}

// ChannelParticipantsBannedTypeID is TL type id of ChannelParticipantsBanned.
const ChannelParticipantsBannedTypeID = 0x1427a5e1

// construct implements constructor of ChannelParticipantsFilterClass.
func ( ChannelParticipantsBanned) () ChannelParticipantsFilterClass { return & }

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

	_ ChannelParticipantsFilterClass = &ChannelParticipantsBanned{}
)

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

	return true
}

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

// FillFrom fills ChannelParticipantsBanned from given interface.
func ( *ChannelParticipantsBanned) ( interface {
	() ( string)
}) {
	.Q = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ChannelParticipantsBanned) () tdp.Type {
	 := tdp.Type{
		Name: "channelParticipantsBanned",
		ID:   ChannelParticipantsBannedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Q",
			SchemaName: "q",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChannelParticipantsBanned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsBanned#1427a5e1 as nil")
	}
	.PutID(ChannelParticipantsBannedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChannelParticipantsBanned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsBanned#1427a5e1 as nil")
	}
	.PutString(.Q)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChannelParticipantsBanned) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode channelParticipantsBanned#1427a5e1 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode channelParticipantsBanned#1427a5e1: field q: %w", )
		}
		.Q = 
	}
	return nil
}

// GetQ returns value of Q field.
func ( *ChannelParticipantsBanned) () ( string) {
	if  == nil {
		return
	}
	return .Q
}

// ChannelParticipantsSearch represents TL type `channelParticipantsSearch#656ac4b`.
// Query participants by name
//
// See https://core.telegram.org/constructor/channelParticipantsSearch for reference.
type ChannelParticipantsSearch struct {
	// Search query
	Q string
}

// ChannelParticipantsSearchTypeID is TL type id of ChannelParticipantsSearch.
const ChannelParticipantsSearchTypeID = 0x656ac4b

// construct implements constructor of ChannelParticipantsFilterClass.
func ( ChannelParticipantsSearch) () ChannelParticipantsFilterClass { return & }

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

	_ ChannelParticipantsFilterClass = &ChannelParticipantsSearch{}
)

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

	return true
}

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

// FillFrom fills ChannelParticipantsSearch from given interface.
func ( *ChannelParticipantsSearch) ( interface {
	() ( string)
}) {
	.Q = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ChannelParticipantsSearch) () tdp.Type {
	 := tdp.Type{
		Name: "channelParticipantsSearch",
		ID:   ChannelParticipantsSearchTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Q",
			SchemaName: "q",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChannelParticipantsSearch) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsSearch#656ac4b as nil")
	}
	.PutID(ChannelParticipantsSearchTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChannelParticipantsSearch) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsSearch#656ac4b as nil")
	}
	.PutString(.Q)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChannelParticipantsSearch) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode channelParticipantsSearch#656ac4b to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode channelParticipantsSearch#656ac4b: field q: %w", )
		}
		.Q = 
	}
	return nil
}

// GetQ returns value of Q field.
func ( *ChannelParticipantsSearch) () ( string) {
	if  == nil {
		return
	}
	return .Q
}

// ChannelParticipantsContacts represents TL type `channelParticipantsContacts#bb6ae88d`.
// Fetch only participants that are also contacts
//
// See https://core.telegram.org/constructor/channelParticipantsContacts for reference.
type ChannelParticipantsContacts struct {
	// Optional search query for searching contact participants by name
	Q string
}

// ChannelParticipantsContactsTypeID is TL type id of ChannelParticipantsContacts.
const ChannelParticipantsContactsTypeID = 0xbb6ae88d

// construct implements constructor of ChannelParticipantsFilterClass.
func ( ChannelParticipantsContacts) () ChannelParticipantsFilterClass { return & }

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

	_ ChannelParticipantsFilterClass = &ChannelParticipantsContacts{}
)

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

	return true
}

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

// FillFrom fills ChannelParticipantsContacts from given interface.
func ( *ChannelParticipantsContacts) ( interface {
	() ( string)
}) {
	.Q = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ChannelParticipantsContacts) () tdp.Type {
	 := tdp.Type{
		Name: "channelParticipantsContacts",
		ID:   ChannelParticipantsContactsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Q",
			SchemaName: "q",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChannelParticipantsContacts) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsContacts#bb6ae88d as nil")
	}
	.PutID(ChannelParticipantsContactsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChannelParticipantsContacts) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsContacts#bb6ae88d as nil")
	}
	.PutString(.Q)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChannelParticipantsContacts) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode channelParticipantsContacts#bb6ae88d to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode channelParticipantsContacts#bb6ae88d: field q: %w", )
		}
		.Q = 
	}
	return nil
}

// GetQ returns value of Q field.
func ( *ChannelParticipantsContacts) () ( string) {
	if  == nil {
		return
	}
	return .Q
}

// ChannelParticipantsMentions represents TL type `channelParticipantsMentions#e04b5ceb`.
// This filter is used when looking for supergroup members to mention.
// This filter will automatically remove anonymous admins, and return even
// non-participant users that replied to a specific thread¹ through the comment
// section² of a channel.
//
// Links:
//  1. https://core.telegram.org/api/threads
//  2. https://core.telegram.org/api/threads#channel-comments
//
// See https://core.telegram.org/constructor/channelParticipantsMentions for reference.
type ChannelParticipantsMentions struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Filter by user name or username
	//
	// Use SetQ and GetQ helpers.
	Q string
	// Look only for users that posted in this thread¹
	//
	// Links:
	//  1) https://core.telegram.org/api/threads
	//
	// Use SetTopMsgID and GetTopMsgID helpers.
	TopMsgID int
}

// ChannelParticipantsMentionsTypeID is TL type id of ChannelParticipantsMentions.
const ChannelParticipantsMentionsTypeID = 0xe04b5ceb

// construct implements constructor of ChannelParticipantsFilterClass.
func ( ChannelParticipantsMentions) () ChannelParticipantsFilterClass { return & }

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

	_ ChannelParticipantsFilterClass = &ChannelParticipantsMentions{}
)

func ( *ChannelParticipantsMentions) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Q == "") {
		return false
	}
	if !(.TopMsgID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelParticipantsMentions from given interface.
func ( *ChannelParticipantsMentions) ( interface {
	() ( string,  bool)
	() ( int,  bool)
}) {
	if ,  := .();  {
		.Q = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *ChannelParticipantsMentions) () tdp.Type {
	 := tdp.Type{
		Name: "channelParticipantsMentions",
		ID:   ChannelParticipantsMentionsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Q",
			SchemaName: "q",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "TopMsgID",
			SchemaName: "top_msg_id",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *ChannelParticipantsMentions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsMentions#e04b5ceb as nil")
	}
	.PutID(ChannelParticipantsMentionsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChannelParticipantsMentions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channelParticipantsMentions#e04b5ceb as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode channelParticipantsMentions#e04b5ceb: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutString(.Q)
	}
	if .Flags.Has(1) {
		.PutInt(.TopMsgID)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChannelParticipantsMentions) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode channelParticipantsMentions#e04b5ceb to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode channelParticipantsMentions#e04b5ceb: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode channelParticipantsMentions#e04b5ceb: field q: %w", )
		}
		.Q = 
	}
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode channelParticipantsMentions#e04b5ceb: field top_msg_id: %w", )
		}
		.TopMsgID = 
	}
	return nil
}

// SetQ sets value of Q conditional field.
func ( *ChannelParticipantsMentions) ( string) {
	.Flags.Set(0)
	.Q = 
}

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

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

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

// ChannelParticipantsFilterClassName is schema name of ChannelParticipantsFilterClass.
const ChannelParticipantsFilterClassName = "ChannelParticipantsFilter"

// ChannelParticipantsFilterClass represents ChannelParticipantsFilter generic type.
//
// See https://core.telegram.org/type/ChannelParticipantsFilter for reference.
//
// Example:
//
//	g, err := tg.DecodeChannelParticipantsFilter(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.ChannelParticipantsRecent: // channelParticipantsRecent#de3f3c79
//	case *tg.ChannelParticipantsAdmins: // channelParticipantsAdmins#b4608969
//	case *tg.ChannelParticipantsKicked: // channelParticipantsKicked#a3b54985
//	case *tg.ChannelParticipantsBots: // channelParticipantsBots#b0d1865b
//	case *tg.ChannelParticipantsBanned: // channelParticipantsBanned#1427a5e1
//	case *tg.ChannelParticipantsSearch: // channelParticipantsSearch#656ac4b
//	case *tg.ChannelParticipantsContacts: // channelParticipantsContacts#bb6ae88d
//	case *tg.ChannelParticipantsMentions: // channelParticipantsMentions#e04b5ceb
//	default: panic(v)
//	}
type ChannelParticipantsFilterClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() ChannelParticipantsFilterClass

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

// DecodeChannelParticipantsFilter implements binary de-serialization for ChannelParticipantsFilterClass.
func ( *bin.Buffer) (ChannelParticipantsFilterClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case ChannelParticipantsRecentTypeID:
		// Decoding channelParticipantsRecent#de3f3c79.
		 := ChannelParticipantsRecent{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", )
		}
		return &, nil
	case ChannelParticipantsAdminsTypeID:
		// Decoding channelParticipantsAdmins#b4608969.
		 := ChannelParticipantsAdmins{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", )
		}
		return &, nil
	case ChannelParticipantsKickedTypeID:
		// Decoding channelParticipantsKicked#a3b54985.
		 := ChannelParticipantsKicked{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", )
		}
		return &, nil
	case ChannelParticipantsBotsTypeID:
		// Decoding channelParticipantsBots#b0d1865b.
		 := ChannelParticipantsBots{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", )
		}
		return &, nil
	case ChannelParticipantsBannedTypeID:
		// Decoding channelParticipantsBanned#1427a5e1.
		 := ChannelParticipantsBanned{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", )
		}
		return &, nil
	case ChannelParticipantsSearchTypeID:
		// Decoding channelParticipantsSearch#656ac4b.
		 := ChannelParticipantsSearch{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", )
		}
		return &, nil
	case ChannelParticipantsContactsTypeID:
		// Decoding channelParticipantsContacts#bb6ae88d.
		 := ChannelParticipantsContacts{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", )
		}
		return &, nil
	case ChannelParticipantsMentionsTypeID:
		// Decoding channelParticipantsMentions#e04b5ceb.
		 := ChannelParticipantsMentions{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode ChannelParticipantsFilterClass: %w", bin.NewUnexpectedID())
	}
}

// ChannelParticipantsFilter boxes the ChannelParticipantsFilterClass providing a helper.
type ChannelParticipantsFilterBox struct {
	ChannelParticipantsFilter ChannelParticipantsFilterClass
}

// Decode implements bin.Decoder for ChannelParticipantsFilterBox.
func ( *ChannelParticipantsFilterBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode ChannelParticipantsFilterBox to nil")
	}
	,  := DecodeChannelParticipantsFilter()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.ChannelParticipantsFilter = 
	return nil
}

// Encode implements bin.Encode for ChannelParticipantsFilterBox.
func ( *ChannelParticipantsFilterBox) ( *bin.Buffer) error {
	if  == nil || .ChannelParticipantsFilter == nil {
		return fmt.Errorf("unable to encode ChannelParticipantsFilterClass as nil")
	}
	return .ChannelParticipantsFilter.Encode()
}