ReservationPurchaseRequest Class

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

Implements

public final class ReservationPurchaseRequest
implements JsonSerializable<ReservationPurchaseRequest>

The request for reservation purchase.

Constructor Summary

Constructor Description
ReservationPurchaseRequest()

Creates an instance of ReservationPurchaseRequest class.

Method Summary

Modifier and Type Method and Description
ReservationAppliedScopeProperties appliedScopeProperties()

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

List<String> appliedScopes()

Get the appliedScopes property: List of the subscriptions that the benefit will be applied.

AppliedScopeType appliedScopeType()

Get the appliedScopeType property: Type of the Applied Scope.

ReservationBillingPlan billingPlan()

Get the billingPlan property: Represent the billing plans.

String billingScopeId()

Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.

String displayName()

Get the displayName property: Friendly name of the reservation.

static ReservationPurchaseRequest fromJson(JsonReader jsonReader)

Reads an instance of ReservationPurchaseRequest from the JsonReader.

InstanceFlexibility instanceFlexibility()

Get the instanceFlexibility property: Allows reservation discount to be applied across skus within the same auto fit group.

InstanceFlexibility instanceFlexibilityReservedResourcePropertiesInstanceFlexibility()

Get the instanceFlexibilityReservedResourcePropertiesInstanceFlexibility property: Turning this on will apply the reservation discount to other VMs in the same VM size group.

String location()

Get the location property: The Azure region where the reserved resource lives.

Integer quantity()

Get the quantity property: Quantity of the skus that are part of the reservation.

Boolean renew()

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

String reservedResourceType()

Get the reservedResourceType property: The reserved source type of the reservation, e.g.

OffsetDateTime reviewDateTime()

Get the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.

SkuName sku()

Get the sku property: The name of sku.

String term()

Get the term property: The term of the reservation, e.g.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

ReservationPurchaseRequest withAppliedScopeProperties(ReservationAppliedScopeProperties appliedScopeProperties)

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

ReservationPurchaseRequest withAppliedScopes(List<String> appliedScopes)

Set the appliedScopes property: List of the subscriptions that the benefit will be applied.

ReservationPurchaseRequest withAppliedScopeType(AppliedScopeType appliedScopeType)

Set the appliedScopeType property: Type of the Applied Scope.

ReservationPurchaseRequest withBillingPlan(ReservationBillingPlan billingPlan)

Set the billingPlan property: Represent the billing plans.

ReservationPurchaseRequest withDisplayName(String displayName)

Set the displayName property: Friendly name of the reservation.

ReservationPurchaseRequest withInstanceFlexibility(InstanceFlexibility instanceFlexibility)

Set the instanceFlexibility property: Allows reservation discount to be applied across skus within the same auto fit group.

ReservationPurchaseRequest withInstanceFlexibilityReservedResourcePropertiesInstanceFlexibility(InstanceFlexibility instanceFlexibilityReservedResourcePropertiesInstanceFlexibility)

Set the instanceFlexibilityReservedResourcePropertiesInstanceFlexibility property: Turning this on will apply the reservation discount to other VMs in the same VM size group.

ReservationPurchaseRequest withLocation(String location)

Set the location property: The Azure region where the reserved resource lives.

ReservationPurchaseRequest withQuantity(Integer quantity)

Set the quantity property: Quantity of the skus that are part of the reservation.

ReservationPurchaseRequest withRenew(Boolean renew)

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

ReservationPurchaseRequest withReviewDateTime(OffsetDateTime reviewDateTime)

Set the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.

ReservationPurchaseRequest withSku(SkuName sku)

Set the sku property: The name of sku.

Methods inherited from java.lang.Object

Constructor Details

ReservationPurchaseRequest

public ReservationPurchaseRequest()

Creates an instance of ReservationPurchaseRequest class.

Method Details

appliedScopeProperties

public ReservationAppliedScopeProperties 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.

appliedScopes

public List<String> appliedScopes()

Get the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared.

Returns:

the appliedScopes value.

appliedScopeType

public AppliedScopeType appliedScopeType()

Get the appliedScopeType property: Type of the Applied Scope.

Returns:

the appliedScopeType value.

billingPlan

public ReservationBillingPlan billingPlan()

Get the billingPlan property: Represent the billing plans.

Returns:

the billingPlan value.

billingScopeId

public String billingScopeId()

Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.

Returns:

the billingScopeId value.

displayName

public String displayName()

Get the displayName property: Friendly name of the reservation.

Returns:

the displayName value.

fromJson

public static ReservationPurchaseRequest fromJson(JsonReader jsonReader)

