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

// BusinessFeatureLocation represents TL type `businessFeatureLocation#c090027c`.
type BusinessFeatureLocation struct {
}

// BusinessFeatureLocationTypeID is TL type id of BusinessFeatureLocation.
const BusinessFeatureLocationTypeID = 0xc090027c

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureLocation) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureLocation{}
)

func (b *BusinessFeatureLocation) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureLocation) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureLocation#c090027c as nil")
	}
	buf.PutID(BusinessFeatureLocationTypeID)
	return b.EncodeBare(buf)
}

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

// Decode implements bin.Decoder.
func (b *BusinessFeatureLocation) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureLocation#c090027c to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureLocationTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureLocation#c090027c: %w", err)
	}
	return b.DecodeBare(buf)
}

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

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

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureLocation) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureLocation#c090027c to nil")
	}

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

// BusinessFeatureOpeningHours represents TL type `businessFeatureOpeningHours#1b7b22ed`.
type BusinessFeatureOpeningHours struct {
}

// BusinessFeatureOpeningHoursTypeID is TL type id of BusinessFeatureOpeningHours.
const BusinessFeatureOpeningHoursTypeID = 0x1b7b22ed

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureOpeningHours) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureOpeningHours{}
)

func (b *BusinessFeatureOpeningHours) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureOpeningHours) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureOpeningHours#1b7b22ed as nil")
	}
	buf.PutID(BusinessFeatureOpeningHoursTypeID)
	return b.EncodeBare(buf)
}

// EncodeBare implements bin.BareEncoder.
func (b *BusinessFeatureOpeningHours) EncodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureOpeningHours#1b7b22ed as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (b *BusinessFeatureOpeningHours) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureOpeningHours#1b7b22ed to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureOpeningHoursTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureOpeningHours#1b7b22ed: %w", err)
	}
	return b.DecodeBare(buf)
}

// DecodeBare implements bin.BareDecoder.
func (b *BusinessFeatureOpeningHours) DecodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureOpeningHours#1b7b22ed to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BusinessFeatureOpeningHours) EncodeTDLibJSON(buf tdjson.Encoder) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureOpeningHours#1b7b22ed as nil")
	}
	buf.ObjStart()
	buf.PutID("businessFeatureOpeningHours")
	buf.Comma()
	buf.StripComma()
	buf.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureOpeningHours) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureOpeningHours#1b7b22ed to nil")
	}

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

// BusinessFeatureQuickReplies represents TL type `businessFeatureQuickReplies#9c380a82`.
type BusinessFeatureQuickReplies struct {
}

// BusinessFeatureQuickRepliesTypeID is TL type id of BusinessFeatureQuickReplies.
const BusinessFeatureQuickRepliesTypeID = 0x9c380a82

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureQuickReplies) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureQuickReplies{}
)

func (b *BusinessFeatureQuickReplies) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureQuickReplies) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureQuickReplies#9c380a82 as nil")
	}
	buf.PutID(BusinessFeatureQuickRepliesTypeID)
	return b.EncodeBare(buf)
}

// EncodeBare implements bin.BareEncoder.
func (b *BusinessFeatureQuickReplies) EncodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureQuickReplies#9c380a82 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (b *BusinessFeatureQuickReplies) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureQuickReplies#9c380a82 to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureQuickRepliesTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureQuickReplies#9c380a82: %w", err)
	}
	return b.DecodeBare(buf)
}

// DecodeBare implements bin.BareDecoder.
func (b *BusinessFeatureQuickReplies) DecodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureQuickReplies#9c380a82 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BusinessFeatureQuickReplies) EncodeTDLibJSON(buf tdjson.Encoder) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureQuickReplies#9c380a82 as nil")
	}
	buf.ObjStart()
	buf.PutID("businessFeatureQuickReplies")
	buf.Comma()
	buf.StripComma()
	buf.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureQuickReplies) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureQuickReplies#9c380a82 to nil")
	}

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

// BusinessFeatureGreetingMessage represents TL type `businessFeatureGreetingMessage#6aa87474`.
type BusinessFeatureGreetingMessage struct {
}

// BusinessFeatureGreetingMessageTypeID is TL type id of BusinessFeatureGreetingMessage.
const BusinessFeatureGreetingMessageTypeID = 0x6aa87474

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureGreetingMessage) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureGreetingMessage{}
)

