# coding: utf-8

"""
    TrueLayer Authtentication

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

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


import pprint
import re  # noqa: F401

import six

import marshmallow
from marshmallow import Schema, validates, ValidationError, post_load, missing

from truelayer.auth import fields
from truelayer.auth.configuration import Configuration



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

    Do not edit the class manually.
    """
    country = marshmallow.fields.String()

    display_name = marshmallow.fields.String()

    logo_url = marshmallow.fields.String()

    provider_id = marshmallow.fields.String()

    scopes = marshmallow.fields.List(marshmallow.fields.String()
,)

    @validates("country")
    def validates_country(self, country):
        pass

    @validates("display_name")
    def validates_display_name(self, display_name):
        pass

    @validates("logo_url")
    def validates_logo_url(self, logo_url):
        pass

    @validates("provider_id")
    def validates_provider_id(self, provider_id):
        pass

    @validates("scopes")
    def validates_scopes(self, scopes):
        pass

    @post_load
    def post_load(self, data, **kwargs):
        config = Configuration()
        config.client_side_validation = False
        return Provider(local_vars_configuration=config, **data)


class Provider(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 = {
        'country': 'str',
        'display_name': 'str',
        'logo_url': 'str',
        'provider_id': 'str',
        'scopes': 'list[str]'
    }

    attribute_map = {
        'country': 'country',
        'display_name': 'display_name',
        'logo_url': 'logo_url',
        'provider_id': 'provider_id',
        'scopes': 'scopes'
    }

    def __init__(self, country=missing, display_name=missing, logo_url=missing, provider_id=missing, scopes=missing, local_vars_configuration=None):  # noqa: E501
        """Provider - 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.discriminator = None
        if self.local_vars_configuration.client_side_validation:
            validated = ProviderSchema().load({
                'country': country,
                'display_name': display_name,
                'logo_url': logo_url,
                'provider_id': provider_id,
                'scopes': scopes
            })
            self.country = validated.country
            self.display_name = validated.display_name
            self.logo_url = validated.logo_url
            self.provider_id = validated.provider_id
            self.scopes = validated.scopes
        else:
            self.country = country
            self.display_name = display_name
            self.logo_url = logo_url
            self.provider_id = provider_id
            self.scopes = scopes

    def to_dict(self):
        """Returns the model properties as a dict"""
        return ProviderSchema().dump(self)

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

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