RetentionPolicy Class

The retention policy which determines how long the associated data should persist.

All required parameters must be populated in order to send to Azure.

Constructor

RetentionPolicy(enabled: bool = False, days: int | None = None)

Parameters

Name Description
enabled

Required. Indicates whether a retention policy is enabled for the storage service.

Default value: False
days
int

Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted.

Default value: None

Methods

as_dict

Return a dict that can be serialized using json.dump.

deserialize

Deserialize this model from a dictionary.

enable_additional_properties_sending

Add additional_properties to the attribute map so they are sent to the service.

from_dict

Parse a dict using a given key extractor and return a model.

is_xml_model

Whether this model is serialized as XML.

serialize

Serialize this model to a dictionary.

as_dict

Return a dict that can be serialized using json.dump.

as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, dict[str, typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) -> MutableMapping[str, Any]

Parameters

Name Description
keep_readonly

If you want to serialize the readonly attributes.

Default value: True
key_transformer

A function that takes an attribute name, the attribute map, and the value, and returns the key to use in the output dict.

Returns

Type Description
<xref:JSON>

A dict JSON compatible object.

deserialize

Deserialize this model from a dictionary.

deserialize(data: Any, content_type: str | None = None) -> Self

Parameters

Name Description
data
Required
str

A str using RestAPI structure. JSON by default.

content_type
str

JSON by default, set application/xml if XML.

Default value: None

Returns

Type Description

An instance of this model.

enable_additional_properties_sending

Add additional_properties to the attribute map so they are sent to the service.

enable_additional_properties_sending() -> None

Returns

Type Description

None

from_dict

Parse a dict using a given key extractor and return a model.

from_dict(data: Any, key_extractors: Callable[[str, dict[str, Any], Any], Any] | None = None, content_type: str | None = None) -> Self

Parameters

Name Description
data
Required

A dict using RestAPI structure.

key_extractors

A key extractor function.

Default value: None
content_type
str

JSON by default, set application/xml if XML.

Default value: None

Returns

Type Description

An instance of this model.

is_xml_model

Whether this model is serialized as XML.

is_xml_model() -> bool

Returns

Type Description

True if this model is serialized as XML, otherwise False.

serialize

Serialize this model to a dictionary.

serialize(keep_readonly: bool = False, **kwargs: Any) -> MutableMapping[str, Any]

Parameters

Name Description
keep_readonly

If you want to serialize the readonly attributes.

Default value: False

Returns

Type Description
<xref:JSON>

A dict JSON compatible object.

Attributes

days

Indicates the number of days that metrics or logging or soft-deleted data should be retained.

days: int | None = None

enabled

Indicates whether a retention policy is enabled for the storage service.

enabled: bool = False