# coding: utf-8

"""
    Arduino IoT Cloud API

     Provides a set of endpoints to manage Arduino IoT Cloud **Devices**, **Things**, **Properties** and **Timeseries**. This API can be called just with any HTTP Client, or using one of these clients:  * [Javascript NPM package](https://www.npmjs.com/package/@arduino/arduino-iot-client)  * [Python PYPI Package](https://pypi.org/project/arduino-iot-client/)  * [Golang Module](https://github.com/arduino/iot-client-go)  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from iot_api_client.configuration import Configuration


class ArduinoDevicev2(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 = {
        'connection_type': 'str',
        'created_at': 'datetime',
        'events': 'list[ArduinoDevicev2SimpleProperties]',
        'fqbn': 'str',
        'href': 'str',
        'id': 'str',
        'label': 'str',
        'last_activity_at': 'datetime',
        'latest_wifi_fw_version': 'str',
        'metadata': 'dict(str, object)',
        'name': 'str',
        'no_sketch': 'bool',
        'organization_id': 'str',
        'ota_available': 'bool',
        'ota_compatible': 'bool',
        'required_wifi_fw_version': 'str',
        'serial': 'str',
        'tags': 'dict(str, object)',
        'thing': 'ArduinoThing',
        'type': 'str',
        'user_id': 'str',
        'webhooks': 'list[ArduinoDevicev2Webhook]',
        'wifi_fw_version': 'str'
    }

    attribute_map = {
        'connection_type': 'connection_type',
        'created_at': 'created_at',
        'events': 'events',
        'fqbn': 'fqbn',
        'href': 'href',
        'id': 'id',
        'label': 'label',
        'last_activity_at': 'last_activity_at',
        'latest_wifi_fw_version': 'latest_wifi_fw_version',
        'metadata': 'metadata',
        'name': 'name',
        'no_sketch': 'no_sketch',
        'organization_id': 'organization_id',
        'ota_available': 'ota_available',
        'ota_compatible': 'ota_compatible',
        'required_wifi_fw_version': 'required_wifi_fw_version',
        'serial': 'serial',
        'tags': 'tags',
        'thing': 'thing',
        'type': 'type',
        'user_id': 'user_id',
        'webhooks': 'webhooks',
        'wifi_fw_version': 'wifi_fw_version'
    }

    def __init__(self, connection_type=None, created_at=None, events=None, fqbn=None, href=None, id=None, label=None, last_activity_at=None, latest_wifi_fw_version=None, metadata=None, name=None, no_sketch=None, organization_id=None, ota_available=None, ota_compatible=None, required_wifi_fw_version=None, serial=None, tags=None, thing=None, type=None, user_id=None, webhooks=None, wifi_fw_version=None, local_vars_configuration=None):  # noqa: E501
        """ArduinoDevicev2 - 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._connection_type = None
        self._created_at = None
        self._events = None
        self._fqbn = None
        self._href = None
        self._id = None
        self._label = None
        self._last_activity_at = None
        self._latest_wifi_fw_version = None
        self._metadata = None
        self._name = None
        self._no_sketch = None
        self._organization_id = None
        self._ota_available = None
        self._ota_compatible = None
        self._required_wifi_fw_version = None
        self._serial = None
        self._tags = None
        self._thing = None
        self._type = None
        self._user_id = None
        self._webhooks = None
        self._wifi_fw_version = None
        self.discriminator = None

        if connection_type is not None:
            self.connection_type = connection_type
        if created_at is not None:
            self.created_at = created_at
        if events is not None:
            self.events = events
        if fqbn is not None:
            self.fqbn = fqbn
        self.href = href
        self.id = id
        self.label = label
        if last_activity_at is not None:
            self.last_activity_at = last_activity_at
        if latest_wifi_fw_version is not None:
            self.latest_wifi_fw_version = latest_wifi_fw_version
        if metadata is not None:
            self.metadata = metadata
        self.name = name
        if no_sketch is not None:
            self.no_sketch = no_sketch
        if organization_id is not None:
            self.organization_id = organization_id
        if ota_available is not None:
            self.ota_available = ota_available
        if ota_compatible is not None:
            self.ota_compatible = ota_compatible
        if required_wifi_fw_version is not None:
            self.required_wifi_fw_version = required_wifi_fw_version
        self.serial = serial
        if tags is not None:
            self.tags = tags
        if thing is not None:
            self.thing = thing
        self.type = type
        self.user_id = user_id
        if webhooks is not None:
            self.webhooks = webhooks
        if wifi_fw_version is not None:
            self.wifi_fw_version = wifi_fw_version

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

        The type of the connections selected by the user when multiple connections are available  # noqa: E501

        :return: The connection_type of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._connection_type

    @connection_type.setter
    def connection_type(self, connection_type):
        """Sets the connection_type of this ArduinoDevicev2.

        The type of the connections selected by the user when multiple connections are available  # noqa: E501

        :param connection_type: The connection_type of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """
        allowed_values = ["wifi", "eth", "wifiandsecret", "gsm", "nb", "lora"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and connection_type not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `connection_type` ({0}), must be one of {1}"  # noqa: E501
                .format(connection_type, allowed_values)
            )

        self._connection_type = connection_type

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

        Creation date of the device  # noqa: E501

        :return: The created_at of this ArduinoDevicev2.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this ArduinoDevicev2.

        Creation date of the device  # noqa: E501

        :param created_at: The created_at of this ArduinoDevicev2.  # noqa: E501
        :type: datetime
        """

        self._created_at = created_at

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

        ArduinoDevicev2SimplePropertiesCollection is the media type for an array of ArduinoDevicev2SimpleProperties (default view)  # noqa: E501

        :return: The events of this ArduinoDevicev2.  # noqa: E501
        :rtype: list[ArduinoDevicev2SimpleProperties]
        """
        return self._events

    @events.setter
    def events(self, events):
        """Sets the events of this ArduinoDevicev2.

        ArduinoDevicev2SimplePropertiesCollection is the media type for an array of ArduinoDevicev2SimpleProperties (default view)  # noqa: E501

        :param events: The events of this ArduinoDevicev2.  # noqa: E501
        :type: list[ArduinoDevicev2SimpleProperties]
        """

        self._events = events

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

        The fully qualified board name  # noqa: E501

        :return: The fqbn of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._fqbn

    @fqbn.setter
    def fqbn(self, fqbn):
        """Sets the fqbn of this ArduinoDevicev2.

        The fully qualified board name  # noqa: E501

        :param fqbn: The fqbn of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """

        self._fqbn = fqbn

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

        The api reference of this device  # noqa: E501

        :return: The href of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._href

    @href.setter
    def href(self, href):
        """Sets the href of this ArduinoDevicev2.

        The api reference of this device  # noqa: E501

        :param href: The href of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and href is None:  # noqa: E501
            raise ValueError("Invalid value for `href`, must not be `None`")  # noqa: E501

        self._href = href

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

        The arn of the device  # noqa: E501

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

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

        The arn of the device  # noqa: E501

        :param id: The id of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and id is None:  # noqa: E501
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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

        The label of the device  # noqa: E501

        :return: The label of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._label

    @label.setter
    def label(self, label):
        """Sets the label of this ArduinoDevicev2.

        The label of the device  # noqa: E501

        :param label: The label of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and label is None:  # noqa: E501
            raise ValueError("Invalid value for `label`, must not be `None`")  # noqa: E501

        self._label = label

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

        Last activity date  # noqa: E501

        :return: The last_activity_at of this ArduinoDevicev2.  # noqa: E501
        :rtype: datetime
        """
        return self._last_activity_at

    @last_activity_at.setter
    def last_activity_at(self, last_activity_at):
        """Sets the last_activity_at of this ArduinoDevicev2.

        Last activity date  # noqa: E501

        :param last_activity_at: The last_activity_at of this ArduinoDevicev2.  # noqa: E501
        :type: datetime
        """

        self._last_activity_at = last_activity_at

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

        The latest version of the NINA/WIFI101 firmware available for this device  # noqa: E501

        :return: The latest_wifi_fw_version of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._latest_wifi_fw_version

    @latest_wifi_fw_version.setter
    def latest_wifi_fw_version(self, latest_wifi_fw_version):
        """Sets the latest_wifi_fw_version of this ArduinoDevicev2.

        The latest version of the NINA/WIFI101 firmware available for this device  # noqa: E501

        :param latest_wifi_fw_version: The latest_wifi_fw_version of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """

        self._latest_wifi_fw_version = latest_wifi_fw_version

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

        The metadata of the device  # noqa: E501

        :return: The metadata of this ArduinoDevicev2.  # noqa: E501
        :rtype: dict(str, object)
        """
        return self._metadata

    @metadata.setter
    def metadata(self, metadata):
        """Sets the metadata of this ArduinoDevicev2.

        The metadata of the device  # noqa: E501

        :param metadata: The metadata of this ArduinoDevicev2.  # noqa: E501
        :type: dict(str, object)
        """

        self._metadata = metadata

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

        The friendly name of the device  # noqa: E501

        :return: The name of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this ArduinoDevicev2.

        The friendly name of the device  # noqa: E501

        :param name: The name of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

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

        True if the device type can not have an associated sketch  # noqa: E501

        :return: The no_sketch of this ArduinoDevicev2.  # noqa: E501
        :rtype: bool
        """
        return self._no_sketch

    @no_sketch.setter
    def no_sketch(self, no_sketch):
        """Sets the no_sketch of this ArduinoDevicev2.

        True if the device type can not have an associated sketch  # noqa: E501

        :param no_sketch: The no_sketch of this ArduinoDevicev2.  # noqa: E501
        :type: bool
        """

        self._no_sketch = no_sketch

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

        Id of the organization the device belongs to  # noqa: E501

        :return: The organization_id of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._organization_id

    @organization_id.setter
    def organization_id(self, organization_id):
        """Sets the organization_id of this ArduinoDevicev2.

        Id of the organization the device belongs to  # noqa: E501

        :param organization_id: The organization_id of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """

        self._organization_id = organization_id

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

        True if the device type is ready to receive OTA updated  # noqa: E501

        :return: The ota_available of this ArduinoDevicev2.  # noqa: E501
        :rtype: bool
        """
        return self._ota_available

    @ota_available.setter
    def ota_available(self, ota_available):
        """Sets the ota_available of this ArduinoDevicev2.

        True if the device type is ready to receive OTA updated  # noqa: E501

        :param ota_available: The ota_available of this ArduinoDevicev2.  # noqa: E501
        :type: bool
        """

        self._ota_available = ota_available

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

        True if the device type is OTA compatible  # noqa: E501

        :return: The ota_compatible of this ArduinoDevicev2.  # noqa: E501
        :rtype: bool
        """
        return self._ota_compatible

    @ota_compatible.setter
    def ota_compatible(self, ota_compatible):
        """Sets the ota_compatible of this ArduinoDevicev2.

        True if the device type is OTA compatible  # noqa: E501

        :param ota_compatible: The ota_compatible of this ArduinoDevicev2.  # noqa: E501
        :type: bool
        """

        self._ota_compatible = ota_compatible

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

        The required version of the NINA/WIFI101 firmware needed by IoT Cloud  # noqa: E501

        :return: The required_wifi_fw_version of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._required_wifi_fw_version

    @required_wifi_fw_version.setter
    def required_wifi_fw_version(self, required_wifi_fw_version):
        """Sets the required_wifi_fw_version of this ArduinoDevicev2.

        The required version of the NINA/WIFI101 firmware needed by IoT Cloud  # noqa: E501

        :param required_wifi_fw_version: The required_wifi_fw_version of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """

        self._required_wifi_fw_version = required_wifi_fw_version

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

        The serial uuid of the device  # noqa: E501

        :return: The serial of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._serial

    @serial.setter
    def serial(self, serial):
        """Sets the serial of this ArduinoDevicev2.

        The serial uuid of the device  # noqa: E501

        :param serial: The serial of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and serial is None:  # noqa: E501
            raise ValueError("Invalid value for `serial`, must not be `None`")  # noqa: E501

        self._serial = serial

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

        Tags belonging to the device  # noqa: E501

        :return: The tags of this ArduinoDevicev2.  # noqa: E501
        :rtype: dict(str, object)
        """
        return self._tags

    @tags.setter
    def tags(self, tags):
        """Sets the tags of this ArduinoDevicev2.

        Tags belonging to the device  # noqa: E501

        :param tags: The tags of this ArduinoDevicev2.  # noqa: E501
        :type: dict(str, object)
        """

        self._tags = tags

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


        :return: The thing of this ArduinoDevicev2.  # noqa: E501
        :rtype: ArduinoThing
        """
        return self._thing

    @thing.setter
    def thing(self, thing):
        """Sets the thing of this ArduinoDevicev2.


        :param thing: The thing of this ArduinoDevicev2.  # noqa: E501
        :type: ArduinoThing
        """

        self._thing = thing

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

        The type of the device  # noqa: E501

        :return: The type of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this ArduinoDevicev2.

        The type of the device  # noqa: E501

        :param type: The type of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and type is None:  # noqa: E501
            raise ValueError("Invalid value for `type`, must not be `None`")  # noqa: E501

        self._type = type

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

        The id of the user  # noqa: E501

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

    @user_id.setter
    def user_id(self, user_id):
        """Sets the user_id of this ArduinoDevicev2.

        The id of the user  # noqa: E501

        :param user_id: The user_id of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and user_id is None:  # noqa: E501
            raise ValueError("Invalid value for `user_id`, must not be `None`")  # noqa: E501

        self._user_id = user_id

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

        ArduinoDevicev2WebhookCollection is the media type for an array of ArduinoDevicev2Webhook (default view)  # noqa: E501

        :return: The webhooks of this ArduinoDevicev2.  # noqa: E501
        :rtype: list[ArduinoDevicev2Webhook]
        """
        return self._webhooks

    @webhooks.setter
    def webhooks(self, webhooks):
        """Sets the webhooks of this ArduinoDevicev2.

        ArduinoDevicev2WebhookCollection is the media type for an array of ArduinoDevicev2Webhook (default view)  # noqa: E501

        :param webhooks: The webhooks of this ArduinoDevicev2.  # noqa: E501
        :type: list[ArduinoDevicev2Webhook]
        """

        self._webhooks = webhooks

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

        The version of the NINA/WIFI101 firmware running on the device  # noqa: E501

        :return: The wifi_fw_version of this ArduinoDevicev2.  # noqa: E501
        :rtype: str
        """
        return self._wifi_fw_version

    @wifi_fw_version.setter
    def wifi_fw_version(self, wifi_fw_version):
        """Sets the wifi_fw_version of this ArduinoDevicev2.

        The version of the NINA/WIFI101 firmware running on the device  # noqa: E501

        :param wifi_fw_version: The wifi_fw_version of this ArduinoDevicev2.  # noqa: E501
        :type: str
        """

        self._wifi_fw_version = wifi_fw_version

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

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