# coding: utf-8

"""
    Algorithmia Management APIs

    APIs for managing actions on the Algorithmia platform  # noqa: E501

    The version of the OpenAPI document: 1.0.1
    Contact: support@algorithmia.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from algorithmia_api_client.configuration import Configuration


class OrganizationMember(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'org_name': 'str',
        'username': 'str',
        'role': 'str',
        'user_link': 'str',
        'resource_type': 'str'
    }

    attribute_map = {
        'org_name': 'org_name',
        'username': 'username',
        'role': 'role',
        'user_link': 'user_link',
        'resource_type': 'resource_type'
    }

    def __init__(self, org_name=None, username=None, role=None, user_link=None, resource_type=None, local_vars_configuration=None):  # noqa: E501
        """OrganizationMember - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._org_name = None
        self._username = None
        self._role = None
        self._user_link = None
        self._resource_type = None
        self.discriminator = None

        self.org_name = org_name
        self.username = username
        self.role = role
        self.user_link = user_link
        self.resource_type = resource_type

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


        :return: The org_name of this OrganizationMember.  # noqa: E501
        :rtype: str
        """
        return self._org_name

    @org_name.setter
    def org_name(self, org_name):
        """Sets the org_name of this OrganizationMember.


        :param org_name: The org_name of this OrganizationMember.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and org_name is None:  # noqa: E501
            raise ValueError("Invalid value for `org_name`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                org_name is not None and not re.search(r'^[a-zA-Z][a-zA-Z0-9_]*$', org_name)):  # noqa: E501
            raise ValueError(r"Invalid value for `org_name`, must be a follow pattern or equal to `/^[a-zA-Z][a-zA-Z0-9_]*$/`")  # noqa: E501

        self._org_name = org_name

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


        :return: The username of this OrganizationMember.  # noqa: E501
        :rtype: str
        """
        return self._username

    @username.setter
    def username(self, username):
        """Sets the username of this OrganizationMember.


        :param username: The username of this OrganizationMember.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and username is None:  # noqa: E501
            raise ValueError("Invalid value for `username`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                username is not None and not re.search(r'^[a-zA-Z][a-zA-Z0-9_]*$', username)):  # noqa: E501
            raise ValueError(r"Invalid value for `username`, must be a follow pattern or equal to `/^[a-zA-Z][a-zA-Z0-9_]*$/`")  # noqa: E501

        self._username = username

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


        :return: The role of this OrganizationMember.  # noqa: E501
        :rtype: str
        """
        return self._role

    @role.setter
    def role(self, role):
        """Sets the role of this OrganizationMember.


        :param role: The role of this OrganizationMember.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and role is None:  # noqa: E501
            raise ValueError("Invalid value for `role`, must not be `None`")  # noqa: E501
        allowed_values = ["owner", "member", "invited", "unknown"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and role not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `role` ({0}), must be one of {1}"  # noqa: E501
                .format(role, allowed_values)
            )

        self._role = role

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


        :return: The user_link of this OrganizationMember.  # noqa: E501
        :rtype: str
        """
        return self._user_link

    @user_link.setter
    def user_link(self, user_link):
        """Sets the user_link of this OrganizationMember.


        :param user_link: The user_link of this OrganizationMember.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and user_link is None:  # noqa: E501
            raise ValueError("Invalid value for `user_link`, must not be `None`")  # noqa: E501

        self._user_link = user_link

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


        :return: The resource_type of this OrganizationMember.  # noqa: E501
        :rtype: str
        """
        return self._resource_type

    @resource_type.setter
    def resource_type(self, resource_type):
        """Sets the resource_type of this OrganizationMember.


        :param resource_type: The resource_type of this OrganizationMember.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and resource_type is None:  # noqa: E501
            raise ValueError("Invalid value for `resource_type`, must not be `None`")  # noqa: E501

        self._resource_type = resource_type

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

        for attr, _ in six.iteritems(self.openapi_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 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, OrganizationMember):
            return False

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
