# coding: utf-8

"""
    Posts

    Use these endpoints for interacting with Blog Posts, Blog Authors, and Blog Tags  # 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.cms.blogs.blog_posts.configuration import Configuration


class LayoutSection(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 = {
        "css_style": "str",
        "label": "str",
        "type": "str",
        "params": "dict[str, object]",
        "rows": "list[dict[str, LayoutSection]]",
        "row_meta_data": "list[RowMetaData]",
        "cells": "list[LayoutSection]",
        "css_class": "str",
        "w": "int",
        "css_id": "str",
        "x": "int",
        "name": "str",
        "styles": "Styles",
    }

    attribute_map = {
        "css_style": "cssStyle",
        "label": "label",
        "type": "type",
        "params": "params",
        "rows": "rows",
        "row_meta_data": "rowMetaData",
        "cells": "cells",
        "css_class": "cssClass",
        "w": "w",
        "css_id": "cssId",
        "x": "x",
        "name": "name",
        "styles": "styles",
    }

    def __init__(
        self,
        css_style=None,
        label=None,
        type=None,
        params=None,
        rows=None,
        row_meta_data=None,
        cells=None,
        css_class=None,
        w=None,
        css_id=None,
        x=None,
        name=None,
        styles=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """LayoutSection - 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._css_style = None
        self._label = None
        self._type = None
        self._params = None
        self._rows = None
        self._row_meta_data = None
        self._cells = None
        self._css_class = None
        self._w = None
        self._css_id = None
        self._x = None
        self._name = None
        self._styles = None
        self.discriminator = None

        self.css_style = css_style
        self.label = label
        self.type = type
        self.params = params
        self.rows = rows
        self.row_meta_data = row_meta_data
        self.cells = cells
        self.css_class = css_class
        self.w = w
        self.css_id = css_id
        self.x = x
        self.name = name
        self.styles = styles

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


        :return: The css_style of this LayoutSection.  # noqa: E501
        :rtype: str
        """
        return self._css_style

    @css_style.setter
    def css_style(self, css_style):
        """Sets the css_style of this LayoutSection.


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

        self._css_style = css_style

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


        :return: The label of this LayoutSection.  # noqa: E501
        :rtype: str
        """
        return self._label

    @label.setter
    def label(self, label):
        """Sets the label of this LayoutSection.


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

        self._label = label

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


        :return: The type of this LayoutSection.  # noqa: E501
        :rtype: str
        """
        return self._type

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


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

        self._type = type

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

        null  # noqa: E501

        :return: The params of this LayoutSection.  # noqa: E501
        :rtype: dict[str, object]
        """
        return self._params

    @params.setter
    def params(self, params):
        """Sets the params of this LayoutSection.

        null  # noqa: E501

        :param params: The params of this LayoutSection.  # noqa: E501
        :type params: dict[str, object]
        """
        if self.local_vars_configuration.client_side_validation and params is None:  # noqa: E501
            raise ValueError("Invalid value for `params`, must not be `None`")  # noqa: E501

        self._params = params

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


        :return: The rows of this LayoutSection.  # noqa: E501
        :rtype: list[dict[str, LayoutSection]]
        """
        return self._rows

    @rows.setter
    def rows(self, rows):
        """Sets the rows of this LayoutSection.


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

        self._rows = rows

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


        :return: The row_meta_data of this LayoutSection.  # noqa: E501
        :rtype: list[RowMetaData]
        """
        return self._row_meta_data

    @row_meta_data.setter
    def row_meta_data(self, row_meta_data):
        """Sets the row_meta_data of this LayoutSection.


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

        self._row_meta_data = row_meta_data

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


        :return: The cells of this LayoutSection.  # noqa: E501
        :rtype: list[LayoutSection]
        """
        return self._cells

    @cells.setter
    def cells(self, cells):
        """Sets the cells of this LayoutSection.


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

        self._cells = cells

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


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

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


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

        self._css_class = css_class

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


        :return: The w of this LayoutSection.  # noqa: E501
        :rtype: int
        """
        return self._w

    @w.setter
    def w(self, w):
        """Sets the w of this LayoutSection.


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

        self._w = w

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


        :return: The css_id of this LayoutSection.  # noqa: E501
        :rtype: str
        """
        return self._css_id

    @css_id.setter
    def css_id(self, css_id):
        """Sets the css_id of this LayoutSection.


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

        self._css_id = css_id

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


        :return: The x of this LayoutSection.  # noqa: E501
        :rtype: int
        """
        return self._x

    @x.setter
    def x(self, x):
        """Sets the x of this LayoutSection.


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

        self._x = x

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


        :return: The name of this LayoutSection.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this LayoutSection.


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

        self._name = name

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


        :return: The styles of this LayoutSection.  # noqa: E501
        :rtype: Styles
        """
        return self._styles

    @styles.setter
    def styles(self, styles):
        """Sets the styles of this LayoutSection.


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

        self._styles = styles

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

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