# 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 BlockPagePreview(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 = {
        "page_id": "str",
        "slug": "str",
        "published_at": "datetime",
        "author": "BlockUser",
        "title": "str",
        "excerpt": "str",
        "image": "BlockImage",
        "variant": "str",
        "site": "SiteReference",
        "tags": "BlockTagReferenceList",
        "metadata": "list[MetadataReference]",
        "reactions": "BlockReactions",
        "order": "list[str]",
        "external_url": "str",
    }
    if hasattr(BaseBlock, "swagger_types"):
        swagger_types.update(BaseBlock.swagger_types)

    attribute_map = {
        "page_id": "pageId",
        "slug": "slug",
        "published_at": "publishedAt",
        "author": "author",
        "title": "title",
        "excerpt": "excerpt",
        "image": "image",
        "variant": "variant",
        "site": "site",
        "tags": "tags",
        "metadata": "metadata",
        "reactions": "reactions",
        "order": "order",
        "external_url": "externalUrl",
    }
    if hasattr(BaseBlock, "attribute_map"):
        attribute_map.update(BaseBlock.attribute_map)

    def __init__(
        self,
        page_id=None,
        slug=None,
        published_at=None,
        author=None,
        title=None,
        excerpt=None,
        image=None,
        variant=None,
        site=None,
        tags=None,
        metadata=None,
        reactions=None,
        order=None,
        external_url=None,
        *args,
        **kwargs
    ):  # noqa: E501
        """BlockPagePreview - a model defined in Swagger"""  # noqa: E501
        self._page_id = None
        self._slug = None
        self._published_at = None
        self._author = None
        self._title = None
        self._excerpt = None
        self._image = None
        self._variant = None
        self._site = None
        self._tags = None
        self._metadata = None
        self._reactions = None
        self._order = None
        self._external_url = None
        self.discriminator = None
        self.page_id = page_id
        self.slug = slug
        if published_at is not None:
            self.published_at = published_at
        if author is not None:
            self.author = author
        if title is not None:
            self.title = title
        if excerpt is not None:
            self.excerpt = excerpt
        if image is not None:
            self.image = image
        self.variant = variant
        self.site = site
        if tags is not None:
            self.tags = tags
        if metadata is not None:
            self.metadata = metadata
        if reactions is not None:
            self.reactions = reactions
        self.order = order
        if external_url is not None:
            self.external_url = external_url
        BaseBlock.__init__(self, *args, **kwargs)

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

        The page's id.  # noqa: E501

        :return: The page_id of this BlockPagePreview.  # noqa: E501
        :rtype: str
        """
        return self._page_id

    @page_id.setter
    def page_id(self, page_id):
        """Sets the page_id of this BlockPagePreview.

        The page's id.  # noqa: E501

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

        self._page_id = page_id

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

        The page's slug, used for navigation purposes.  # noqa: E501

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

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

        The page's slug, used for navigation purposes.  # noqa: E501

        :param slug: The slug of this BlockPagePreview.  # 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 published_at(self):
        """Gets the published_at of this BlockPagePreview.  # noqa: E501

        The date and time when the page was published.  # noqa: E501

        :return: The published_at of this BlockPagePreview.  # noqa: E501
        :rtype: datetime
        """
        return self._published_at

    @published_at.setter
    def published_at(self, published_at):
        """Sets the published_at of this BlockPagePreview.

        The date and time when the page was published.  # noqa: E501

        :param published_at: The published_at of this BlockPagePreview.  # noqa: E501
        :type: datetime
        """

        self._published_at = published_at

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


        :return: The author of this BlockPagePreview.  # noqa: E501
        :rtype: BlockUser
        """
        return self._author

    @author.setter
    def author(self, author):
        """Sets the author of this BlockPagePreview.


        :param author: The author of this BlockPagePreview.  # noqa: E501
        :type: BlockUser
        """

        self._author = author

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

        The page's title.  # noqa: E501

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

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

        The page's title.  # noqa: E501

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

        self._title = title

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

        A short extract of the page's content.  # noqa: E501

        :return: The excerpt of this BlockPagePreview.  # noqa: E501
        :rtype: str
        """
        return self._excerpt

    @excerpt.setter
    def excerpt(self, excerpt):
        """Sets the excerpt of this BlockPagePreview.

        A short extract of the page's content.  # noqa: E501

        :param excerpt: The excerpt of this BlockPagePreview.  # noqa: E501
        :type: str
        """

        self._excerpt = excerpt

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


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

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


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

        self._image = image

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


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

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


        :param variant: The variant of this BlockPagePreview.  # noqa: E501
        :type: str
        """
        if variant is None:
            raise ValueError(
                "Invalid value for `variant`, must not be `None`"
            )  # noqa: E501
        allowed_values = ["VERTICAL", "HORIZONTAL", "COVER", "SIDE"]  # 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 site(self):
        """Gets the site of this BlockPagePreview.  # noqa: E501


        :return: The site of this BlockPagePreview.  # noqa: E501
        :rtype: SiteReference
        """
        return self._site

    @site.setter
    def site(self, site):
        """Sets the site of this BlockPagePreview.


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

        self._site = site

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


        :return: The tags of this BlockPagePreview.  # noqa: E501
        :rtype: BlockTagReferenceList
        """
        return self._tags

    @tags.setter
    def tags(self, tags):
        """Sets the tags of this BlockPagePreview.


        :param tags: The tags of this BlockPagePreview.  # noqa: E501
        :type: BlockTagReferenceList
        """

        self._tags = tags

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


        :return: The metadata of this BlockPagePreview.  # noqa: E501
        :rtype: list[MetadataReference]
        """
        return self._metadata

    @metadata.setter
    def metadata(self, metadata):
        """Sets the metadata of this BlockPagePreview.


        :param metadata: The metadata of this BlockPagePreview.  # noqa: E501
        :type: list[MetadataReference]
        """

        self._metadata = metadata

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


        :return: The reactions of this BlockPagePreview.  # noqa: E501
        :rtype: BlockReactions
        """
        return self._reactions

    @reactions.setter
    def reactions(self, reactions):
        """Sets the reactions of this BlockPagePreview.


        :param reactions: The reactions of this BlockPagePreview.  # noqa: E501
        :type: BlockReactions
        """

        self._reactions = reactions

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

        The display order of the properties.  # noqa: E501

        :return: The order of this BlockPagePreview.  # noqa: E501
        :rtype: list[str]
        """
        return self._order

    @order.setter
    def order(self, order):
        """Sets the order of this BlockPagePreview.

        The display order of the properties.  # noqa: E501

        :param order: The order of this BlockPagePreview.  # noqa: E501
        :type: list[str]
        """
        if order is None:
            raise ValueError(
                "Invalid value for `order`, must not be `None`"
            )  # noqa: E501

        self._order = order

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

        The URL to an external resource.  # noqa: E501

        :return: The external_url of this BlockPagePreview.  # noqa: E501
        :rtype: str
        """
        return self._external_url

    @external_url.setter
    def external_url(self, external_url):
        """Sets the external_url of this BlockPagePreview.

        The URL to an external resource.  # noqa: E501

        :param external_url: The external_url of this BlockPagePreview.  # noqa: E501
        :type: str
        """

        self._external_url = external_url

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

        return self.__dict__ == other.__dict__

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