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

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

    number = marshmallow.fields.String()

    sort_code = marshmallow.fields.String()

    swift_bic = marshmallow.fields.String()

    @validates("iban")
    def validates_iban(self, iban):
        pass

    @validates("number")
    def validates_number(self, number):
        pass

    @validates("sort_code")
    def validates_sort_code(self, sort_code):
        pass

    @validates("swift_bic")
    def validates_swift_bic(self, swift_bic):
        pass

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


class AccountNumber(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 = {
        'iban': 'str',
        'number': 'str',
        'sort_code': 'str',
        'swift_bic': 'str'
    }

    attribute_map = {
        'iban': 'iban',
        'number': 'number',
        'sort_code': 'sort_code',
        'swift_bic': 'swift_bic'
    }

    def __init__(self, iban=missing, number=missing, sort_code=missing, swift_bic=missing, local_vars_configuration=None):  # noqa: E501
        """AccountNumber - 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 = AccountNumberSchema().load({
                'iban': iban,
                'number': number,
                'sort_code': sort_code,
                'swift_bic': swift_bic
            })
            self.iban = validated.iban
            self.number = validated.number
            self.sort_code = validated.sort_code
            self.swift_bic = validated.swift_bic
        else:
            self.iban = iban
            self.number = number
            self.sort_code = sort_code
            self.swift_bic = swift_bic

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

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