# -*- coding: utf-8 -*-

"""
pqapiv2

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from pqapiv2.models.bank_account_required_fields import BankAccountRequiredFields
from pqapiv2.models.monetary_formatted import MonetaryFormatted


class BankAccountRequirement(object):

    """Implementation of the '_bankAccountRequirement' model.

    Classifies the format of the required information for a bank account

    Attributes:
        bank_country (CountryTypesEnum): Two-digit country code types
        bank_currency (CurrencyTypesEnum): Currency code type for the object
        source_country (CountryTypesEnum): Two-digit country code types
        source_currency (CurrencyTypesEnum): Currency code type for the
            object
        requirements (list of BankAccountRequiredFields): TODO: type
            description here.
        quote (MonetaryFormatted): Object representing monies, including
            currency, decimal, and formatted amounts

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "bank_country": 'bankCountry',
        "bank_currency": 'bankCurrency',
        "source_country": 'sourceCountry',
        "source_currency": 'sourceCurrency',
        "requirements": 'requirements',
        "quote": 'quote'
    }

    def __init__(self,
                 bank_country=None,
                 bank_currency=None,
                 source_country=None,
                 source_currency=None,
                 requirements=None,
                 quote=None):
        """Constructor for the BankAccountRequirement class"""

        # Initialize members of the class
        self.bank_country = bank_country
        self.bank_currency = bank_currency
        self.source_country = source_country
        self.source_currency = source_currency
        self.requirements = requirements
        self.quote = quote

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if dictionary is None:
            return None

        # Extract variables from the dictionary
        bank_country = dictionary.get('bankCountry')
        bank_currency = dictionary.get('bankCurrency')
        source_country = dictionary.get('sourceCountry')
        source_currency = dictionary.get('sourceCurrency')
        requirements = None
        if dictionary.get('requirements') is not None:
            requirements = [BankAccountRequiredFields.from_dictionary(x) for x in dictionary.get('requirements')]
        quote = MonetaryFormatted.from_dictionary(dictionary.get('quote')) if dictionary.get('quote') else None

        # Return an object of this model
        return cls(bank_country,
                   bank_currency,
                   source_country,
                   source_currency,
                   requirements,
                   quote)
