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

// AccountInstallWallPaperRequest represents TL type `account.installWallPaper#feed5769`.
// Install wallpaper¹
//
// Links:
//  1. https://core.telegram.org/api/wallpapers
//
// See https://core.telegram.org/method/account.installWallPaper for reference.
type AccountInstallWallPaperRequest struct {
	// Wallpaper¹ to install
	//
	// Links:
	//  1) https://core.telegram.org/api/wallpapers
	Wallpaper InputWallPaperClass
	// Wallpaper¹ settings
	//
	// Links:
	//  1) https://core.telegram.org/api/wallpapers
	Settings WallPaperSettings
}

// AccountInstallWallPaperRequestTypeID is TL type id of AccountInstallWallPaperRequest.
const AccountInstallWallPaperRequestTypeID = 0xfeed5769

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *AccountInstallWallPaperRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.installWallPaper#feed5769 as nil")
	}
	.PutID(AccountInstallWallPaperRequestTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountInstallWallPaperRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.installWallPaper#feed5769 to nil")
	}
	{
		,  := DecodeInputWallPaper()
		if  != nil {
			return fmt.Errorf("unable to decode account.installWallPaper#feed5769: field wallpaper: %w", )
		}
		.Wallpaper = 
	}
	{
		if  := .Settings.Decode();  != nil {
			return fmt.Errorf("unable to decode account.installWallPaper#feed5769: field settings: %w", )
		}
	}
	return nil
}

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

// GetSettings returns value of Settings field.
func ( *AccountInstallWallPaperRequest) () ( WallPaperSettings) {
	if  == nil {
		return
	}
	return .Settings
}

// AccountInstallWallPaper invokes method account.installWallPaper#feed5769 returning error if any.
// Install 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.installWallPaper for reference.
func ( *Client) ( context.Context,  *AccountInstallWallPaperRequest) (bool, error) {
	var  BoolBox

	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}