# 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

from .base_block import BaseBlock  # noqa: F401,E501


class BlockCommunityPreview(BaseBlock):
    """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 = {
        "community_id": "str",
        "site_id": "str",
        "slug": "str",
        "title": "str",
        "description": "str",
        "image": "BlockImage",
        "variant": "str",
        "are_social_buttons_visible": "bool",
        "is_followed": "bool",
        "are_notifications_enabled": "bool",
        "members": "list[BlockUser]",
    }
    if hasattr(BaseBlock, "swagger_types"):
        swagger_types.update(BaseBlock.swagger_types)

    attribute_map = {
        "community_id": "communityId",
        "site_id": "siteId",
        "slug": "slug",
        "title": "title",
        "description": "description",
        "image": "image",
        "variant": "variant",
        "are_social_buttons_visible": "areSocialButtonsVisible",
        "is_followed": "isFollowed",
        "are_notifications_enabled": "areNotificationsEnabled",
        "members": "members",
    }
    if hasattr(BaseBlock, "attribute_map"):
        attribute_map.update(BaseBlock.attribute_map)

    def __init__(
        self,
        community_id=None,
        site_id=None,
        slug=None,
        title=None,
        description=None,
        image=None,
        variant=None,
        are_social_buttons_visible=None,
        is_followed=None,
        are_notifications_enabled=None,
        members=None,
        *args,
        **kwargs
    ):  # noqa: E501
        """BlockCommunityPreview - a model defined in Swagger"""  # noqa: E501
        self._community_id = None
        self._site_id = None
        self._slug = None
        self._title = None
        self._description = None
        self._image = None
        self._variant = None
        self._are_social_buttons_visible = None
        self._is_followed = None
        self._are_notifications_enabled = None
        self._members = None
        self.discriminator = None
        self.community_id = community_id
        self.site_id = site_id
        self.slug = slug
        if title is not None:
            self.title = title
        if description is not None:
            self.description = description
        if image is not None:
            self.image = image
        self.variant = variant
        self.are_social_buttons_visible = are_social_buttons_visible
        if is_followed is not None:
            self.is_followed = is_followed
        if are_notifications_enabled is not None:
            self.are_notifications_enabled = are_notifications_enabled
        if members is not None:
            self.members = members
        BaseBlock.__init__(self, *args, **kwargs)

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

        The community's id.  # noqa: E501

        :return: The community_id of this BlockCommunityPreview.  # noqa: E501
        :rtype: str
        """
        return self._community_id

    @community_id.setter
    def community_id(self, community_id):
        """Sets the community_id of this BlockCommunityPreview.

        The community's id.  # noqa: E501

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

        self._community_id = community_id

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

        The site's id.  # noqa: E501

        :return: The site_id of this BlockCommunityPreview.  # noqa: E501
        :rtype: str
        """
        return self._site_id

    @site_id.setter
    def site_id(self, site_id):
        """Sets the site_id of this BlockCommunityPreview.

        The site's id.  # noqa: E501

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

        self._site_id = site_id

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

        The community's slug.  # noqa: E501

        :return: The slug of this BlockCommunityPreview.  # noqa: E501
        :rtype: str
        """
        return self._slug

    @slug.setter
    def slug(self, slug):
        """Sets the slug of this BlockCommunityPreview.

        The community's slug.  # noqa: E501

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

        self._slug = slug

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

        The community's title.  # noqa: E501

        :return: The title of this BlockCommunityPreview.  # noqa: E501
        :rtype: str
        """
        return self._title

    @title.setter
    def title(self, title):
        """Sets the title of this BlockCommunityPreview.

        The community's title.  # noqa: E501

        :param title: The title of this BlockCommunityPreview.  # noqa: E501
        :type: str
        """

        self._title = title

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

        The community's description.  # noqa: E501

        :return: The description of this BlockCommunityPreview.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this BlockCommunityPreview.

        The community's description.  # noqa: E501

        :param description: The description of this BlockCommunityPreview.  # noqa: E501
        :type: str
        """

        self._description = description

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


        :return: The image of this BlockCommunityPreview.  # noqa: E501
        :rtype: BlockImage
        """
        return self._image

    @image.setter
    def image(self, image):
        """Sets the image of this BlockCommunityPreview.


        :param image: The image of this BlockCommunityPreview.  # noqa: E501
        :type: BlockImage
        """

        self._image = image

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


        :return: The variant of this BlockCommunityPreview.  # noqa: E501
        :rtype: str
        """
        return self._variant

    @variant.setter
    def variant(self, variant):
        """Sets the variant of this BlockCommunityPreview.


        :param variant: The variant of this BlockCommunityPreview.  # noqa: E501
        :type: str
        """
        if variant is None:
            raise ValueError(
                "Invalid value for `variant`, must not be `None`"
            )  # noqa: E501
        allowed_values = [
            "VERTICAL",
            "VERTICAL_STRETCH",
            "HORIZONTAL",
            "HORIZONTAL_STRETCH",
        ]  # noqa: E501
        if variant not in allowed_values:
            raise ValueError(
                "Invalid value for `variant` ({0}), must be one of {1}".format(  # noqa: E501
                    variant, allowed_values
                )
            )

        self._variant = variant

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

        Whether the follow button and the notifications button must be displayed.  # noqa: E501

        :return: The are_social_buttons_visible of this BlockCommunityPreview.  # noqa: E501
        :rtype: bool
        """
        return self._are_social_buttons_visible

    @are_social_buttons_visible.setter
    def are_social_buttons_visible(self, are_social_buttons_visible):
        """Sets the are_social_buttons_visible of this BlockCommunityPreview.

        Whether the follow button and the notifications button must be displayed.  # noqa: E501

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

        self._are_social_buttons_visible = are_social_buttons_visible

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

        Whether the current user follows the community.  # noqa: E501

        :return: The is_followed of this BlockCommunityPreview.  # noqa: E501
        :rtype: bool
        """
        return self._is_followed

    @is_followed.setter
    def is_followed(self, is_followed):
        """Sets the is_followed of this BlockCommunityPreview.

        Whether the current user follows the community.  # noqa: E501

        :param is_followed: The is_followed of this BlockCommunityPreview.  # noqa: E501
        :type: bool
        """

        self._is_followed = is_followed

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

        Whether the current user has enabled notifications for the community.  # noqa: E501

        :return: The are_notifications_enabled of this BlockCommunityPreview.  # noqa: E501
        :rtype: bool
        """
        return self._are_notifications_enabled

    @are_notifications_enabled.setter
    def are_notifications_enabled(self, are_notifications_enabled):
        """Sets the are_notifications_enabled of this BlockCommunityPreview.

        Whether the current user has enabled notifications for the community.  # noqa: E501

        :param are_notifications_enabled: The are_notifications_enabled of this BlockCommunityPreview.  # noqa: E501
        :type: bool
        """

        self._are_notifications_enabled = are_notifications_enabled

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

        The first five members of the community, ordered by email ascending.  # noqa: E501

        :return: The members of this BlockCommunityPreview.  # noqa: E501
        :rtype: list[BlockUser]
        """
        return self._members

    @members.setter
    def members(self, members):
        """Sets the members of this BlockCommunityPreview.

        The first five members of the community, ordered by email ascending.  # noqa: E501

        :param members: The members of this BlockCommunityPreview.  # noqa: E501
        :type: list[BlockUser]
        """

        self._members = members

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

        return self.__dict__ == other.__dict__

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