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 Details

    • PurchaseRequest

      public PurchaseRequest()
      Creates an instance of PurchaseRequest class.
  • Method Details

    • sku

      public SkuName sku()
      Get the sku property: The name of sku.
      Returns:
      the sku value.
    • withSku

      public PurchaseRequest withSku(SkuName sku)
      Set the sku property: The name of sku.
      Parameters:
      sku - the sku value to set.
      Returns:
      the PurchaseRequest object itself.
    • location

      public String location()
      Get the location property: The Azure region where the reserved resource lives.
      Returns:
      the location value.
    • withLocation

      public PurchaseRequest withLocation(String location)
      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

      public ReservedResourceType reservedResourceType()
      Get the reservedResourceType property: The type of the resource that is being reserved.
      Returns:
      the reservedResourceType value.
    • withReservedResourceType

      public PurchaseRequest withReservedResourceType(ReservedResourceType reservedResourceType)
      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

      public String billingScopeId()
      Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.
      Returns:
      the billingScopeId value.
    • withBillingScopeId

      public PurchaseRequest withBillingScopeId(String billingScopeId)
      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

      public ReservationTerm term()
      Get the term property: Represent the term of reservation.
      Returns:
      the term value.
    • withTerm

      public PurchaseRequest withTerm(ReservationTerm term)
      Set the term property: Represent the term of reservation.
      Parameters:
      term - the term value to set.
      Returns:
      the PurchaseRequest object itself.
    • billingPlan

      public ReservationBillingPlan billingPlan()
      Get the billingPlan property: Represent the billing plans.
      Returns:
      the billingPlan value.
    • withBillingPlan

      public PurchaseRequest withBillingPlan(ReservationBillingPlan billingPlan)
      Set the billingPlan property: Represent the billing plans.
      Parameters:
      billingPlan - the billingPlan value to set.
      Returns:
      the PurchaseRequest object itself.
    • quantity

      public Integer quantity()
      Get the quantity property: Quantity of the skus that are part of the reservation.
      Returns:
      the quantity value.
    • withQuantity

      public PurchaseRequest withQuantity(Integer quantity)
      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

      public String displayName()
      Get the displayName property: Friendly name of the reservation.
      Returns:
      the displayName value.
    • withDisplayName

      public PurchaseRequest withDisplayName(String displayName)
      Set the displayName property: Friendly name of the reservation.
      Parameters:
      displayName - the displayName value to set.
      Returns:
      the PurchaseRequest object itself.
    • appliedScopeType

      public AppliedScopeType appliedScopeType()
      Get the appliedScopeType property: Type of the Applied Scope.
      Returns:
      the appliedScopeType value.
    • 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.
    • 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. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.
      Returns:
      the appliedScopes value.
    • withAppliedScopes

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

      public AppliedScopeProperties 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 PurchaseRequest 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 PurchaseRequest object itself.
    • renew

      public Boolean 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

      public PurchaseRequest withRenew(Boolean renew)
      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

      public PurchaseRequestPropertiesReservedResourceProperties 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

      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.
    • withReviewDateTime

      public PurchaseRequest 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 PurchaseRequest object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<PurchaseRequest>
      Throws:
      IOException
    • fromJson

      public static PurchaseRequest fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.