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

// ChatlistsExportedChatlistInvite represents TL type `chatlists.exportedChatlistInvite#10e6e3a6`.
// Info about an exported chat folder deep link »¹.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// See https://core.telegram.org/constructor/chatlists.exportedChatlistInvite for reference.
type ChatlistsExportedChatlistInvite struct {
	// Folder ID
	Filter DialogFilterClass
	// The exported chat folder deep link »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/links#chat-folder-links
	Invite ExportedChatlistInvite
}

// ChatlistsExportedChatlistInviteTypeID is TL type id of ChatlistsExportedChatlistInvite.
const ChatlistsExportedChatlistInviteTypeID = 0x10e6e3a6

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

func ( *ChatlistsExportedChatlistInvite) () bool {
	if  == nil {
		return true
	}
	if !(.Filter == nil) {
		return false
	}
	if !(.Invite.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills ChatlistsExportedChatlistInvite from given interface.
func ( *ChatlistsExportedChatlistInvite) ( interface {
	() ( DialogFilterClass)
	() ( ExportedChatlistInvite)
}) {
	.Filter = .()
	.Invite = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ChatlistsExportedChatlistInvite) () tdp.Type {
	 := tdp.Type{
		Name: "chatlists.exportedChatlistInvite",
		ID:   ChatlistsExportedChatlistInviteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Filter",
			SchemaName: "filter",
		},
		{
			Name:       "Invite",
			SchemaName: "invite",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChatlistsExportedChatlistInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.exportedChatlistInvite#10e6e3a6 as nil")
	}
	.PutID(ChatlistsExportedChatlistInviteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChatlistsExportedChatlistInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.exportedChatlistInvite#10e6e3a6 as nil")
	}
	if .Filter == nil {
		return fmt.Errorf("unable to encode chatlists.exportedChatlistInvite#10e6e3a6: field filter is nil")
	}
	if  := .Filter.Encode();  != nil {
		return fmt.Errorf("unable to encode chatlists.exportedChatlistInvite#10e6e3a6: field filter: %w", )
	}
	if  := .Invite.Encode();  != nil {
		return fmt.Errorf("unable to encode chatlists.exportedChatlistInvite#10e6e3a6: field invite: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChatlistsExportedChatlistInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode chatlists.exportedChatlistInvite#10e6e3a6 to nil")
	}
	{
		,  := DecodeDialogFilter()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.exportedChatlistInvite#10e6e3a6: field filter: %w", )
		}
		.Filter = 
	}
	{
		if  := .Invite.Decode();  != nil {
			return fmt.Errorf("unable to decode chatlists.exportedChatlistInvite#10e6e3a6: field invite: %w", )
		}
	}
	return nil
}

// GetFilter returns value of Filter field.
func ( *ChatlistsExportedChatlistInvite) () ( DialogFilterClass) {
	if  == nil {
		return
	}
	return .Filter
}

// GetInvite returns value of Invite field.
func ( *ChatlistsExportedChatlistInvite) () ( ExportedChatlistInvite) {
	if  == nil {
		return
	}
	return .Invite
}