// Code generated by gotdgen, DO NOT EDIT.

package tdapi

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

// SearchMessagesFilterEmpty represents TL type `searchMessagesFilterEmpty#cc2e1337`.
type SearchMessagesFilterEmpty struct {
}

// SearchMessagesFilterEmptyTypeID is TL type id of SearchMessagesFilterEmpty.
const SearchMessagesFilterEmptyTypeID = 0xcc2e1337

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterEmpty) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterEmpty{}
)

func (s *SearchMessagesFilterEmpty) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterEmpty) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterEmpty#cc2e1337 as nil")
	}
	b.PutID(SearchMessagesFilterEmptyTypeID)
	return s.EncodeBare(b)
}

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

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterEmpty) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterEmpty#cc2e1337 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterEmptyTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterEmpty#cc2e1337: %w", err)
	}
	return s.DecodeBare(b)
}

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

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterEmpty) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterEmpty#cc2e1337 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterEmpty")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterEmpty) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterEmpty#cc2e1337 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterEmpty"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterEmpty#cc2e1337: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterAnimation represents TL type `searchMessagesFilterAnimation#f6b800c5`.
type SearchMessagesFilterAnimation struct {
}

// SearchMessagesFilterAnimationTypeID is TL type id of SearchMessagesFilterAnimation.
const SearchMessagesFilterAnimationTypeID = 0xf6b800c5

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterAnimation) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterAnimation{}
)

func (s *SearchMessagesFilterAnimation) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterAnimation) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterAnimation#f6b800c5 as nil")
	}
	b.PutID(SearchMessagesFilterAnimationTypeID)
	return s.EncodeBare(b)
}

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

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterAnimation) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterAnimation#f6b800c5 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterAnimationTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterAnimation#f6b800c5: %w", err)
	}
	return s.DecodeBare(b)
}

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

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterAnimation) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterAnimation#f6b800c5 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterAnimation")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterAnimation) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterAnimation#f6b800c5 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterAnimation"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterAnimation#f6b800c5: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterAudio represents TL type `searchMessagesFilterAudio#33b5147b`.
type SearchMessagesFilterAudio struct {
}

// SearchMessagesFilterAudioTypeID is TL type id of SearchMessagesFilterAudio.
const SearchMessagesFilterAudioTypeID = 0x33b5147b

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterAudio) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterAudio{}
)

func (s *SearchMessagesFilterAudio) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterAudio) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterAudio#33b5147b as nil")
	}
	b.PutID(SearchMessagesFilterAudioTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterAudio) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterAudio#33b5147b as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterAudio) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterAudio#33b5147b to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterAudioTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterAudio#33b5147b: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterAudio) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterAudio#33b5147b to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterAudio) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterAudio#33b5147b as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterAudio")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterAudio) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterAudio#33b5147b to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterAudio"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterAudio#33b5147b: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterDocument represents TL type `searchMessagesFilterDocument#5af9f74f`.
type SearchMessagesFilterDocument struct {
}

// SearchMessagesFilterDocumentTypeID is TL type id of SearchMessagesFilterDocument.
const SearchMessagesFilterDocumentTypeID = 0x5af9f74f

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterDocument) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterDocument{}
)

func (s *SearchMessagesFilterDocument) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterDocument) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterDocument#5af9f74f as nil")
	}
	b.PutID(SearchMessagesFilterDocumentTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterDocument) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterDocument#5af9f74f as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterDocument) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterDocument#5af9f74f to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterDocumentTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterDocument#5af9f74f: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterDocument) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterDocument#5af9f74f to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterDocument) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterDocument#5af9f74f as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterDocument")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterDocument) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterDocument#5af9f74f to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterDocument"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterDocument#5af9f74f: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterPhoto represents TL type `searchMessagesFilterPhoto#37309b05`.
type SearchMessagesFilterPhoto struct {
}

// SearchMessagesFilterPhotoTypeID is TL type id of SearchMessagesFilterPhoto.
const SearchMessagesFilterPhotoTypeID = 0x37309b05

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterPhoto) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterPhoto{}
)

