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

// ChatlistsGetLeaveChatlistSuggestionsRequest represents TL type `chatlists.getLeaveChatlistSuggestions#fdbcd714`.
// Returns identifiers of pinned or always included chats from a chat folder imported
// using a chat folder deep link »¹, which are suggested to be left when the chat
// folder is deleted.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// See https://core.telegram.org/method/chatlists.getLeaveChatlistSuggestions for reference.
type ChatlistsGetLeaveChatlistSuggestionsRequest struct {
	// Folder ID
	Chatlist InputChatlistDialogFilter
}

// ChatlistsGetLeaveChatlistSuggestionsRequestTypeID is TL type id of ChatlistsGetLeaveChatlistSuggestionsRequest.
const ChatlistsGetLeaveChatlistSuggestionsRequestTypeID = 0xfdbcd714

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

func ( *ChatlistsGetLeaveChatlistSuggestionsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Chatlist.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills ChatlistsGetLeaveChatlistSuggestionsRequest from given interface.
func ( *ChatlistsGetLeaveChatlistSuggestionsRequest) ( interface {
	() ( InputChatlistDialogFilter)
}) {
	.Chatlist = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ChatlistsGetLeaveChatlistSuggestionsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "chatlists.getLeaveChatlistSuggestions",
		ID:   ChatlistsGetLeaveChatlistSuggestionsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Chatlist",
			SchemaName: "chatlist",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChatlistsGetLeaveChatlistSuggestionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.getLeaveChatlistSuggestions#fdbcd714 as nil")
	}
	.PutID(ChatlistsGetLeaveChatlistSuggestionsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChatlistsGetLeaveChatlistSuggestionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.getLeaveChatlistSuggestions#fdbcd714 as nil")
	}
	if  := .Chatlist.Encode();  != nil {
		return fmt.Errorf("unable to encode chatlists.getLeaveChatlistSuggestions#fdbcd714: field chatlist: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChatlistsGetLeaveChatlistSuggestionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode chatlists.getLeaveChatlistSuggestions#fdbcd714 to nil")
	}
	{
		if  := .Chatlist.Decode();  != nil {
			return fmt.Errorf("unable to decode chatlists.getLeaveChatlistSuggestions#fdbcd714: field chatlist: %w", )
		}
	}
	return nil
}

// GetChatlist returns value of Chatlist field.
func ( *ChatlistsGetLeaveChatlistSuggestionsRequest) () ( InputChatlistDialogFilter) {
	if  == nil {
		return
	}
	return .Chatlist
}

// ChatlistsGetLeaveChatlistSuggestions invokes method chatlists.getLeaveChatlistSuggestions#fdbcd714 returning error if any.
// Returns identifiers of pinned or always included chats from a chat folder imported
// using a chat folder deep link »¹, which are suggested to be left when the chat
// folder is deleted.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// See https://core.telegram.org/method/chatlists.getLeaveChatlistSuggestions for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  InputChatlistDialogFilter) ([]PeerClass, error) {
	var  PeerClassVector

	 := &ChatlistsGetLeaveChatlistSuggestionsRequest{
		Chatlist: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return []PeerClass(.Elems), nil
}