# coding: utf-8

"""
    Managed Ray API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class TryLoginEmailResponse(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 = {
        'email_address': 'str',
        'create_new_org': 'bool',
        'organizations': 'list[OrganizationSummary]',
        'invite_code': 'str'
    }

    attribute_map = {
        'email_address': 'email_address',
        'create_new_org': 'create_new_org',
        'organizations': 'organizations',
        'invite_code': 'invite_code'
    }

    def __init__(self, email_address=None, create_new_org=None, organizations=None, invite_code=None, local_vars_configuration=None):  # noqa: E501
        """TryLoginEmailResponse - 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._email_address = None
        self._create_new_org = None
        self._organizations = None
        self._invite_code = None
        self.discriminator = None

        self.email_address = email_address
        self.create_new_org = create_new_org
        if organizations is not None:
            self.organizations = organizations
        if invite_code is not None:
            self.invite_code = invite_code

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

        The email address that the user is trying to log in with  # noqa: E501

        :return: The email_address of this TryLoginEmailResponse.  # noqa: E501
        :rtype: str
        """
        return self._email_address

    @email_address.setter
    def email_address(self, email_address):
        """Sets the email_address of this TryLoginEmailResponse.

        The email address that the user is trying to log in with  # noqa: E501

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

        self._email_address = email_address

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

        When email has not been used yet, we send user to create a new org  # noqa: E501

        :return: The create_new_org of this TryLoginEmailResponse.  # noqa: E501
        :rtype: bool
        """
        return self._create_new_org

    @create_new_org.setter
    def create_new_org(self, create_new_org):
        """Sets the create_new_org of this TryLoginEmailResponse.

        When email has not been used yet, we send user to create a new org  # noqa: E501

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

        self._create_new_org = create_new_org

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

        When logging in as an existing user, there could be one or multiple organizations to log in to  # noqa: E501

        :return: The organizations of this TryLoginEmailResponse.  # noqa: E501
        :rtype: list[OrganizationSummary]
        """
        return self._organizations

    @organizations.setter
    def organizations(self, organizations):
        """Sets the organizations of this TryLoginEmailResponse.

        When logging in as an existing user, there could be one or multiple organizations to log in to  # noqa: E501

        :param organizations: The organizations of this TryLoginEmailResponse.  # noqa: E501
        :type: list[OrganizationSummary]
        """

        self._organizations = organizations

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

        Invite code to use when creating a new organization. Only present when create_new_org is true and the user registers through a url with an invite code.  # noqa: E501

        :return: The invite_code of this TryLoginEmailResponse.  # noqa: E501
        :rtype: str
        """
        return self._invite_code

    @invite_code.setter
    def invite_code(self, invite_code):
        """Sets the invite_code of this TryLoginEmailResponse.

        Invite code to use when creating a new organization. Only present when create_new_org is true and the user registers through a url with an invite code.  # noqa: E501

        :param invite_code: The invite_code of this TryLoginEmailResponse.  # noqa: E501
        :type: str
        """

        self._invite_code = invite_code

    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, TryLoginEmailResponse):
            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, TryLoginEmailResponse):
            return True

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