# coding: utf-8

"""
    ThingsBoard REST API

     ThingsBoard open-source IoT platform REST API documentation.  # noqa: E501

    OpenAPI spec version: 3.7.0
    Contact: info@thingsboard.io
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

#  Copyright 2024. ThingsBoard
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

import pprint
import re  # noqa: F401

import six

class DeviceCredentials(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 = {
        'id': 'DeviceCredentialsId',
        'created_time': 'int',
        'device_id': 'DeviceId',
        'credentials_type': 'str',
        'credentials_id': 'str',
        'credentials_value': 'str'
    }

    attribute_map = {
        'id': 'id',
        'created_time': 'createdTime',
        'device_id': 'deviceId',
        'credentials_type': 'credentialsType',
        'credentials_id': 'credentialsId',
        'credentials_value': 'credentialsValue'
    }

    def __init__(self, id=None, created_time=None, device_id=None, credentials_type=None, credentials_id=None, credentials_value=None):  # noqa: E501
        """DeviceCredentials - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._created_time = None
        self._device_id = None
        self._credentials_type = None
        self._credentials_id = None
        self._credentials_value = None
        self.discriminator = None
        self.id = id
        if created_time is not None:
            self.created_time = created_time
        self.device_id = device_id
        if credentials_type is not None:
            self.credentials_type = credentials_type
        self.credentials_id = credentials_id
        if credentials_value is not None:
            self.credentials_value = credentials_value

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


        :return: The id of this DeviceCredentials.  # noqa: E501
        :rtype: DeviceCredentialsId
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this DeviceCredentials.


        :param id: The id of this DeviceCredentials.  # noqa: E501
        :type: DeviceCredentialsId
        """

        self._id = id

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

        Timestamp of the device credentials creation, in milliseconds  # noqa: E501

        :return: The created_time of this DeviceCredentials.  # noqa: E501
        :rtype: int
        """
        return self._created_time

    @created_time.setter
    def created_time(self, created_time):
        """Sets the created_time of this DeviceCredentials.

        Timestamp of the device credentials creation, in milliseconds  # noqa: E501

        :param created_time: The created_time of this DeviceCredentials.  # noqa: E501
        :type: int
        """

        self._created_time = created_time

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


        :return: The device_id of this DeviceCredentials.  # noqa: E501
        :rtype: DeviceId
        """
        return self._device_id

    @device_id.setter
    def device_id(self, device_id):
        """Sets the device_id of this DeviceCredentials.


        :param device_id: The device_id of this DeviceCredentials.  # noqa: E501
        :type: DeviceId
        """

        self._device_id = device_id

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

        Type of the credentials  # noqa: E501

        :return: The credentials_type of this DeviceCredentials.  # noqa: E501
        :rtype: str
        """
        return self._credentials_type

    @credentials_type.setter
    def credentials_type(self, credentials_type):
        """Sets the credentials_type of this DeviceCredentials.

        Type of the credentials  # noqa: E501

        :param credentials_type: The credentials_type of this DeviceCredentials.  # noqa: E501
        :type: str
        """
        allowed_values = ["ACCESS_TOKEN", "LWM2M_CREDENTIALS", "MQTT_BASIC", "X509_CERTIFICATE"]  # noqa: E501
        if credentials_type not in allowed_values:
            raise ValueError(
                "Invalid value for `credentials_type` ({0}), must be one of {1}"  # noqa: E501
                .format(credentials_type, allowed_values)
            )

        self._credentials_type = credentials_type

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

        Unique Credentials Id per platform instance. Used to lookup credentials from the database. By default, new access token for your device. Depends on the type of the credentials.  # noqa: E501

        :return: The credentials_id of this DeviceCredentials.  # noqa: E501
        :rtype: str
        """
        return self._credentials_id

    @credentials_id.setter
    def credentials_id(self, credentials_id):
        """Sets the credentials_id of this DeviceCredentials.

        Unique Credentials Id per platform instance. Used to lookup credentials from the database. By default, new access token for your device. Depends on the type of the credentials.  # noqa: E501

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

        self._credentials_id = credentials_id

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

        Value of the credentials. Null in case of ACCESS_TOKEN credentials type. Base64 value in case of X509_CERTIFICATE. Complex object in case of MQTT_BASIC and LWM2M_CREDENTIALS  # noqa: E501

        :return: The credentials_value of this DeviceCredentials.  # noqa: E501
        :rtype: str
        """
        return self._credentials_value

    @credentials_value.setter
    def credentials_value(self, credentials_value):
        """Sets the credentials_value of this DeviceCredentials.

        Value of the credentials. Null in case of ACCESS_TOKEN credentials type. Base64 value in case of X509_CERTIFICATE. Complex object in case of MQTT_BASIC and LWM2M_CREDENTIALS  # noqa: E501

        :param credentials_value: The credentials_value of this DeviceCredentials.  # noqa: E501
        :type: str
        """

        self._credentials_value = credentials_value

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

        return self.__dict__ == other.__dict__

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