# 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 BlockGenericResource(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 = {
        "title": "str",
        "description": "str",
        "image": "BlockImage",
        "variant": "str",
        "link": "str",
    }
    if hasattr(BaseBlock, "swagger_types"):
        swagger_types.update(BaseBlock.swagger_types)

    attribute_map = {
        "title": "title",
        "description": "description",
        "image": "image",
        "variant": "variant",
        "link": "link",
    }
    if hasattr(BaseBlock, "attribute_map"):
        attribute_map.update(BaseBlock.attribute_map)

    def __init__(
        self,
        title=None,
        description=None,
        image=None,
        variant=None,
        link=None,
        *args,
        **kwargs
    ):  # noqa: E501
        """BlockGenericResource - a model defined in Swagger"""  # noqa: E501
        self._title = None
        self._description = None
        self._image = None
        self._variant = None
        self._link = None
        self.discriminator = None
        self.title = title
        if description is not None:
            self.description = description
        self.image = image
        self.variant = variant
        if link is not None:
            self.link = link
        BaseBlock.__init__(self, *args, **kwargs)

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

        The resource's title.  # noqa: E501

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

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

        The resource's title.  # noqa: E501

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

        self._title = title

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

        The resource's description.  # noqa: E501

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

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

        The resource's description.  # noqa: E501

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

        self._description = description

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


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

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


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

        self._image = image

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


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

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


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

        The url to navigate to when the user interacts with the resource.  # noqa: E501

        :return: The link of this BlockGenericResource.  # noqa: E501
        :rtype: str
        """
        return self._link

    @link.setter
    def link(self, link):
        """Sets the link of this BlockGenericResource.

        The url to navigate to when the user interacts with the resource.  # noqa: E501

        :param link: The link of this BlockGenericResource.  # noqa: E501
        :type: str
        """

        self._link = link

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

        return self.__dict__ == other.__dict__

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