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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SkuRestriction
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of SkuRestriction from the JsonReader.Get the reasonCode property: The reason for restriction.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) type()
Get the type property: The type of restrictions.void
validate()
Validates the instance.values()
Get the values property: The value of restrictions.withReasonCode
(String reasonCode) Set the reasonCode property: The reason for restriction.Set the type property: The type of restrictions.withValues
(List<String> values) Set the values property: The value of restrictions.Methods inherited from class java.lang.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
-
SkuRestriction
public SkuRestriction()Creates an instance of SkuRestriction class.
-
-
Method Details
-
type
Get the type property: The type of restrictions.- Returns:
- the type value.
-
withType
Set the type property: The type of restrictions.- Parameters:
type
- the type value to set.- Returns:
- the SkuRestriction object itself.
-
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
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
Get the reasonCode property: The reason for restriction.- Returns:
- the reasonCode value.
-
withReasonCode
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<SkuRestriction>
- Throws:
IOException
-
fromJson
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.
-