Duration¶
- class oci.object_storage.models.Duration(**kwargs)¶
Bases:
objectThe amount of time that objects in the bucket should be preserved for and which is calculated in relation to each object’s Last-Modified timestamp. If duration is not present, then there is no time limit and the objects in the bucket will be preserved indefinitely.
Attributes:
A constant which can be used with the time_unit property of a Duration.
A constant which can be used with the time_unit property of a Duration.
[Required] Gets the time_amount of this Duration.
[Required] Gets the time_unit of this Duration.
Methods:
__init__(**kwargs)Initializes a new Duration object with values from keyword arguments.
- TIME_UNIT_DAYS = 'DAYS'¶
A constant which can be used with the time_unit property of a Duration. This constant has a value of “DAYS”
- TIME_UNIT_YEARS = 'YEARS'¶
A constant which can be used with the time_unit property of a Duration. This constant has a value of “YEARS”
- __init__(**kwargs)¶
Initializes a new Duration object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):
- Parameters
time_amount (int) – The value to assign to the time_amount property of this Duration.
time_unit (str) – The value to assign to the time_unit property of this Duration. Allowed values for this property are: “YEARS”, “DAYS”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
- property time_amount¶
[Required] Gets the time_amount of this Duration. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object’s Last-Modified timestamp.
- Returns
The time_amount of this Duration.
- Return type
int
- property time_unit¶
[Required] Gets the time_unit of this Duration. The unit that should be used to interpret timeAmount.
Allowed values for this property are: “YEARS”, “DAYS”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
- Returns
The time_unit of this Duration.
- Return type
str