Class Restriction

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

public final class Restriction extends Object implements com.azure.json.JsonSerializable<Restriction>
The restriction because of which SKU cannot be used.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of Restriction class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of Restriction from the JsonReader.
    Get the reasonCode property: The reason for the restriction.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    Get the type property: The type of restrictions.
    void
    Validates the instance.
    Get the values property: The value of restrictions.
    Set the reasonCode property: The reason for the restriction.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • Restriction

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

    • type

      public String type()
      Get the type property: The type of restrictions. As of now only possible value for this is location.
      Returns:
      the type value.
    • 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.
    • reasonCode

      public ReasonCode reasonCode()
      Get the reasonCode property: The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC.
      Returns:
      the reasonCode value.
    • withReasonCode

      public Restriction withReasonCode(ReasonCode reasonCode)
      Set the reasonCode property: The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC.
      Parameters:
      reasonCode - the reasonCode value to set.
      Returns:
      the Restriction 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<Restriction>
      Throws:
      IOException
    • fromJson

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