Reads an instance of ReservationPurchaseRequest from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ReservationPurchaseRequest 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 ReservationPurchaseRequest.

instanceFlexibility

public InstanceFlexibility instanceFlexibility()

Get the instanceFlexibility property: Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility.

Returns:

the instanceFlexibility value.

instanceFlexibilityReservedResourcePropertiesInstanceFlexibility

public InstanceFlexibility instanceFlexibilityReservedResourcePropertiesInstanceFlexibility()

Get the instanceFlexibilityReservedResourcePropertiesInstanceFlexibility property: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.

Returns:

the instanceFlexibilityReservedResourcePropertiesInstanceFlexibility value.

location

public String location()

Get the location property: The Azure region where the reserved resource lives.

Returns:

the location value.

quantity

public Integer quantity()

Get the quantity property: Quantity of the skus that are part of the reservation. Must be greater than zero.

Returns:

the quantity value.

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.

reservedResourceType

public String reservedResourceType()

Get the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine.

Returns:

the reservedResourceType value.

reviewDateTime

public OffsetDateTime reviewDateTime()

Get the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.

Returns:

the reviewDateTime value.

sku

public SkuName sku()

Get the sku property: The name of sku.

Returns:

the sku value.

term

public String term()

Get the term property: The term of the reservation, e.g. P1Y.

Returns:

the term value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withAppliedScopeProperties

public ReservationPurchaseRequest withAppliedScopeProperties(ReservationAppliedScopeProperties 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 ReservationPurchaseRequest object itself.

withAppliedScopes

public ReservationPurchaseRequest withAppliedScopes(List<String> appliedScopes)

Set the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared.

Parameters:

appliedScopes - the appliedScopes value to set.

Returns:

the ReservationPurchaseRequest object itself.

withAppliedScopeType

public ReservationPurchaseRequest withAppliedScopeType(AppliedScopeType appliedScopeType)

Set the appliedScopeType property: Type of the Applied Scope.

Parameters:

appliedScopeType - the appliedScopeType value to set.

Returns:

the ReservationPurchaseRequest object itself.

withBillingPlan

public ReservationPurchaseRequest withBillingPlan(ReservationBillingPlan billingPlan)

Set the billingPlan property: Represent the billing plans.

Parameters:

billingPlan - the billingPlan value to set.

Returns:

the ReservationPurchaseRequest object itself.

withDisplayName

public ReservationPurchaseRequest withDisplayName(String displayName)

Set the displayName property: Friendly name of the reservation.

Parameters:

displayName - the displayName value to set.

Returns:

the ReservationPurchaseRequest object itself.

withInstanceFlexibility

public ReservationPurchaseRequest withInstanceFlexibility(InstanceFlexibility instanceFlexibility)

Set the instanceFlexibility property: Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility.

Parameters:

instanceFlexibility - the instanceFlexibility value to set.

Returns:

the ReservationPurchaseRequest object itself.

withInstanceFlexibilityReservedResourcePropertiesInstanceFlexibility

public ReservationPurchaseRequest withInstanceFlexibilityReservedResourcePropertiesInstanceFlexibility(InstanceFlexibility instanceFlexibilityReservedResourcePropertiesInstanceFlexibility)

Set the instanceFlexibilityReservedResourcePropertiesInstanceFlexibility property: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.

Parameters:

instanceFlexibilityReservedResourcePropertiesInstanceFlexibility - the instanceFlexibilityReservedResourcePropertiesInstanceFlexibility value to set.

Returns:

the ReservationPurchaseRequest object itself.

withLocation

public ReservationPurchaseRequest withLocation(String location)

Set the location property: The Azure region where the reserved resource lives.

Parameters:

location - the location value to set.

Returns:

the ReservationPurchaseRequest object itself.

withQuantity

public ReservationPurchaseRequest withQuantity(Integer quantity)

Set the quantity property: Quantity of the skus that are part of the reservation. Must be greater than zero.

Parameters:

quantity - the quantity value to set.

Returns:

the ReservationPurchaseRequest object itself.

withRenew

public ReservationPurchaseRequest 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 ReservationPurchaseRequest object itself.

withReviewDateTime

public ReservationPurchaseRequest withReviewDateTime(OffsetDateTime reviewDateTime)

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 ReservationPurchaseRequest object itself.

withSku

public ReservationPurchaseRequest withSku(SkuName sku)

Set the sku property: The name of sku.

Parameters:

sku - the sku value to set.

Returns:

the ReservationPurchaseRequest object itself.

Applies to