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

"""
shelldatareportingapis

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


class StatementOfAccountRequestFilters(object):

    """Implementation of the 'StatementOfAccountRequestFilters' model.

    TODO: type model description here.

    Attributes:
        col_co_code (int): Collecting Company Code (Shell Code) of the
            selected payer.   Optional If ColCo Id is passed else Mandatory.
        payer_id (int): Payer Id of the selected payer. Optional if
            PayerNumber is passed else Mandatory.
        payer_number (str): Payer Number of the selected payer. Optional if
            PayerId is passed else Mandatory.
        include_monthly_invoice_trend (bool): True/False. Optional. Default is
            False. True if the past 13 monthly invoice trend to be included as
            part of the response. Else false.
        include_past_statement_of_accounts (bool): True/False. Optional.
            Default is False. True if the past X SOA documents are to be
            included as part of the response. Else false.
        due_or_over_due_soa_documents_only (bool): True/False Optional Default
            is False. If true PastStatementOfAccounts entity on this API
            output should contain the SOA documents that are due or overdue
            only.
        number_of_soa_documents (int): This parameter is only applicable when
            “IncludePastStatementOfAccounts” parameter is set to True.
        include_account_invoices_summary (bool): True/False Optional. Default
            value is false. When true InvoicesSummaries list will be returned
            in the API output.
        col_co_id (int): Collecting Company Id of the selected payer.  
            Optional If ColCo Code is passed else Mandatory.
        accounts (List[Accounts]): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "col_co_code": 'ColCoCode',
        "payer_id": 'PayerId',
        "payer_number": 'PayerNumber',
        "include_monthly_invoice_trend": 'IncludeMonthlyInvoiceTrend',
        "include_past_statement_of_accounts": 'IncludePastStatementOfAccounts',
        "due_or_over_due_soa_documents_only": 'DueOrOverDueSOADocumentsOnly',
        "number_of_soa_documents": 'NumberOfSOADocuments',
        "include_account_invoices_summary": 'IncludeAccountInvoicesSummary',
        "col_co_id": 'ColCoId',
        "accounts": 'Accounts'
    }

    _optionals = [
        'col_co_code',
        'payer_id',
        'payer_number',
        'include_monthly_invoice_trend',
        'include_past_statement_of_accounts',
        'due_or_over_due_soa_documents_only',
        'number_of_soa_documents',
        'include_account_invoices_summary',
        'col_co_id',
        'accounts',
    ]

    _nullables = [
        'col_co_code',
        'payer_id',
        'payer_number',
        'include_monthly_invoice_trend',
        'include_past_statement_of_accounts',
        'due_or_over_due_soa_documents_only',
        'number_of_soa_documents',
        'include_account_invoices_summary',
        'col_co_id',
    ]

    def __init__(self,
                 col_co_code=APIHelper.SKIP,
                 payer_id=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 include_monthly_invoice_trend=APIHelper.SKIP,
                 include_past_statement_of_accounts=APIHelper.SKIP,
                 due_or_over_due_soa_documents_only=APIHelper.SKIP,
                 number_of_soa_documents=APIHelper.SKIP,
                 include_account_invoices_summary=APIHelper.SKIP,
                 col_co_id=APIHelper.SKIP,
                 accounts=APIHelper.SKIP):
        """Constructor for the StatementOfAccountRequestFilters class"""

        # Initialize members of the class
        if col_co_code is not APIHelper.SKIP:
            self.col_co_code = col_co_code 
        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 include_monthly_invoice_trend is not APIHelper.SKIP:
            self.include_monthly_invoice_trend = include_monthly_invoice_trend 
        if include_past_statement_of_accounts is not APIHelper.SKIP:
            self.include_past_statement_of_accounts = include_past_statement_of_accounts 
        if due_or_over_due_soa_documents_only is not APIHelper.SKIP:
            self.due_or_over_due_soa_documents_only = due_or_over_due_soa_documents_only 
        if number_of_soa_documents is not APIHelper.SKIP:
            self.number_of_soa_documents = number_of_soa_documents 
        if include_account_invoices_summary is not APIHelper.SKIP:
            self.include_account_invoices_summary = include_account_invoices_summary 
        if col_co_id is not APIHelper.SKIP:
            self.col_co_id = col_co_id 
        if accounts is not APIHelper.SKIP:
            self.accounts = accounts 

    @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
        col_co_code = dictionary.get("ColCoCode") if "ColCoCode" 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
        include_monthly_invoice_trend = dictionary.get("IncludeMonthlyInvoiceTrend") if "IncludeMonthlyInvoiceTrend" in dictionary.keys() else APIHelper.SKIP
        include_past_statement_of_accounts = dictionary.get("IncludePastStatementOfAccounts") if "IncludePastStatementOfAccounts" in dictionary.keys() else APIHelper.SKIP
        due_or_over_due_soa_documents_only = dictionary.get("DueOrOverDueSOADocumentsOnly") if "DueOrOverDueSOADocumentsOnly" in dictionary.keys() else APIHelper.SKIP
        number_of_soa_documents = dictionary.get("NumberOfSOADocuments") if "NumberOfSOADocuments" in dictionary.keys() else APIHelper.SKIP
        include_account_invoices_summary = dictionary.get("IncludeAccountInvoicesSummary") if "IncludeAccountInvoicesSummary" in dictionary.keys() else APIHelper.SKIP
        col_co_id = dictionary.get("ColCoId") if "ColCoId" in dictionary.keys() else APIHelper.SKIP
        accounts = None
        if dictionary.get('Accounts') is not None:
            accounts = [Accounts.from_dictionary(x) for x in dictionary.get('Accounts')]
        else:
            accounts = APIHelper.SKIP
        # Return an object of this model
        return cls(col_co_code,
                   payer_id,
                   payer_number,
                   include_monthly_invoice_trend,
                   include_past_statement_of_accounts,
                   due_or_over_due_soa_documents_only,
                   number_of_soa_documents,
                   include_account_invoices_summary,
                   col_co_id,
                   accounts)
