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

"""
shelldatareportingapis

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


class SearchStatementOfAccount(object):

    """Implementation of the 'SearchStatementOfAccount' model.

    TODO: type model description here.

    Attributes:
        statement_of_account_id (int): Statement of account identifier
        so_a_reference_number (str): Statement of account reference
        statement_date (str): Date on which the SOA was generated. Format:
            yyyyMMdd
        payer_id (int): Payment customer id of the customer.
        payer_number (str): Payment customer number.
        amount_due (float): Invoiced amount and due for payment
        amount_overdue (float): Invoiced amount and overdue for payment.
        currency_code (str): ISO code of SOA currency.
        currency_symbol (str): Symbol of SOA currency.   Example: €
        due_date (str): Due date for payment. Format: yyyyMMdd  Note:   •   
            Clients to convert this to appropriate DateTime type.  •    SoA
            due date is considered as the latest due date of the invoices
            within the SoA
        invoiced_on_behalf_of (str): ISO code of the country i.e., UK, DE, MY,
            etc. This is the value of the first invoice within the SoA. It may
            not be same for all the invoices within the SoA.
        status (str): Status of the document. Valid values – 1.    Paid –
            Fully paid all Invoices with in the SOA. 2.    Overdue – At least
            one invoice payment due date is less than current date with in the
            SOA. 3.    Due – At least one invoice is due for payment and is
            within the due date. There is no invoice overdue for payment.
        gross_amount_customer_currency (float): Total gross amount in customer
            currency.
        document_reference_number (str): Document reference number fetched

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "statement_of_account_id": 'StatementOfAccountId',
        "so_a_reference_number": 'SoAReferenceNumber',
        "statement_date": 'StatementDate',
        "payer_id": 'PayerId',
        "payer_number": 'PayerNumber',
        "amount_due": 'AmountDue',
        "amount_overdue": 'AmountOverdue',
        "currency_code": 'CurrencyCode',
        "currency_symbol": 'CurrencySymbol',
        "due_date": 'DueDate',
        "invoiced_on_behalf_of": 'InvoicedOnBehalfOf',
        "status": 'Status',
        "gross_amount_customer_currency": 'GrossAmountCustomerCurrency',
        "document_reference_number": 'DocumentReferenceNumber'
    }

    _optionals = [
        'statement_of_account_id',
        'so_a_reference_number',
        'statement_date',
        'payer_id',
        'payer_number',
        'amount_due',
        'amount_overdue',
        'currency_code',
        'currency_symbol',
        'due_date',
        'invoiced_on_behalf_of',
        'status',
        'gross_amount_customer_currency',
        'document_reference_number',
    ]

    _nullables = [
        'statement_of_account_id',
        'so_a_reference_number',
        'statement_date',
        'payer_id',
        'payer_number',
        'amount_due',
        'amount_overdue',
        'currency_code',
        'currency_symbol',
        'due_date',
        'invoiced_on_behalf_of',
        'status',
        'gross_amount_customer_currency',
        'document_reference_number',
    ]

    def __init__(self,
                 statement_of_account_id=APIHelper.SKIP,
                 so_a_reference_number=APIHelper.SKIP,
                 statement_date=APIHelper.SKIP,
                 payer_id=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 amount_due=APIHelper.SKIP,
                 amount_overdue=APIHelper.SKIP,
                 currency_code=APIHelper.SKIP,
                 currency_symbol=APIHelper.SKIP,
                 due_date=APIHelper.SKIP,
                 invoiced_on_behalf_of=APIHelper.SKIP,
                 status=APIHelper.SKIP,
                 gross_amount_customer_currency=APIHelper.SKIP,
                 document_reference_number=APIHelper.SKIP):
        """Constructor for the SearchStatementOfAccount class"""

        # Initialize members of the class
        if statement_of_account_id is not APIHelper.SKIP:
            self.statement_of_account_id = statement_of_account_id 
        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 payer_id is not APIHelper.SKIP:
            self.payer_id = payer_id 
        if payer_number is not APIHelper.SKIP:
            self.payer_number = payer_number 
        if amount_due is not APIHelper.SKIP:
            self.amount_due = amount_due 
        if amount_overdue is not APIHelper.SKIP:
            self.amount_overdue = amount_overdue 
        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 due_date is not APIHelper.SKIP:
            self.due_date = due_date 
        if invoiced_on_behalf_of is not APIHelper.SKIP:
            self.invoiced_on_behalf_of = invoiced_on_behalf_of 
        if status is not APIHelper.SKIP:
            self.status = status 
        if gross_amount_customer_currency is not APIHelper.SKIP:
            self.gross_amount_customer_currency = gross_amount_customer_currency 
        if document_reference_number is not APIHelper.SKIP:
            self.document_reference_number = document_reference_number 

    @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
        statement_of_account_id = dictionary.get("StatementOfAccountId") if "StatementOfAccountId" 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
        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
        amount_due = dictionary.get("AmountDue") if "AmountDue" in dictionary.keys() else APIHelper.SKIP
        amount_overdue = dictionary.get("AmountOverdue") if "AmountOverdue" 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
        due_date = dictionary.get("DueDate") if "DueDate" in dictionary.keys() else APIHelper.SKIP
        invoiced_on_behalf_of = dictionary.get("InvoicedOnBehalfOf") if "InvoicedOnBehalfOf" in dictionary.keys() else APIHelper.SKIP
        status = dictionary.get("Status") if "Status" in dictionary.keys() else APIHelper.SKIP
        gross_amount_customer_currency = dictionary.get("GrossAmountCustomerCurrency") if "GrossAmountCustomerCurrency" in dictionary.keys() else APIHelper.SKIP
        document_reference_number = dictionary.get("DocumentReferenceNumber") if "DocumentReferenceNumber" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(statement_of_account_id,
                   so_a_reference_number,
                   statement_date,
                   payer_id,
                   payer_number,
                   amount_due,
                   amount_overdue,
                   currency_code,
                   currency_symbol,
                   due_date,
                   invoiced_on_behalf_of,
                   status,
                   gross_amount_customer_currency,
                   document_reference_number)
