# 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 User(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 = {
        'fullname': 'str',
        'email': 'str',
        'username': 'str',
        'company_name': 'str',
        'company_role': 'str',
        'self_link': 'str',
        'resource_type': 'str'
    }

    attribute_map = {
        'fullname': 'fullname',
        'email': 'email',
        'username': 'username',
        'company_name': 'company_name',
        'company_role': 'company_role',
        'self_link': 'self_link',
        'resource_type': 'resource_type'
    }

    def __init__(self, fullname=None, email=None, username=None, company_name=None, company_role=None, self_link=None, resource_type=None, local_vars_configuration=None):  # noqa: E501
        """User - 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._fullname = None
        self._email = None
        self._username = None
        self._company_name = None
        self._company_role = None
        self._self_link = None
        self._resource_type = None
        self.discriminator = None

        if fullname is not None:
            self.fullname = fullname
        self.email = email
        self.username = username
        if company_name is not None:
            self.company_name = company_name
        if company_role is not None:
            self.company_role = company_role
        if self_link is not None:
            self.self_link = self_link
        self.resource_type = resource_type

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


        :return: The fullname of this User.  # noqa: E501
        :rtype: str
        """
        return self._fullname

    @fullname.setter
    def fullname(self, fullname):
        """Sets the fullname of this User.


        :param fullname: The fullname of this User.  # noqa: E501
        :type: str
        """

        self._fullname = fullname

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


        :return: The email of this User.  # noqa: E501
        :rtype: str
        """
        return self._email

    @email.setter
    def email(self, email):
        """Sets the email of this User.


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

        self._email = email

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


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

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


        :param username: The username of this User.  # 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 company_name(self):
        """Gets the company_name of this User.  # noqa: E501


        :return: The company_name of this User.  # noqa: E501
        :rtype: str
        """
        return self._company_name

    @company_name.setter
    def company_name(self, company_name):
        """Sets the company_name of this User.


        :param company_name: The company_name of this User.  # noqa: E501
        :type: str
        """

        self._company_name = company_name

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


        :return: The company_role of this User.  # noqa: E501
        :rtype: str
        """
        return self._company_role

    @company_role.setter
    def company_role(self, company_role):
        """Sets the company_role of this User.


        :param company_role: The company_role of this User.  # noqa: E501
        :type: str
        """

        self._company_role = company_role

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


        :return: The self_link of this User.  # noqa: E501
        :rtype: str
        """
        return self._self_link

    @self_link.setter
    def self_link(self, self_link):
        """Sets the self_link of this User.


        :param self_link: The self_link of this User.  # noqa: E501
        :type: str
        """

        self._self_link = self_link

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


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

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


        :param resource_type: The resource_type of this User.  # 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, User):
            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, User):
            return True

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