SoftDeletePolicy Class

  • java.lang.Object
    • com.azure.resourcemanager.compute.models.SoftDeletePolicy

Implements

public final class SoftDeletePolicy
implements JsonSerializable<SoftDeletePolicy>

Contains information about the soft deletion policy of the gallery.

Constructor Summary

Constructor Description
SoftDeletePolicy()

Creates an instance of SoftDeletePolicy class.

Method Summary

Modifier and Type Method and Description
static SoftDeletePolicy fromJson(JsonReader jsonReader)

Reads an instance of SoftDeletePolicy from the JsonReader.

Integer gracePeriodInDays()

Get the gracePeriodInDays property: The grace period in days for a simulated hard-deleted resource.

Boolean isSoftDeleteEnabled()

Get the isSoftDeleteEnabled property: Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time.

Integer retentionPeriodInDays()

Get the retentionPeriodInDays property: The retention period in days for a soft-deleted resource.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

SoftDeletePolicy withGracePeriodInDays(Integer gracePeriodInDays)

Set the gracePeriodInDays property: The grace period in days for a simulated hard-deleted resource.

SoftDeletePolicy withIsSoftDeleteEnabled(Boolean isSoftDeleteEnabled)

Set the isSoftDeleteEnabled property: Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time.

SoftDeletePolicy withRetentionPeriodInDays(Integer retentionPeriodInDays)

Set the retentionPeriodInDays property: The retention period in days for a soft-deleted resource.

Methods inherited from java.lang.Object

Constructor Details

SoftDeletePolicy

public SoftDeletePolicy()

Creates an instance of SoftDeletePolicy class.

Method Details

fromJson

public static SoftDeletePolicy fromJson(JsonReader jsonReader)

Reads an instance of SoftDeletePolicy from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of SoftDeletePolicy 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 SoftDeletePolicy.

gracePeriodInDays

public Integer gracePeriodInDays()

Get the gracePeriodInDays property: The grace period in days for a simulated hard-deleted resource. During this period the gallery image version is unusable but can still be recovered if required. After this period elapses, the gallery image version is permanently (hard) deleted.

Returns:

the gracePeriodInDays value.

isSoftDeleteEnabled

public Boolean isSoftDeleteEnabled()

Get the isSoftDeleteEnabled property: Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time.

Returns:

the isSoftDeleteEnabled value.

retentionPeriodInDays

public Integer retentionPeriodInDays()

Get the retentionPeriodInDays property: The retention period in days for a soft-deleted resource. After this period elapses, the soft-deleted gallery image version transitions to a simulated hard-deleted state.

Returns:

the retentionPeriodInDays value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withGracePeriodInDays

public SoftDeletePolicy withGracePeriodInDays(Integer gracePeriodInDays)

Set the gracePeriodInDays property: The grace period in days for a simulated hard-deleted resource. During this period the gallery image version is unusable but can still be recovered if required. After this period elapses, the gallery image version is permanently (hard) deleted.

Parameters:

gracePeriodInDays - the gracePeriodInDays value to set.

Returns:

the SoftDeletePolicy object itself.

withIsSoftDeleteEnabled

public SoftDeletePolicy withIsSoftDeleteEnabled(Boolean isSoftDeleteEnabled)

Set the isSoftDeleteEnabled property: Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time.

Parameters:

isSoftDeleteEnabled - the isSoftDeleteEnabled value to set.

Returns:

the SoftDeletePolicy object itself.

withRetentionPeriodInDays

public SoftDeletePolicy withRetentionPeriodInDays(Integer retentionPeriodInDays)

Set the retentionPeriodInDays property: The retention period in days for a soft-deleted resource. After this period elapses, the soft-deleted gallery image version transitions to a simulated hard-deleted state.

Parameters:

retentionPeriodInDays - the retentionPeriodInDays value to set.

Returns:

the SoftDeletePolicy object itself.

Applies to