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

// AccountGetMultiWallPapersRequest represents TL type `account.getMultiWallPapers#65ad71dc`.
// Get info about multiple wallpapers¹
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// See https://core.telegram.org/method/account.getMultiWallPapers for reference.
type AccountGetMultiWallPapersRequest struct {
	// Wallpapers¹ to fetch info about
	//
	// Links:
	//  1) https://core.telegram.org/api/wallpapers
	Wallpapers []InputWallPaperClass
}

// AccountGetMultiWallPapersRequestTypeID is TL type id of AccountGetMultiWallPapersRequest.
const AccountGetMultiWallPapersRequestTypeID = 0x65ad71dc

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

func ( *AccountGetMultiWallPapersRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Wallpapers == nil) {
		return false
	}

	return true
}

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

// FillFrom fills AccountGetMultiWallPapersRequest from given interface.
func ( *AccountGetMultiWallPapersRequest) ( interface {
	() ( []InputWallPaperClass)
}) {
	.Wallpapers = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *AccountGetMultiWallPapersRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.getMultiWallPapers",
		ID:   AccountGetMultiWallPapersRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Wallpapers",
			SchemaName: "wallpapers",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountGetMultiWallPapersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getMultiWallPapers#65ad71dc as nil")
	}
	.PutID(AccountGetMultiWallPapersRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountGetMultiWallPapersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getMultiWallPapers#65ad71dc as nil")
	}
	.PutVectorHeader(len(.Wallpapers))
	for ,  := range .Wallpapers {
		if  == nil {
			return fmt.Errorf("unable to encode account.getMultiWallPapers#65ad71dc: field wallpapers element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode account.getMultiWallPapers#65ad71dc: field wallpapers element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountGetMultiWallPapersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getMultiWallPapers#65ad71dc to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode account.getMultiWallPapers#65ad71dc: field wallpapers: %w", )
		}

		if  > 0 {
			.Wallpapers = make([]InputWallPaperClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeInputWallPaper()
			if  != nil {
				return fmt.Errorf("unable to decode account.getMultiWallPapers#65ad71dc: field wallpapers: %w", )
			}
			.Wallpapers = append(.Wallpapers, )
		}
	}
	return nil
}

// GetWallpapers returns value of Wallpapers field.
func ( *AccountGetMultiWallPapersRequest) () ( []InputWallPaperClass) {
	if  == nil {
		return
	}
	return .Wallpapers
}

// MapWallpapers returns field Wallpapers wrapped in InputWallPaperClassArray helper.
func ( *AccountGetMultiWallPapersRequest) () ( InputWallPaperClassArray) {
	return InputWallPaperClassArray(.Wallpapers)
}

// AccountGetMultiWallPapers invokes method account.getMultiWallPapers#65ad71dc returning error if any.
// Get info about multiple wallpapers¹
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// Possible errors:
//
//	400 WALLPAPER_INVALID: The specified wallpaper is invalid.
//
// See https://core.telegram.org/method/account.getMultiWallPapers for reference.
func ( *Client) ( context.Context,  []InputWallPaperClass) ([]WallPaperClass, error) {
	var  WallPaperClassVector

	 := &AccountGetMultiWallPapersRequest{
		Wallpapers: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return []WallPaperClass(.Elems), nil
}