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

// AccountGetWallPaperRequest represents TL type `account.getWallPaper#fc8ddbea`.
// Get info about a certain wallpaper¹
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// See https://core.telegram.org/method/account.getWallPaper for reference.
type AccountGetWallPaperRequest struct {
	// The wallpaper¹ to get info about
	//
	// Links:
	//  1) https://core.telegram.org/api/wallpapers
	Wallpaper InputWallPaperClass
}

// AccountGetWallPaperRequestTypeID is TL type id of AccountGetWallPaperRequest.
const AccountGetWallPaperRequestTypeID = 0xfc8ddbea

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

func ( *AccountGetWallPaperRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Wallpaper == nil) {
		return false
	}

	return true
}

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

// FillFrom fills AccountGetWallPaperRequest from given interface.
func ( *AccountGetWallPaperRequest) ( interface {
	() ( InputWallPaperClass)
}) {
	.Wallpaper = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *AccountGetWallPaperRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.getWallPaper",
		ID:   AccountGetWallPaperRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Wallpaper",
			SchemaName: "wallpaper",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountGetWallPaperRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getWallPaper#fc8ddbea as nil")
	}
	.PutID(AccountGetWallPaperRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountGetWallPaperRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getWallPaper#fc8ddbea as nil")
	}
	if .Wallpaper == nil {
		return fmt.Errorf("unable to encode account.getWallPaper#fc8ddbea: field wallpaper is nil")
	}
	if  := .Wallpaper.Encode();  != nil {
		return fmt.Errorf("unable to encode account.getWallPaper#fc8ddbea: field wallpaper: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountGetWallPaperRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getWallPaper#fc8ddbea to nil")
	}
	{
		,  := DecodeInputWallPaper()
		if  != nil {
			return fmt.Errorf("unable to decode account.getWallPaper#fc8ddbea: field wallpaper: %w", )
		}
		.Wallpaper = 
	}
	return nil
}

// GetWallpaper returns value of Wallpaper field.
func ( *AccountGetWallPaperRequest) () ( InputWallPaperClass) {
	if  == nil {
		return
	}
	return .Wallpaper
}

// AccountGetWallPaper invokes method account.getWallPaper#fc8ddbea returning error if any.
// Get info about a certain wallpaper¹
//
// 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.getWallPaper for reference.
func ( *Client) ( context.Context,  InputWallPaperClass) (WallPaperClass, error) {
	var  WallPaperBox

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