# 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 CardBalanceSchema(Schema):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """
    available = marshmallow.fields.Float()

    credit_limit = marshmallow.fields.Float()

    currency = marshmallow.fields.String()

    current = marshmallow.fields.Float()

    last_statement_balance = marshmallow.fields.Float()

    last_statement_date = fields.DateTime()

    payment_due = marshmallow.fields.Float()

    payment_due_date = fields.DateTime()

    update_timestamp = fields.DateTime()

    @validates("available")
    def validates_available(self, available):
        pass

    @validates("credit_limit")
    def validates_credit_limit(self, credit_limit):
        pass

    @validates("currency")
    def validates_currency(self, currency):
        pass

    @validates("current")
    def validates_current(self, current):
        pass

    @validates("last_statement_balance")
    def validates_last_statement_balance(self, last_statement_balance):
        pass

    @validates("last_statement_date")
    def validates_last_statement_date(self, last_statement_date):
        pass

    @validates("payment_due")
    def validates_payment_due(self, payment_due):
        pass

    @validates("payment_due_date")
    def validates_payment_due_date(self, payment_due_date):
        pass

    @validates("update_timestamp")
    def validates_update_timestamp(self, update_timestamp):
        pass

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


class CardBalance(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 = {
        'available': 'float',
        'credit_limit': 'float',
        'currency': 'str',
        'current': 'float',
        'last_statement_balance': 'float',
        'last_statement_date': 'datetime',
        'payment_due': 'float',
        'payment_due_date': 'datetime',
        'update_timestamp': 'datetime'
    }

    attribute_map = {
        'available': 'available',
        'credit_limit': 'credit_limit',
        'currency': 'currency',
        'current': 'current',
        'last_statement_balance': 'last_statement_balance',
        'last_statement_date': 'last_statement_date',
        'payment_due': 'payment_due',
        'payment_due_date': 'payment_due_date',
        'update_timestamp': 'update_timestamp'
    }

    def __init__(self, available=missing, credit_limit=missing, currency=missing, current=missing, last_statement_balance=missing, last_statement_date=missing, payment_due=missing, payment_due_date=missing, update_timestamp=missing, local_vars_configuration=None):  # noqa: E501
        """CardBalance - 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 = CardBalanceSchema().load({
                'available': available,
                'credit_limit': credit_limit,
                'currency': currency,
                'current': current,
                'last_statement_balance': last_statement_balance,
                'last_statement_date': last_statement_date,
                'payment_due': payment_due,
                'payment_due_date': payment_due_date,
                'update_timestamp': update_timestamp
            })
            self.available = validated.available
            self.credit_limit = validated.credit_limit
            self.currency = validated.currency
            self.current = validated.current
            self.last_statement_balance = validated.last_statement_balance
            self.last_statement_date = validated.last_statement_date
            self.payment_due = validated.payment_due
            self.payment_due_date = validated.payment_due_date
            self.update_timestamp = validated.update_timestamp
        else:
            self.available = available
            self.credit_limit = credit_limit
            self.currency = currency
            self.current = current
            self.last_statement_balance = last_statement_balance
            self.last_statement_date = last_statement_date
            self.payment_due = payment_due
            self.payment_due_date = payment_due_date
            self.update_timestamp = update_timestamp

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

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