func (b *BusinessFeatureGreetingMessage) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureGreetingMessage) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureGreetingMessage#6aa87474 as nil")
	}
	buf.PutID(BusinessFeatureGreetingMessageTypeID)
	return b.EncodeBare(buf)
}

// EncodeBare implements bin.BareEncoder.
func (b *BusinessFeatureGreetingMessage) EncodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureGreetingMessage#6aa87474 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (b *BusinessFeatureGreetingMessage) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureGreetingMessage#6aa87474 to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureGreetingMessageTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureGreetingMessage#6aa87474: %w", err)
	}
	return b.DecodeBare(buf)
}

// DecodeBare implements bin.BareDecoder.
func (b *BusinessFeatureGreetingMessage) DecodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureGreetingMessage#6aa87474 to nil")
	}
	return nil
}

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

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureGreetingMessage) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureGreetingMessage#6aa87474 to nil")
	}

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

// BusinessFeatureAwayMessage represents TL type `businessFeatureAwayMessage#40f9e8dd`.
type BusinessFeatureAwayMessage struct {
}

// BusinessFeatureAwayMessageTypeID is TL type id of BusinessFeatureAwayMessage.
const BusinessFeatureAwayMessageTypeID = 0x40f9e8dd

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureAwayMessage) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureAwayMessage{}
)

func (b *BusinessFeatureAwayMessage) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureAwayMessage) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureAwayMessage#40f9e8dd as nil")
	}
	buf.PutID(BusinessFeatureAwayMessageTypeID)
	return b.EncodeBare(buf)
}

// EncodeBare implements bin.BareEncoder.
func (b *BusinessFeatureAwayMessage) EncodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureAwayMessage#40f9e8dd as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (b *BusinessFeatureAwayMessage) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureAwayMessage#40f9e8dd to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureAwayMessageTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureAwayMessage#40f9e8dd: %w", err)
	}
	return b.DecodeBare(buf)
}

// DecodeBare implements bin.BareDecoder.
func (b *BusinessFeatureAwayMessage) DecodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureAwayMessage#40f9e8dd to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BusinessFeatureAwayMessage) EncodeTDLibJSON(buf tdjson.Encoder) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureAwayMessage#40f9e8dd as nil")
	}
	buf.ObjStart()
	buf.PutID("businessFeatureAwayMessage")
	buf.Comma()
	buf.StripComma()
	buf.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureAwayMessage) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureAwayMessage#40f9e8dd to nil")
	}

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

// BusinessFeatureAccountLinks represents TL type `businessFeatureAccountLinks#6ffa970e`.
type BusinessFeatureAccountLinks struct {
}

// BusinessFeatureAccountLinksTypeID is TL type id of BusinessFeatureAccountLinks.
const BusinessFeatureAccountLinksTypeID = 0x6ffa970e

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureAccountLinks) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureAccountLinks{}
)

func (b *BusinessFeatureAccountLinks) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureAccountLinks) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureAccountLinks#6ffa970e as nil")
	}
	buf.PutID(BusinessFeatureAccountLinksTypeID)
	return b.EncodeBare(buf)
}

// EncodeBare implements bin.BareEncoder.
func (b *BusinessFeatureAccountLinks) EncodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureAccountLinks#6ffa970e as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (b *BusinessFeatureAccountLinks) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureAccountLinks#6ffa970e to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureAccountLinksTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureAccountLinks#6ffa970e: %w", err)
	}
	return b.DecodeBare(buf)
}

// DecodeBare implements bin.BareDecoder.
func (b *BusinessFeatureAccountLinks) DecodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureAccountLinks#6ffa970e to nil")
	}
	return nil
}

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

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureAccountLinks) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureAccountLinks#6ffa970e to nil")
	}

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

// BusinessFeatureStartPage represents TL type `businessFeatureStartPage#17edf7e1`.
type BusinessFeatureStartPage struct {
}

// BusinessFeatureStartPageTypeID is TL type id of BusinessFeatureStartPage.
const BusinessFeatureStartPageTypeID = 0x17edf7e1

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureStartPage) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureStartPage{}
)

