# coding: utf-8

"""
    TrueLayer Resource API

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

    The version of the OpenAPI document: v1.0
    Contact: rienafairefr@gmail.com
    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 import fields
from truelayer.configuration import Configuration



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

    Do not edit the class manually.
    """
    results = marshmallow.fields.List(fields.Nested('Card')('CardSchema', )
,)

    results_uri = marshmallow.fields.String()

    status = marshmallow.fields.String()

    task_id = marshmallow.fields.String()

    @validates("results")
    def validates_results(self, results):
        pass

    @validates("results_uri")
    def validates_results_uri(self, results_uri):
        pass

    @validates("status")
    def validates_status(self, status):
        allowed_values = ["Queued", "Running", "Succeeded", "Failed"]  # noqa: E501
        if status not in allowed_values:  # noqa: E501
            raise ValidationError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )
        pass

    @validates("task_id")
    def validates_task_id(self, task_id):
        pass

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


class APIResponseCard(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 = {
        'results': 'list[Card]',
        'results_uri': 'str',
        'status': 'str',
        'task_id': 'str'
    }

    attribute_map = {
        'results': 'results',
        'results_uri': 'results_uri',
        'status': 'status',
        'task_id': 'task_id'
    }

    def __init__(self, results=missing, results_uri=missing, status=missing, task_id=missing, local_vars_configuration=None):  # noqa: E501
        """APIResponseCard - 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 = APIResponseCardSchema().load({
                'results': results,
                'results_uri': results_uri,
                'status': status,
                'task_id': task_id
            })
            self.results = validated.results
            self.results_uri = validated.results_uri
            self.status = validated.status
            self.task_id = validated.task_id
        else:
            self.results = results
            self.results_uri = results_uri
            self.status = status
            self.task_id = task_id

    def to_dict(self):
        """Returns the model properties as a dict"""
        return APIResponseCardSchema().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, APIResponseCard):
            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, APIResponseCard):
            return True

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