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

// ChatlistsCheckChatlistInviteRequest represents TL type `chatlists.checkChatlistInvite#41c10fff`.
// Obtain information about a chat folder deep link »¹.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// See https://core.telegram.org/method/chatlists.checkChatlistInvite for reference.
type ChatlistsCheckChatlistInviteRequest struct {
	// slug obtained from the chat folder deep link »¹
	//
	// Links:
	//  1) https://core.telegram.org/api/links#chat-folder-links
	Slug string
}

// ChatlistsCheckChatlistInviteRequestTypeID is TL type id of ChatlistsCheckChatlistInviteRequest.
const ChatlistsCheckChatlistInviteRequestTypeID = 0x41c10fff

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

func ( *ChatlistsCheckChatlistInviteRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Slug == "") {
		return false
	}

	return true
}

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

// FillFrom fills ChatlistsCheckChatlistInviteRequest from given interface.
func ( *ChatlistsCheckChatlistInviteRequest) ( interface {
	() ( string)
}) {
	.Slug = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *ChatlistsCheckChatlistInviteRequest) () tdp.Type {
	 := tdp.Type{
		Name: "chatlists.checkChatlistInvite",
		ID:   ChatlistsCheckChatlistInviteRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Slug",
			SchemaName: "slug",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChatlistsCheckChatlistInviteRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.checkChatlistInvite#41c10fff as nil")
	}
	.PutID(ChatlistsCheckChatlistInviteRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChatlistsCheckChatlistInviteRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode chatlists.checkChatlistInvite#41c10fff as nil")
	}
	.PutString(.Slug)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ChatlistsCheckChatlistInviteRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode chatlists.checkChatlistInvite#41c10fff to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode chatlists.checkChatlistInvite#41c10fff: field slug: %w", )
		}
		.Slug = 
	}
	return nil
}

// GetSlug returns value of Slug field.
func ( *ChatlistsCheckChatlistInviteRequest) () ( string) {
	if  == nil {
		return
	}
	return .Slug
}

// ChatlistsCheckChatlistInvite invokes method chatlists.checkChatlistInvite#41c10fff returning error if any.
// Obtain information about a chat folder deep link »¹.
//
// Links:
//  1. https://core.telegram.org/api/links#chat-folder-links
//
// Possible errors:
//
//	400 INVITE_SLUG_EMPTY: The specified invite slug is empty.
//	400 INVITE_SLUG_EXPIRED: The specified chat folder link has expired.
//
// See https://core.telegram.org/method/chatlists.checkChatlistInvite for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  string) (ChatlistsChatlistInviteClass, error) {
	var  ChatlistsChatlistInviteBox

	 := &ChatlistsCheckChatlistInviteRequest{
		Slug: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .ChatlistInvite, nil
}