Class ImmutabilityPolicyProperty

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

public final class ImmutabilityPolicyProperty extends Object implements com.azure.json.JsonSerializable<ImmutabilityPolicyProperty>
The properties of an ImmutabilityPolicy of a blob container.
  • Constructor Details

    • ImmutabilityPolicyProperty

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

    • immutabilityPeriodSinceCreationInDays

      public Integer 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 ImmutabilityPolicyProperty 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 ImmutabilityPolicyProperty object itself.
    • state

      public ImmutabilityPolicyState state()
      Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.
      Returns:
      the state value.
    • allowProtectedAppendWrites

      public Boolean allowProtectedAppendWrites()
      Get the allowProtectedAppendWrites property: This property can only be changed for 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. This property cannot be changed with ExtendImmutabilityPolicy API.
      Returns:
      the allowProtectedAppendWrites value.
    • withAllowProtectedAppendWrites

      public ImmutabilityPolicyProperty withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites)
      Set the allowProtectedAppendWrites property: This property can only be changed for 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. This property cannot be changed with ExtendImmutabilityPolicy API.
      Parameters:
      allowProtectedAppendWrites - the allowProtectedAppendWrites value to set.
      Returns:
      the ImmutabilityPolicyProperty object itself.
    • allowProtectedAppendWritesAll

      public Boolean allowProtectedAppendWritesAll()
      Get the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.
      Returns:
      the allowProtectedAppendWritesAll value.
    • withAllowProtectedAppendWritesAll

      public ImmutabilityPolicyProperty withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll)
      Set the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.
      Parameters:
      allowProtectedAppendWritesAll - the allowProtectedAppendWritesAll value to set.
      Returns:
      the ImmutabilityPolicyProperty 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<ImmutabilityPolicyProperty>
      Throws:
      IOException
    • fromJson

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