# coding: utf-8

"""
    Kubernetes

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: release-1.35
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from kubernetes.client.configuration import Configuration


class V1beta1PodCertificateRequestStatus(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'begin_refresh_at': 'datetime',
        'certificate_chain': 'str',
        'conditions': 'list[V1Condition]',
        'not_after': 'datetime',
        'not_before': 'datetime'
    }

    attribute_map = {
        'begin_refresh_at': 'beginRefreshAt',
        'certificate_chain': 'certificateChain',
        'conditions': 'conditions',
        'not_after': 'notAfter',
        'not_before': 'notBefore'
    }

    def __init__(self, begin_refresh_at=None, certificate_chain=None, conditions=None, not_after=None, not_before=None, local_vars_configuration=None):  # noqa: E501
        """V1beta1PodCertificateRequestStatus - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._begin_refresh_at = None
        self._certificate_chain = None
        self._conditions = None
        self._not_after = None
        self._not_before = None
        self.discriminator = None

        if begin_refresh_at is not None:
            self.begin_refresh_at = begin_refresh_at
        if certificate_chain is not None:
            self.certificate_chain = certificate_chain
        if conditions is not None:
            self.conditions = conditions
        if not_after is not None:
            self.not_after = not_after
        if not_before is not None:
            self.not_before = not_before

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

        beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate.  This field is set via the /status subresource, and must be set at the same time as certificateChain.  Once populated, this field is immutable.  This field is only a hint.  Kubelet may start refreshing before or after this time if necessary.  # noqa: E501

        :return: The begin_refresh_at of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :rtype: datetime
        """
        return self._begin_refresh_at

    @begin_refresh_at.setter
    def begin_refresh_at(self, begin_refresh_at):
        """Sets the begin_refresh_at of this V1beta1PodCertificateRequestStatus.

        beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate.  This field is set via the /status subresource, and must be set at the same time as certificateChain.  Once populated, this field is immutable.  This field is only a hint.  Kubelet may start refreshing before or after this time if necessary.  # noqa: E501

        :param begin_refresh_at: The begin_refresh_at of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :type: datetime
        """

        self._begin_refresh_at = begin_refresh_at

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

        certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable.  If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty.  Validation requirements:  1. certificateChain must consist of one or more PEM-formatted certificates.  2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as     described in section 4 of RFC5280.  If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes.  When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers.  # noqa: E501

        :return: The certificate_chain of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :rtype: str
        """
        return self._certificate_chain

    @certificate_chain.setter
    def certificate_chain(self, certificate_chain):
        """Sets the certificate_chain of this V1beta1PodCertificateRequestStatus.

        certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable.  If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty.  Validation requirements:  1. certificateChain must consist of one or more PEM-formatted certificates.  2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as     described in section 4 of RFC5280.  If more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes.  When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers.  # noqa: E501

        :param certificate_chain: The certificate_chain of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :type: str
        """

        self._certificate_chain = certificate_chain

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

        conditions applied to the request.  The types \"Issued\", \"Denied\", and \"Failed\" have special handling.  At most one of these conditions may be present, and they must have status \"True\".  If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field.  # noqa: E501

        :return: The conditions of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :rtype: list[V1Condition]
        """
        return self._conditions

    @conditions.setter
    def conditions(self, conditions):
        """Sets the conditions of this V1beta1PodCertificateRequestStatus.

        conditions applied to the request.  The types \"Issued\", \"Denied\", and \"Failed\" have special handling.  At most one of these conditions may be present, and they must have status \"True\".  If the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field.  # noqa: E501

        :param conditions: The conditions of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :type: list[V1Condition]
        """

        self._conditions = conditions

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

        notAfter is the time at which the certificate expires.  The value must be the same as the notAfter value in the leaf certificate in certificateChain.  This field is set via the /status subresource.  Once populated, it is immutable.  The signer must set this field at the same time it sets certificateChain.  # noqa: E501

        :return: The not_after of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :rtype: datetime
        """
        return self._not_after

    @not_after.setter
    def not_after(self, not_after):
        """Sets the not_after of this V1beta1PodCertificateRequestStatus.

        notAfter is the time at which the certificate expires.  The value must be the same as the notAfter value in the leaf certificate in certificateChain.  This field is set via the /status subresource.  Once populated, it is immutable.  The signer must set this field at the same time it sets certificateChain.  # noqa: E501

        :param not_after: The not_after of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :type: datetime
        """

        self._not_after = not_after

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

        notBefore is the time at which the certificate becomes valid.  The value must be the same as the notBefore value in the leaf certificate in certificateChain.  This field is set via the /status subresource.  Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.  # noqa: E501

        :return: The not_before of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :rtype: datetime
        """
        return self._not_before

    @not_before.setter
    def not_before(self, not_before):
        """Sets the not_before of this V1beta1PodCertificateRequestStatus.

        notBefore is the time at which the certificate becomes valid.  The value must be the same as the notBefore value in the leaf certificate in certificateChain.  This field is set via the /status subresource.  Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.  # noqa: E501

        :param not_before: The not_before of this V1beta1PodCertificateRequestStatus.  # noqa: E501
        :type: datetime
        """

        self._not_before = not_before

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

        for attr, _ in six.iteritems(self.openapi_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

        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, V1beta1PodCertificateRequestStatus):
            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, V1beta1PodCertificateRequestStatus):
            return True

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