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 Details

    • SavingsPlanPurchaseRequest

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

    • sku

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

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

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

      public SavingsPlanPurchaseRequest withDisplayName(String displayName)
      Set the displayName property: Friendly name of the savings plan.
      Parameters:
      displayName - the displayName value to set.
      Returns:
      the SavingsPlanPurchaseRequest 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 SavingsPlanPurchaseRequest 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 SavingsPlanPurchaseRequest object itself.
    • term

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

      public BillingPlan billingPlan()
      Get the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
      Returns:
      the billingPlan value.
    • withBillingPlan

      public SavingsPlanPurchaseRequest withBillingPlan(BillingPlan billingPlan)
      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

      public AppliedScopeType appliedScopeType()
      Get the appliedScopeType property: Type of the Applied Scope.
      Returns:
      the appliedScopeType value.
    • withAppliedScopeType

      public SavingsPlanPurchaseRequest withAppliedScopeType(AppliedScopeType appliedScopeType)
      Set the appliedScopeType property: Type of the Applied Scope.
      Parameters:
      appliedScopeType - the appliedScopeType value to set.
      Returns:
      the SavingsPlanPurchaseRequest 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 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

      public Commitment commitment()
      Get the commitment property: Commitment towards the benefit.
      Returns:
      the commitment value.
    • withCommitment

      public SavingsPlanPurchaseRequest withCommitment(Commitment commitment)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.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.