DeleteRetentionPolicy Class

  • java.lang.Object
    • com.azure.resourcemanager.storage.models.DeleteRetentionPolicy

Implements

public final class DeleteRetentionPolicy
implements JsonSerializable<DeleteRetentionPolicy>

The service properties for soft delete.

Constructor Summary

Constructor Description
DeleteRetentionPolicy()

Creates an instance of DeleteRetentionPolicy class.

Method Summary

Modifier and Type Method and Description
Boolean allowPermanentDelete()

Get the allowPermanentDelete property: This property when set to true allows deletion of the soft deleted blob versions and snapshots.

Integer days()

Get the days property: Indicates the number of days that the deleted item should be retained.

Boolean enabled()

Get the enabled property: Indicates whether DeleteRetentionPolicy is enabled.

static DeleteRetentionPolicy fromJson(JsonReader jsonReader)

Reads an instance of DeleteRetentionPolicy from the JsonReader.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

DeleteRetentionPolicy withAllowPermanentDelete(Boolean allowPermanentDelete)

Set the allowPermanentDelete property: This property when set to true allows deletion of the soft deleted blob versions and snapshots.

DeleteRetentionPolicy withDays(Integer days)

Set the days property: Indicates the number of days that the deleted item should be retained.

DeleteRetentionPolicy withEnabled(Boolean enabled)

Set the enabled property: Indicates whether DeleteRetentionPolicy is enabled.

Methods inherited from java.lang.Object

Constructor Details

DeleteRetentionPolicy

public DeleteRetentionPolicy()

Creates an instance of DeleteRetentionPolicy class.

Method Details

allowPermanentDelete

public Boolean 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.

days

public Integer 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.

enabled

public Boolean enabled()

Get the enabled property: Indicates whether DeleteRetentionPolicy is enabled.

Returns:

the enabled value.

fromJson

public static DeleteRetentionPolicy fromJson(JsonReader jsonReader)

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withAllowPermanentDelete

public DeleteRetentionPolicy withAllowPermanentDelete(Boolean allowPermanentDelete)

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.

withDays

public DeleteRetentionPolicy withDays(Integer days)

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.

withEnabled

public DeleteRetentionPolicy withEnabled(Boolean enabled)

Set the enabled property: Indicates whether DeleteRetentionPolicy is enabled.

Parameters:

enabled - the enabled value to set.

Returns:

the DeleteRetentionPolicy object itself.

Applies to