# coding: utf-8

"""
    Crm Owners

    HubSpot uses **owners** to assign CRM objects to specific people in your organization. The endpoints described here are used to get a list of the owners that are available for an account. To assign an owner to an object, set the hubspot_owner_id property using the appropriate CRM object update or create a request.  If teams are available for your HubSpot tier, these endpoints will also indicate which team(s) an owner can access, as well as which team is the owner's primary team.  # noqa: E501

    The version of the OpenAPI document: v3
    Generated by: https://openapi-generator.tech
"""


try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from hubspot.crm.owners.configuration import Configuration


class PublicOwner(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 = {
        "first_name": "str",
        "last_name": "str",
        "created_at": "datetime",
        "archived": "bool",
        "teams": "list[PublicTeam]",
        "id": "str",
        "user_id_including_inactive": "int",
        "type": "str",
        "user_id": "int",
        "email": "str",
        "updated_at": "datetime",
    }

    attribute_map = {
        "first_name": "firstName",
        "last_name": "lastName",
        "created_at": "createdAt",
        "archived": "archived",
        "teams": "teams",
        "id": "id",
        "user_id_including_inactive": "userIdIncludingInactive",
        "type": "type",
        "user_id": "userId",
        "email": "email",
        "updated_at": "updatedAt",
    }

    def __init__(
        self,
        first_name=None,
        last_name=None,
        created_at=None,
        archived=None,
        teams=None,
        id=None,
        user_id_including_inactive=None,
        type=None,
        user_id=None,
        email=None,
        updated_at=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """PublicOwner - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._first_name = None
        self._last_name = None
        self._created_at = None
        self._archived = None
        self._teams = None
        self._id = None
        self._user_id_including_inactive = None
        self._type = None
        self._user_id = None
        self._email = None
        self._updated_at = None
        self.discriminator = None

        if first_name is not None:
            self.first_name = first_name
        if last_name is not None:
            self.last_name = last_name
        self.created_at = created_at
        self.archived = archived
        if teams is not None:
            self.teams = teams
        self.id = id
        if user_id_including_inactive is not None:
            self.user_id_including_inactive = user_id_including_inactive
        self.type = type
        if user_id is not None:
            self.user_id = user_id
        if email is not None:
            self.email = email
        self.updated_at = updated_at

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


        :return: The first_name of this PublicOwner.  # noqa: E501
        :rtype: str
        """
        return self._first_name

    @first_name.setter
    def first_name(self, first_name):
        """Sets the first_name of this PublicOwner.


        :param first_name: The first_name of this PublicOwner.  # noqa: E501
        :type first_name: str
        """

        self._first_name = first_name

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


        :return: The last_name of this PublicOwner.  # noqa: E501
        :rtype: str
        """
        return self._last_name

    @last_name.setter
    def last_name(self, last_name):
        """Sets the last_name of this PublicOwner.


        :param last_name: The last_name of this PublicOwner.  # noqa: E501
        :type last_name: str
        """

        self._last_name = last_name

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


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

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


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

        self._created_at = created_at

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


        :return: The archived of this PublicOwner.  # noqa: E501
        :rtype: bool
        """
        return self._archived

    @archived.setter
    def archived(self, archived):
        """Sets the archived of this PublicOwner.


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

        self._archived = archived

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


        :return: The teams of this PublicOwner.  # noqa: E501
        :rtype: list[PublicTeam]
        """
        return self._teams

    @teams.setter
    def teams(self, teams):
        """Sets the teams of this PublicOwner.


        :param teams: The teams of this PublicOwner.  # noqa: E501
        :type teams: list[PublicTeam]
        """

        self._teams = teams

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


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

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


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

        self._id = id

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


        :return: The user_id_including_inactive of this PublicOwner.  # noqa: E501
        :rtype: int
        """
        return self._user_id_including_inactive

    @user_id_including_inactive.setter
    def user_id_including_inactive(self, user_id_including_inactive):
        """Sets the user_id_including_inactive of this PublicOwner.


        :param user_id_including_inactive: The user_id_including_inactive of this PublicOwner.  # noqa: E501
        :type user_id_including_inactive: int
        """

        self._user_id_including_inactive = user_id_including_inactive

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


        :return: The type of this PublicOwner.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this PublicOwner.


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

        self._type = type

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


        :return: The user_id of this PublicOwner.  # noqa: E501
        :rtype: int
        """
        return self._user_id

    @user_id.setter
    def user_id(self, user_id):
        """Sets the user_id of this PublicOwner.


        :param user_id: The user_id of this PublicOwner.  # noqa: E501
        :type user_id: int
        """

        self._user_id = user_id

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


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

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


        :param email: The email of this PublicOwner.  # noqa: E501
        :type email: str
        """

        self._email = email

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


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

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


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

        self._updated_at = updated_at

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

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(lambda x: convert(x), value))
            elif isinstance(value, dict):
                result[attr] = dict(map(lambda item: (item[0], convert(item[1])), value.items()))
            else:
                result[attr] = convert(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, PublicOwner):
            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, PublicOwner):
            return True

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