func (b *BusinessFeatureStartPage) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureStartPage) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureStartPage#17edf7e1 as nil")
	}
	buf.PutID(BusinessFeatureStartPageTypeID)
	return b.EncodeBare(buf)
}

// EncodeBare implements bin.BareEncoder.
func (b *BusinessFeatureStartPage) EncodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureStartPage#17edf7e1 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (b *BusinessFeatureStartPage) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureStartPage#17edf7e1 to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureStartPageTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureStartPage#17edf7e1: %w", err)
	}
	return b.DecodeBare(buf)
}

// DecodeBare implements bin.BareDecoder.
func (b *BusinessFeatureStartPage) DecodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureStartPage#17edf7e1 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BusinessFeatureStartPage) EncodeTDLibJSON(buf tdjson.Encoder) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureStartPage#17edf7e1 as nil")
	}
	buf.ObjStart()
	buf.PutID("businessFeatureStartPage")
	buf.Comma()
	buf.StripComma()
	buf.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureStartPage) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureStartPage#17edf7e1 to nil")
	}

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

// BusinessFeatureBots represents TL type `businessFeatureBots#106575e5`.
type BusinessFeatureBots struct {
}

// BusinessFeatureBotsTypeID is TL type id of BusinessFeatureBots.
const BusinessFeatureBotsTypeID = 0x106575e5

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureBots) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureBots{}
)

func (b *BusinessFeatureBots) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureBots) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureBots#106575e5 as nil")
	}
	buf.PutID(BusinessFeatureBotsTypeID)
	return b.EncodeBare(buf)
}

// EncodeBare implements bin.BareEncoder.
func (b *BusinessFeatureBots) EncodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureBots#106575e5 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (b *BusinessFeatureBots) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureBots#106575e5 to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureBotsTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureBots#106575e5: %w", err)
	}
	return b.DecodeBare(buf)
}

// DecodeBare implements bin.BareDecoder.
func (b *BusinessFeatureBots) DecodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureBots#106575e5 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BusinessFeatureBots) EncodeTDLibJSON(buf tdjson.Encoder) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureBots#106575e5 as nil")
	}
	buf.ObjStart()
	buf.PutID("businessFeatureBots")
	buf.Comma()
	buf.StripComma()
	buf.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureBots) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureBots#106575e5 to nil")
	}

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

// BusinessFeatureEmojiStatus represents TL type `businessFeatureEmojiStatus#cd8ec0e5`.
type BusinessFeatureEmojiStatus struct {
}

// BusinessFeatureEmojiStatusTypeID is TL type id of BusinessFeatureEmojiStatus.
const BusinessFeatureEmojiStatusTypeID = 0xcd8ec0e5

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureEmojiStatus) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureEmojiStatus{}
)

func (b *BusinessFeatureEmojiStatus) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureEmojiStatus) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureEmojiStatus#cd8ec0e5 as nil")
	}
	buf.PutID(BusinessFeatureEmojiStatusTypeID)
	return b.EncodeBare(buf)
}

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

// Decode implements bin.Decoder.
func (b *BusinessFeatureEmojiStatus) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureEmojiStatus#cd8ec0e5 to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureEmojiStatusTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureEmojiStatus#cd8ec0e5: %w", err)
	}
	return b.DecodeBare(buf)
}

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

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

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureEmojiStatus) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureEmojiStatus#cd8ec0e5 to nil")
	}

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

// BusinessFeatureChatFolderTags represents TL type `businessFeatureChatFolderTags#df95092a`.
type BusinessFeatureChatFolderTags struct {
}

// BusinessFeatureChatFolderTagsTypeID is TL type id of BusinessFeatureChatFolderTags.
const BusinessFeatureChatFolderTagsTypeID = 0xdf95092a

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureChatFolderTags) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureChatFolderTags{}
)

func (b *BusinessFeatureChatFolderTags) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureChatFolderTags) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureChatFolderTags#df95092a as nil")
	}
	buf.PutID(BusinessFeatureChatFolderTagsTypeID)
	return b.EncodeBare(buf)
}

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

// Decode implements bin.Decoder.
func (b *BusinessFeatureChatFolderTags) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureChatFolderTags#df95092a to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureChatFolderTagsTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureChatFolderTags#df95092a: %w", err)
	}
	return b.DecodeBare(buf)
}

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

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

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureChatFolderTags) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureChatFolderTags#df95092a to nil")
	}

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

