Class SavingsPlanPurchaseRequest
java.lang.Object
com.azure.resourcemanager.reservations.models.SavingsPlanPurchaseRequest
- All Implemented Interfaces:
com.azure.json.JsonSerializable<SavingsPlanPurchaseRequest>
public final class SavingsPlanPurchaseRequest
extends Object
implements com.azure.json.JsonSerializable<SavingsPlanPurchaseRequest>
Request body for savings plan purchase.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of SavingsPlanPurchaseRequest class. -
Method Summary
Modifier and TypeMethodDescriptionGet the appliedScopeProperties property: Properties specific to applied scope type.Get the appliedScopeType property: Type of the Applied Scope.Get the billingPlan property: Represents the billing plan in ISO 8601 format.Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.Get the commitment property: Commitment towards the benefit.Get the displayName property: Friendly name of the savings plan.static SavingsPlanPurchaseRequest
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of SavingsPlanPurchaseRequest from the JsonReader.sku()
Get the sku property: The name of sku.term()
Get the term property: Represent savings plan term in ISO 8601 format.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withAppliedScopeProperties
(AppliedScopeProperties appliedScopeProperties) Set the appliedScopeProperties property: Properties specific to applied scope type.withAppliedScopeType
(AppliedScopeType appliedScopeType) Set the appliedScopeType property: Type of the Applied Scope.withBillingPlan
(BillingPlan billingPlan) Set the billingPlan property: Represents the billing plan in ISO 8601 format.withBillingScopeId
(String billingScopeId) Set the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.withCommitment
(Commitment commitment) Set the commitment property: Commitment towards the benefit.withDisplayName
(String displayName) Set the displayName property: Friendly name of the savings plan.Set the sku property: The name of sku.withTerm
(SavingsPlanTerm term) Set the term property: Represent savings plan term in ISO 8601 format.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
SavingsPlanPurchaseRequest
public SavingsPlanPurchaseRequest()Creates an instance of SavingsPlanPurchaseRequest class.
-
-
Method Details
-
sku
Get the sku property: The name of sku.- Returns:
- the sku value.
-
withSku
Set the sku property: The name of sku.- Parameters:
sku
- the sku value to set.- Returns:
- the SavingsPlanPurchaseRequest object itself.
-
displayName
Get the displayName property: Friendly name of the savings plan.- Returns:
- the displayName value.
-
withDisplayName
Set the displayName property: Friendly name of the savings plan.- Parameters:
displayName
- the displayName value to set.- Returns:
- the SavingsPlanPurchaseRequest object itself.
-
billingScopeId
Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.- Returns:
- the billingScopeId value.
-
withBillingScopeId
Set the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.- Parameters:
billingScopeId
- the billingScopeId value to set.- Returns:
- the SavingsPlanPurchaseRequest object itself.
-
term
Get the term property: Represent savings plan term in ISO 8601 format.- Returns:
- the term value.
-
withTerm
Set the term property: Represent savings plan term in ISO 8601 format.- Parameters:
term
- the term value to set.- Returns:
- the SavingsPlanPurchaseRequest object itself.
-
billingPlan
Get the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.- Returns:
- the billingPlan value.
-
withBillingPlan
Set the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.- Parameters:
billingPlan
- the billingPlan value to set.- Returns:
- the SavingsPlanPurchaseRequest object itself.
-
appliedScopeType
Get the appliedScopeType property: Type of the Applied Scope.- Returns:
- the appliedScopeType value.
-
withAppliedScopeType
Set the appliedScopeType property: Type of the Applied Scope.- Parameters:
appliedScopeType
- the appliedScopeType value to set.- Returns:
- the SavingsPlanPurchaseRequest object itself.
-
appliedScopeProperties
Get the appliedScopeProperties property: Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.- Returns:
- the appliedScopeProperties value.
-
withAppliedScopeProperties
public SavingsPlanPurchaseRequest withAppliedScopeProperties(AppliedScopeProperties appliedScopeProperties) Set the appliedScopeProperties property: Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.- Parameters:
appliedScopeProperties
- the appliedScopeProperties value to set.- Returns:
- the SavingsPlanPurchaseRequest object itself.
-
commitment
Get the commitment property: Commitment towards the benefit.- Returns:
- the commitment value.
-
withCommitment
Set the commitment property: Commitment towards the benefit.- Parameters:
commitment
- the commitment value to set.- Returns:
- the SavingsPlanPurchaseRequest object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<SavingsPlanPurchaseRequest>
- Throws:
IOException
-
fromJson
public static SavingsPlanPurchaseRequest fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of SavingsPlanPurchaseRequest from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of SavingsPlanPurchaseRequest 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 SavingsPlanPurchaseRequest.
-