# coding: utf-8

"""
    external/v1/external_session_service.proto

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: version not set
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git

    NOTE
    ----
    standard swagger-codegen-cli for this python client has been modified
    by custom templates. The purpose of these templates is to include
    typing information in the API and Model code. Please refer to the
    main grid repository for more info
"""


import pprint
import re  # noqa: F401
from typing import TYPE_CHECKING

import six

from grid.openapi.configuration import Configuration

if TYPE_CHECKING:
    from datetime import datetime
    from grid.openapi.models import *

class V1Credential(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 = {
        'cluster_id': 'str',
        'creation_timestamp': 'datetime',
        'credential': 'str',
        'deletion_timestamp': 'datetime',
        'id': 'str',
        'type': 'V1CredentialType',
        'update_timestamp': 'datetime',
        'user_id': 'str'
    }

    attribute_map = {
        'cluster_id': 'clusterId',
        'creation_timestamp': 'creationTimestamp',
        'credential': 'credential',
        'deletion_timestamp': 'deletionTimestamp',
        'id': 'id',
        'type': 'type',
        'update_timestamp': 'updateTimestamp',
        'user_id': 'userId'
    }

    def __init__(self, cluster_id: 'str' = None, creation_timestamp: 'datetime' = None, credential: 'str' = None, deletion_timestamp: 'datetime' = None, id: 'str' = None, type: 'V1CredentialType' = None, update_timestamp: 'datetime' = None, user_id: 'str' = None, _configuration=None):  # noqa: E501
        """V1Credential - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._cluster_id = None
        self._creation_timestamp = None
        self._credential = None
        self._deletion_timestamp = None
        self._id = None
        self._type = None
        self._update_timestamp = None
        self._user_id = None
        self.discriminator = None

        if cluster_id is not None:
            self.cluster_id = cluster_id
        if creation_timestamp is not None:
            self.creation_timestamp = creation_timestamp
        if credential is not None:
            self.credential = credential
        if deletion_timestamp is not None:
            self.deletion_timestamp = deletion_timestamp
        if id is not None:
            self.id = id
        if type is not None:
            self.type = type
        if update_timestamp is not None:
            self.update_timestamp = update_timestamp
        if user_id is not None:
            self.user_id = user_id

    @property
    def cluster_id(self) -> 'str':
        """Gets the cluster_id of this V1Credential.  # noqa: E501


        :return: The cluster_id of this V1Credential.  # noqa: E501
        :rtype: str
        """
        return self._cluster_id

    @cluster_id.setter
    def cluster_id(self, cluster_id: 'str'):
        """Sets the cluster_id of this V1Credential.


        :param cluster_id: The cluster_id of this V1Credential.  # noqa: E501
        :type: str
        """

        self._cluster_id = cluster_id

    @property
    def creation_timestamp(self) -> 'datetime':
        """Gets the creation_timestamp of this V1Credential.  # noqa: E501


        :return: The creation_timestamp of this V1Credential.  # noqa: E501
        :rtype: datetime
        """
        return self._creation_timestamp

    @creation_timestamp.setter
    def creation_timestamp(self, creation_timestamp: 'datetime'):
        """Sets the creation_timestamp of this V1Credential.


        :param creation_timestamp: The creation_timestamp of this V1Credential.  # noqa: E501
        :type: datetime
        """

        self._creation_timestamp = creation_timestamp

    @property
    def credential(self) -> 'str':
        """Gets the credential of this V1Credential.  # noqa: E501

        credential is a serialized json blob of a particular credential type. this is done since the protobuf oneof keyword presents a pretty horrible UX. it is upon the implementer of each `CredentialType` to implement their own serialization / deserialization routines.  # noqa: E501

        :return: The credential of this V1Credential.  # noqa: E501
        :rtype: str
        """
        return self._credential

    @credential.setter
    def credential(self, credential: 'str'):
        """Sets the credential of this V1Credential.

        credential is a serialized json blob of a particular credential type. this is done since the protobuf oneof keyword presents a pretty horrible UX. it is upon the implementer of each `CredentialType` to implement their own serialization / deserialization routines.  # noqa: E501

        :param credential: The credential of this V1Credential.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                credential is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', credential)):  # noqa: E501
            raise ValueError(r"Invalid value for `credential`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`")  # noqa: E501

        self._credential = credential

    @property
    def deletion_timestamp(self) -> 'datetime':
        """Gets the deletion_timestamp of this V1Credential.  # noqa: E501


        :return: The deletion_timestamp of this V1Credential.  # noqa: E501
        :rtype: datetime
        """
        return self._deletion_timestamp

    @deletion_timestamp.setter
    def deletion_timestamp(self, deletion_timestamp: 'datetime'):
        """Sets the deletion_timestamp of this V1Credential.


        :param deletion_timestamp: The deletion_timestamp of this V1Credential.  # noqa: E501
        :type: datetime
        """

        self._deletion_timestamp = deletion_timestamp

    @property
    def id(self) -> 'str':
        """Gets the id of this V1Credential.  # noqa: E501


        :return: The id of this V1Credential.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id: 'str'):
        """Sets the id of this V1Credential.


        :param id: The id of this V1Credential.  # noqa: E501
        :type: str
        """

        self._id = id

    @property
    def type(self) -> 'V1CredentialType':
        """Gets the type of this V1Credential.  # noqa: E501


        :return: The type of this V1Credential.  # noqa: E501
        :rtype: V1CredentialType
        """
        return self._type

    @type.setter
    def type(self, type: 'V1CredentialType'):
        """Sets the type of this V1Credential.


        :param type: The type of this V1Credential.  # noqa: E501
        :type: V1CredentialType
        """

        self._type = type

    @property
    def update_timestamp(self) -> 'datetime':
        """Gets the update_timestamp of this V1Credential.  # noqa: E501


        :return: The update_timestamp of this V1Credential.  # noqa: E501
        :rtype: datetime
        """
        return self._update_timestamp

    @update_timestamp.setter
    def update_timestamp(self, update_timestamp: 'datetime'):
        """Sets the update_timestamp of this V1Credential.


        :param update_timestamp: The update_timestamp of this V1Credential.  # noqa: E501
        :type: datetime
        """

        self._update_timestamp = update_timestamp

    @property
    def user_id(self) -> 'str':
        """Gets the user_id of this V1Credential.  # noqa: E501


        :return: The user_id of this V1Credential.  # noqa: E501
        :rtype: str
        """
        return self._user_id

    @user_id.setter
    def user_id(self, user_id: 'str'):
        """Sets the user_id of this V1Credential.


        :param user_id: The user_id of this V1Credential.  # noqa: E501
        :type: str
        """

        self._user_id = user_id

    def to_dict(self) -> dict:
        """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(V1Credential, dict):
            for key, value in self.items():
                result[key] = value

        return result

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

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

    def __eq__(self, other: 'V1Credential') -> bool:
        """Returns true if both objects are equal"""
        if not isinstance(other, V1Credential):
            return False

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

    def __ne__(self, other: 'V1Credential') -> bool:
        """Returns true if both objects are not equal"""
        if not isinstance(other, V1Credential):
            return True

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