# coding: utf-8

"""
    CMS Contribution API

    The CMS Contribution API allows access and modification of Lumapps contents.   # noqa: E501

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

import pprint
import re  # noqa: F401

import six


class Widget(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 = {
        "widget_id": "str",
        "widget_type": "WidgetType",
        "header": "Header",
        "footer": "Footer",
        "body": "OneOfWidgetBody",
        "is_collapsed": "bool",
        "style": "ElementStyle",
        "css_class": "str",
        "html_id": "str",
    }

    attribute_map = {
        "widget_id": "widgetId",
        "widget_type": "widgetType",
        "header": "header",
        "footer": "footer",
        "body": "body",
        "is_collapsed": "isCollapsed",
        "style": "style",
        "css_class": "cssClass",
        "html_id": "htmlId",
    }

    def __init__(
        self,
        widget_id=None,
        widget_type=None,
        header=None,
        footer=None,
        body=None,
        is_collapsed=None,
        style=None,
        css_class=None,
        html_id=None,
    ):  # noqa: E501
        """Widget - a model defined in Swagger"""  # noqa: E501
        self._widget_id = None
        self._widget_type = None
        self._header = None
        self._footer = None
        self._body = None
        self._is_collapsed = None
        self._style = None
        self._css_class = None
        self._html_id = None
        self.discriminator = None
        self.widget_id = widget_id
        self.widget_type = widget_type
        if header is not None:
            self.header = header
        if footer is not None:
            self.footer = footer
        if body is not None:
            self.body = body
        self.is_collapsed = is_collapsed
        if style is not None:
            self.style = style
        if css_class is not None:
            self.css_class = css_class
        if html_id is not None:
            self.html_id = html_id

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

        The widget's id.  # noqa: E501

        :return: The widget_id of this Widget.  # noqa: E501
        :rtype: str
        """
        return self._widget_id

    @widget_id.setter
    def widget_id(self, widget_id):
        """Sets the widget_id of this Widget.

        The widget's id.  # noqa: E501

        :param widget_id: The widget_id of this Widget.  # noqa: E501
        :type: str
        """
        if widget_id is None:
            raise ValueError(
                "Invalid value for `widget_id`, must not be `None`"
            )  # noqa: E501

        self._widget_id = widget_id

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


        :return: The widget_type of this Widget.  # noqa: E501
        :rtype: WidgetType
        """
        return self._widget_type

    @widget_type.setter
    def widget_type(self, widget_type):
        """Sets the widget_type of this Widget.


        :param widget_type: The widget_type of this Widget.  # noqa: E501
        :type: WidgetType
        """
        if widget_type is None:
            raise ValueError(
                "Invalid value for `widget_type`, must not be `None`"
            )  # noqa: E501

        self._widget_type = widget_type

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


        :return: The header of this Widget.  # noqa: E501
        :rtype: Header
        """
        return self._header

    @header.setter
    def header(self, header):
        """Sets the header of this Widget.


        :param header: The header of this Widget.  # noqa: E501
        :type: Header
        """

        self._header = header

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


        :return: The footer of this Widget.  # noqa: E501
        :rtype: Footer
        """
        return self._footer

    @footer.setter
    def footer(self, footer):
        """Sets the footer of this Widget.


        :param footer: The footer of this Widget.  # noqa: E501
        :type: Footer
        """

        self._footer = footer

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


        :return: The body of this Widget.  # noqa: E501
        :rtype: OneOfWidgetBody
        """
        return self._body

    @body.setter
    def body(self, body):
        """Sets the body of this Widget.


        :param body: The body of this Widget.  # noqa: E501
        :type: OneOfWidgetBody
        """

        self._body = body

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

        Whether the widget is collapsed upon load.  # noqa: E501

        :return: The is_collapsed of this Widget.  # noqa: E501
        :rtype: bool
        """
        return self._is_collapsed

    @is_collapsed.setter
    def is_collapsed(self, is_collapsed):
        """Sets the is_collapsed of this Widget.

        Whether the widget is collapsed upon load.  # noqa: E501

        :param is_collapsed: The is_collapsed of this Widget.  # noqa: E501
        :type: bool
        """
        if is_collapsed is None:
            raise ValueError(
                "Invalid value for `is_collapsed`, must not be `None`"
            )  # noqa: E501

        self._is_collapsed = is_collapsed

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


        :return: The style of this Widget.  # noqa: E501
        :rtype: ElementStyle
        """
        return self._style

    @style.setter
    def style(self, style):
        """Sets the style of this Widget.


        :param style: The style of this Widget.  # noqa: E501
        :type: ElementStyle
        """

        self._style = style

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

        The CSS class(es) used by this widget, if any.  # noqa: E501

        :return: The css_class of this Widget.  # noqa: E501
        :rtype: str
        """
        return self._css_class

    @css_class.setter
    def css_class(self, css_class):
        """Sets the css_class of this Widget.

        The CSS class(es) used by this widget, if any.  # noqa: E501

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

        self._css_class = css_class

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

        The HTML id used by this widget, if any.  # noqa: E501

        :return: The html_id of this Widget.  # noqa: E501
        :rtype: str
        """
        return self._html_id

    @html_id.setter
    def html_id(self, html_id):
        """Sets the html_id of this Widget.

        The HTML id used by this widget, if any.  # noqa: E501

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

        self._html_id = html_id

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

        return self.__dict__ == other.__dict__

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