# 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 Article(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 = {
        "id": "str",
        "author": "UserReference",
        "created_at": "datetime",
        "updated_at": "datetime",
        "template_id": "str",
        "owner_users": "list[str]",
        "owner_groups": "list[str]",
        "shares": "list[ArticleShare]",
        "can_edit": "bool",
        "structured_content": "StructuredContent",
    }

    attribute_map = {
        "id": "id",
        "author": "author",
        "created_at": "createdAt",
        "updated_at": "updatedAt",
        "template_id": "templateId",
        "owner_users": "ownerUsers",
        "owner_groups": "ownerGroups",
        "shares": "shares",
        "can_edit": "canEdit",
        "structured_content": "structuredContent",
    }

    def __init__(
        self,
        id=None,
        author=None,
        created_at=None,
        updated_at=None,
        template_id=None,
        owner_users=None,
        owner_groups=None,
        shares=None,
        can_edit=None,
        structured_content=None,
    ):  # noqa: E501
        """Article - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._author = None
        self._created_at = None
        self._updated_at = None
        self._template_id = None
        self._owner_users = None
        self._owner_groups = None
        self._shares = None
        self._can_edit = None
        self._structured_content = None
        self.discriminator = None
        self.id = id
        if author is not None:
            self.author = author
        if created_at is not None:
            self.created_at = created_at
        if updated_at is not None:
            self.updated_at = updated_at
        if template_id is not None:
            self.template_id = template_id
        if owner_users is not None:
            self.owner_users = owner_users
        if owner_groups is not None:
            self.owner_groups = owner_groups
        if shares is not None:
            self.shares = shares
        if can_edit is not None:
            self.can_edit = can_edit
        if structured_content is not None:
            self.structured_content = structured_content

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

        The article id  # noqa: E501

        :return: The id of this Article.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Article.

        The article id  # noqa: E501

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

        self._id = id

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


        :return: The author of this Article.  # noqa: E501
        :rtype: UserReference
        """
        return self._author

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


        :param author: The author of this Article.  # noqa: E501
        :type: UserReference
        """

        self._author = author

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

        The date and time when the article was created  # noqa: E501

        :return: The created_at of this Article.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this Article.

        The date and time when the article was created  # noqa: E501

        :param created_at: The created_at of this Article.  # noqa: E501
        :type: datetime
        """

        self._created_at = created_at

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

        The date and time when the article was last updated  # noqa: E501

        :return: The updated_at of this Article.  # noqa: E501
        :rtype: datetime
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """Sets the updated_at of this Article.

        The date and time when the article was last updated  # noqa: E501

        :param updated_at: The updated_at of this Article.  # noqa: E501
        :type: datetime
        """

        self._updated_at = updated_at

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

        The id of the template used to display the article  # noqa: E501

        :return: The template_id of this Article.  # noqa: E501
        :rtype: str
        """
        return self._template_id

    @template_id.setter
    def template_id(self, template_id):
        """Sets the template_id of this Article.

        The id of the template used to display the article  # noqa: E501

        :param template_id: The template_id of this Article.  # noqa: E501
        :type: str
        """

        self._template_id = template_id

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

        The ids of users owning the article  # noqa: E501

        :return: The owner_users of this Article.  # noqa: E501
        :rtype: list[str]
        """
        return self._owner_users

    @owner_users.setter
    def owner_users(self, owner_users):
        """Sets the owner_users of this Article.

        The ids of users owning the article  # noqa: E501

        :param owner_users: The owner_users of this Article.  # noqa: E501
        :type: list[str]
        """

        self._owner_users = owner_users

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

        The ids of groups owning the article  # noqa: E501

        :return: The owner_groups of this Article.  # noqa: E501
        :rtype: list[str]
        """
        return self._owner_groups

    @owner_groups.setter
    def owner_groups(self, owner_groups):
        """Sets the owner_groups of this Article.

        The ids of groups owning the article  # noqa: E501

        :param owner_groups: The owner_groups of this Article.  # noqa: E501
        :type: list[str]
        """

        self._owner_groups = owner_groups

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


        :return: The shares of this Article.  # noqa: E501
        :rtype: list[ArticleShare]
        """
        return self._shares

    @shares.setter
    def shares(self, shares):
        """Sets the shares of this Article.


        :param shares: The shares of this Article.  # noqa: E501
        :type: list[ArticleShare]
        """

        self._shares = shares

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

        Whether the user doing the request can edit the article  # noqa: E501

        :return: The can_edit of this Article.  # noqa: E501
        :rtype: bool
        """
        return self._can_edit

    @can_edit.setter
    def can_edit(self, can_edit):
        """Sets the can_edit of this Article.

        Whether the user doing the request can edit the article  # noqa: E501

        :param can_edit: The can_edit of this Article.  # noqa: E501
        :type: bool
        """

        self._can_edit = can_edit

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


        :return: The structured_content of this Article.  # noqa: E501
        :rtype: StructuredContent
        """
        return self._structured_content

    @structured_content.setter
    def structured_content(self, structured_content):
        """Sets the structured_content of this Article.


        :param structured_content: The structured_content of this Article.  # noqa: E501
        :type: StructuredContent
        """

        self._structured_content = structured_content

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

        return self.__dict__ == other.__dict__

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