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

// ChatlistsHideChatlistUpdatesRequest represents TL type `chatlists.hideChatlistUpdates#66e486fb`.
// Dismiss new pending peers recently added to a chat folder deep link »¹.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// See https://core.telegram.org/method/chatlists.hideChatlistUpdates for reference.
type ChatlistsHideChatlistUpdatesRequest struct {
	// The folder
	Chatlist InputChatlistDialogFilter
}

// ChatlistsHideChatlistUpdatesRequestTypeID is TL type id of ChatlistsHideChatlistUpdatesRequest.
const ChatlistsHideChatlistUpdatesRequestTypeID = 0x66e486fb

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *ChatlistsHideChatlistUpdatesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.hideChatlistUpdates#66e486fb as nil")
	}
	.PutID(ChatlistsHideChatlistUpdatesRequestTypeID)
	return .EncodeBare()
}

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

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

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

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

// ChatlistsHideChatlistUpdates invokes method chatlists.hideChatlistUpdates#66e486fb returning error if any.
// Dismiss new pending peers recently added to a chat folder deep link »¹.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// See https://core.telegram.org/method/chatlists.hideChatlistUpdates for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  InputChatlistDialogFilter) (bool, error) {
	var  BoolBox

	 := &ChatlistsHideChatlistUpdatesRequest{
		Chatlist: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}