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

// AccountGetUniqueGiftChatThemesRequest represents TL type `account.getUniqueGiftChatThemes#e42ce9c9`.
// Obtain all chat themes »¹ associated to owned collectible gifts »².
//
// Links:
//  1. https://core.telegram.org/api/themes#chat-themes
//  2. https://core.telegram.org/api/gifts#collectible-gifts
//
// See https://core.telegram.org/method/account.getUniqueGiftChatThemes for reference.
type AccountGetUniqueGiftChatThemesRequest struct {
	// Offset for pagination¹, intially an empty string, then equal the value of the last
	// returned account.chatThemes².next_offset (if set).
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets
	//  2) https://core.telegram.org/constructor/account.chatThemes
	Offset string
	// Maximum number of results to return, see pagination¹. Note that the server may return
	// less than limit results, even if the actual number of remaining results is >= limit,
	// paginate to fetch them all.
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets
	Limit int
	// Hash from a previously returned account.chatThemes¹ constructor, to avoid returning
	// any result if the theme list hasn't changed.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/account.chatThemes
	Hash int64
}

// AccountGetUniqueGiftChatThemesRequestTypeID is TL type id of AccountGetUniqueGiftChatThemesRequest.
const AccountGetUniqueGiftChatThemesRequestTypeID = 0xe42ce9c9

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

func ( *AccountGetUniqueGiftChatThemesRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == "") {
		return false
	}
	if !(.Limit == 0) {
		return false
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills AccountGetUniqueGiftChatThemesRequest from given interface.
func ( *AccountGetUniqueGiftChatThemesRequest) ( interface {
	() ( string)
	() ( int)
	() ( int64)
}) {
	.Offset = .()
	.Limit = .()
	.Hash = .()
}

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

// TypeName returns name of type in TL schema.
func (*AccountGetUniqueGiftChatThemesRequest) () string {
	return "account.getUniqueGiftChatThemes"
}

// TypeInfo returns info about TL type.
func ( *AccountGetUniqueGiftChatThemesRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.getUniqueGiftChatThemes",
		ID:   AccountGetUniqueGiftChatThemesRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Limit",
			SchemaName: "limit",
		},
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountGetUniqueGiftChatThemesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getUniqueGiftChatThemes#e42ce9c9 as nil")
	}
	.PutID(AccountGetUniqueGiftChatThemesRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountGetUniqueGiftChatThemesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getUniqueGiftChatThemes#e42ce9c9 as nil")
	}
	.PutString(.Offset)
	.PutInt(.Limit)
	.PutLong(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *AccountGetUniqueGiftChatThemesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getUniqueGiftChatThemes#e42ce9c9 to nil")
	}
	if  := .ConsumeID(AccountGetUniqueGiftChatThemesRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode account.getUniqueGiftChatThemes#e42ce9c9: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AccountGetUniqueGiftChatThemesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getUniqueGiftChatThemes#e42ce9c9 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode account.getUniqueGiftChatThemes#e42ce9c9: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode account.getUniqueGiftChatThemes#e42ce9c9: field limit: %w", )
		}
		.Limit = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode account.getUniqueGiftChatThemes#e42ce9c9: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *AccountGetUniqueGiftChatThemesRequest) () ( string) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLimit returns value of Limit field.
func ( *AccountGetUniqueGiftChatThemesRequest) () ( int) {
	if  == nil {
		return
	}
	return .Limit
}

// GetHash returns value of Hash field.
func ( *AccountGetUniqueGiftChatThemesRequest) () ( int64) {
	if  == nil {
		return
	}
	return .Hash
}

// AccountGetUniqueGiftChatThemes invokes method account.getUniqueGiftChatThemes#e42ce9c9 returning error if any.
// Obtain all chat themes »¹ associated to owned collectible gifts »².
//
// Links:
//  1. https://core.telegram.org/api/themes#chat-themes
//  2. https://core.telegram.org/api/gifts#collectible-gifts
//
// See https://core.telegram.org/method/account.getUniqueGiftChatThemes for reference.
func ( *Client) ( context.Context,  *AccountGetUniqueGiftChatThemesRequest) (AccountChatThemesClass, error) {
	var  AccountChatThemesBox

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