// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

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

// ForumTopicDeleted represents TL type `forumTopicDeleted#23f109b`.
// Represents a deleted forum topic.
//
// See https://core.telegram.org/constructor/forumTopicDeleted for reference.
type ForumTopicDeleted struct {
	// The ID of the deleted forum topic.
	ID int
}

// ForumTopicDeletedTypeID is TL type id of ForumTopicDeleted.
const ForumTopicDeletedTypeID = 0x23f109b

// construct implements constructor of ForumTopicClass.
func ( ForumTopicDeleted) () ForumTopicClass { return & }

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

	_ ForumTopicClass = &ForumTopicDeleted{}
)

func ( *ForumTopicDeleted) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills ForumTopicDeleted from given interface.
func ( *ForumTopicDeleted) ( interface {
	() ( int)
}) {
	.ID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ForumTopicDeleted) () tdp.Type {
	 := tdp.Type{
		Name: "forumTopicDeleted",
		ID:   ForumTopicDeletedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ForumTopicDeleted) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode forumTopicDeleted#23f109b as nil")
	}
	.PutID(ForumTopicDeletedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ForumTopicDeleted) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode forumTopicDeleted#23f109b as nil")
	}
	.PutInt(.ID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ForumTopicDeleted) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode forumTopicDeleted#23f109b to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopicDeleted#23f109b: field id: %w", )
		}
		.ID = 
	}
	return nil
}

// GetID returns value of ID field.
func ( *ForumTopicDeleted) () ( int) {
	if  == nil {
		return
	}
	return .ID
}

// ForumTopic represents TL type `forumTopic#71701da9`.
// Represents a forum topic¹.
//
// Links:
//  1. https://core.telegram.org/api/forum#forum-topics
//
// See https://core.telegram.org/constructor/forumTopic for reference.
type ForumTopic struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the topic was created by the current user
	My bool
	// Whether the topic is closed (no messages can be sent to it)
	Closed bool
	// Whether the topic is pinned
	Pinned bool
	// Whether this constructor is a reduced version of the full topic information. If set,
	// only the my, closed, id, date, title, icon_color, icon_emoji_id and from_id parameters
	// will contain valid information. Reduced info is usually only returned in topic-related
	// admin log events »¹ and in the messages.channelMessages² constructor: if needed,
	// full information can be fetched using channels.getForumTopicsByID³.
	//
	// Links:
	//  1) https://core.telegram.org/api/recent-actions
	//  2) https://core.telegram.org/constructor/messages.channelMessages
	//  3) https://core.telegram.org/method/channels.getForumTopicsByID
	Short bool
	// Whether the topic is hidden (only valid for the "General" topic, id=1)
	Hidden bool
	// Topic ID¹
	//
	// Links:
	//  1) https://core.telegram.org/api/forum#forum-topics
	ID int
	// Topic creation date
	Date int
	// Topic title
	Title string
	// If no custom emoji icon is specified, specifies the color of the fallback topic icon
	// (RGB), one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F.
	IconColor int
	// ID of the custom emoji¹ used as topic icon.
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	//
	// Use SetIconEmojiID and GetIconEmojiID helpers.
	IconEmojiID int64
	// ID of the last message that was sent to this topic
	TopMessage int
	// Position up to which all incoming messages are read.
	ReadInboxMaxID int
	// Position up to which all outgoing messages are read.
	ReadOutboxMaxID int
	// Number of unread messages
	UnreadCount int
	// Number of unread mentions¹
	//
	// Links:
	//  1) https://core.telegram.org/api/mentions
	UnreadMentionsCount int
	// Number of unread reactions to messages you sent
	UnreadReactionsCount int
	// ID of the peer that created the topic
	FromID PeerClass
	// Notification settings
	NotifySettings PeerNotifySettings
	// Message draft¹
	//
	// Links:
	//  1) https://core.telegram.org/api/drafts
	//
	// Use SetDraft and GetDraft helpers.
	Draft DraftMessageClass
}

