Class SkuRestriction

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

public final class SkuRestriction extends Object implements com.azure.json.JsonSerializable<SkuRestriction>
Restriction of a sku.
  • Constructor Details

    • SkuRestriction

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

    • type

      public String type()
      Get the type property: The type of restrictions.
      Returns:
      the type value.
    • withType

      public SkuRestriction withType(String type)
      Set the type property: The type of restrictions.
      Parameters:
      type - the type value to set.
      Returns:
      the SkuRestriction object itself.
    • values

      public List<String> values()
      Get the values property: The value of restrictions. If the restriction type is set to location. This would be different locations where the sku is restricted.
      Returns:
      the values value.
    • withValues

      public SkuRestriction withValues(List<String> values)
      Set the values property: The value of restrictions. If the restriction type is set to location. This would be different locations where the sku is restricted.
      Parameters:
      values - the values value to set.
      Returns:
      the SkuRestriction object itself.
    • reasonCode

      public String reasonCode()
      Get the reasonCode property: The reason for restriction.
      Returns:
      the reasonCode value.
    • withReasonCode

      public SkuRestriction withReasonCode(String reasonCode)
      Set the reasonCode property: The reason for restriction.
      Parameters:
      reasonCode - the reasonCode value to set.
      Returns:
      the SkuRestriction 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<SkuRestriction>
      Throws:
      IOException
    • fromJson

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