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

// AccountGetThemesRequest represents TL type `account.getThemes#7206e458`.
// Get installed themes
//
// See https://core.telegram.org/method/account.getThemes for reference.
type AccountGetThemesRequest struct {
	// Theme format, a string that identifies the theming engines supported by the client
	Format string
	// Hash for pagination, for more info click hereĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int64
}

// AccountGetThemesRequestTypeID is TL type id of AccountGetThemesRequest.
const AccountGetThemesRequestTypeID = 0x7206e458

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

func ( *AccountGetThemesRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Format == "") {
		return false
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills AccountGetThemesRequest from given interface.
func ( *AccountGetThemesRequest) ( interface {
	() ( string)
	() ( int64)
}) {
	.Format = .()
	.Hash = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *AccountGetThemesRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.getThemes",
		ID:   AccountGetThemesRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Format",
			SchemaName: "format",
		},
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountGetThemesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getThemes#7206e458 as nil")
	}
	.PutID(AccountGetThemesRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountGetThemesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getThemes#7206e458 as nil")
	}
	.PutString(.Format)
	.PutLong(.Hash)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountGetThemesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getThemes#7206e458 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode account.getThemes#7206e458: field format: %w", )
		}
		.Format = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode account.getThemes#7206e458: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetFormat returns value of Format field.
func ( *AccountGetThemesRequest) () ( string) {
	if  == nil {
		return
	}
	return .Format
}

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

// AccountGetThemes invokes method account.getThemes#7206e458 returning error if any.
// Get installed themes
//
// See https://core.telegram.org/method/account.getThemes for reference.
func ( *Client) ( context.Context,  *AccountGetThemesRequest) (AccountThemesClass, error) {
	var  AccountThemesBox

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