// ForumTopicTypeID is TL type id of ForumTopic.
const ForumTopicTypeID = 0x71701da9

// construct implements constructor of ForumTopicClass.
func ( ForumTopic) () ForumTopicClass { return & }

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

	_ ForumTopicClass = &ForumTopic{}
)

func ( *ForumTopic) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.My == false) {
		return false
	}
	if !(.Closed == false) {
		return false
	}
	if !(.Pinned == false) {
		return false
	}
	if !(.Short == false) {
		return false
	}
	if !(.Hidden == false) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.IconColor == 0) {
		return false
	}
	if !(.IconEmojiID == 0) {
		return false
	}
	if !(.TopMessage == 0) {
		return false
	}
	if !(.ReadInboxMaxID == 0) {
		return false
	}
	if !(.ReadOutboxMaxID == 0) {
		return false
	}
	if !(.UnreadCount == 0) {
		return false
	}
	if !(.UnreadMentionsCount == 0) {
		return false
	}
	if !(.UnreadReactionsCount == 0) {
		return false
	}
	if !(.FromID == nil) {
		return false
	}
	if !(.NotifySettings.Zero()) {
		return false
	}
	if !(.Draft == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ForumTopic from given interface.
func ( *ForumTopic) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( int)
	() ( int)
	() ( string)
	() ( int)
	() ( int64,  bool)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( PeerClass)
	() ( PeerNotifySettings)
	() ( DraftMessageClass,  bool)
}) {
	.My = .()
	.Closed = .()
	.Pinned = .()
	.Short = .()
	.Hidden = .()
	.ID = .()
	.Date = .()
	.Title = .()
	.IconColor = .()
	if ,  := .();  {
		.IconEmojiID = 
	}

	.TopMessage = .()
	.ReadInboxMaxID = .()
	.ReadOutboxMaxID = .()
	.UnreadCount = .()
	.UnreadMentionsCount = .()
	.UnreadReactionsCount = .()
	.FromID = .()
	.NotifySettings = .()
	if ,  := .();  {
		.Draft = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *ForumTopic) () tdp.Type {
	 := tdp.Type{
		Name: "forumTopic",
		ID:   ForumTopicTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "My",
			SchemaName: "my",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Closed",
			SchemaName: "closed",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Pinned",
			SchemaName: "pinned",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "Short",
			SchemaName: "short",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "Hidden",
			SchemaName: "hidden",
			Null:       !.Flags.Has(6),
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "IconColor",
			SchemaName: "icon_color",
		},
		{
			Name:       "IconEmojiID",
			SchemaName: "icon_emoji_id",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "TopMessage",
			SchemaName: "top_message",
		},
		{
			Name:       "ReadInboxMaxID",
			SchemaName: "read_inbox_max_id",
		},
		{
			Name:       "ReadOutboxMaxID",
			SchemaName: "read_outbox_max_id",
		},
		{
			Name:       "UnreadCount",
			SchemaName: "unread_count",
		},
		{
			Name:       "UnreadMentionsCount",
			SchemaName: "unread_mentions_count",
		},
		{
			Name:       "UnreadReactionsCount",
			SchemaName: "unread_reactions_count",
		},
		{
			Name:       "FromID",
			SchemaName: "from_id",
		},
		{
			Name:       "NotifySettings",
			SchemaName: "notify_settings",
		},
		{
			Name:       "Draft",
			SchemaName: "draft",
			Null:       !.Flags.Has(4),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *ForumTopic) () {
	if !(.My == false) {
		.Flags.Set(1)
	}
	if !(.Closed == false) {
		.Flags.Set(2)
	}
	if !(.Pinned == false) {
		.Flags.Set(3)
	}
	if !(.Short == false) {
		.Flags.Set(5)
	}
	if !(.Hidden == false) {
		.Flags.Set(6)
	}
	if !(.IconEmojiID == 0) {
		.Flags.Set(0)
	}
	if !(.Draft == nil) {
		.Flags.Set(4)
	}
}

// Encode implements bin.Encoder.
func ( *ForumTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode forumTopic#71701da9 as nil")
	}
	.PutID(ForumTopicTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ForumTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode forumTopic#71701da9 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode forumTopic#71701da9: field flags: %w", )
	}
	.PutInt(.ID)
	.PutInt(.Date)
	.PutString(.Title)
	.PutInt(.IconColor)
	if .Flags.Has(0) {
		.PutLong(.IconEmojiID)
	}
	.PutInt(.TopMessage)
	.PutInt(.ReadInboxMaxID)
	.PutInt(.ReadOutboxMaxID)
	.PutInt(.UnreadCount)
	.PutInt(.UnreadMentionsCount)
	.PutInt(.UnreadReactionsCount)
	if .FromID == nil {
		return fmt.Errorf("unable to encode forumTopic#71701da9: field from_id is nil")
	}
	if  := .FromID.Encode();  != nil {
		return fmt.Errorf("unable to encode forumTopic#71701da9: field from_id: %w", )
	}
	if  := .NotifySettings.Encode();  != nil {
		return fmt.Errorf("unable to encode forumTopic#71701da9: field notify_settings: %w", )
	}
	if .Flags.Has(4) {
		if .Draft == nil {
			return fmt.Errorf("unable to encode forumTopic#71701da9: field draft is nil")
		}
		if  := .Draft.Encode();  != nil {
			return fmt.Errorf("unable to encode forumTopic#71701da9: field draft: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ForumTopic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode forumTopic#71701da9 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field flags: %w", )
		}
	}
	.My = .Flags.Has(1)
	.Closed = .Flags.Has(2)
	.Pinned = .Flags.Has(3)
	.Short = .Flags.Has(5)
	.Hidden = .Flags.Has(6)
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field icon_color: %w", )
		}
		.IconColor = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field icon_emoji_id: %w", )
		}
		.IconEmojiID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field top_message: %w", )
		}
		.TopMessage = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field read_inbox_max_id: %w", )
		}
		.ReadInboxMaxID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field read_outbox_max_id: %w", )
		}
		.ReadOutboxMaxID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field unread_count: %w", )
		}
		.UnreadCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field unread_mentions_count: %w", )
		}
		.UnreadMentionsCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field unread_reactions_count: %w", )
		}
		.UnreadReactionsCount = 
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field from_id: %w", )
		}
		.FromID = 
	}
	{
		if  := .NotifySettings.Decode();  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field notify_settings: %w", )
		}
	}
	if .Flags.Has(4) {
		,  := DecodeDraftMessage()
		if  != nil {
			return fmt.Errorf("unable to decode forumTopic#71701da9: field draft: %w", )
		}
		.Draft = 
	}
	return nil
}

