PurchaseRequest Class

  • java.lang.Object
    • com.azure.resourcemanager.billing.models.PurchaseRequest

Implements

public final class PurchaseRequest
implements JsonSerializable<PurchaseRequest>

Purchase request.

Constructor Summary

Constructor Description
PurchaseRequest()

Creates an instance of PurchaseRequest class.

Method Summary

Modifier and Type Method and Description
AppliedScopeProperties appliedScopeProperties()

Get the appliedScopeProperties property: Properties specific to applied scope type.

AppliedScopeType appliedScopeType()

Get the appliedScopeType property: Type of the Applied Scope.

BillingPlan billingPlan()

Get the billingPlan property: Represents the billing plan in ISO 8601 format.

String billingScopeId()

Get the billingScopeId property: Subscription that will be charged for purchasing SavingsPlan.

Commitment commitment()

Get the commitment property: Commitment towards the benefit.

String displayName()

Get the displayName property: Friendly name of the savings plan.

static PurchaseRequest fromJson(JsonReader jsonReader)

Reads an instance of PurchaseRequest from the JsonReader.

Boolean renew()

Get the renew property: Setting this to true will automatically purchase a new benefit on the expiration date time.

Sku sku()

Get the sku property: The SKU to be applied for this resource.

SavingsPlanTerm term()

Get the term property: Represents the Savings plan term in ISO 8601 format.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

PurchaseRequest withAppliedScopeProperties(AppliedScopeProperties appliedScopeProperties)

Set the appliedScopeProperties property: Properties specific to applied scope type.

PurchaseRequest withAppliedScopeType(AppliedScopeType appliedScopeType)

Set the appliedScopeType property: Type of the Applied Scope.

PurchaseRequest withBillingPlan(BillingPlan billingPlan)

Set the billingPlan property: Represents the billing plan in ISO 8601 format.

PurchaseRequest withBillingScopeId(String billingScopeId)

Set the billingScopeId property: Subscription that will be charged for purchasing SavingsPlan.

PurchaseRequest withCommitment(Commitment commitment)

Set the commitment property: Commitment towards the benefit.

PurchaseRequest withDisplayName(String displayName)

Set the displayName property: Friendly name of the savings plan.

PurchaseRequest withRenew(Boolean renew)

Set the renew property: Setting this to true will automatically purchase a new benefit on the expiration date time.

PurchaseRequest withSku(Sku sku)

Set the sku property: The SKU to be applied for this resource.

PurchaseRequest withTerm(SavingsPlanTerm term)

Set the term property: Represents the Savings plan term in ISO 8601 format.

Methods inherited from java.lang.Object

Constructor Details

PurchaseRequest

public PurchaseRequest()

Creates an instance of PurchaseRequest class.

Method Details

appliedScopeProperties

public AppliedScopeProperties appliedScopeProperties()

Get the appliedScopeProperties property: Properties specific to applied scope type. Not required if not applicable.

Returns:

the appliedScopeProperties value.

appliedScopeType

public AppliedScopeType appliedScopeType()

Get the appliedScopeType property: Type of the Applied Scope.

Returns:

the appliedScopeType value.

billingPlan

public BillingPlan billingPlan()

Get the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly purchases.

Returns:

the billingPlan value.

billingScopeId

public String billingScopeId()

Get the billingScopeId property: Subscription that will be charged for purchasing SavingsPlan.

Returns:

the billingScopeId value.

commitment

public Commitment commitment()

Get the commitment property: Commitment towards the benefit.

Returns:

the commitment value.

displayName

public String displayName()

Get the displayName property: Friendly name of the savings plan.

Returns:

the displayName value.

fromJson

public static PurchaseRequest fromJson(JsonReader jsonReader)

Reads an instance of PurchaseRequest from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of PurchaseRequest if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the PurchaseRequest.

renew

public Boolean renew()

Get the renew property: Setting this to true will automatically purchase a new benefit on the expiration date time.

Returns:

the renew value.

sku

public Sku sku()

Get the sku property: The SKU to be applied for this resource.

Returns:

the sku value.

term

public SavingsPlanTerm term()

Get the term property: Represents the Savings plan term in ISO 8601 format.

Returns:

the term value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withAppliedScopeProperties

public PurchaseRequest withAppliedScopeProperties(AppliedScopeProperties appliedScopeProperties)

Set the appliedScopeProperties property: Properties specific to applied scope type. Not required if not applicable.

Parameters:

appliedScopeProperties - the appliedScopeProperties value to set.

Returns:

the PurchaseRequest object itself.

withAppliedScopeType

public PurchaseRequest withAppliedScopeType(AppliedScopeType appliedScopeType)

Set the appliedScopeType property: Type of the Applied Scope.

Parameters:

appliedScopeType - the appliedScopeType value to set.

Returns:

the PurchaseRequest object itself.

withBillingPlan

public PurchaseRequest withBillingPlan(BillingPlan billingPlan)

Set the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly purchases.

Parameters:

billingPlan - the billingPlan value to set.

Returns:

the PurchaseRequest object itself.

withBillingScopeId

public PurchaseRequest withBillingScopeId(String billingScopeId)

Set the billingScopeId property: Subscription that will be charged for purchasing SavingsPlan.

Parameters:

billingScopeId - the billingScopeId value to set.

Returns:

the PurchaseRequest object itself.

withCommitment

public PurchaseRequest withCommitment(Commitment commitment)

Set the commitment property: Commitment towards the benefit.

Parameters:

commitment - the commitment value to set.

Returns:

the PurchaseRequest object itself.

withDisplayName

public PurchaseRequest withDisplayName(String displayName)

Set the displayName property: Friendly name of the savings plan.

Parameters:

displayName - the displayName value to set.

Returns:

the PurchaseRequest object itself.

withRenew

public PurchaseRequest withRenew(Boolean renew)

Set the renew property: Setting this to true will automatically purchase a new benefit on the expiration date time.

Parameters:

renew - the renew value to set.

Returns:

the PurchaseRequest object itself.

withSku

public PurchaseRequest withSku(Sku sku)

Set the sku property: The SKU to be applied for this resource.

Parameters:

sku - the sku value to set.

Returns:

the PurchaseRequest object itself.

withTerm

public PurchaseRequest withTerm(SavingsPlanTerm term)

Set the term property: Represents the Savings plan term in ISO 8601 format.

Parameters:

term - the term value to set.

Returns:

the PurchaseRequest object itself.

Applies to