# coding: utf-8

"""
Copyright 2016 SmartBear Software

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    Ref: https://github.com/swagger-api/swagger-codegen
"""

from pprint import pformat
from six import iteritems
import re


class Share(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self):
        """
        Share - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'id': 'str',
            'name': 'str',
            'shared_entity_type': 'str',
            'shared_entity': 'UriReference',
            'member_type': 'str',
            'member': 'UriReference',
            'shared_by': 'UriReference',
            'workspace': 'UriReference',
            'user': 'User',
            'group': 'Group',
            'self_uri': 'str'
        }

        self.attribute_map = {
            'id': 'id',
            'name': 'name',
            'shared_entity_type': 'sharedEntityType',
            'shared_entity': 'sharedEntity',
            'member_type': 'memberType',
            'member': 'member',
            'shared_by': 'sharedBy',
            'workspace': 'workspace',
            'user': 'user',
            'group': 'group',
            'self_uri': 'selfUri'
        }

        self._id = None
        self._name = None
        self._shared_entity_type = None
        self._shared_entity = None
        self._member_type = None
        self._member = None
        self._shared_by = None
        self._workspace = None
        self._user = None
        self._group = None
        self._self_uri = None

    @property
    def id(self):
        """
        Gets the id of this Share.
        The globally unique identifier for the object.

        :return: The id of this Share.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this Share.
        The globally unique identifier for the object.

        :param id: The id of this Share.
        :type: str
        """
        
        self._id = id

    @property
    def name(self):
        """
        Gets the name of this Share.


        :return: The name of this Share.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this Share.


        :param name: The name of this Share.
        :type: str
        """
        
        self._name = name

    @property
    def shared_entity_type(self):
        """
        Gets the shared_entity_type of this Share.


        :return: The shared_entity_type of this Share.
        :rtype: str
        """
        return self._shared_entity_type

    @shared_entity_type.setter
    def shared_entity_type(self, shared_entity_type):
        """
        Sets the shared_entity_type of this Share.


        :param shared_entity_type: The shared_entity_type of this Share.
        :type: str
        """
        allowed_values = ["DOCUMENT"]
        if shared_entity_type.lower() not in map(str.lower, allowed_values):
            # print "Invalid value for shared_entity_type -> " + shared_entity_type
            self._shared_entity_type = "outdated_sdk_version"
        else:
            self._shared_entity_type = shared_entity_type.lower()

    @property
    def shared_entity(self):
        """
        Gets the shared_entity of this Share.


        :return: The shared_entity of this Share.
        :rtype: UriReference
        """
        return self._shared_entity

    @shared_entity.setter
    def shared_entity(self, shared_entity):
        """
        Sets the shared_entity of this Share.


        :param shared_entity: The shared_entity of this Share.
        :type: UriReference
        """
        
        self._shared_entity = shared_entity

    @property
    def member_type(self):
        """
        Gets the member_type of this Share.


        :return: The member_type of this Share.
        :rtype: str
        """
        return self._member_type

    @member_type.setter
    def member_type(self, member_type):
        """
        Sets the member_type of this Share.


        :param member_type: The member_type of this Share.
        :type: str
        """
        allowed_values = ["USER", "GROUP", "PUBLIC"]
        if member_type.lower() not in map(str.lower, allowed_values):
            # print "Invalid value for member_type -> " + member_type
            self._member_type = "outdated_sdk_version"
        else:
            self._member_type = member_type.lower()

    @property
    def member(self):
        """
        Gets the member of this Share.


        :return: The member of this Share.
        :rtype: UriReference
        """
        return self._member

    @member.setter
    def member(self, member):
        """
        Sets the member of this Share.


        :param member: The member of this Share.
        :type: UriReference
        """
        
        self._member = member

    @property
    def shared_by(self):
        """
        Gets the shared_by of this Share.


        :return: The shared_by of this Share.
        :rtype: UriReference
        """
        return self._shared_by

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


        :param shared_by: The shared_by of this Share.
        :type: UriReference
        """
        
        self._shared_by = shared_by

    @property
    def workspace(self):
        """
        Gets the workspace of this Share.


        :return: The workspace of this Share.
        :rtype: UriReference
        """
        return self._workspace

    @workspace.setter
    def workspace(self, workspace):
        """
        Sets the workspace of this Share.


        :param workspace: The workspace of this Share.
        :type: UriReference
        """
        
        self._workspace = workspace

    @property
    def user(self):
        """
        Gets the user of this Share.


        :return: The user of this Share.
        :rtype: User
        """
        return self._user

    @user.setter
    def user(self, user):
        """
        Sets the user of this Share.


        :param user: The user of this Share.
        :type: User
        """
        
        self._user = user

    @property
    def group(self):
        """
        Gets the group of this Share.


        :return: The group of this Share.
        :rtype: Group
        """
        return self._group

    @group.setter
    def group(self, group):
        """
        Sets the group of this Share.


        :param group: The group of this Share.
        :type: Group
        """
        
        self._group = group

    @property
    def self_uri(self):
        """
        Gets the self_uri of this Share.
        The URI for this object

        :return: The self_uri of this Share.
        :rtype: str
        """
        return self._self_uri

    @self_uri.setter
    def self_uri(self, self_uri):
        """
        Sets the self_uri of this Share.
        The URI for this object

        :param self_uri: The self_uri of this Share.
        :type: str
        """
        
        self._self_uri = self_uri

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

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

