# coding: utf-8

"""
    BIMData API

    BIMData API is a tool to interact with your models stored on BIMData’s servers.     Through the API, you can manage your projects, the clouds, upload your IFC files and manage them through endpoints.  # noqa: E501

    The version of the OpenAPI document: v1
    Contact: support@bimdata.io
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from bimdata_api_client.configuration import Configuration


class RuleComponent(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',
        'type': 'str',
        'value': 'object',
        'operator': 'str',
        'params': 'object',
        'condition': 'str',
        'rule_components': 'object'
    }

    attribute_map = {
        'id': 'id',
        'type': 'type',
        'value': 'value',
        'operator': 'operator',
        'params': 'params',
        'condition': 'condition',
        'rule_components': 'rule_components'
    }

    def __init__(self, id=None, type=None, value=None, operator=None, params=None, condition=None, rule_components=None, local_vars_configuration=None):  # noqa: E501
        """RuleComponent - 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._type = None
        self._value = None
        self._operator = None
        self._params = None
        self._condition = None
        self._rule_components = None
        self.discriminator = None

        if id is not None:
            self.id = id
        self.type = type
        self.value = value
        self.operator = operator
        self.params = params
        self.condition = condition
        self.rule_components = rule_components

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


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

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


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

        self._id = id

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


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

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


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

        self._type = type

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


        :return: The value of this RuleComponent.  # noqa: E501
        :rtype: object
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this RuleComponent.


        :param value: The value of this RuleComponent.  # noqa: E501
        :type: object
        """

        self._value = value

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


        :return: The operator of this RuleComponent.  # noqa: E501
        :rtype: str
        """
        return self._operator

    @operator.setter
    def operator(self, operator):
        """Sets the operator of this RuleComponent.


        :param operator: The operator of this RuleComponent.  # noqa: E501
        :type: str
        """

        self._operator = operator

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


        :return: The params of this RuleComponent.  # noqa: E501
        :rtype: object
        """
        return self._params

    @params.setter
    def params(self, params):
        """Sets the params of this RuleComponent.


        :param params: The params of this RuleComponent.  # noqa: E501
        :type: object
        """

        self._params = params

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


        :return: The condition of this RuleComponent.  # noqa: E501
        :rtype: str
        """
        return self._condition

    @condition.setter
    def condition(self, condition):
        """Sets the condition of this RuleComponent.


        :param condition: The condition of this RuleComponent.  # noqa: E501
        :type: str
        """

        self._condition = condition

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


        :return: The rule_components of this RuleComponent.  # noqa: E501
        :rtype: object
        """
        return self._rule_components

    @rule_components.setter
    def rule_components(self, rule_components):
        """Sets the rule_components of this RuleComponent.


        :param rule_components: The rule_components of this RuleComponent.  # noqa: E501
        :type: object
        """

        self._rule_components = rule_components

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

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