# coding: utf-8

"""
    Onshape REST API

    The Onshape REST API consumed by all clients.  # noqa: E501

    The version of the OpenAPI document: 1.106
    Contact: api-support@onshape.zendesk.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class BTPExpressionOperator(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 = {
        'import_microversion': 'str',
        'for_export': 'bool',
        'operand1': 'BTPExpression',
        'operand2': 'BTPExpression',
        'operator': 'str',
        'global_namespace': 'bool',
        'written_as_function_call': 'bool',
        'space_after_namespace': 'BTPSpace',
        'space_before_operator': 'BTPSpace',
        'space_after_operator': 'BTPSpace',
        'operand3': 'BTPExpression',
        'namespace': 'list[BTPIdentifier]'
    }

    attribute_map = {
        'import_microversion': 'importMicroversion',
        'for_export': 'forExport',
        'operand1': 'operand1',
        'operand2': 'operand2',
        'operator': 'operator',
        'global_namespace': 'globalNamespace',
        'written_as_function_call': 'writtenAsFunctionCall',
        'space_after_namespace': 'spaceAfterNamespace',
        'space_before_operator': 'spaceBeforeOperator',
        'space_after_operator': 'spaceAfterOperator',
        'operand3': 'operand3',
        'namespace': 'namespace'
    }

    def __init__(self, import_microversion=None, for_export=None, operand1=None, operand2=None, operator=None, global_namespace=None, written_as_function_call=None, space_after_namespace=None, space_before_operator=None, space_after_operator=None, operand3=None, namespace=None):  # noqa: E501
        """BTPExpressionOperator - a model defined in OpenAPI"""  # noqa: E501

        self._import_microversion = None
        self._for_export = None
        self._operand1 = None
        self._operand2 = None
        self._operator = None
        self._global_namespace = None
        self._written_as_function_call = None
        self._space_after_namespace = None
        self._space_before_operator = None
        self._space_after_operator = None
        self._operand3 = None
        self._namespace = None
        self.discriminator = None

        if import_microversion is not None:
            self.import_microversion = import_microversion
        if for_export is not None:
            self.for_export = for_export
        if operand1 is not None:
            self.operand1 = operand1
        if operand2 is not None:
            self.operand2 = operand2
        if operator is not None:
            self.operator = operator
        if global_namespace is not None:
            self.global_namespace = global_namespace
        if written_as_function_call is not None:
            self.written_as_function_call = written_as_function_call
        if space_after_namespace is not None:
            self.space_after_namespace = space_after_namespace
        if space_before_operator is not None:
            self.space_before_operator = space_before_operator
        if space_after_operator is not None:
            self.space_after_operator = space_after_operator
        if operand3 is not None:
            self.operand3 = operand3
        if namespace is not None:
            self.namespace = namespace

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


        :return: The import_microversion of this BTPExpressionOperator.  # noqa: E501
        :rtype: str
        """
        return self._import_microversion

    @import_microversion.setter
    def import_microversion(self, import_microversion):
        """Sets the import_microversion of this BTPExpressionOperator.


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

        self._import_microversion = import_microversion

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


        :return: The for_export of this BTPExpressionOperator.  # noqa: E501
        :rtype: bool
        """
        return self._for_export

    @for_export.setter
    def for_export(self, for_export):
        """Sets the for_export of this BTPExpressionOperator.


        :param for_export: The for_export of this BTPExpressionOperator.  # noqa: E501
        :type: bool
        """

        self._for_export = for_export

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


        :return: The operand1 of this BTPExpressionOperator.  # noqa: E501
        :rtype: BTPExpression
        """
        return self._operand1

    @operand1.setter
    def operand1(self, operand1):
        """Sets the operand1 of this BTPExpressionOperator.


        :param operand1: The operand1 of this BTPExpressionOperator.  # noqa: E501
        :type: BTPExpression
        """

        self._operand1 = operand1

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


        :return: The operand2 of this BTPExpressionOperator.  # noqa: E501
        :rtype: BTPExpression
        """
        return self._operand2

    @operand2.setter
    def operand2(self, operand2):
        """Sets the operand2 of this BTPExpressionOperator.


        :param operand2: The operand2 of this BTPExpressionOperator.  # noqa: E501
        :type: BTPExpression
        """

        self._operand2 = operand2

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


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

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


        :param operator: The operator of this BTPExpressionOperator.  # noqa: E501
        :type: str
        """
        allowed_values = ["NONE", "PLUS", "MINUS", "TIMES", "DIVIDE", "MODULUS", "POWER", "NEGATE", "OR", "AND", "NOT", "EQUAL_TO", "NOT_EQUAL_TO", "GREATER", "LESS", "GREATER_OR_EQUAL", "LESS_OR_EQUAL", "CONCATENATE", "CONDITIONAL"]  # noqa: E501
        if operator not in allowed_values:
            raise ValueError(
                "Invalid value for `operator` ({0}), must be one of {1}"  # noqa: E501
                .format(operator, allowed_values)
            )

        self._operator = operator

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


        :return: The global_namespace of this BTPExpressionOperator.  # noqa: E501
        :rtype: bool
        """
        return self._global_namespace

    @global_namespace.setter
    def global_namespace(self, global_namespace):
        """Sets the global_namespace of this BTPExpressionOperator.


        :param global_namespace: The global_namespace of this BTPExpressionOperator.  # noqa: E501
        :type: bool
        """

        self._global_namespace = global_namespace

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


        :return: The written_as_function_call of this BTPExpressionOperator.  # noqa: E501
        :rtype: bool
        """
        return self._written_as_function_call

    @written_as_function_call.setter
    def written_as_function_call(self, written_as_function_call):
        """Sets the written_as_function_call of this BTPExpressionOperator.


        :param written_as_function_call: The written_as_function_call of this BTPExpressionOperator.  # noqa: E501
        :type: bool
        """

        self._written_as_function_call = written_as_function_call

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


        :return: The space_after_namespace of this BTPExpressionOperator.  # noqa: E501
        :rtype: BTPSpace
        """
        return self._space_after_namespace

    @space_after_namespace.setter
    def space_after_namespace(self, space_after_namespace):
        """Sets the space_after_namespace of this BTPExpressionOperator.


        :param space_after_namespace: The space_after_namespace of this BTPExpressionOperator.  # noqa: E501
        :type: BTPSpace
        """

        self._space_after_namespace = space_after_namespace

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


        :return: The space_before_operator of this BTPExpressionOperator.  # noqa: E501
        :rtype: BTPSpace
        """
        return self._space_before_operator

    @space_before_operator.setter
    def space_before_operator(self, space_before_operator):
        """Sets the space_before_operator of this BTPExpressionOperator.


        :param space_before_operator: The space_before_operator of this BTPExpressionOperator.  # noqa: E501
        :type: BTPSpace
        """

        self._space_before_operator = space_before_operator

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


        :return: The space_after_operator of this BTPExpressionOperator.  # noqa: E501
        :rtype: BTPSpace
        """
        return self._space_after_operator

    @space_after_operator.setter
    def space_after_operator(self, space_after_operator):
        """Sets the space_after_operator of this BTPExpressionOperator.


        :param space_after_operator: The space_after_operator of this BTPExpressionOperator.  # noqa: E501
        :type: BTPSpace
        """

        self._space_after_operator = space_after_operator

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


        :return: The operand3 of this BTPExpressionOperator.  # noqa: E501
        :rtype: BTPExpression
        """
        return self._operand3

    @operand3.setter
    def operand3(self, operand3):
        """Sets the operand3 of this BTPExpressionOperator.


        :param operand3: The operand3 of this BTPExpressionOperator.  # noqa: E501
        :type: BTPExpression
        """

        self._operand3 = operand3

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


        :return: The namespace of this BTPExpressionOperator.  # noqa: E501
        :rtype: list[BTPIdentifier]
        """
        return self._namespace

    @namespace.setter
    def namespace(self, namespace):
        """Sets the namespace of this BTPExpressionOperator.


        :param namespace: The namespace of this BTPExpressionOperator.  # noqa: E501
        :type: list[BTPIdentifier]
        """

        self._namespace = namespace

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

        return self.__dict__ == other.__dict__

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