Class ImmutableStorageAccount
java.lang.Object
com.azure.resourcemanager.storage.models.ImmutableStorageAccount
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ImmutableStorageAccount>
public final class ImmutableStorageAccount
extends Object
implements com.azure.json.JsonSerializable<ImmutableStorageAccount>
This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of ImmutableStorageAccount class. -
Method Summary
Modifier and TypeMethodDescriptionenabled()Get the enabled property: A boolean flag which enables account-level immutability.static ImmutableStorageAccountfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ImmutableStorageAccount from the JsonReader.Get the immutabilityPolicy property: Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess an explicit immutability policy at the object level.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withEnabled(Boolean enabled) Set the enabled property: A boolean flag which enables account-level immutability.withImmutabilityPolicy(AccountImmutabilityPolicyProperties immutabilityPolicy) Set the immutabilityPolicy property: Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess an explicit immutability policy at the object level.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ImmutableStorageAccount
public ImmutableStorageAccount()Creates an instance of ImmutableStorageAccount class.
-
-
Method Details
-
enabled
Get the enabled property: A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.- Returns:
- the enabled value.
-
withEnabled
Set the enabled property: A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.- Parameters:
enabled- the enabled value to set.- Returns:
- the ImmutableStorageAccount object itself.
-
immutabilityPolicy
Get the immutabilityPolicy property: Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the container-level immutability policy, which has a higher precedence than the account-level immutability policy.- Returns:
- the immutabilityPolicy value.
-
withImmutabilityPolicy
public ImmutableStorageAccount withImmutabilityPolicy(AccountImmutabilityPolicyProperties immutabilityPolicy) Set the immutabilityPolicy property: Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the container-level immutability policy, which has a higher precedence than the account-level immutability policy.- Parameters:
immutabilityPolicy- the immutabilityPolicy value to set.- Returns:
- the ImmutableStorageAccount object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ImmutableStorageAccount>- Throws:
IOException
-
fromJson
public static ImmutableStorageAccount fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ImmutableStorageAccount from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ImmutableStorageAccount 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 ImmutableStorageAccount.
-