# coding: utf-8

"""
    DeviceServer

    DeviceServer API  # noqa: E501

    The version of the OpenAPI document: 1.1.9
    Contact: david@3adesign.co.uk
    Generated by: https://openapi-generator.tech
"""


try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from DeviceServer.configuration import Configuration


class DeviceRxBuffer(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 = {
        'locator': 'str',
        'state': 'str',
        'timestamp_db_write': 'int',
        'timestamp_hid_message': 'int'
    }

    attribute_map = {
        'locator': 'locator',
        'state': 'state',
        'timestamp_db_write': 'timestamp_db_write',
        'timestamp_hid_message': 'timestamp_hid_message'
    }

    def __init__(self, locator=None, state=None, timestamp_db_write=None, timestamp_hid_message=None, local_vars_configuration=None):  # noqa: E501
        """DeviceRxBuffer - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._locator = None
        self._state = None
        self._timestamp_db_write = None
        self._timestamp_hid_message = None
        self.discriminator = None

        self.locator = locator
        if state is not None:
            self.state = state
        if timestamp_db_write is not None:
            self.timestamp_db_write = timestamp_db_write
        if timestamp_hid_message is not None:
            self.timestamp_hid_message = timestamp_hid_message

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


        :return: The locator of this DeviceRxBuffer.  # noqa: E501
        :rtype: str
        """
        return self._locator

    @locator.setter
    def locator(self, locator):
        """Sets the locator of this DeviceRxBuffer.


        :param locator: The locator of this DeviceRxBuffer.  # noqa: E501
        :type locator: str
        """
        if self.local_vars_configuration.client_side_validation and locator is None:  # noqa: E501
            raise ValueError("Invalid value for `locator`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                locator is not None and len(locator) > 100):
            raise ValueError("Invalid value for `locator`, length must be less than or equal to `100`")  # noqa: E501

        self._locator = locator

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


        :return: The state of this DeviceRxBuffer.  # noqa: E501
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this DeviceRxBuffer.


        :param state: The state of this DeviceRxBuffer.  # noqa: E501
        :type state: str
        """
        if (self.local_vars_configuration.client_side_validation and
                state is not None and len(state) > 100):
            raise ValueError("Invalid value for `state`, length must be less than or equal to `100`")  # noqa: E501

        self._state = state

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


        :return: The timestamp_db_write of this DeviceRxBuffer.  # noqa: E501
        :rtype: int
        """
        return self._timestamp_db_write

    @timestamp_db_write.setter
    def timestamp_db_write(self, timestamp_db_write):
        """Sets the timestamp_db_write of this DeviceRxBuffer.


        :param timestamp_db_write: The timestamp_db_write of this DeviceRxBuffer.  # noqa: E501
        :type timestamp_db_write: int
        """

        self._timestamp_db_write = timestamp_db_write

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


        :return: The timestamp_hid_message of this DeviceRxBuffer.  # noqa: E501
        :rtype: int
        """
        return self._timestamp_hid_message

    @timestamp_hid_message.setter
    def timestamp_hid_message(self, timestamp_hid_message):
        """Sets the timestamp_hid_message of this DeviceRxBuffer.


        :param timestamp_hid_message: The timestamp_hid_message of this DeviceRxBuffer.  # noqa: E501
        :type timestamp_hid_message: int
        """

        self._timestamp_hid_message = timestamp_hid_message

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

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(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, DeviceRxBuffer):
            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, DeviceRxBuffer):
            return True

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