# 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 ScmUserOAuthStatus(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 = {
        'authorization_status': 'str',
        'scm_username': 'str',
        'scm_organizations': 'list[ScmUserOAuthStatusScmOrganizations]'
    }

    attribute_map = {
        'authorization_status': 'authorization_status',
        'scm_username': 'scm_username',
        'scm_organizations': 'scm_organizations'
    }

    def __init__(self, authorization_status=None, scm_username=None, scm_organizations=None, local_vars_configuration=None):  # noqa: E501
        """ScmUserOAuthStatus - 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._authorization_status = None
        self._scm_username = None
        self._scm_organizations = None
        self.discriminator = None

        if authorization_status is not None:
            self.authorization_status = authorization_status
        if scm_username is not None:
            self.scm_username = scm_username
        if scm_organizations is not None:
            self.scm_organizations = scm_organizations

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


        :return: The authorization_status of this ScmUserOAuthStatus.  # noqa: E501
        :rtype: str
        """
        return self._authorization_status

    @authorization_status.setter
    def authorization_status(self, authorization_status):
        """Sets the authorization_status of this ScmUserOAuthStatus.


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

        self._authorization_status = authorization_status

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


        :return: The scm_username of this ScmUserOAuthStatus.  # noqa: E501
        :rtype: str
        """
        return self._scm_username

    @scm_username.setter
    def scm_username(self, scm_username):
        """Sets the scm_username of this ScmUserOAuthStatus.


        :param scm_username: The scm_username of this ScmUserOAuthStatus.  # noqa: E501
        :type: str
        """

        self._scm_username = scm_username

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


        :return: The scm_organizations of this ScmUserOAuthStatus.  # noqa: E501
        :rtype: list[ScmUserOAuthStatusScmOrganizations]
        """
        return self._scm_organizations

    @scm_organizations.setter
    def scm_organizations(self, scm_organizations):
        """Sets the scm_organizations of this ScmUserOAuthStatus.


        :param scm_organizations: The scm_organizations of this ScmUserOAuthStatus.  # noqa: E501
        :type: list[ScmUserOAuthStatusScmOrganizations]
        """

        self._scm_organizations = scm_organizations

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

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