java.lang.Object
com.azure.resourcemanager.reservations.models.PatchModel
All Implemented Interfaces:
com.azure.json.JsonSerializable<PatchModel>

public final class PatchModel extends Object implements com.azure.json.JsonSerializable<PatchModel>
The request for reservation patch.
  • Constructor Details

    • PatchModel

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

    • appliedScopeType

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

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

      public InstanceFlexibility instanceFlexibility()
      Get the instanceFlexibility 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 instanceFlexibility value.
    • withInstanceFlexibility

      public PatchModel withInstanceFlexibility(InstanceFlexibility instanceFlexibility)
      Set the instanceFlexibility 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:
      instanceFlexibility - the instanceFlexibility value to set.
      Returns:
      the PatchModel object itself.
    • name

      public String name()
      Get the name property: Display name of the reservation.
      Returns:
      the name value.
    • withName

      public PatchModel withName(String name)
      Set the name property: Display name of the reservation.
      Parameters:
      name - the name value to set.
      Returns:
      the PatchModel 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 PatchModel 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 PatchModel object itself.
    • renewProperties

      public PatchPropertiesRenewProperties renewProperties()
      Get the renewProperties property: The renewProperties property.
      Returns:
      the renewProperties value.
    • withRenewProperties

      public PatchModel withRenewProperties(PatchPropertiesRenewProperties renewProperties)
      Set the renewProperties property: The renewProperties property.
      Parameters:
      renewProperties - the renewProperties value to set.
      Returns:
      the PatchModel 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 PatchModel 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 PatchModel 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<PatchModel>
      Throws:
      IOException
    • fromJson

      public static PatchModel fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of PatchModel from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of PatchModel 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 PatchModel.