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

"""
shelldatareportingapis

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


class InvoiceDownloadReq(object):

    """Implementation of the 'InvoiceDownloadReq' model.

    TODO: type model description here.

    Attributes:
        col_co_code (int): Collecting Company Code of the selected payer.  
            Mandatory
        payer_number (str): Payer Number of the selected payer. Mandatory
            Example: GB000000123
        account_number (List[str]): List of Account Numbers of the invoices.
            Mandatory for customer users else optional.
        document_reference (List[int]): Unique reference ids of invoice
            document (of zip file). Optional if InvoiceOrSOANumber is passed
            else Mandatory.
        invoice_or_soa_number (str): Invoice or the SOA document reference
            number issued by Card s Platform.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "col_co_code": 'ColCoCode',
        "payer_number": 'PayerNumber',
        "account_number": 'AccountNumber',
        "document_reference": 'DocumentReference',
        "invoice_or_soa_number": 'InvoiceOrSOANumber'
    }

    _optionals = [
        'account_number',
        'document_reference',
        'invoice_or_soa_number',
    ]

    _nullables = [
        'col_co_code',
        'payer_number',
        'invoice_or_soa_number',
    ]

    def __init__(self,
                 col_co_code=None,
                 payer_number=None,
                 account_number=APIHelper.SKIP,
                 document_reference=APIHelper.SKIP,
                 invoice_or_soa_number=APIHelper.SKIP):
        """Constructor for the InvoiceDownloadReq class"""

        # Initialize members of the class
        self.col_co_code = col_co_code 
        self.payer_number = payer_number 
        if account_number is not APIHelper.SKIP:
            self.account_number = account_number 
        if document_reference is not APIHelper.SKIP:
            self.document_reference = document_reference 
        if invoice_or_soa_number is not APIHelper.SKIP:
            self.invoice_or_soa_number = invoice_or_soa_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
        col_co_code = dictionary.get("ColCoCode") if dictionary.get("ColCoCode") else None
        payer_number = dictionary.get("PayerNumber") if dictionary.get("PayerNumber") else None
        account_number = dictionary.get("AccountNumber") if dictionary.get("AccountNumber") else APIHelper.SKIP
        document_reference = dictionary.get("DocumentReference") if dictionary.get("DocumentReference") else APIHelper.SKIP
        invoice_or_soa_number = dictionary.get("InvoiceOrSOANumber") if "InvoiceOrSOANumber" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(col_co_code,
                   payer_number,
                   account_number,
                   document_reference,
                   invoice_or_soa_number)