// BusinessFeatureUpgradedStories represents TL type `businessFeatureUpgradedStories#93fb53d2`.
type BusinessFeatureUpgradedStories struct {
}

// BusinessFeatureUpgradedStoriesTypeID is TL type id of BusinessFeatureUpgradedStories.
const BusinessFeatureUpgradedStoriesTypeID = 0x93fb53d2

// construct implements constructor of BusinessFeatureClass.
func (b BusinessFeatureUpgradedStories) construct() BusinessFeatureClass { return &b }

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

	_ BusinessFeatureClass = &BusinessFeatureUpgradedStories{}
)

func (b *BusinessFeatureUpgradedStories) Zero() bool {
	if b == nil {
		return true
	}

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func (b *BusinessFeatureUpgradedStories) Encode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureUpgradedStories#93fb53d2 as nil")
	}
	buf.PutID(BusinessFeatureUpgradedStoriesTypeID)
	return b.EncodeBare(buf)
}

// EncodeBare implements bin.BareEncoder.
func (b *BusinessFeatureUpgradedStories) EncodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureUpgradedStories#93fb53d2 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func (b *BusinessFeatureUpgradedStories) Decode(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureUpgradedStories#93fb53d2 to nil")
	}
	if err := buf.ConsumeID(BusinessFeatureUpgradedStoriesTypeID); err != nil {
		return fmt.Errorf("unable to decode businessFeatureUpgradedStories#93fb53d2: %w", err)
	}
	return b.DecodeBare(buf)
}

// DecodeBare implements bin.BareDecoder.
func (b *BusinessFeatureUpgradedStories) DecodeBare(buf *bin.Buffer) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureUpgradedStories#93fb53d2 to nil")
	}
	return nil
}

// EncodeTDLibJSON implements tdjson.TDLibEncoder.
func (b *BusinessFeatureUpgradedStories) EncodeTDLibJSON(buf tdjson.Encoder) error {
	if b == nil {
		return fmt.Errorf("can't encode businessFeatureUpgradedStories#93fb53d2 as nil")
	}
	buf.ObjStart()
	buf.PutID("businessFeatureUpgradedStories")
	buf.Comma()
	buf.StripComma()
	buf.ObjEnd()
	return nil
}

