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

// AccountGetWallPapersRequest represents TL type `account.getWallPapers#7967d36`.
// Returns a list of available wallpapers¹.
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// See https://core.telegram.org/method/account.getWallPapers for reference.
type AccountGetWallPapersRequest struct {
	// Hash for pagination, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int64
}

// AccountGetWallPapersRequestTypeID is TL type id of AccountGetWallPapersRequest.
const AccountGetWallPapersRequestTypeID = 0x7967d36

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *AccountGetWallPapersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getWallPapers#7967d36 as nil")
	}
	.PutID(AccountGetWallPapersRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountGetWallPapersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getWallPapers#7967d36 as nil")
	}
	.PutLong(.Hash)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountGetWallPapersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getWallPapers#7967d36 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode account.getWallPapers#7967d36: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

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

// AccountGetWallPapers invokes method account.getWallPapers#7967d36 returning error if any.
// Returns a list of available wallpapers¹.
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// See https://core.telegram.org/method/account.getWallPapers for reference.
func ( *Client) ( context.Context,  int64) (AccountWallPapersClass, error) {
	var  AccountWallPapersBox

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