func (s *SearchMessagesFilterPhoto) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterPhoto) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPhoto#37309b05 as nil")
	}
	b.PutID(SearchMessagesFilterPhotoTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterPhoto) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPhoto#37309b05 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterPhoto) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPhoto#37309b05 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterPhotoTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterPhoto#37309b05: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterPhoto) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPhoto#37309b05 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterPhoto) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPhoto#37309b05 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterPhoto")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterPhoto) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPhoto#37309b05 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterPhoto"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterPhoto#37309b05: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterVideo represents TL type `searchMessagesFilterVideo#6e2f92e`.
type SearchMessagesFilterVideo struct {
}

// SearchMessagesFilterVideoTypeID is TL type id of SearchMessagesFilterVideo.
const SearchMessagesFilterVideoTypeID = 0x6e2f92e

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterVideo) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterVideo{}
)

func (s *SearchMessagesFilterVideo) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterVideo) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVideo#6e2f92e as nil")
	}
	b.PutID(SearchMessagesFilterVideoTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterVideo) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVideo#6e2f92e as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterVideo) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVideo#6e2f92e to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterVideoTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterVideo#6e2f92e: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterVideo) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVideo#6e2f92e to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterVideo) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVideo#6e2f92e as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterVideo")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterVideo) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVideo#6e2f92e to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterVideo"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterVideo#6e2f92e: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterVoiceNote represents TL type `searchMessagesFilterVoiceNote#6dc2227d`.
type SearchMessagesFilterVoiceNote struct {
}

// SearchMessagesFilterVoiceNoteTypeID is TL type id of SearchMessagesFilterVoiceNote.
const SearchMessagesFilterVoiceNoteTypeID = 0x6dc2227d

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterVoiceNote) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterVoiceNote{}
)

func (s *SearchMessagesFilterVoiceNote) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterVoiceNote) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVoiceNote#6dc2227d as nil")
	}
	b.PutID(SearchMessagesFilterVoiceNoteTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterVoiceNote) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVoiceNote#6dc2227d as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterVoiceNote) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVoiceNote#6dc2227d to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterVoiceNoteTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterVoiceNote#6dc2227d: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterVoiceNote) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVoiceNote#6dc2227d to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterVoiceNote) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVoiceNote#6dc2227d as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterVoiceNote")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterVoiceNote) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVoiceNote#6dc2227d to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterVoiceNote"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterVoiceNote#6dc2227d: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterPhotoAndVideo represents TL type `searchMessagesFilterPhotoAndVideo#5097e193`.
type SearchMessagesFilterPhotoAndVideo struct {
}

// SearchMessagesFilterPhotoAndVideoTypeID is TL type id of SearchMessagesFilterPhotoAndVideo.
const SearchMessagesFilterPhotoAndVideoTypeID = 0x5097e193

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterPhotoAndVideo) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterPhotoAndVideo{}
)

func (s *SearchMessagesFilterPhotoAndVideo) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterPhotoAndVideo) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPhotoAndVideo#5097e193 as nil")
	}
	b.PutID(SearchMessagesFilterPhotoAndVideoTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterPhotoAndVideo) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPhotoAndVideo#5097e193 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterPhotoAndVideo) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPhotoAndVideo#5097e193 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterPhotoAndVideoTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterPhotoAndVideo#5097e193: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterPhotoAndVideo) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPhotoAndVideo#5097e193 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterPhotoAndVideo) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPhotoAndVideo#5097e193 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterPhotoAndVideo")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterPhotoAndVideo) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPhotoAndVideo#5097e193 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterPhotoAndVideo"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterPhotoAndVideo#5097e193: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterURL represents TL type `searchMessagesFilterUrl#92ffe18b`.
type SearchMessagesFilterURL struct {
}

// SearchMessagesFilterURLTypeID is TL type id of SearchMessagesFilterURL.
const SearchMessagesFilterURLTypeID = 0x92ffe18b

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterURL) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterURL{}
)

