Class PurchaseRequest
java.lang.Object
com.azure.resourcemanager.reservations.models.PurchaseRequest
- All Implemented Interfaces:
com.azure.json.JsonSerializable<PurchaseRequest>
public final class PurchaseRequest
extends Object
implements com.azure.json.JsonSerializable<PurchaseRequest>
The request for reservation purchase.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the appliedScopeProperties property: Properties specific to applied scope type.Get the appliedScopes property: List of the subscriptions that the benefit will be applied.Get the appliedScopeType property: Type of the Applied Scope.Get the billingPlan property: Represent the billing plans.Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.Get the displayName property: Friendly name of the reservation.static PurchaseRequest
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of PurchaseRequest from the JsonReader.location()
Get the location property: The Azure region where the reserved resource lives.quantity()
Get the quantity property: Quantity of the skus that are part of the reservation.renew()
Get the renew property: Setting this to true will automatically purchase a new reservation on the expiration date time.Get the reservedResourceProperties property: Properties specific to each reserved resource type.Get the reservedResourceType property: The type of the resource that is being reserved.Get the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.sku()
Get the sku property: The name of sku.term()
Get the term property: Represent the term of reservation.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.withAppliedScopes
(List<String> appliedScopes) Set the appliedScopes property: List of the subscriptions that the benefit will be applied.withAppliedScopeType
(AppliedScopeType appliedScopeType) Set the appliedScopeType property: Type of the Applied Scope.withBillingPlan
(ReservationBillingPlan billingPlan) Set the billingPlan property: Represent the billing plans.withBillingScopeId
(String billingScopeId) Set the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.withDisplayName
(String displayName) Set the displayName property: Friendly name of the reservation.withLocation
(String location) Set the location property: The Azure region where the reserved resource lives.withQuantity
(Integer quantity) Set the quantity property: Quantity of the skus that are part of the reservation.Set the renew property: Setting this to true will automatically purchase a new reservation on the expiration date time.withReservedResourceProperties
(PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties) Set the reservedResourceProperties property: Properties specific to each reserved resource type.withReservedResourceType
(ReservedResourceType reservedResourceType) Set the reservedResourceType property: The type of the resource that is being reserved.withReviewDateTime
(OffsetDateTime reviewDateTime) Set the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.Set the sku property: The name of sku.withTerm
(ReservationTerm term) Set the term property: Represent the term of reservation.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
-
PurchaseRequest
public PurchaseRequest()Creates an instance of PurchaseRequest 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 PurchaseRequest object itself.
-
location
Get the location property: The Azure region where the reserved resource lives.- Returns:
- the location value.
-
withLocation
Set the location property: The Azure region where the reserved resource lives.- Parameters:
location
- the location value to set.- Returns:
- the PurchaseRequest object itself.
-
reservedResourceType
Get the reservedResourceType property: The type of the resource that is being reserved.- Returns:
- the reservedResourceType value.
-
withReservedResourceType
Set the reservedResourceType property: The type of the resource that is being reserved.- Parameters:
reservedResourceType
- the reservedResourceType value to set.- Returns:
- the PurchaseRequest 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 PurchaseRequest object itself.
-
term
Get the term property: Represent the term of reservation.- Returns:
- the term value.
-
withTerm
Set the term property: Represent the term of reservation.- Parameters:
term
- the term value to set.- Returns:
- the PurchaseRequest object itself.
-
billingPlan
Get the billingPlan property: Represent the billing plans.- Returns:
- the billingPlan value.
-
withBillingPlan
Set the billingPlan property: Represent the billing plans.- Parameters:
billingPlan
- the billingPlan value to set.- Returns:
- the PurchaseRequest object itself.
-
quantity
Get the quantity property: Quantity of the skus that are part of the reservation.- Returns:
- the quantity value.
-
withQuantity
Set the quantity property: Quantity of the skus that are part of the reservation.- Parameters:
quantity
- the quantity value to set.- Returns:
- the PurchaseRequest object itself.
-
displayName
Get the displayName property: Friendly name of the reservation.- Returns:
- the displayName value.
-
withDisplayName
Set the displayName property: Friendly name of the reservation.- Parameters:
displayName
- the displayName value to set.- Returns:
- the PurchaseRequest 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 PurchaseRequest object itself.
-
appliedScopes
Get the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.- Returns:
- the appliedScopes value.
-
withAppliedScopes
Set the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.- Parameters:
appliedScopes
- the appliedScopes value to set.- Returns:
- the PurchaseRequest 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
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 PurchaseRequest object itself.
-
renew
Get the renew property: Setting this to true will automatically purchase a new reservation on the expiration date time.- Returns:
- the renew value.
-
withRenew
Set the renew property: Setting this to true will automatically purchase a new reservation on the expiration date time.- Parameters:
renew
- the renew value to set.- Returns:
- the PurchaseRequest object itself.
-
reservedResourceProperties
Get the reservedResourceProperties property: Properties specific to each reserved resource type. Not required if not applicable.- Returns:
- the reservedResourceProperties value.
-
withReservedResourceProperties
public PurchaseRequest withReservedResourceProperties(PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties) Set the reservedResourceProperties property: Properties specific to each reserved resource type. Not required if not applicable.- Parameters:
reservedResourceProperties
- the reservedResourceProperties value to set.- Returns:
- the PurchaseRequest object itself.
-
reviewDateTime
Get the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.- Returns:
- the reviewDateTime value.
-
withReviewDateTime
Set the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.- Parameters:
reviewDateTime
- the reviewDateTime value to set.- Returns:
- the PurchaseRequest 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<PurchaseRequest>
- Throws:
IOException
-
fromJson
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.
-