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

"""
shelldatareportingapis

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from shelldatareportingapis.api_helper import APIHelper


class PastStatementOfAccounts(object):

    """Implementation of the 'PastStatementOfAccounts' model.

    TODO: type model description here.

    Attributes:
        amount_due (float): Invoiced amount under this statement of account
            and due for payment.
        amount_not_overdue (float): Total Invoiced amount until this SOA and
            not overdue for payment.
        amount_overdue (float): Overdue amount from the previously generated
            statement of accounts.
        amount_overdue_from_unallocated (float): Overdue amount calculated
            from unallocated payment.
        amount_paid (float): Amount settled for this Statement.
        balance_on_this_statement (float): Balance amount to be settled on
            this SOA.
        billing_currency_code (str): Billing currency ISO code. Example: EUR
        billing_currency_symbol (str): Billing currency symbol. Example: €
        credit_limit (float): Credit limit.
        credit_limit_currency_code (str): ISO code of the credit limit’s
            currency. Example: EUR
        credit_limit_currency_symbol (str): Symbol of the credit limit’s
            currency. Example: €
        credit_limit_in_customer_currency (float): Credit limit in Customer
            currency. Note: For currency details refer the parameters
            CurrencyCode & CurrencySymbol in the SOADetail response.
        currency_code (str): ISO code of SOA currency.   Example: EUR
        currency_symbol (str): Symbol of SOA currency.   Example: €
        fully_paid (bool): True If all summary billing documents under this
            SOA are fully paid (i.e., the fully paid flag is set to true for
            all documents or the amount allocated is greater than or equal to
            the amount due under this SOA.
        last_payment_currency_code (str): ISO code of last payment currency.  
            Example: EUR
        last_payment_currency_symbol (str): Symbol of last payment currency.  
            Example: €
        last_payment_date (str): Last payment date. Format: yyyyMMdd
        last_payment_value (float): Last payment value.
        outstanding_balance (float): Total outstanding balance at the time of
            this SOA generation.
        payer_id (int): Payment customer id of the customer.
        payer_number (str): Payment customer number.
        payment_due_date (str): Due date for payment. Format: yyyyMMdd
        so_a_reference_number (str): Statement of account reference number.
        statement_date (str): Date on which the SOA was generated. Format:
            yyyyMMdd
        statement_of_account_id (int): Statement of account identifier,
        total_billing_documents (int): Total number of billing documents
            generated under this Statement of Account.
        total_net_amount_billing_currency (float): Total NET amount from all
            billing documents in this SOA.
        total_summary_billing_documents (float): Total number of summary
            billing documents for this Statement of Account
        total_vat_amount_billing_currency (float): Total VAT amount from all
            billing documents in this SOA.
        unallocated_payment (float): Amount paid but not allocated to any
            invoices at the time of this SOA generation.
        local_currency_code (str): Currency ISO code of the local country. It
            is derived based on CountryCode from microservice configuration.
            This field is expected to have different value than the previously
            mentioned field CurrencyCode, only in the case of serviced OUs.
            Example: EUR
        local_currency_symbol (str): Currency Symbol of the local country. It
            is derived based on CountryCode from microservice configuration.
            This field is expected to have different value than the previously
            mentioned field CurrencySymbol, only in the case of serviced OUs.
            Example: €
        local_currency_exchange_rate (float): Exchange rate from Billing
            currency to local currency. Example: 1.2

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "amount_due": 'AmountDue',
        "amount_not_overdue": 'AmountNotOverdue',
        "amount_overdue": 'AmountOverdue',
        "amount_overdue_from_unallocated": 'AmountOverdueFromUnallocated',
        "amount_paid": 'AmountPaid',
        "balance_on_this_statement": 'BalanceOnThisStatement',
        "billing_currency_code": 'BillingCurrencyCode',
        "billing_currency_symbol": 'BillingCurrencySymbol',
        "credit_limit": 'CreditLimit',
        "credit_limit_currency_code": 'CreditLimitCurrencyCode',
        "credit_limit_currency_symbol": 'CreditLimitCurrencySymbol',
        "credit_limit_in_customer_currency": 'CreditLimitInCustomerCurrency',
        "currency_code": 'CurrencyCode',
        "currency_symbol": 'CurrencySymbol',
        "fully_paid": 'FullyPaid',
        "last_payment_currency_code": 'LastPaymentCurrencyCode',
        "last_payment_currency_symbol": 'LastPaymentCurrencySymbol',
        "last_payment_date": 'LastPaymentDate',
        "last_payment_value": 'LastPaymentValue',
        "outstanding_balance": 'OutstandingBalance',
        "payer_id": 'PayerId',
        "payer_number": 'PayerNumber',
        "payment_due_date": 'PaymentDueDate',
        "so_a_reference_number": 'SoAReferenceNumber',
        "statement_date": 'StatementDate',
        "statement_of_account_id": 'StatementOfAccountId',
        "total_billing_documents": 'TotalBillingDocuments',
        "total_net_amount_billing_currency": 'TotalNetAmountBillingCurrency',
        "total_summary_billing_documents": 'TotalSummaryBillingDocuments',
        "total_vat_amount_billing_currency": 'TotalVATAmountBillingCurrency',
        "unallocated_payment": 'UnallocatedPayment',
        "local_currency_code": 'LocalCurrencyCode',
        "local_currency_symbol": 'LocalCurrencySymbol',
        "local_currency_exchange_rate": 'LocalCurrencyExchangeRate'
    }

    _optionals = [
        'amount_due',
        'amount_not_overdue',
        'amount_overdue',
        'amount_overdue_from_unallocated',
        'amount_paid',
        'balance_on_this_statement',
        'billing_currency_code',
        'billing_currency_symbol',
        'credit_limit',
        'credit_limit_currency_code',
        'credit_limit_currency_symbol',
        'credit_limit_in_customer_currency',
        'currency_code',
        'currency_symbol',
        'fully_paid',
        'last_payment_currency_code',
        'last_payment_currency_symbol',
        'last_payment_date',
        'last_payment_value',
        'outstanding_balance',
        'payer_id',
        'payer_number',
        'payment_due_date',
        'so_a_reference_number',
        'statement_date',
        'statement_of_account_id',
        'total_billing_documents',
        'total_net_amount_billing_currency',
        'total_summary_billing_documents',
        'total_vat_amount_billing_currency',
        'unallocated_payment',
        'local_currency_code',
        'local_currency_symbol',
        'local_currency_exchange_rate',
    ]

    _nullables = [
        'amount_due',
        'amount_not_overdue',
        'amount_overdue',
        'amount_overdue_from_unallocated',
        'amount_paid',
        'balance_on_this_statement',
        'billing_currency_code',
        'billing_currency_symbol',
        'credit_limit',
        'credit_limit_currency_code',
        'credit_limit_currency_symbol',
        'credit_limit_in_customer_currency',
        'currency_code',
        'currency_symbol',
        'fully_paid',
        'last_payment_currency_code',
        'last_payment_currency_symbol',
        'last_payment_date',
        'last_payment_value',
        'outstanding_balance',
        'payer_id',
        'payer_number',
        'payment_due_date',
        'so_a_reference_number',
        'statement_date',
        'statement_of_account_id',
        'total_billing_documents',
        'total_net_amount_billing_currency',
        'total_summary_billing_documents',
        'total_vat_amount_billing_currency',
        'unallocated_payment',
        'local_currency_code',
        'local_currency_symbol',
        'local_currency_exchange_rate',
    ]

    def __init__(self,
                 amount_due=APIHelper.SKIP,
                 amount_not_overdue=APIHelper.SKIP,
                 amount_overdue=APIHelper.SKIP,
                 amount_overdue_from_unallocated=APIHelper.SKIP,
                 amount_paid=APIHelper.SKIP,
                 balance_on_this_statement=APIHelper.SKIP,
                 billing_currency_code=APIHelper.SKIP,
                 billing_currency_symbol=APIHelper.SKIP,
                 credit_limit=APIHelper.SKIP,
                 credit_limit_currency_code=APIHelper.SKIP,
                 credit_limit_currency_symbol=APIHelper.SKIP,
                 credit_limit_in_customer_currency=APIHelper.SKIP,
                 currency_code=APIHelper.SKIP,
                 currency_symbol=APIHelper.SKIP,
                 fully_paid=APIHelper.SKIP,
                 last_payment_currency_code=APIHelper.SKIP,
                 last_payment_currency_symbol=APIHelper.SKIP,
                 last_payment_date=APIHelper.SKIP,
                 last_payment_value=APIHelper.SKIP,
                 outstanding_balance=APIHelper.SKIP,
                 payer_id=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 payment_due_date=APIHelper.SKIP,
                 so_a_reference_number=APIHelper.SKIP,
                 statement_date=APIHelper.SKIP,
                 statement_of_account_id=APIHelper.SKIP,
                 total_billing_documents=APIHelper.SKIP,
                 total_net_amount_billing_currency=APIHelper.SKIP,
                 total_summary_billing_documents=APIHelper.SKIP,
                 total_vat_amount_billing_currency=APIHelper.SKIP,
                 unallocated_payment=APIHelper.SKIP,
                 local_currency_code=APIHelper.SKIP,
                 local_currency_symbol=APIHelper.SKIP,
                 local_currency_exchange_rate=APIHelper.SKIP):
        """Constructor for the PastStatementOfAccounts class"""

        # Initialize members of the class
        if amount_due is not APIHelper.SKIP:
            self.amount_due = amount_due 
        if amount_not_overdue is not APIHelper.SKIP:
            self.amount_not_overdue = amount_not_overdue 
        if amount_overdue is not APIHelper.SKIP:
            self.amount_overdue = amount_overdue 
        if amount_overdue_from_unallocated is not APIHelper.SKIP:
            self.amount_overdue_from_unallocated = amount_overdue_from_unallocated 
        if amount_paid is not APIHelper.SKIP:
            self.amount_paid = amount_paid 
        if balance_on_this_statement is not APIHelper.SKIP:
            self.balance_on_this_statement = balance_on_this_statement 
        if billing_currency_code is not APIHelper.SKIP:
            self.billing_currency_code = billing_currency_code 
        if billing_currency_symbol is not APIHelper.SKIP:
            self.billing_currency_symbol = billing_currency_symbol 
        if credit_limit is not APIHelper.SKIP:
            self.credit_limit = credit_limit 
        if credit_limit_currency_code is not APIHelper.SKIP:
            self.credit_limit_currency_code = credit_limit_currency_code 
        if credit_limit_currency_symbol is not APIHelper.SKIP:
            self.credit_limit_currency_symbol = credit_limit_currency_symbol 
        if credit_limit_in_customer_currency is not APIHelper.SKIP:
            self.credit_limit_in_customer_currency = credit_limit_in_customer_currency 
        if currency_code is not APIHelper.SKIP:
            self.currency_code = currency_code 
        if currency_symbol is not APIHelper.SKIP:
            self.currency_symbol = currency_symbol 
        if fully_paid is not APIHelper.SKIP:
            self.fully_paid = fully_paid 
        if last_payment_currency_code is not APIHelper.SKIP:
            self.last_payment_currency_code = last_payment_currency_code 
        if last_payment_currency_symbol is not APIHelper.SKIP:
            self.last_payment_currency_symbol = last_payment_currency_symbol 
        if last_payment_date is not APIHelper.SKIP:
            self.last_payment_date = last_payment_date 
        if last_payment_value is not APIHelper.SKIP:
            self.last_payment_value = last_payment_value 
        if outstanding_balance is not APIHelper.SKIP:
            self.outstanding_balance = outstanding_balance 
        if payer_id is not APIHelper.SKIP:
            self.payer_id = payer_id 
        if payer_number is not APIHelper.SKIP:
            self.payer_number = payer_number 
        if payment_due_date is not APIHelper.SKIP:
            self.payment_due_date = payment_due_date 
        if so_a_reference_number is not APIHelper.SKIP:
            self.so_a_reference_number = so_a_reference_number 
        if statement_date is not APIHelper.SKIP:
            self.statement_date = statement_date 
        if statement_of_account_id is not APIHelper.SKIP:
            self.statement_of_account_id = statement_of_account_id 
        if total_billing_documents is not APIHelper.SKIP:
            self.total_billing_documents = total_billing_documents 
        if total_net_amount_billing_currency is not APIHelper.SKIP:
            self.total_net_amount_billing_currency = total_net_amount_billing_currency 
        if total_summary_billing_documents is not APIHelper.SKIP:
            self.total_summary_billing_documents = total_summary_billing_documents 
        if total_vat_amount_billing_currency is not APIHelper.SKIP:
            self.total_vat_amount_billing_currency = total_vat_amount_billing_currency 
        if unallocated_payment is not APIHelper.SKIP:
            self.unallocated_payment = unallocated_payment 
        if local_currency_code is not APIHelper.SKIP:
            self.local_currency_code = local_currency_code 
        if local_currency_symbol is not APIHelper.SKIP:
            self.local_currency_symbol = local_currency_symbol 
        if local_currency_exchange_rate is not APIHelper.SKIP:
            self.local_currency_exchange_rate = local_currency_exchange_rate 

    @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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        amount_due = dictionary.get("AmountDue") if "AmountDue" in dictionary.keys() else APIHelper.SKIP
        amount_not_overdue = dictionary.get("AmountNotOverdue") if "AmountNotOverdue" in dictionary.keys() else APIHelper.SKIP
        amount_overdue = dictionary.get("AmountOverdue") if "AmountOverdue" in dictionary.keys() else APIHelper.SKIP
        amount_overdue_from_unallocated = dictionary.get("AmountOverdueFromUnallocated") if "AmountOverdueFromUnallocated" in dictionary.keys() else APIHelper.SKIP
        amount_paid = dictionary.get("AmountPaid") if "AmountPaid" in dictionary.keys() else APIHelper.SKIP
        balance_on_this_statement = dictionary.get("BalanceOnThisStatement") if "BalanceOnThisStatement" in dictionary.keys() else APIHelper.SKIP
        billing_currency_code = dictionary.get("BillingCurrencyCode") if "BillingCurrencyCode" in dictionary.keys() else APIHelper.SKIP
        billing_currency_symbol = dictionary.get("BillingCurrencySymbol") if "BillingCurrencySymbol" in dictionary.keys() else APIHelper.SKIP
        credit_limit = dictionary.get("CreditLimit") if "CreditLimit" in dictionary.keys() else APIHelper.SKIP
        credit_limit_currency_code = dictionary.get("CreditLimitCurrencyCode") if "CreditLimitCurrencyCode" in dictionary.keys() else APIHelper.SKIP
        credit_limit_currency_symbol = dictionary.get("CreditLimitCurrencySymbol") if "CreditLimitCurrencySymbol" in dictionary.keys() else APIHelper.SKIP
        credit_limit_in_customer_currency = dictionary.get("CreditLimitInCustomerCurrency") if "CreditLimitInCustomerCurrency" in dictionary.keys() else APIHelper.SKIP
        currency_code = dictionary.get("CurrencyCode") if "CurrencyCode" in dictionary.keys() else APIHelper.SKIP
        currency_symbol = dictionary.get("CurrencySymbol") if "CurrencySymbol" in dictionary.keys() else APIHelper.SKIP
        fully_paid = dictionary.get("FullyPaid") if "FullyPaid" in dictionary.keys() else APIHelper.SKIP
        last_payment_currency_code = dictionary.get("LastPaymentCurrencyCode") if "LastPaymentCurrencyCode" in dictionary.keys() else APIHelper.SKIP
        last_payment_currency_symbol = dictionary.get("LastPaymentCurrencySymbol") if "LastPaymentCurrencySymbol" in dictionary.keys() else APIHelper.SKIP
        last_payment_date = dictionary.get("LastPaymentDate") if "LastPaymentDate" in dictionary.keys() else APIHelper.SKIP
        last_payment_value = dictionary.get("LastPaymentValue") if "LastPaymentValue" in dictionary.keys() else APIHelper.SKIP
        outstanding_balance = dictionary.get("OutstandingBalance") if "OutstandingBalance" in dictionary.keys() else APIHelper.SKIP
        payer_id = dictionary.get("PayerId") if "PayerId" in dictionary.keys() else APIHelper.SKIP
        payer_number = dictionary.get("PayerNumber") if "PayerNumber" in dictionary.keys() else APIHelper.SKIP
        payment_due_date = dictionary.get("PaymentDueDate") if "PaymentDueDate" in dictionary.keys() else APIHelper.SKIP
        so_a_reference_number = dictionary.get("SoAReferenceNumber") if "SoAReferenceNumber" in dictionary.keys() else APIHelper.SKIP
        statement_date = dictionary.get("StatementDate") if "StatementDate" in dictionary.keys() else APIHelper.SKIP
        statement_of_account_id = dictionary.get("StatementOfAccountId") if "StatementOfAccountId" in dictionary.keys() else APIHelper.SKIP
        total_billing_documents = dictionary.get("TotalBillingDocuments") if "TotalBillingDocuments" in dictionary.keys() else APIHelper.SKIP
        total_net_amount_billing_currency = dictionary.get("TotalNetAmountBillingCurrency") if "TotalNetAmountBillingCurrency" in dictionary.keys() else APIHelper.SKIP
        total_summary_billing_documents = dictionary.get("TotalSummaryBillingDocuments") if "TotalSummaryBillingDocuments" in dictionary.keys() else APIHelper.SKIP
        total_vat_amount_billing_currency = dictionary.get("TotalVATAmountBillingCurrency") if "TotalVATAmountBillingCurrency" in dictionary.keys() else APIHelper.SKIP
        unallocated_payment = dictionary.get("UnallocatedPayment") if "UnallocatedPayment" in dictionary.keys() else APIHelper.SKIP
        local_currency_code = dictionary.get("LocalCurrencyCode") if "LocalCurrencyCode" in dictionary.keys() else APIHelper.SKIP
        local_currency_symbol = dictionary.get("LocalCurrencySymbol") if "LocalCurrencySymbol" in dictionary.keys() else APIHelper.SKIP
        local_currency_exchange_rate = dictionary.get("LocalCurrencyExchangeRate") if "LocalCurrencyExchangeRate" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(amount_due,
                   amount_not_overdue,
                   amount_overdue,
                   amount_overdue_from_unallocated,
                   amount_paid,
                   balance_on_this_statement,
                   billing_currency_code,
                   billing_currency_symbol,
                   credit_limit,
                   credit_limit_currency_code,
                   credit_limit_currency_symbol,
                   credit_limit_in_customer_currency,
                   currency_code,
                   currency_symbol,
                   fully_paid,
                   last_payment_currency_code,
                   last_payment_currency_symbol,
                   last_payment_date,
                   last_payment_value,
                   outstanding_balance,
                   payer_id,
                   payer_number,
                   payment_due_date,
                   so_a_reference_number,
                   statement_date,
                   statement_of_account_id,
                   total_billing_documents,
                   total_net_amount_billing_currency,
                   total_summary_billing_documents,
                   total_vat_amount_billing_currency,
                   unallocated_payment,
                   local_currency_code,
                   local_currency_symbol,
                   local_currency_exchange_rate)