// SetMy sets value of My conditional field.
func ( *ForumTopic) ( bool) {
	if  {
		.Flags.Set(1)
		.My = true
	} else {
		.Flags.Unset(1)
		.My = false
	}
}

// GetMy returns value of My conditional field.
func ( *ForumTopic) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetClosed sets value of Closed conditional field.
func ( *ForumTopic) ( bool) {
	if  {
		.Flags.Set(2)
		.Closed = true
	} else {
		.Flags.Unset(2)
		.Closed = false
	}
}

// GetClosed returns value of Closed conditional field.
func ( *ForumTopic) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetPinned sets value of Pinned conditional field.
func ( *ForumTopic) ( bool) {
	if  {
		.Flags.Set(3)
		.Pinned = true
	} else {
		.Flags.Unset(3)
		.Pinned = false
	}
}

// GetPinned returns value of Pinned conditional field.
func ( *ForumTopic) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// SetShort sets value of Short conditional field.
func ( *ForumTopic) ( bool) {
	if  {
		.Flags.Set(5)
		.Short = true
	} else {
		.Flags.Unset(5)
		.Short = false
	}
}

// GetShort returns value of Short conditional field.
func ( *ForumTopic) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(5)
}

// SetHidden sets value of Hidden conditional field.
func ( *ForumTopic) ( bool) {
	if  {
		.Flags.Set(6)
		.Hidden = true
	} else {
		.Flags.Unset(6)
		.Hidden = false
	}
}

