Class DeleteRetentionPolicy
java.lang.Object
com.azure.resourcemanager.storage.models.DeleteRetentionPolicy
- All Implemented Interfaces:
com.azure.json.JsonSerializable<DeleteRetentionPolicy>
public final class DeleteRetentionPolicy
extends Object
implements com.azure.json.JsonSerializable<DeleteRetentionPolicy>
The service properties for soft delete.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the allowPermanentDelete property: This property when set to true allows deletion of the soft deleted blob versions and snapshots.days()Get the days property: Indicates the number of days that the deleted item should be retained.enabled()Get the enabled property: Indicates whether DeleteRetentionPolicy is enabled.static DeleteRetentionPolicyfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of DeleteRetentionPolicy from the JsonReader.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withAllowPermanentDelete(Boolean allowPermanentDelete) Set the allowPermanentDelete property: This property when set to true allows deletion of the soft deleted blob versions and snapshots.Set the days property: Indicates the number of days that the deleted item should be retained.withEnabled(Boolean enabled) Set the enabled property: Indicates whether DeleteRetentionPolicy is enabled.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
-
DeleteRetentionPolicy
public DeleteRetentionPolicy()Creates an instance of DeleteRetentionPolicy class.
-
-
Method Details
-
enabled
Get the enabled property: Indicates whether DeleteRetentionPolicy is enabled.- Returns:
- the enabled value.
-
withEnabled
Set the enabled property: Indicates whether DeleteRetentionPolicy is enabled.- Parameters:
enabled- the enabled value to set.- Returns:
- the DeleteRetentionPolicy object itself.
-
days
Get the days property: Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365.- Returns:
- the days value.
-
withDays
Set the days property: Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365.- Parameters:
days- the days value to set.- Returns:
- the DeleteRetentionPolicy object itself.
-
allowPermanentDelete
Get the allowPermanentDelete property: This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob service and does not apply to containers or file share.- Returns:
- the allowPermanentDelete value.
-
withAllowPermanentDelete
Set the allowPermanentDelete property: This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob service and does not apply to containers or file share.- Parameters:
allowPermanentDelete- the allowPermanentDelete value to set.- Returns:
- the DeleteRetentionPolicy 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<DeleteRetentionPolicy>- Throws:
IOException
-
fromJson
public static DeleteRetentionPolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of DeleteRetentionPolicy from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of DeleteRetentionPolicy 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 DeleteRetentionPolicy.
-