func (s *SearchMessagesFilterURL) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterURL) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterUrl#92ffe18b as nil")
	}
	b.PutID(SearchMessagesFilterURLTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterURL) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterUrl#92ffe18b as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterURL) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterUrl#92ffe18b to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterURLTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterUrl#92ffe18b: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterURL) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterUrl#92ffe18b to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterURL) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterUrl#92ffe18b as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterUrl")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterURL) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterUrl#92ffe18b to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterUrl"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterUrl#92ffe18b: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterChatPhoto represents TL type `searchMessagesFilterChatPhoto#b5a0d35f`.
type SearchMessagesFilterChatPhoto struct {
}

// SearchMessagesFilterChatPhotoTypeID is TL type id of SearchMessagesFilterChatPhoto.
const SearchMessagesFilterChatPhotoTypeID = 0xb5a0d35f

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterChatPhoto) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterChatPhoto{}
)

func (s *SearchMessagesFilterChatPhoto) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterChatPhoto) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterChatPhoto#b5a0d35f as nil")
	}
	b.PutID(SearchMessagesFilterChatPhotoTypeID)
	return s.EncodeBare(b)
}

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

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterChatPhoto) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterChatPhoto#b5a0d35f to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterChatPhotoTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterChatPhoto#b5a0d35f: %w", err)
	}
	return s.DecodeBare(b)
}

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

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterChatPhoto) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterChatPhoto#b5a0d35f as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterChatPhoto")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterChatPhoto) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterChatPhoto#b5a0d35f to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterChatPhoto"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterChatPhoto#b5a0d35f: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterVideoNote represents TL type `searchMessagesFilterVideoNote#21a2e3f9`.
type SearchMessagesFilterVideoNote struct {
}

// SearchMessagesFilterVideoNoteTypeID is TL type id of SearchMessagesFilterVideoNote.
const SearchMessagesFilterVideoNoteTypeID = 0x21a2e3f9

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterVideoNote) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterVideoNote{}
)

func (s *SearchMessagesFilterVideoNote) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterVideoNote) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVideoNote#21a2e3f9 as nil")
	}
	b.PutID(SearchMessagesFilterVideoNoteTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterVideoNote) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVideoNote#21a2e3f9 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterVideoNote) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVideoNote#21a2e3f9 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterVideoNoteTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterVideoNote#21a2e3f9: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterVideoNote) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVideoNote#21a2e3f9 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterVideoNote) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVideoNote#21a2e3f9 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterVideoNote")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterVideoNote) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVideoNote#21a2e3f9 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterVideoNote"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterVideoNote#21a2e3f9: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterVoiceAndVideoNote represents TL type `searchMessagesFilterVoiceAndVideoNote#279680e3`.
type SearchMessagesFilterVoiceAndVideoNote struct {
}

// SearchMessagesFilterVoiceAndVideoNoteTypeID is TL type id of SearchMessagesFilterVoiceAndVideoNote.
const SearchMessagesFilterVoiceAndVideoNoteTypeID = 0x279680e3

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterVoiceAndVideoNote) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterVoiceAndVideoNote{}
)

func (s *SearchMessagesFilterVoiceAndVideoNote) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterVoiceAndVideoNote) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVoiceAndVideoNote#279680e3 as nil")
	}
	b.PutID(SearchMessagesFilterVoiceAndVideoNoteTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterVoiceAndVideoNote) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVoiceAndVideoNote#279680e3 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterVoiceAndVideoNote) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVoiceAndVideoNote#279680e3 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterVoiceAndVideoNoteTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterVoiceAndVideoNote#279680e3: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterVoiceAndVideoNote) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVoiceAndVideoNote#279680e3 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterVoiceAndVideoNote) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterVoiceAndVideoNote#279680e3 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterVoiceAndVideoNote")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterVoiceAndVideoNote) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterVoiceAndVideoNote#279680e3 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterVoiceAndVideoNote"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterVoiceAndVideoNote#279680e3: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterMention represents TL type `searchMessagesFilterMention#7748c89c`.
type SearchMessagesFilterMention struct {
}

// SearchMessagesFilterMentionTypeID is TL type id of SearchMessagesFilterMention.
const SearchMessagesFilterMentionTypeID = 0x7748c89c

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterMention) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterMention{}
)

