# coding: utf-8

"""
    Automation Actions V4

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: v4
    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 hubspot.automation.actions.configuration import Configuration


class InputFieldDefinition(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 = {"is_required": "bool", "automation_field_type": "str", "type_definition": "FieldTypeDefinition", "supported_value_types": "list[str]"}

    attribute_map = {"is_required": "isRequired", "automation_field_type": "automationFieldType", "type_definition": "typeDefinition", "supported_value_types": "supportedValueTypes"}

    def __init__(self, is_required=None, automation_field_type=None, type_definition=None, supported_value_types=None, local_vars_configuration=None):  # noqa: E501
        """InputFieldDefinition - 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._is_required = None
        self._automation_field_type = None
        self._type_definition = None
        self._supported_value_types = None
        self.discriminator = None

        self.is_required = is_required
        if automation_field_type is not None:
            self.automation_field_type = automation_field_type
        self.type_definition = type_definition
        if supported_value_types is not None:
            self.supported_value_types = supported_value_types

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


        :return: The is_required of this InputFieldDefinition.  # noqa: E501
        :rtype: bool
        """
        return self._is_required

    @is_required.setter
    def is_required(self, is_required):
        """Sets the is_required of this InputFieldDefinition.


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

        self._is_required = is_required

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


        :return: The automation_field_type of this InputFieldDefinition.  # noqa: E501
        :rtype: str
        """
        return self._automation_field_type

    @automation_field_type.setter
    def automation_field_type(self, automation_field_type):
        """Sets the automation_field_type of this InputFieldDefinition.


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

        self._automation_field_type = automation_field_type

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


        :return: The type_definition of this InputFieldDefinition.  # noqa: E501
        :rtype: FieldTypeDefinition
        """
        return self._type_definition

    @type_definition.setter
    def type_definition(self, type_definition):
        """Sets the type_definition of this InputFieldDefinition.


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

        self._type_definition = type_definition

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


        :return: The supported_value_types of this InputFieldDefinition.  # noqa: E501
        :rtype: list[str]
        """
        return self._supported_value_types

    @supported_value_types.setter
    def supported_value_types(self, supported_value_types):
        """Sets the supported_value_types of this InputFieldDefinition.


        :param supported_value_types: The supported_value_types of this InputFieldDefinition.  # noqa: E501
        :type supported_value_types: list[str]
        """
        allowed_values = ["STATIC_VALUE", "OBJECT_PROPERTY", "FIELD_DATA", "FETCHED_OBJECT_PROPERTY", "ENROLLMENT_EVENT_PROPERTY"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and not set(supported_value_types).issubset(set(allowed_values)):  # noqa: E501
            raise ValueError(
                "Invalid values for `supported_value_types` [{0}], must be a subset of [{1}]".format(  # noqa: E501
                    ", ".join(map(str, set(supported_value_types) - set(allowed_values))), ", ".join(map(str, allowed_values))  # noqa: E501
                )
            )

        self._supported_value_types = supported_value_types

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

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