# coding: utf-8

"""
    FormsExternalService

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

    The version of the OpenAPI document: v3
    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.marketing.forms.configuration import Configuration


class FieldGroup(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 = {"group_type": "str", "rich_text_type": "str", "rich_text": "str", "fields": "list[DependentFieldDependentField]"}

    attribute_map = {"group_type": "groupType", "rich_text_type": "richTextType", "rich_text": "richText", "fields": "fields"}

    def __init__(self, group_type=None, rich_text_type=None, rich_text=None, fields=None, local_vars_configuration=None):  # noqa: E501
        """FieldGroup - 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._group_type = None
        self._rich_text_type = None
        self._rich_text = None
        self._fields = None
        self.discriminator = None

        if group_type is not None:
            self.group_type = group_type
        if rich_text_type is not None:
            self.rich_text_type = rich_text_type
        if rich_text is not None:
            self.rich_text = rich_text
        self.fields = fields

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


        :return: The group_type of this FieldGroup.  # noqa: E501
        :rtype: str
        """
        return self._group_type

    @group_type.setter
    def group_type(self, group_type):
        """Sets the group_type of this FieldGroup.


        :param group_type: The group_type of this FieldGroup.  # noqa: E501
        :type group_type: str
        """
        allowed_values = ["default_group", "progressive", "queued"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and group_type not in allowed_values:  # noqa: E501
            raise ValueError("Invalid value for `group_type` ({0}), must be one of {1}".format(group_type, allowed_values))  # noqa: E501

        self._group_type = group_type

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

        The type of rich text included. The default value is text.  # noqa: E501

        :return: The rich_text_type of this FieldGroup.  # noqa: E501
        :rtype: str
        """
        return self._rich_text_type

    @rich_text_type.setter
    def rich_text_type(self, rich_text_type):
        """Sets the rich_text_type of this FieldGroup.

        The type of rich text included. The default value is text.  # noqa: E501

        :param rich_text_type: The rich_text_type of this FieldGroup.  # noqa: E501
        :type rich_text_type: str
        """
        allowed_values = ["text", "image"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and rich_text_type not in allowed_values:  # noqa: E501
            raise ValueError("Invalid value for `rich_text_type` ({0}), must be one of {1}".format(rich_text_type, allowed_values))  # noqa: E501

        self._rich_text_type = rich_text_type

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

        A block of rich text or an image. Those can be used to add extra information for the customers filling in the form. If the field group includes fields, the rich text will be displayed before the fields.  # noqa: E501

        :return: The rich_text of this FieldGroup.  # noqa: E501
        :rtype: str
        """
        return self._rich_text

    @rich_text.setter
    def rich_text(self, rich_text):
        """Sets the rich_text of this FieldGroup.

        A block of rich text or an image. Those can be used to add extra information for the customers filling in the form. If the field group includes fields, the rich text will be displayed before the fields.  # noqa: E501

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

        self._rich_text = rich_text

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

        The form fields included in the group  # noqa: E501

        :return: The fields of this FieldGroup.  # noqa: E501
        :rtype: list[DependentFieldDependentField]
        """
        return self._fields

    @fields.setter
    def fields(self, fields):
        """Sets the fields of this FieldGroup.

        The form fields included in the group  # noqa: E501

        :param fields: The fields of this FieldGroup.  # noqa: E501
        :type fields: list[DependentFieldDependentField]
        """
        if self.local_vars_configuration.client_side_validation and fields is None:  # noqa: E501
            raise ValueError("Invalid value for `fields`, must not be `None`")  # noqa: E501

        self._fields = fields

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

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