func (s *SearchMessagesFilterMention) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterMention) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterMention#7748c89c as nil")
	}
	b.PutID(SearchMessagesFilterMentionTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterMention) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterMention#7748c89c as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterMention) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterMention#7748c89c to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterMentionTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterMention#7748c89c: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterMention) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterMention#7748c89c to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterMention) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterMention#7748c89c as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterMention")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterMention) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterMention#7748c89c to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterMention"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterMention#7748c89c: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterUnreadMention represents TL type `searchMessagesFilterUnreadMention#fa4aadc3`.
type SearchMessagesFilterUnreadMention struct {
}

// SearchMessagesFilterUnreadMentionTypeID is TL type id of SearchMessagesFilterUnreadMention.
const SearchMessagesFilterUnreadMentionTypeID = 0xfa4aadc3

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterUnreadMention) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterUnreadMention{}
)

func (s *SearchMessagesFilterUnreadMention) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterUnreadMention) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterUnreadMention#fa4aadc3 as nil")
	}
	b.PutID(SearchMessagesFilterUnreadMentionTypeID)
	return s.EncodeBare(b)
}

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

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterUnreadMention) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterUnreadMention#fa4aadc3 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterUnreadMentionTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterUnreadMention#fa4aadc3: %w", err)
	}
	return s.DecodeBare(b)
}

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

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterUnreadMention) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterUnreadMention#fa4aadc3 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterUnreadMention")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterUnreadMention) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterUnreadMention#fa4aadc3 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterUnreadMention"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterUnreadMention#fa4aadc3: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterUnreadReaction represents TL type `searchMessagesFilterUnreadReaction#adc43100`.
type SearchMessagesFilterUnreadReaction struct {
}

// SearchMessagesFilterUnreadReactionTypeID is TL type id of SearchMessagesFilterUnreadReaction.
const SearchMessagesFilterUnreadReactionTypeID = 0xadc43100

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterUnreadReaction) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterUnreadReaction{}
)

func (s *SearchMessagesFilterUnreadReaction) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterUnreadReaction) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterUnreadReaction#adc43100 as nil")
	}
	b.PutID(SearchMessagesFilterUnreadReactionTypeID)
	return s.EncodeBare(b)
}

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

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterUnreadReaction) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterUnreadReaction#adc43100 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterUnreadReactionTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterUnreadReaction#adc43100: %w", err)
	}
	return s.DecodeBare(b)
}

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

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterUnreadReaction) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterUnreadReaction#adc43100 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterUnreadReaction")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterUnreadReaction) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterUnreadReaction#adc43100 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterUnreadReaction"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterUnreadReaction#adc43100: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterFailedToSend represents TL type `searchMessagesFilterFailedToSend#dc74d6fc`.
type SearchMessagesFilterFailedToSend struct {
}

// SearchMessagesFilterFailedToSendTypeID is TL type id of SearchMessagesFilterFailedToSend.
const SearchMessagesFilterFailedToSendTypeID = 0xdc74d6fc

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterFailedToSend) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterFailedToSend{}
)

func (s *SearchMessagesFilterFailedToSend) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterFailedToSend) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterFailedToSend#dc74d6fc as nil")
	}
	b.PutID(SearchMessagesFilterFailedToSendTypeID)
	return s.EncodeBare(b)
}

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

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterFailedToSend) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterFailedToSend#dc74d6fc to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterFailedToSendTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterFailedToSend#dc74d6fc: %w", err)
	}
	return s.DecodeBare(b)
}

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

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterFailedToSend) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterFailedToSend#dc74d6fc as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterFailedToSend")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterFailedToSend) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterFailedToSend#dc74d6fc to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterFailedToSend"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterFailedToSend#dc74d6fc: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterPinned represents TL type `searchMessagesFilterPinned#16294d48`.
type SearchMessagesFilterPinned struct {
}

// SearchMessagesFilterPinnedTypeID is TL type id of SearchMessagesFilterPinned.
const SearchMessagesFilterPinnedTypeID = 0x16294d48

