# 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 PostShare(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 = {
        "shared_by": "UserReference",
        "shared_at": "datetime",
        "shared_to": "CommunityInfo",
        "site_id": "str",
        "is_pinned": "bool",
        "can_pin": "bool",
        "can_unshare": "bool",
    }

    attribute_map = {
        "shared_by": "sharedBy",
        "shared_at": "sharedAt",
        "shared_to": "sharedTo",
        "site_id": "siteId",
        "is_pinned": "isPinned",
        "can_pin": "canPin",
        "can_unshare": "canUnshare",
    }

    def __init__(
        self,
        shared_by=None,
        shared_at=None,
        shared_to=None,
        site_id=None,
        is_pinned=None,
        can_pin=None,
        can_unshare=None,
    ):  # noqa: E501
        """PostShare - a model defined in Swagger"""  # noqa: E501
        self._shared_by = None
        self._shared_at = None
        self._shared_to = None
        self._site_id = None
        self._is_pinned = None
        self._can_pin = None
        self._can_unshare = None
        self.discriminator = None
        self.shared_by = shared_by
        self.shared_at = shared_at
        self.shared_to = shared_to
        self.site_id = site_id
        self.is_pinned = is_pinned
        self.can_pin = can_pin
        self.can_unshare = can_unshare

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


        :return: The shared_by of this PostShare.  # noqa: E501
        :rtype: UserReference
        """
        return self._shared_by

    @shared_by.setter
    def shared_by(self, shared_by):
        """Sets the shared_by of this PostShare.


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

        self._shared_by = shared_by

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

        The date and time when the post was shared to the community.  # noqa: E501

        :return: The shared_at of this PostShare.  # noqa: E501
        :rtype: datetime
        """
        return self._shared_at

    @shared_at.setter
    def shared_at(self, shared_at):
        """Sets the shared_at of this PostShare.

        The date and time when the post was shared to the community.  # noqa: E501

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

        self._shared_at = shared_at

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


        :return: The shared_to of this PostShare.  # noqa: E501
        :rtype: CommunityInfo
        """
        return self._shared_to

    @shared_to.setter
    def shared_to(self, shared_to):
        """Sets the shared_to of this PostShare.


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

        self._shared_to = shared_to

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

        The id of the site owning the community.  # noqa: E501

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

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

        The id of the site owning the community.  # noqa: E501

        :param site_id: The site_id of this PostShare.  # 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 is_pinned(self):
        """Gets the is_pinned of this PostShare.  # noqa: E501

        Whether the post is pinned in the community.  # noqa: E501

        :return: The is_pinned of this PostShare.  # noqa: E501
        :rtype: bool
        """
        return self._is_pinned

    @is_pinned.setter
    def is_pinned(self, is_pinned):
        """Sets the is_pinned of this PostShare.

        Whether the post is pinned in the community.  # noqa: E501

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

        self._is_pinned = is_pinned

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

        Whether the user is allowed to pin or unpin the post in the community.  # noqa: E501

        :return: The can_pin of this PostShare.  # noqa: E501
        :rtype: bool
        """
        return self._can_pin

    @can_pin.setter
    def can_pin(self, can_pin):
        """Sets the can_pin of this PostShare.

        Whether the user is allowed to pin or unpin the post in the community.  # noqa: E501

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

        self._can_pin = can_pin

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

        Whether the user is allowed to remove the sharing of the post to the community.  # noqa: E501

        :return: The can_unshare of this PostShare.  # noqa: E501
        :rtype: bool
        """
        return self._can_unshare

    @can_unshare.setter
    def can_unshare(self, can_unshare):
        """Sets the can_unshare of this PostShare.

        Whether the user is allowed to remove the sharing of the post to the community.  # noqa: E501

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

        self._can_unshare = can_unshare

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

        return self.__dict__ == other.__dict__

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