# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

    OpenAPI spec version: 4.11.5
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from swagger_client.configuration import Configuration


class CustomField(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'type': 'CustomFieldTypeEnum',
        'linked_entity_type': 'LinkedEntityTypeEnum',
        'control': 'CustomFieldControlEnum',
        'kind': 'CustomFieldKind',
        'decimal_digits': 'int'
    }

    attribute_map = {
        'type': 'type',
        'linked_entity_type': 'linkedEntityType',
        'control': 'control',
        'kind': 'kind',
        'decimal_digits': 'decimalDigits'
    }

    def __init__(self, type=None, linked_entity_type=None, control=None, kind=None, decimal_digits=None, _configuration=None):  # noqa: E501
        """CustomField - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._type = None
        self._linked_entity_type = None
        self._control = None
        self._kind = None
        self._decimal_digits = None
        self.discriminator = None

        if type is not None:
            self.type = type
        if linked_entity_type is not None:
            self.linked_entity_type = linked_entity_type
        if control is not None:
            self.control = control
        if kind is not None:
            self.kind = kind
        if decimal_digits is not None:
            self.decimal_digits = decimal_digits

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

        The data type for the custom field Possible values are: * boolean: A boolean value * date: A date value * decimal: A decimal value * dynamicSelection: Single selection based on options generated by a custom script * file: Multiple binary files * image: Multiple images * integer: An integer value * linkedEntity: Another entity. Uses the `linkedEntityType` to define which kind of entity is it * multiSelection: Multiple enumerated values * richText: A multi line string formatted as HTML * singleSelection: A single enumerated value * string: A single line string * text: A multi line string * url: An URL   # noqa: E501

        :return: The type of this CustomField.  # noqa: E501
        :rtype: CustomFieldTypeEnum
        """
        return self._type

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

        The data type for the custom field Possible values are: * boolean: A boolean value * date: A date value * decimal: A decimal value * dynamicSelection: Single selection based on options generated by a custom script * file: Multiple binary files * image: Multiple images * integer: An integer value * linkedEntity: Another entity. Uses the `linkedEntityType` to define which kind of entity is it * multiSelection: Multiple enumerated values * richText: A multi line string formatted as HTML * singleSelection: A single enumerated value * string: A single line string * text: A multi line string * url: An URL   # noqa: E501

        :param type: The type of this CustomField.  # noqa: E501
        :type: CustomFieldTypeEnum
        """

        self._type = type

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

        When the type is linkedEntity, indicates the entity type Possible values are: * advertisement: An advertisement * record: A record (user or system) * transaction: A transaction (payment, scheduled payment, payment request, etc) * transfer: A transfer * user: An user   # noqa: E501

        :return: The linked_entity_type of this CustomField.  # noqa: E501
        :rtype: LinkedEntityTypeEnum
        """
        return self._linked_entity_type

    @linked_entity_type.setter
    def linked_entity_type(self, linked_entity_type):
        """Sets the linked_entity_type of this CustomField.

        When the type is linkedEntity, indicates the entity type Possible values are: * advertisement: An advertisement * record: A record (user or system) * transaction: A transaction (payment, scheduled payment, payment request, etc) * transfer: A transfer * user: An user   # noqa: E501

        :param linked_entity_type: The linked_entity_type of this CustomField.  # noqa: E501
        :type: LinkedEntityTypeEnum
        """

        self._linked_entity_type = linked_entity_type

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

        The UI control (widget) type that should be used to render this field for edit. Most notably, the types that can have distinct controls are singleSelection, that could be rendered as a single selection widget or radio button group, and multi selection, which could be rendered as a multi selection widget or a checkbox group. Possible values are: * checkbox: A checkbox group * entitySelection: A widget to select a linked entity (for example, an auto-complete for users) * multiSelection: A multi-selection field * radio: A radio button group * richEditor: An HTML editor * singleSelection: A single-selection field * text: A single line text * textarea: A multi line text * upload: A widget to upload a file   # noqa: E501

        :return: The control of this CustomField.  # noqa: E501
        :rtype: CustomFieldControlEnum
        """
        return self._control

    @control.setter
    def control(self, control):
        """Sets the control of this CustomField.

        The UI control (widget) type that should be used to render this field for edit. Most notably, the types that can have distinct controls are singleSelection, that could be rendered as a single selection widget or radio button group, and multi selection, which could be rendered as a multi selection widget or a checkbox group. Possible values are: * checkbox: A checkbox group * entitySelection: A widget to select a linked entity (for example, an auto-complete for users) * multiSelection: A multi-selection field * radio: A radio button group * richEditor: An HTML editor * singleSelection: A single-selection field * text: A single line text * textarea: A multi line text * upload: A widget to upload a file   # noqa: E501

        :param control: The control of this CustomField.  # noqa: E501
        :type: CustomFieldControlEnum
        """

        self._control = control

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

        Determines the kind if a custom field Possible values are: * contact: Contact fields. * contactInfo: Additional contact information fields. * custom_operation: Custom operation fields. * document: Document fields. * marketplace: Advertisements field. * record: Record fields. * transaction: Transaction fields. * user: User profile fields.   # noqa: E501

        :return: The kind of this CustomField.  # noqa: E501
        :rtype: CustomFieldKind
        """
        return self._kind

    @kind.setter
    def kind(self, kind):
        """Sets the kind of this CustomField.

        Determines the kind if a custom field Possible values are: * contact: Contact fields. * contactInfo: Additional contact information fields. * custom_operation: Custom operation fields. * document: Document fields. * marketplace: Advertisements field. * record: Record fields. * transaction: Transaction fields. * user: User profile fields.   # noqa: E501

        :param kind: The kind of this CustomField.  # noqa: E501
        :type: CustomFieldKind
        """

        self._kind = kind

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

        The number of decimal digits. Only available if `type` is   # noqa: E501

        :return: The decimal_digits of this CustomField.  # noqa: E501
        :rtype: int
        """
        return self._decimal_digits

    @decimal_digits.setter
    def decimal_digits(self, decimal_digits):
        """Sets the decimal_digits of this CustomField.

        The number of decimal digits. Only available if `type` is   # noqa: E501

        :param decimal_digits: The decimal_digits of this CustomField.  # noqa: E501
        :type: int
        """

        self._decimal_digits = decimal_digits

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

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(CustomField, dict):
            for key, value in self.items():
                result[key] = 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, CustomField):
            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, CustomField):
            return True

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