# coding: utf-8
# Copyright (c) 2016, 2026, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918


from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
from oci.decorators import init_model_state_from_kwargs


@init_model_state_from_kwargs
class RetentionDuration(object):
    """
    This field is used to define the retention period for backups. This is an optional field. If it is not specified, it is set to null, no retention period will be applied to the backups.
    """

    #: A constant which can be used with the retention_time_unit property of a RetentionDuration.
    #: This constant has a value of "YEARS"
    RETENTION_TIME_UNIT_YEARS = "YEARS"

    #: A constant which can be used with the retention_time_unit property of a RetentionDuration.
    #: This constant has a value of "DAYS"
    RETENTION_TIME_UNIT_DAYS = "DAYS"

    def __init__(self, **kwargs):
        """
        Initializes a new RetentionDuration object with values from keyword arguments.
        The following keyword arguments are supported (corresponding to the getters/setters of this class):

        :param retention_time_unit:
            The value to assign to the retention_time_unit property of this RetentionDuration.
            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'.
        :type retention_time_unit: str

        :param retention_time_amount:
            The value to assign to the retention_time_amount property of this RetentionDuration.
        :type retention_time_amount: int

        """
        self.swagger_types = {
            'retention_time_unit': 'str',
            'retention_time_amount': 'int'
        }
        self.attribute_map = {
            'retention_time_unit': 'retentionTimeUnit',
            'retention_time_amount': 'retentionTimeAmount'
        }
        self._retention_time_unit = None
        self._retention_time_amount = None

    @property
    def retention_time_unit(self):
        """
        **[Required]** Gets the retention_time_unit of this RetentionDuration.
        The value you can assign to the Time Unit property for this Duration may be either \"YEARS\" or \"DAYS\".

        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'.


        :return: The retention_time_unit of this RetentionDuration.
        :rtype: str
        """
        return self._retention_time_unit

    @retention_time_unit.setter
    def retention_time_unit(self, retention_time_unit):
        """
        Sets the retention_time_unit of this RetentionDuration.
        The value you can assign to the Time Unit property for this Duration may be either \"YEARS\" or \"DAYS\".


        :param retention_time_unit: The retention_time_unit of this RetentionDuration.
        :type: str
        """
        allowed_values = ["YEARS", "DAYS"]
        if not value_allowed_none_or_none_sentinel(retention_time_unit, allowed_values):
            retention_time_unit = 'UNKNOWN_ENUM_VALUE'
        self._retention_time_unit = retention_time_unit

    @property
    def retention_time_amount(self):
        """
        **[Required]** Gets the retention_time_amount of this RetentionDuration.
        The value to enter for the amount of retention time should be a numerical figure (such as 1, 7, 30, etc.) that corresponds to the period specified in the retention time unit property (such as YEARS, DAYS). The combination of these two properties determines the total length of the retention period.


        :return: The retention_time_amount of this RetentionDuration.
        :rtype: int
        """
        return self._retention_time_amount

    @retention_time_amount.setter
    def retention_time_amount(self, retention_time_amount):
        """
        Sets the retention_time_amount of this RetentionDuration.
        The value to enter for the amount of retention time should be a numerical figure (such as 1, 7, 30, etc.) that corresponds to the period specified in the retention time unit property (such as YEARS, DAYS). The combination of these two properties determines the total length of the retention period.


        :param retention_time_amount: The retention_time_amount of this RetentionDuration.
        :type: int
        """
        self._retention_time_amount = retention_time_amount

    def __repr__(self):
        return formatted_flat_dict(self)

    def __eq__(self, other):
        if other is None:
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other