// GetHidden returns value of Hidden conditional field.
func ( *ForumTopic) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(6)
}

// GetID returns value of ID field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .ID
}

// GetDate returns value of Date field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .Date
}

// GetTitle returns value of Title field.
func ( *ForumTopic) () ( string) {
	if  == nil {
		return
	}
	return .Title
}

// GetIconColor returns value of IconColor field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .IconColor
}

// SetIconEmojiID sets value of IconEmojiID conditional field.
func ( *ForumTopic) ( int64) {
	.Flags.Set(0)
	.IconEmojiID = 
}

// GetIconEmojiID returns value of IconEmojiID conditional field and
// boolean which is true if field was set.
func ( *ForumTopic) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .IconEmojiID, true
}

// GetTopMessage returns value of TopMessage field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .TopMessage
}

// GetReadInboxMaxID returns value of ReadInboxMaxID field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .ReadInboxMaxID
}

// GetReadOutboxMaxID returns value of ReadOutboxMaxID field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .ReadOutboxMaxID
}

// GetUnreadCount returns value of UnreadCount field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .UnreadCount
}

// GetUnreadMentionsCount returns value of UnreadMentionsCount field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .UnreadMentionsCount
}

// GetUnreadReactionsCount returns value of UnreadReactionsCount field.
func ( *ForumTopic) () ( int) {
	if  == nil {
		return
	}
	return .UnreadReactionsCount
}

// GetFromID returns value of FromID field.
func ( *ForumTopic) () ( PeerClass) {
	if  == nil {
		return
	}
	return .FromID
}

// GetNotifySettings returns value of NotifySettings field.
func ( *ForumTopic) () ( PeerNotifySettings) {
	if  == nil {
		return
	}
	return .NotifySettings
}

// SetDraft sets value of Draft conditional field.
func ( *ForumTopic) ( DraftMessageClass) {
	.Flags.Set(4)
	.Draft = 
}

// GetDraft returns value of Draft conditional field and
// boolean which is true if field was set.
func ( *ForumTopic) () ( DraftMessageClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .Draft, true
}

// ForumTopicClassName is schema name of ForumTopicClass.
const ForumTopicClassName = "ForumTopic"

// ForumTopicClass represents ForumTopic generic type.
//
// See https://core.telegram.org/type/ForumTopic for reference.
//
// Example:
//
//	g, err := tg.DecodeForumTopic(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.ForumTopicDeleted: // forumTopicDeleted#23f109b
//	case *tg.ForumTopic: // forumTopic#71701da9
//	default: panic(v)
//	}
type ForumTopicClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() ForumTopicClass

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

	// The ID of the deleted forum topic.
	GetID() (value int)
}

// DecodeForumTopic implements binary de-serialization for ForumTopicClass.
func ( *bin.Buffer) (ForumTopicClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case ForumTopicDeletedTypeID:
		// Decoding forumTopicDeleted#23f109b.
		 := ForumTopicDeleted{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ForumTopicClass: %w", )
		}
		return &, nil
	case ForumTopicTypeID:
		// Decoding forumTopic#71701da9.
		 := ForumTopic{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ForumTopicClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode ForumTopicClass: %w", bin.NewUnexpectedID())
	}
}

// ForumTopic boxes the ForumTopicClass providing a helper.
type ForumTopicBox struct {
	ForumTopic ForumTopicClass
}

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

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