// construct implements constructor of SearchMessagesFilterClass.
func (s SearchMessagesFilterPinned) construct() SearchMessagesFilterClass { return &s }

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

	_ SearchMessagesFilterClass = &SearchMessagesFilterPinned{}
)

func (s *SearchMessagesFilterPinned) Zero() bool {
	if s == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (s *SearchMessagesFilterPinned) Encode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPinned#16294d48 as nil")
	}
	b.PutID(SearchMessagesFilterPinnedTypeID)
	return s.EncodeBare(b)
}

// EncodeBare implements bin.BareEncoder.
func (s *SearchMessagesFilterPinned) EncodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPinned#16294d48 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (s *SearchMessagesFilterPinned) Decode(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPinned#16294d48 to nil")
	}
	if err := b.ConsumeID(SearchMessagesFilterPinnedTypeID); err != nil {
		return fmt.Errorf("unable to decode searchMessagesFilterPinned#16294d48: %w", err)
	}
	return s.DecodeBare(b)
}

// DecodeBare implements bin.BareDecoder.
func (s *SearchMessagesFilterPinned) DecodeBare(b *bin.Buffer) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPinned#16294d48 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (s *SearchMessagesFilterPinned) EncodeTDLibJSON(b tdjson.Encoder) error {
	if s == nil {
		return fmt.Errorf("can't encode searchMessagesFilterPinned#16294d48 as nil")
	}
	b.ObjStart()
	b.PutID("searchMessagesFilterPinned")
	b.Comma()
	b.StripComma()
	b.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (s *SearchMessagesFilterPinned) DecodeTDLibJSON(b tdjson.Decoder) error {
	if s == nil {
		return fmt.Errorf("can't decode searchMessagesFilterPinned#16294d48 to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("searchMessagesFilterPinned"); err != nil {
				return fmt.Errorf("unable to decode searchMessagesFilterPinned#16294d48: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}

// SearchMessagesFilterClassName is schema name of SearchMessagesFilterClass.
const SearchMessagesFilterClassName = "SearchMessagesFilter"

// SearchMessagesFilterClass represents SearchMessagesFilter generic type.
//
// Example:
//
//	g, err := tdapi.DecodeSearchMessagesFilter(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tdapi.SearchMessagesFilterEmpty: // searchMessagesFilterEmpty#cc2e1337
//	case *tdapi.SearchMessagesFilterAnimation: // searchMessagesFilterAnimation#f6b800c5
//	case *tdapi.SearchMessagesFilterAudio: // searchMessagesFilterAudio#33b5147b
//	case *tdapi.SearchMessagesFilterDocument: // searchMessagesFilterDocument#5af9f74f
//	case *tdapi.SearchMessagesFilterPhoto: // searchMessagesFilterPhoto#37309b05
//	case *tdapi.SearchMessagesFilterVideo: // searchMessagesFilterVideo#6e2f92e
//	case *tdapi.SearchMessagesFilterVoiceNote: // searchMessagesFilterVoiceNote#6dc2227d
//	case *tdapi.SearchMessagesFilterPhotoAndVideo: // searchMessagesFilterPhotoAndVideo#5097e193
//	case *tdapi.SearchMessagesFilterURL: // searchMessagesFilterUrl#92ffe18b
//	case *tdapi.SearchMessagesFilterChatPhoto: // searchMessagesFilterChatPhoto#b5a0d35f
//	case *tdapi.SearchMessagesFilterVideoNote: // searchMessagesFilterVideoNote#21a2e3f9
//	case *tdapi.SearchMessagesFilterVoiceAndVideoNote: // searchMessagesFilterVoiceAndVideoNote#279680e3
//	case *tdapi.SearchMessagesFilterMention: // searchMessagesFilterMention#7748c89c
//	case *tdapi.SearchMessagesFilterUnreadMention: // searchMessagesFilterUnreadMention#fa4aadc3
//	case *tdapi.SearchMessagesFilterUnreadReaction: // searchMessagesFilterUnreadReaction#adc43100
//	case *tdapi.SearchMessagesFilterFailedToSend: // searchMessagesFilterFailedToSend#dc74d6fc
//	case *tdapi.SearchMessagesFilterPinned: // searchMessagesFilterPinned#16294d48
//	default: panic(v)
//	}
type SearchMessagesFilterClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() SearchMessagesFilterClass

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

	EncodeTDLibJSON(b tdjson.Encoder) error
	DecodeTDLibJSON(b tdjson.Decoder) error
}

// DecodeSearchMessagesFilter implements binary de-serialization for SearchMessagesFilterClass.
func DecodeSearchMessagesFilter(buf *bin.Buffer) (SearchMessagesFilterClass, error) {
	id, err := buf.PeekID()
	if err != nil {
		return nil, err
	}
	switch id {
	case SearchMessagesFilterEmptyTypeID:
		// Decoding searchMessagesFilterEmpty#cc2e1337.
		v := SearchMessagesFilterEmpty{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterAnimationTypeID:
		// Decoding searchMessagesFilterAnimation#f6b800c5.
		v := SearchMessagesFilterAnimation{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterAudioTypeID:
		// Decoding searchMessagesFilterAudio#33b5147b.
		v := SearchMessagesFilterAudio{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterDocumentTypeID:
		// Decoding searchMessagesFilterDocument#5af9f74f.
		v := SearchMessagesFilterDocument{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterPhotoTypeID:
		// Decoding searchMessagesFilterPhoto#37309b05.
		v := SearchMessagesFilterPhoto{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterVideoTypeID:
		// Decoding searchMessagesFilterVideo#6e2f92e.
		v := SearchMessagesFilterVideo{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterVoiceNoteTypeID:
		// Decoding searchMessagesFilterVoiceNote#6dc2227d.
		v := SearchMessagesFilterVoiceNote{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterPhotoAndVideoTypeID:
		// Decoding searchMessagesFilterPhotoAndVideo#5097e193.
		v := SearchMessagesFilterPhotoAndVideo{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterURLTypeID:
		// Decoding searchMessagesFilterUrl#92ffe18b.
		v := SearchMessagesFilterURL{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterChatPhotoTypeID:
		// Decoding searchMessagesFilterChatPhoto#b5a0d35f.
		v := SearchMessagesFilterChatPhoto{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterVideoNoteTypeID:
		// Decoding searchMessagesFilterVideoNote#21a2e3f9.
		v := SearchMessagesFilterVideoNote{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterVoiceAndVideoNoteTypeID:
		// Decoding searchMessagesFilterVoiceAndVideoNote#279680e3.
		v := SearchMessagesFilterVoiceAndVideoNote{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterMentionTypeID:
		// Decoding searchMessagesFilterMention#7748c89c.
		v := SearchMessagesFilterMention{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterUnreadMentionTypeID:
		// Decoding searchMessagesFilterUnreadMention#fa4aadc3.
		v := SearchMessagesFilterUnreadMention{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterUnreadReactionTypeID:
		// Decoding searchMessagesFilterUnreadReaction#adc43100.
		v := SearchMessagesFilterUnreadReaction{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterFailedToSendTypeID:
		// Decoding searchMessagesFilterFailedToSend#dc74d6fc.
		v := SearchMessagesFilterFailedToSend{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case SearchMessagesFilterPinnedTypeID:
		// Decoding searchMessagesFilterPinned#16294d48.
		v := SearchMessagesFilterPinned{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	default:
		return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", bin.NewUnexpectedID(id))
	}
}

// DecodeTDLibJSONSearchMessagesFilter implements binary de-serialization for SearchMessagesFilterClass.
func DecodeTDLibJSONSearchMessagesFilter(buf tdjson.Decoder) (SearchMessagesFilterClass, error) {
	id, err := buf.FindTypeID()
	if err != nil {
		return nil, err
	}
	switch id {
	case "searchMessagesFilterEmpty":
		// Decoding searchMessagesFilterEmpty#cc2e1337.
		v := SearchMessagesFilterEmpty{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterAnimation":
		// Decoding searchMessagesFilterAnimation#f6b800c5.
		v := SearchMessagesFilterAnimation{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterAudio":
		// Decoding searchMessagesFilterAudio#33b5147b.
		v := SearchMessagesFilterAudio{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterDocument":
		// Decoding searchMessagesFilterDocument#5af9f74f.
		v := SearchMessagesFilterDocument{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterPhoto":
		// Decoding searchMessagesFilterPhoto#37309b05.
		v := SearchMessagesFilterPhoto{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterVideo":
		// Decoding searchMessagesFilterVideo#6e2f92e.
		v := SearchMessagesFilterVideo{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterVoiceNote":
		// Decoding searchMessagesFilterVoiceNote#6dc2227d.
		v := SearchMessagesFilterVoiceNote{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterPhotoAndVideo":
		// Decoding searchMessagesFilterPhotoAndVideo#5097e193.
		v := SearchMessagesFilterPhotoAndVideo{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterUrl":
		// Decoding searchMessagesFilterUrl#92ffe18b.
		v := SearchMessagesFilterURL{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterChatPhoto":
		// Decoding searchMessagesFilterChatPhoto#b5a0d35f.
		v := SearchMessagesFilterChatPhoto{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterVideoNote":
		// Decoding searchMessagesFilterVideoNote#21a2e3f9.
		v := SearchMessagesFilterVideoNote{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterVoiceAndVideoNote":
		// Decoding searchMessagesFilterVoiceAndVideoNote#279680e3.
		v := SearchMessagesFilterVoiceAndVideoNote{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterMention":
		// Decoding searchMessagesFilterMention#7748c89c.
		v := SearchMessagesFilterMention{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterUnreadMention":
		// Decoding searchMessagesFilterUnreadMention#fa4aadc3.
		v := SearchMessagesFilterUnreadMention{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterUnreadReaction":
		// Decoding searchMessagesFilterUnreadReaction#adc43100.
		v := SearchMessagesFilterUnreadReaction{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterFailedToSend":
		// Decoding searchMessagesFilterFailedToSend#dc74d6fc.
		v := SearchMessagesFilterFailedToSend{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	case "searchMessagesFilterPinned":
		// Decoding searchMessagesFilterPinned#16294d48.
		v := SearchMessagesFilterPinned{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", err)
		}
		return &v, nil
	default:
		return nil, fmt.Errorf("unable to decode SearchMessagesFilterClass: %w", tdjson.NewUnexpectedID(id))
	}
}

// SearchMessagesFilter boxes the SearchMessagesFilterClass providing a helper.
type SearchMessagesFilterBox struct {
	SearchMessagesFilter SearchMessagesFilterClass
}

// Decode implements bin.Decoder for SearchMessagesFilterBox.
func (b *SearchMessagesFilterBox) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("unable to decode SearchMessagesFilterBox to nil")
	}
	v, err := DecodeSearchMessagesFilter(buf)
	if err != nil {
		return fmt.Errorf("unable to decode boxed value: %w", err)
	}
	b.SearchMessagesFilter = v
	return nil
}

// Encode implements bin.Encode for SearchMessagesFilterBox.
func (b *SearchMessagesFilterBox) Encode(buf *bin.Buffer) error {
	if b == nil || b.SearchMessagesFilter == nil {
		return fmt.Errorf("unable to encode SearchMessagesFilterClass as nil")
	}
	return b.SearchMessagesFilter.Encode(buf)
}

// DecodeTDLibJSON implements bin.Decoder for SearchMessagesFilterBox.
func (b *SearchMessagesFilterBox) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("unable to decode SearchMessagesFilterBox to nil")
	}
	v, err := DecodeTDLibJSONSearchMessagesFilter(buf)
	if err != nil {
		return fmt.Errorf("unable to decode boxed value: %w", err)
	}
	b.SearchMessagesFilter = v
	return nil
}

// EncodeTDLibJSON implements bin.Encode for SearchMessagesFilterBox.
func (b *SearchMessagesFilterBox) EncodeTDLibJSON(buf tdjson.Encoder) error {
	if b == nil || b.SearchMessagesFilter == nil {
		return fmt.Errorf("unable to encode SearchMessagesFilterClass as nil")
	}
	return b.SearchMessagesFilter.EncodeTDLibJSON(buf)
}
