# coding: utf-8

"""
    X-Road Security Server Admin API

    X-Road Security Server Admin API. Note that the error metadata responses described in some endpoints are subjects to change and may be updated in upcoming versions.  # noqa: E501

    OpenAPI spec version: 1.0.31
    Contact: <EMAIL>
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class TokenCertificate(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 = {
        'ocsp_status': 'CertificateOcspStatus',
        'owner_id': 'str',
        'active': 'bool',
        'saved_to_configuration': 'bool',
        'certificate_details': 'CertificateDetails',
        'status': 'CertificateStatus',
        'possible_actions': 'PossibleActions'
    }

    attribute_map = {
        'ocsp_status': 'ocsp_status',
        'owner_id': 'owner_id',
        'active': 'active',
        'saved_to_configuration': 'saved_to_configuration',
        'certificate_details': 'certificate_details',
        'status': 'status',
        'possible_actions': 'possible_actions'
    }

    def __init__(self, ocsp_status=None, owner_id=None, active=None, saved_to_configuration=None, certificate_details=None, status=None, possible_actions=None):  # noqa: E501
        """TokenCertificate - a model defined in Swagger"""  # noqa: E501
        self._ocsp_status = None
        self._owner_id = None
        self._active = None
        self._saved_to_configuration = None
        self._certificate_details = None
        self._status = None
        self._possible_actions = None
        self.discriminator = None
        self.ocsp_status = ocsp_status
        self.owner_id = owner_id
        self.active = active
        self.saved_to_configuration = saved_to_configuration
        self.certificate_details = certificate_details
        self.status = status
        if possible_actions is not None:
            self.possible_actions = possible_actions

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


        :return: The ocsp_status of this TokenCertificate.  # noqa: E501
        :rtype: CertificateOcspStatus
        """
        return self._ocsp_status

    @ocsp_status.setter
    def ocsp_status(self, ocsp_status):
        """Sets the ocsp_status of this TokenCertificate.


        :param ocsp_status: The ocsp_status of this TokenCertificate.  # noqa: E501
        :type: CertificateOcspStatus
        """
        #Can be missing at construction time
        #if ocsp_status is None:
        #    raise ValueError("Invalid value for `ocsp_status`, must not be `None`")  # noqa: E501

        self._ocsp_status = ocsp_status

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

        client id of the owner member, <instance_id>:<member_class>:<member_code>  # noqa: E501

        :return: The owner_id of this TokenCertificate.  # noqa: E501
        :rtype: str
        """
        return self._owner_id

    @owner_id.setter
    def owner_id(self, owner_id):
        """Sets the owner_id of this TokenCertificate.

        client id of the owner member, <instance_id>:<member_class>:<member_code>  # noqa: E501

        :param owner_id: The owner_id of this TokenCertificate.  # noqa: E501
        :type: str
        """
        #TODO: see if there is another way around the fact that development environment tokens do not have owner_id
        #if owner_id is None:
        #    raise ValueError("Invalid value for `owner_id`, must not be `None`")  # noqa: E501

        self._owner_id = owner_id

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

        if the certificate is active  # noqa: E501

        :return: The active of this TokenCertificate.  # noqa: E501
        :rtype: bool
        """
        return self._active

    @active.setter
    def active(self, active):
        """Sets the active of this TokenCertificate.

        if the certificate is active  # noqa: E501

        :param active: The active of this TokenCertificate.  # noqa: E501
        :type: bool
        """
        if active is None:
            raise ValueError("Invalid value for `active`, must not be `None`")  # noqa: E501

        self._active = active

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

        if the certificate is saved to configuration  # noqa: E501

        :return: The saved_to_configuration of this TokenCertificate.  # noqa: E501
        :rtype: bool
        """
        return self._saved_to_configuration

    @saved_to_configuration.setter
    def saved_to_configuration(self, saved_to_configuration):
        """Sets the saved_to_configuration of this TokenCertificate.

        if the certificate is saved to configuration  # noqa: E501

        :param saved_to_configuration: The saved_to_configuration of this TokenCertificate.  # noqa: E501
        :type: bool
        """
        if saved_to_configuration is None:
            raise ValueError("Invalid value for `saved_to_configuration`, must not be `None`")  # noqa: E501

        self._saved_to_configuration = saved_to_configuration

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


        :return: The certificate_details of this TokenCertificate.  # noqa: E501
        :rtype: CertificateDetails
        """
        return self._certificate_details

    @certificate_details.setter
    def certificate_details(self, certificate_details):
        """Sets the certificate_details of this TokenCertificate.


        :param certificate_details: The certificate_details of this TokenCertificate.  # noqa: E501
        :type: CertificateDetails
        """
        if certificate_details is None:
            raise ValueError("Invalid value for `certificate_details`, must not be `None`")  # noqa: E501

        self._certificate_details = certificate_details

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


        :return: The status of this TokenCertificate.  # noqa: E501
        :rtype: CertificateStatus
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this TokenCertificate.


        :param status: The status of this TokenCertificate.  # noqa: E501
        :type: CertificateStatus
        """
        if status is None:
            raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501

        self._status = status

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


        :return: The possible_actions of this TokenCertificate.  # noqa: E501
        :rtype: PossibleActions
        """
        return self._possible_actions

    @possible_actions.setter
    def possible_actions(self, possible_actions):
        """Sets the possible_actions of this TokenCertificate.


        :param possible_actions: The possible_actions of this TokenCertificate.  # noqa: E501
        :type: PossibleActions
        """

        self._possible_actions = possible_actions

    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(TokenCertificate, 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, TokenCertificate):
            return False

        return self.__dict__ == other.__dict__

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