// DecodeTDLibJSON implements tdjson.TDLibDecoder.
func (b *BusinessFeatureUpgradedStories) DecodeTDLibJSON(buf tdjson.Decoder) error {
	if b == nil {
		return fmt.Errorf("can't decode businessFeatureUpgradedStories#93fb53d2 to nil")
	}

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

// BusinessFeatureClassName is schema name of BusinessFeatureClass.
const BusinessFeatureClassName = "BusinessFeature"

// BusinessFeatureClass represents BusinessFeature generic type.
//
// Example:
//
//	g, err := tdapi.DecodeBusinessFeature(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tdapi.BusinessFeatureLocation: // businessFeatureLocation#c090027c
//	case *tdapi.BusinessFeatureOpeningHours: // businessFeatureOpeningHours#1b7b22ed
//	case *tdapi.BusinessFeatureQuickReplies: // businessFeatureQuickReplies#9c380a82
//	case *tdapi.BusinessFeatureGreetingMessage: // businessFeatureGreetingMessage#6aa87474
//	case *tdapi.BusinessFeatureAwayMessage: // businessFeatureAwayMessage#40f9e8dd
//	case *tdapi.BusinessFeatureAccountLinks: // businessFeatureAccountLinks#6ffa970e
//	case *tdapi.BusinessFeatureStartPage: // businessFeatureStartPage#17edf7e1
//	case *tdapi.BusinessFeatureBots: // businessFeatureBots#106575e5
//	case *tdapi.BusinessFeatureEmojiStatus: // businessFeatureEmojiStatus#cd8ec0e5
//	case *tdapi.BusinessFeatureChatFolderTags: // businessFeatureChatFolderTags#df95092a
//	case *tdapi.BusinessFeatureUpgradedStories: // businessFeatureUpgradedStories#93fb53d2
//	default: panic(v)
//	}
type BusinessFeatureClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() BusinessFeatureClass

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

// DecodeBusinessFeature implements binary de-serialization for BusinessFeatureClass.
func DecodeBusinessFeature(buf *bin.Buffer) (BusinessFeatureClass, error) {
	id, err := buf.PeekID()
	if err != nil {
		return nil, err
	}
	switch id {
	case BusinessFeatureLocationTypeID:
		// Decoding businessFeatureLocation#c090027c.
		v := BusinessFeatureLocation{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureOpeningHoursTypeID:
		// Decoding businessFeatureOpeningHours#1b7b22ed.
		v := BusinessFeatureOpeningHours{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureQuickRepliesTypeID:
		// Decoding businessFeatureQuickReplies#9c380a82.
		v := BusinessFeatureQuickReplies{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureGreetingMessageTypeID:
		// Decoding businessFeatureGreetingMessage#6aa87474.
		v := BusinessFeatureGreetingMessage{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureAwayMessageTypeID:
		// Decoding businessFeatureAwayMessage#40f9e8dd.
		v := BusinessFeatureAwayMessage{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureAccountLinksTypeID:
		// Decoding businessFeatureAccountLinks#6ffa970e.
		v := BusinessFeatureAccountLinks{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureStartPageTypeID:
		// Decoding businessFeatureStartPage#17edf7e1.
		v := BusinessFeatureStartPage{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureBotsTypeID:
		// Decoding businessFeatureBots#106575e5.
		v := BusinessFeatureBots{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureEmojiStatusTypeID:
		// Decoding businessFeatureEmojiStatus#cd8ec0e5.
		v := BusinessFeatureEmojiStatus{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureChatFolderTagsTypeID:
		// Decoding businessFeatureChatFolderTags#df95092a.
		v := BusinessFeatureChatFolderTags{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case BusinessFeatureUpgradedStoriesTypeID:
		// Decoding businessFeatureUpgradedStories#93fb53d2.
		v := BusinessFeatureUpgradedStories{}
		if err := v.Decode(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	default:
		return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", bin.NewUnexpectedID(id))
	}
}

// DecodeTDLibJSONBusinessFeature implements binary de-serialization for BusinessFeatureClass.
func DecodeTDLibJSONBusinessFeature(buf tdjson.Decoder) (BusinessFeatureClass, error) {
	id, err := buf.FindTypeID()
	if err != nil {
		return nil, err
	}
	switch id {
	case "businessFeatureLocation":
		// Decoding businessFeatureLocation#c090027c.
		v := BusinessFeatureLocation{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureOpeningHours":
		// Decoding businessFeatureOpeningHours#1b7b22ed.
		v := BusinessFeatureOpeningHours{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureQuickReplies":
		// Decoding businessFeatureQuickReplies#9c380a82.
		v := BusinessFeatureQuickReplies{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureGreetingMessage":
		// Decoding businessFeatureGreetingMessage#6aa87474.
		v := BusinessFeatureGreetingMessage{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureAwayMessage":
		// Decoding businessFeatureAwayMessage#40f9e8dd.
		v := BusinessFeatureAwayMessage{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureAccountLinks":
		// Decoding businessFeatureAccountLinks#6ffa970e.
		v := BusinessFeatureAccountLinks{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureStartPage":
		// Decoding businessFeatureStartPage#17edf7e1.
		v := BusinessFeatureStartPage{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureBots":
		// Decoding businessFeatureBots#106575e5.
		v := BusinessFeatureBots{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureEmojiStatus":
		// Decoding businessFeatureEmojiStatus#cd8ec0e5.
		v := BusinessFeatureEmojiStatus{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureChatFolderTags":
		// Decoding businessFeatureChatFolderTags#df95092a.
		v := BusinessFeatureChatFolderTags{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	case "businessFeatureUpgradedStories":
		// Decoding businessFeatureUpgradedStories#93fb53d2.
		v := BusinessFeatureUpgradedStories{}
		if err := v.DecodeTDLibJSON(buf); err != nil {
			return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", err)
		}
		return &v, nil
	default:
		return nil, fmt.Errorf("unable to decode BusinessFeatureClass: %w", tdjson.NewUnexpectedID(id))
	}
}

// BusinessFeature boxes the BusinessFeatureClass providing a helper.
type BusinessFeatureBox struct {
	BusinessFeature BusinessFeatureClass
}

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

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

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

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