Class AccountImmutabilityPolicyProperties
java.lang.Object
com.azure.resourcemanager.storage.models.AccountImmutabilityPolicyProperties
- All Implemented Interfaces:
com.azure.json.JsonSerializable<AccountImmutabilityPolicyProperties>
public final class AccountImmutabilityPolicyProperties
extends Object
implements com.azure.json.JsonSerializable<AccountImmutabilityPolicyProperties>
This defines account-level immutability policy properties.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of AccountImmutabilityPolicyProperties class. -
Method Summary
Modifier and TypeMethodDescriptionGet the allowProtectedAppendWrites property: This property can only be changed for disabled and unlocked time-based retention policies.fromJson(com.azure.json.JsonReader jsonReader) Reads an instance of AccountImmutabilityPolicyProperties from the JsonReader.Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container since the policy creation, in days.state()Get the state property: The ImmutabilityPolicy state defines the mode of the policy.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) Set the allowProtectedAppendWrites property: This property can only be changed for disabled and unlocked time-based retention policies.withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays) Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container since the policy creation, in days.Set the state property: The ImmutabilityPolicy state defines the mode of the policy.Methods inherited from class java.lang.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
-
AccountImmutabilityPolicyProperties
public AccountImmutabilityPolicyProperties()Creates an instance of AccountImmutabilityPolicyProperties class.
-
-
Method Details
-
immutabilityPeriodSinceCreationInDays
Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container since the policy creation, in days.- Returns:
- the immutabilityPeriodSinceCreationInDays value.
-
withImmutabilityPeriodSinceCreationInDays
public AccountImmutabilityPolicyProperties withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays) Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container since the policy creation, in days.- Parameters:
immutabilityPeriodSinceCreationInDays- the immutabilityPeriodSinceCreationInDays value to set.- Returns:
- the AccountImmutabilityPolicyProperties object itself.
-
state
Get the state property: The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.- Returns:
- the state value.
-
withState
Set the state property: The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.- Parameters:
state- the state value to set.- Returns:
- the AccountImmutabilityPolicyProperties object itself.
-
allowProtectedAppendWrites
Get the allowProtectedAppendWrites property: This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.- Returns:
- the allowProtectedAppendWrites value.
-
withAllowProtectedAppendWrites
public AccountImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) Set the allowProtectedAppendWrites property: This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.- Parameters:
allowProtectedAppendWrites- the allowProtectedAppendWrites value to set.- Returns:
- the AccountImmutabilityPolicyProperties 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<AccountImmutabilityPolicyProperties>- Throws:
IOException
-
fromJson
public static AccountImmutabilityPolicyProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of AccountImmutabilityPolicyProperties from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of AccountImmutabilityPolicyProperties 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 AccountImmutabilityPolicyProperties.
-