# coding: utf-8

"""
    KubeVirt API

    This is KubeVirt API an add-on for Kubernetes.  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: kubevirt-dev@googlegroups.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from kubevirt.configuration import Configuration


class V1KubeVirtSelfSignConfiguration(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'ca': 'V1CertConfig',
        'ca_overlap_interval': 'K8sIoApimachineryPkgApisMetaV1Duration',
        'ca_rotate_interval': 'K8sIoApimachineryPkgApisMetaV1Duration',
        'cert_rotate_interval': 'K8sIoApimachineryPkgApisMetaV1Duration',
        'server': 'V1CertConfig'
    }

    attribute_map = {
        'ca': 'ca',
        'ca_overlap_interval': 'caOverlapInterval',
        'ca_rotate_interval': 'caRotateInterval',
        'cert_rotate_interval': 'certRotateInterval',
        'server': 'server'
    }

    def __init__(self, ca=None, ca_overlap_interval=None, ca_rotate_interval=None, cert_rotate_interval=None, server=None, _configuration=None):  # noqa: E501
        """V1KubeVirtSelfSignConfiguration - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._ca = None
        self._ca_overlap_interval = None
        self._ca_rotate_interval = None
        self._cert_rotate_interval = None
        self._server = None
        self.discriminator = None

        if ca is not None:
            self.ca = ca
        if ca_overlap_interval is not None:
            self.ca_overlap_interval = ca_overlap_interval
        if ca_rotate_interval is not None:
            self.ca_rotate_interval = ca_rotate_interval
        if cert_rotate_interval is not None:
            self.cert_rotate_interval = cert_rotate_interval
        if server is not None:
            self.server = server

    @property
    def ca(self):
        """Gets the ca of this V1KubeVirtSelfSignConfiguration.  # noqa: E501

        CA configuration CA certs are kept in the CA bundle as long as they are valid  # noqa: E501

        :return: The ca of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :rtype: V1CertConfig
        """
        return self._ca

    @ca.setter
    def ca(self, ca):
        """Sets the ca of this V1KubeVirtSelfSignConfiguration.

        CA configuration CA certs are kept in the CA bundle as long as they are valid  # noqa: E501

        :param ca: The ca of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :type: V1CertConfig
        """

        self._ca = ca

    @property
    def ca_overlap_interval(self):
        """Gets the ca_overlap_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501

        Deprecated. Use CA.Duration and CA.RenewBefore instead  # noqa: E501

        :return: The ca_overlap_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :rtype: K8sIoApimachineryPkgApisMetaV1Duration
        """
        return self._ca_overlap_interval

    @ca_overlap_interval.setter
    def ca_overlap_interval(self, ca_overlap_interval):
        """Sets the ca_overlap_interval of this V1KubeVirtSelfSignConfiguration.

        Deprecated. Use CA.Duration and CA.RenewBefore instead  # noqa: E501

        :param ca_overlap_interval: The ca_overlap_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :type: K8sIoApimachineryPkgApisMetaV1Duration
        """

        self._ca_overlap_interval = ca_overlap_interval

    @property
    def ca_rotate_interval(self):
        """Gets the ca_rotate_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501

        Deprecated. Use CA.Duration instead  # noqa: E501

        :return: The ca_rotate_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :rtype: K8sIoApimachineryPkgApisMetaV1Duration
        """
        return self._ca_rotate_interval

    @ca_rotate_interval.setter
    def ca_rotate_interval(self, ca_rotate_interval):
        """Sets the ca_rotate_interval of this V1KubeVirtSelfSignConfiguration.

        Deprecated. Use CA.Duration instead  # noqa: E501

        :param ca_rotate_interval: The ca_rotate_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :type: K8sIoApimachineryPkgApisMetaV1Duration
        """

        self._ca_rotate_interval = ca_rotate_interval

    @property
    def cert_rotate_interval(self):
        """Gets the cert_rotate_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501

        Deprecated. Use Server.Duration instead  # noqa: E501

        :return: The cert_rotate_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :rtype: K8sIoApimachineryPkgApisMetaV1Duration
        """
        return self._cert_rotate_interval

    @cert_rotate_interval.setter
    def cert_rotate_interval(self, cert_rotate_interval):
        """Sets the cert_rotate_interval of this V1KubeVirtSelfSignConfiguration.

        Deprecated. Use Server.Duration instead  # noqa: E501

        :param cert_rotate_interval: The cert_rotate_interval of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :type: K8sIoApimachineryPkgApisMetaV1Duration
        """

        self._cert_rotate_interval = cert_rotate_interval

    @property
    def server(self):
        """Gets the server of this V1KubeVirtSelfSignConfiguration.  # noqa: E501

        Server configuration Certs are rotated and discarded  # noqa: E501

        :return: The server of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :rtype: V1CertConfig
        """
        return self._server

    @server.setter
    def server(self, server):
        """Sets the server of this V1KubeVirtSelfSignConfiguration.

        Server configuration Certs are rotated and discarded  # noqa: E501

        :param server: The server of this V1KubeVirtSelfSignConfiguration.  # noqa: E501
        :type: V1CertConfig
        """

        self._server = server

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(V1KubeVirtSelfSignConfiguration, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, V1KubeVirtSelfSignConfiguration):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, V1KubeVirtSelfSignConfiguration):
            return True

        return self.to_dict() != other.to_dict()
