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

// ChatlistsChatlistInviteAlready represents TL type `chatlists.chatlistInviteAlready#fa87f659`.
// Updated info about a chat folder deep link »¹ we already imported.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// See https://core.telegram.org/constructor/chatlists.chatlistInviteAlready for reference.
type ChatlistsChatlistInviteAlready struct {
	// ID of the imported folder
	FilterID int
	// New peers to be imported
	MissingPeers []PeerClass
	// Peers that were already imported
	AlreadyPeers []PeerClass
	// Related chat information
	Chats []ChatClass
	// Related user information
	Users []UserClass
}

// ChatlistsChatlistInviteAlreadyTypeID is TL type id of ChatlistsChatlistInviteAlready.
const ChatlistsChatlistInviteAlreadyTypeID = 0xfa87f659

// construct implements constructor of ChatlistsChatlistInviteClass.
func ( ChatlistsChatlistInviteAlready) () ChatlistsChatlistInviteClass { return & }

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

	_ ChatlistsChatlistInviteClass = &ChatlistsChatlistInviteAlready{}
)

func ( *ChatlistsChatlistInviteAlready) () bool {
	if  == nil {
		return true
	}
	if !(.FilterID == 0) {
		return false
	}
	if !(.MissingPeers == nil) {
		return false
	}
	if !(.AlreadyPeers == nil) {
		return false
	}
	if !(.Chats == nil) {
		return false
	}
	if !(.Users == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChatlistsChatlistInviteAlready from given interface.
func ( *ChatlistsChatlistInviteAlready) ( interface {
	() ( int)
	() ( []PeerClass)
	() ( []PeerClass)
	() ( []ChatClass)
	() ( []UserClass)
}) {
	.FilterID = .()
	.MissingPeers = .()
	.AlreadyPeers = .()
	.Chats = .()
	.Users = .()
}

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

// TypeName returns name of type in TL schema.
func (*ChatlistsChatlistInviteAlready) () string {
	return "chatlists.chatlistInviteAlready"
}

// TypeInfo returns info about TL type.
func ( *ChatlistsChatlistInviteAlready) () tdp.Type {
	 := tdp.Type{
		Name: "chatlists.chatlistInviteAlready",
		ID:   ChatlistsChatlistInviteAlreadyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "FilterID",
			SchemaName: "filter_id",
		},
		{
			Name:       "MissingPeers",
			SchemaName: "missing_peers",
		},
		{
			Name:       "AlreadyPeers",
			SchemaName: "already_peers",
		},
		{
			Name:       "Chats",
			SchemaName: "chats",
		},
		{
			Name:       "Users",
			SchemaName: "users",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChatlistsChatlistInviteAlready) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.chatlistInviteAlready#fa87f659 as nil")
	}
	.PutID(ChatlistsChatlistInviteAlreadyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChatlistsChatlistInviteAlready) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.chatlistInviteAlready#fa87f659 as nil")
	}
	.PutInt(.FilterID)
	.PutVectorHeader(len(.MissingPeers))
	for ,  := range .MissingPeers {
		if  == nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInviteAlready#fa87f659: field missing_peers element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInviteAlready#fa87f659: field missing_peers element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.AlreadyPeers))
	for ,  := range .AlreadyPeers {
		if  == nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInviteAlready#fa87f659: field already_peers element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInviteAlready#fa87f659: field already_peers element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Chats))
	for ,  := range .Chats {
		if  == nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInviteAlready#fa87f659: field chats element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInviteAlready#fa87f659: field chats element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		if  == nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInviteAlready#fa87f659: field users element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInviteAlready#fa87f659: field users element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChatlistsChatlistInviteAlready) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode chatlists.chatlistInviteAlready#fa87f659 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field filter_id: %w", )
		}
		.FilterID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field missing_peers: %w", )
		}

		if  > 0 {
			.MissingPeers = make([]PeerClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePeer()
			if  != nil {
				return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field missing_peers: %w", )
			}
			.MissingPeers = append(.MissingPeers, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field already_peers: %w", )
		}

		if  > 0 {
			.AlreadyPeers = make([]PeerClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePeer()
			if  != nil {
				return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field already_peers: %w", )
			}
			.AlreadyPeers = append(.AlreadyPeers, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field chats: %w", )
		}

		if  > 0 {
			.Chats = make([]ChatClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeChat()
			if  != nil {
				return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field chats: %w", )
			}
			.Chats = append(.Chats, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field users: %w", )
		}

		if  > 0 {
			.Users = make([]UserClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeUser()
			if  != nil {
				return fmt.Errorf("unable to decode chatlists.chatlistInviteAlready#fa87f659: field users: %w", )
			}
			.Users = append(.Users, )
		}
	}
	return nil
}

// GetFilterID returns value of FilterID field.
func ( *ChatlistsChatlistInviteAlready) () ( int) {
	if  == nil {
		return
	}
	return .FilterID
}

// GetMissingPeers returns value of MissingPeers field.
func ( *ChatlistsChatlistInviteAlready) () ( []PeerClass) {
	if  == nil {
		return
	}
	return .MissingPeers
}

// GetAlreadyPeers returns value of AlreadyPeers field.
func ( *ChatlistsChatlistInviteAlready) () ( []PeerClass) {
	if  == nil {
		return
	}
	return .AlreadyPeers
}

// GetChats returns value of Chats field.
func ( *ChatlistsChatlistInviteAlready) () ( []ChatClass) {
	if  == nil {
		return
	}
	return .Chats
}

// GetUsers returns value of Users field.
func ( *ChatlistsChatlistInviteAlready) () ( []UserClass) {
	if  == nil {
		return
	}
	return .Users
}

// MapMissingPeers returns field MissingPeers wrapped in PeerClassArray helper.
func ( *ChatlistsChatlistInviteAlready) () ( PeerClassArray) {
	return PeerClassArray(.MissingPeers)
}

// MapAlreadyPeers returns field AlreadyPeers wrapped in PeerClassArray helper.
func ( *ChatlistsChatlistInviteAlready) () ( PeerClassArray) {
	return PeerClassArray(.AlreadyPeers)
}

// MapChats returns field Chats wrapped in ChatClassArray helper.
func ( *ChatlistsChatlistInviteAlready) () ( ChatClassArray) {
	return ChatClassArray(.Chats)
}

// MapUsers returns field Users wrapped in UserClassArray helper.
func ( *ChatlistsChatlistInviteAlready) () ( UserClassArray) {
	return UserClassArray(.Users)
}

// ChatlistsChatlistInvite represents TL type `chatlists.chatlistInvite#1dcd839d`.
// Info about a chat folder deep link »¹.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// See https://core.telegram.org/constructor/chatlists.chatlistInvite for reference.
type ChatlistsChatlistInvite struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Name of the link
	Title string
	// Emoji to use as icon for the folder.
	//
	// Use SetEmoticon and GetEmoticon helpers.
	Emoticon string
	// Supergroups and channels to join
	Peers []PeerClass
	// Related chat information
	Chats []ChatClass
	// Related user information
	Users []UserClass
}

// ChatlistsChatlistInviteTypeID is TL type id of ChatlistsChatlistInvite.
const ChatlistsChatlistInviteTypeID = 0x1dcd839d

// construct implements constructor of ChatlistsChatlistInviteClass.
func ( ChatlistsChatlistInvite) () ChatlistsChatlistInviteClass { return & }

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

	_ ChatlistsChatlistInviteClass = &ChatlistsChatlistInvite{}
)

func ( *ChatlistsChatlistInvite) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.Emoticon == "") {
		return false
	}
	if !(.Peers == nil) {
		return false
	}
	if !(.Chats == nil) {
		return false
	}
	if !(.Users == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChatlistsChatlistInvite from given interface.
func ( *ChatlistsChatlistInvite) ( interface {
	() ( string)
	() ( string,  bool)
	() ( []PeerClass)
	() ( []ChatClass)
	() ( []UserClass)
}) {
	.Title = .()
	if ,  := .();  {
		.Emoticon = 
	}

	.Peers = .()
	.Chats = .()
	.Users = .()
}

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

// TypeName returns name of type in TL schema.
func (*ChatlistsChatlistInvite) () string {
	return "chatlists.chatlistInvite"
}

// TypeInfo returns info about TL type.
func ( *ChatlistsChatlistInvite) () tdp.Type {
	 := tdp.Type{
		Name: "chatlists.chatlistInvite",
		ID:   ChatlistsChatlistInviteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "Emoticon",
			SchemaName: "emoticon",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Peers",
			SchemaName: "peers",
		},
		{
			Name:       "Chats",
			SchemaName: "chats",
		},
		{
			Name:       "Users",
			SchemaName: "users",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *ChatlistsChatlistInvite) () {
	if !(.Emoticon == "") {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *ChatlistsChatlistInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.chatlistInvite#1dcd839d as nil")
	}
	.PutID(ChatlistsChatlistInviteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChatlistsChatlistInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.chatlistInvite#1dcd839d as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode chatlists.chatlistInvite#1dcd839d: field flags: %w", )
	}
	.PutString(.Title)
	if .Flags.Has(0) {
		.PutString(.Emoticon)
	}
	.PutVectorHeader(len(.Peers))
	for ,  := range .Peers {
		if  == nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInvite#1dcd839d: field peers element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInvite#1dcd839d: field peers element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Chats))
	for ,  := range .Chats {
		if  == nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInvite#1dcd839d: field chats element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInvite#1dcd839d: field chats element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		if  == nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInvite#1dcd839d: field users element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode chatlists.chatlistInvite#1dcd839d: field users element with index %d: %w", , )
		}
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *ChatlistsChatlistInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode chatlists.chatlistInvite#1dcd839d to nil")
	}
	if  := .ConsumeID(ChatlistsChatlistInviteTypeID);  != nil {
		return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *ChatlistsChatlistInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode chatlists.chatlistInvite#1dcd839d to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field flags: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field title: %w", )
		}
		.Title = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field emoticon: %w", )
		}
		.Emoticon = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field peers: %w", )
		}

		if  > 0 {
			.Peers = make([]PeerClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePeer()
			if  != nil {
				return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field peers: %w", )
			}
			.Peers = append(.Peers, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field chats: %w", )
		}

		if  > 0 {
			.Chats = make([]ChatClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeChat()
			if  != nil {
				return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field chats: %w", )
			}
			.Chats = append(.Chats, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field users: %w", )
		}

		if  > 0 {
			.Users = make([]UserClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeUser()
			if  != nil {
				return fmt.Errorf("unable to decode chatlists.chatlistInvite#1dcd839d: field users: %w", )
			}
			.Users = append(.Users, )
		}
	}
	return nil
}

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

// SetEmoticon sets value of Emoticon conditional field.
func ( *ChatlistsChatlistInvite) ( string) {
	.Flags.Set(0)
	.Emoticon = 
}

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

// GetPeers returns value of Peers field.
func ( *ChatlistsChatlistInvite) () ( []PeerClass) {
	if  == nil {
		return
	}
	return .Peers
}

// GetChats returns value of Chats field.
func ( *ChatlistsChatlistInvite) () ( []ChatClass) {
	if  == nil {
		return
	}
	return .Chats
}

// GetUsers returns value of Users field.
func ( *ChatlistsChatlistInvite) () ( []UserClass) {
	if  == nil {
		return
	}
	return .Users
}

// MapPeers returns field Peers wrapped in PeerClassArray helper.
func ( *ChatlistsChatlistInvite) () ( PeerClassArray) {
	return PeerClassArray(.Peers)
}

// MapChats returns field Chats wrapped in ChatClassArray helper.
func ( *ChatlistsChatlistInvite) () ( ChatClassArray) {
	return ChatClassArray(.Chats)
}

// MapUsers returns field Users wrapped in UserClassArray helper.
func ( *ChatlistsChatlistInvite) () ( UserClassArray) {
	return UserClassArray(.Users)
}

// ChatlistsChatlistInviteClassName is schema name of ChatlistsChatlistInviteClass.
const ChatlistsChatlistInviteClassName = "chatlists.ChatlistInvite"

// ChatlistsChatlistInviteClass represents chatlists.ChatlistInvite generic type.
//
// See https://core.telegram.org/type/chatlists.ChatlistInvite for reference.
//
// Example:
//
//	g, err := tg.DecodeChatlistsChatlistInvite(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.ChatlistsChatlistInviteAlready: // chatlists.chatlistInviteAlready#fa87f659
//	case *tg.ChatlistsChatlistInvite: // chatlists.chatlistInvite#1dcd839d
//	default: panic(v)
//	}
type ChatlistsChatlistInviteClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() ChatlistsChatlistInviteClass

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

	// Related chat information
	GetChats() (value []ChatClass)
	// Related chat information
	MapChats() (value ChatClassArray)
	// Related user information
	GetUsers() (value []UserClass)
	// Related user information
	MapUsers() (value UserClassArray)
}

// DecodeChatlistsChatlistInvite implements binary de-serialization for ChatlistsChatlistInviteClass.
func ( *bin.Buffer) (ChatlistsChatlistInviteClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case ChatlistsChatlistInviteAlreadyTypeID:
		// Decoding chatlists.chatlistInviteAlready#fa87f659.
		 := ChatlistsChatlistInviteAlready{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChatlistsChatlistInviteClass: %w", )
		}
		return &, nil
	case ChatlistsChatlistInviteTypeID:
		// Decoding chatlists.chatlistInvite#1dcd839d.
		 := ChatlistsChatlistInvite{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ChatlistsChatlistInviteClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode ChatlistsChatlistInviteClass: %w", bin.NewUnexpectedID())
	}
}

// ChatlistsChatlistInvite boxes the ChatlistsChatlistInviteClass providing a helper.
type ChatlistsChatlistInviteBox struct {
	ChatlistInvite ChatlistsChatlistInviteClass
}

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

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