# coding: utf-8

"""
    PowerMeter API

    API  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from powermeter_api.configuration import Configuration


class DesignPin(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 = {
        'id': 'int',
        'name': 'str',
        'direction': 'str',
        'type': 'str',
        'bus': 'str',
        'bus_index': 'int',
        'bundle': 'str',
        'bundle_index': 'int',
        'pin_caps': 'list[PinCap]',
        'power_count': 'int',
        'function': 'str',
        'internal_node': 'str'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'direction': 'direction',
        'type': 'type',
        'bus': 'bus',
        'bus_index': 'bus_index',
        'bundle': 'bundle',
        'bundle_index': 'bundle_index',
        'pin_caps': 'pin_caps',
        'power_count': 'power_count',
        'function': 'function',
        'internal_node': 'internal_node'
    }

    def __init__(self, id=None, name=None, direction=None, type=None, bus=None, bus_index=None, bundle=None, bundle_index=None, pin_caps=None, power_count=None, function=None, internal_node=None, local_vars_configuration=None):  # noqa: E501
        """DesignPin - 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._id = None
        self._name = None
        self._direction = None
        self._type = None
        self._bus = None
        self._bus_index = None
        self._bundle = None
        self._bundle_index = None
        self._pin_caps = None
        self._power_count = None
        self._function = None
        self._internal_node = None
        self.discriminator = None

        if id is not None:
            self.id = id
        self.name = name
        self.direction = direction
        self.type = type
        self.bus = bus
        self.bus_index = bus_index
        self.bundle = bundle
        self.bundle_index = bundle_index
        if pin_caps is not None:
            self.pin_caps = pin_caps
        if power_count is not None:
            self.power_count = power_count
        self.function = function
        self.internal_node = internal_node

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


        :return: The id of this DesignPin.  # noqa: E501
        :rtype: int
        """
        return self._id

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


        :param id: The id of this DesignPin.  # noqa: E501
        :type: int
        """

        self._id = id

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


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

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


        :param name: The name of this DesignPin.  # 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
        if (self.local_vars_configuration.client_side_validation and
                name is not None and len(name) < 1):
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")  # noqa: E501

        self._name = name

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


        :return: The direction of this DesignPin.  # noqa: E501
        :rtype: str
        """
        return self._direction

    @direction.setter
    def direction(self, direction):
        """Sets the direction of this DesignPin.


        :param direction: The direction of this DesignPin.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and direction is None:  # noqa: E501
            raise ValueError("Invalid value for `direction`, must not be `None`")  # noqa: E501
        allowed_values = ["input", "output", "inout", "internal"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and direction not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `direction` ({0}), must be one of {1}"  # noqa: E501
                .format(direction, allowed_values)
            )

        self._direction = direction

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


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

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


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

        self._type = type

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


        :return: The bus of this DesignPin.  # noqa: E501
        :rtype: str
        """
        return self._bus

    @bus.setter
    def bus(self, bus):
        """Sets the bus of this DesignPin.


        :param bus: The bus of this DesignPin.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                bus is not None and len(bus) < 1):
            raise ValueError("Invalid value for `bus`, length must be greater than or equal to `1`")  # noqa: E501

        self._bus = bus

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


        :return: The bus_index of this DesignPin.  # noqa: E501
        :rtype: int
        """
        return self._bus_index

    @bus_index.setter
    def bus_index(self, bus_index):
        """Sets the bus_index of this DesignPin.


        :param bus_index: The bus_index of this DesignPin.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                bus_index is not None and bus_index > 2147483647):  # noqa: E501
            raise ValueError("Invalid value for `bus_index`, must be a value less than or equal to `2147483647`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                bus_index is not None and bus_index < -2147483648):  # noqa: E501
            raise ValueError("Invalid value for `bus_index`, must be a value greater than or equal to `-2147483648`")  # noqa: E501

        self._bus_index = bus_index

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


        :return: The bundle of this DesignPin.  # noqa: E501
        :rtype: str
        """
        return self._bundle

    @bundle.setter
    def bundle(self, bundle):
        """Sets the bundle of this DesignPin.


        :param bundle: The bundle of this DesignPin.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                bundle is not None and len(bundle) < 1):
            raise ValueError("Invalid value for `bundle`, length must be greater than or equal to `1`")  # noqa: E501

        self._bundle = bundle

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


        :return: The bundle_index of this DesignPin.  # noqa: E501
        :rtype: int
        """
        return self._bundle_index

    @bundle_index.setter
    def bundle_index(self, bundle_index):
        """Sets the bundle_index of this DesignPin.


        :param bundle_index: The bundle_index of this DesignPin.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                bundle_index is not None and bundle_index > 2147483647):  # noqa: E501
            raise ValueError("Invalid value for `bundle_index`, must be a value less than or equal to `2147483647`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                bundle_index is not None and bundle_index < 0):  # noqa: E501
            raise ValueError("Invalid value for `bundle_index`, must be a value greater than or equal to `0`")  # noqa: E501

        self._bundle_index = bundle_index

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


        :return: The pin_caps of this DesignPin.  # noqa: E501
        :rtype: list[PinCap]
        """
        return self._pin_caps

    @pin_caps.setter
    def pin_caps(self, pin_caps):
        """Sets the pin_caps of this DesignPin.


        :param pin_caps: The pin_caps of this DesignPin.  # noqa: E501
        :type: list[PinCap]
        """

        self._pin_caps = pin_caps

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


        :return: The power_count of this DesignPin.  # noqa: E501
        :rtype: int
        """
        return self._power_count

    @power_count.setter
    def power_count(self, power_count):
        """Sets the power_count of this DesignPin.


        :param power_count: The power_count of this DesignPin.  # noqa: E501
        :type: int
        """

        self._power_count = power_count

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


        :return: The function of this DesignPin.  # noqa: E501
        :rtype: str
        """
        return self._function

    @function.setter
    def function(self, function):
        """Sets the function of this DesignPin.


        :param function: The function of this DesignPin.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                function is not None and len(function) < 1):
            raise ValueError("Invalid value for `function`, length must be greater than or equal to `1`")  # noqa: E501

        self._function = function

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


        :return: The internal_node of this DesignPin.  # noqa: E501
        :rtype: str
        """
        return self._internal_node

    @internal_node.setter
    def internal_node(self, internal_node):
        """Sets the internal_node of this DesignPin.


        :param internal_node: The internal_node of this DesignPin.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                internal_node is not None and len(internal_node) < 1):
            raise ValueError("Invalid value for `internal_node`, length must be greater than or equal to `1`")  # noqa: E501

        self._internal_node = internal_node

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

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