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

"""
shelldatareportingapis

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


class SearchDocReq(object):

    """Implementation of the 'SearchDocReq' model.

    TODO: type model description here.

    Attributes:
        payer_number (str): Payer Number of the selected payer. Mandatory
            Example: GB000000123
        account_number (str): Account Number of the customer. Mandatory for
            customer users else optional. This input is a search criterion, if
            given. Example: GB000000123
        account_number_list (List[str]): Account Number of the customers.
            optional. This input is a search criterion, if given. Example:
            [“GB00000123”, “GB00000225”]
        invoice_number (str): Invoice number.  Optional if InvoiceNumberList
            is passed else Mandatory   This input is a search criterion, if
            given.  Example: 0123456789
        invoice_number_list (List[str]): List of Invoice number. Optional if
            InvoiceNumber is passed else Mandatory  Example: [“0123456789”,
            “0123459799”]
        invoice_status (str): The status of the invoices Optional One of the
            following values: •    NEW •    VIEWED •    DOWNLOADED •   
            RESTORED
        issuing_date_from (str): Invoice Issuing Date Range/From Optional
            Format: yyyy/MM/dd
        issuing_date_to (str): Invoice Issuing Date Range/To Optional Format:
            yyyy/MM/dd
        due_date_from (str): Invoice Due Date Range/From Optional Format:
            yyyy/MM/dd
        due_date_to (str): Invoice Due Date Range/To Optional Format:
            yyyy/MM/dd
        gross_amount (str): Gross amount of the bill. Optional
        gross_amount_operator (str): Criteria on the gross amount, for
            instance use GT when to retrieve the invoices for that gross
            amount is greater than the given amount on GrossAmount parameter
            above. Optional   This parameter will be ignored if GrossAmount
            parameter is not set.   One of the following values: •    LT (Less
            Than) •    LE (Lesser or Equal) •    EQ (equal) •    GE (Greater
            or equal) •    GT (Greater than)
        document_type (str): Document Type Optional One of the following
            values: •    NAT (National) •    INT (International) •    SOA
            (Statement of Account)
        vat_issuer_country (str): Two letter ISO country code.
        sorty_by (List[str]): Collecting Company Code of the selected payer. 
            Mandatory Example: 86-Philippines 5-UK
        col_co_code (int): Collecting Company Code of the selected payer.  
            Mandatory  Example:  86-Philippines  5-UK

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payer_number": 'PayerNumber',
        "col_co_code": 'ColCoCode',
        "account_number": 'AccountNumber',
        "account_number_list": 'AccountNumberList',
        "invoice_number": 'InvoiceNumber',
        "invoice_number_list": 'InvoiceNumberList',
        "invoice_status": 'InvoiceStatus',
        "issuing_date_from": 'IssuingDateFrom',
        "issuing_date_to": 'IssuingDateTo',
        "due_date_from": 'DueDateFrom',
        "due_date_to": 'DueDateTo',
        "gross_amount": 'GrossAmount',
        "gross_amount_operator": 'GrossAmountOperator',
        "document_type": 'DocumentType',
        "vat_issuer_country": 'VATIssuerCountry',
        "sorty_by": 'SortyBy'
    }

    _optionals = [
        'account_number',
        'account_number_list',
        'invoice_number',
        'invoice_number_list',
        'invoice_status',
        'issuing_date_from',
        'issuing_date_to',
        'due_date_from',
        'due_date_to',
        'gross_amount',
        'gross_amount_operator',
        'document_type',
        'vat_issuer_country',
        'sorty_by',
    ]

    _nullables = [
        'payer_number',
        'account_number',
        'invoice_number',
        'invoice_status',
        'issuing_date_from',
        'issuing_date_to',
        'due_date_from',
        'due_date_to',
        'gross_amount',
        'gross_amount_operator',
        'document_type',
        'vat_issuer_country',
        'col_co_code',
    ]

    def __init__(self,
                 payer_number=None,
                 col_co_code=None,
                 account_number=APIHelper.SKIP,
                 account_number_list=APIHelper.SKIP,
                 invoice_number=APIHelper.SKIP,
                 invoice_number_list=APIHelper.SKIP,
                 invoice_status=APIHelper.SKIP,
                 issuing_date_from=APIHelper.SKIP,
                 issuing_date_to=APIHelper.SKIP,
                 due_date_from=APIHelper.SKIP,
                 due_date_to=APIHelper.SKIP,
                 gross_amount=APIHelper.SKIP,
                 gross_amount_operator=APIHelper.SKIP,
                 document_type=APIHelper.SKIP,
                 vat_issuer_country=APIHelper.SKIP,
                 sorty_by=APIHelper.SKIP):
        """Constructor for the SearchDocReq class"""

        # Initialize members of the class
        self.payer_number = payer_number 
        if account_number is not APIHelper.SKIP:
            self.account_number = account_number 
        if account_number_list is not APIHelper.SKIP:
            self.account_number_list = account_number_list 
        if invoice_number is not APIHelper.SKIP:
            self.invoice_number = invoice_number 
        if invoice_number_list is not APIHelper.SKIP:
            self.invoice_number_list = invoice_number_list 
        if invoice_status is not APIHelper.SKIP:
            self.invoice_status = invoice_status 
        if issuing_date_from is not APIHelper.SKIP:
            self.issuing_date_from = issuing_date_from 
        if issuing_date_to is not APIHelper.SKIP:
            self.issuing_date_to = issuing_date_to 
        if due_date_from is not APIHelper.SKIP:
            self.due_date_from = due_date_from 
        if due_date_to is not APIHelper.SKIP:
            self.due_date_to = due_date_to 
        if gross_amount is not APIHelper.SKIP:
            self.gross_amount = gross_amount 
        if gross_amount_operator is not APIHelper.SKIP:
            self.gross_amount_operator = gross_amount_operator 
        if document_type is not APIHelper.SKIP:
            self.document_type = document_type 
        if vat_issuer_country is not APIHelper.SKIP:
            self.vat_issuer_country = vat_issuer_country 
        if sorty_by is not APIHelper.SKIP:
            self.sorty_by = sorty_by 
        self.col_co_code = col_co_code 

    @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
        payer_number = dictionary.get("PayerNumber") if dictionary.get("PayerNumber") else None
        col_co_code = dictionary.get("ColCoCode") if dictionary.get("ColCoCode") else None
        account_number = dictionary.get("AccountNumber") if "AccountNumber" in dictionary.keys() else APIHelper.SKIP
        account_number_list = dictionary.get("AccountNumberList") if dictionary.get("AccountNumberList") else APIHelper.SKIP
        invoice_number = dictionary.get("InvoiceNumber") if "InvoiceNumber" in dictionary.keys() else APIHelper.SKIP
        invoice_number_list = dictionary.get("InvoiceNumberList") if dictionary.get("InvoiceNumberList") else APIHelper.SKIP
        invoice_status = dictionary.get("InvoiceStatus") if "InvoiceStatus" in dictionary.keys() else APIHelper.SKIP
        issuing_date_from = dictionary.get("IssuingDateFrom") if "IssuingDateFrom" in dictionary.keys() else APIHelper.SKIP
        issuing_date_to = dictionary.get("IssuingDateTo") if "IssuingDateTo" in dictionary.keys() else APIHelper.SKIP
        due_date_from = dictionary.get("DueDateFrom") if "DueDateFrom" in dictionary.keys() else APIHelper.SKIP
        due_date_to = dictionary.get("DueDateTo") if "DueDateTo" in dictionary.keys() else APIHelper.SKIP
        gross_amount = dictionary.get("GrossAmount") if "GrossAmount" in dictionary.keys() else APIHelper.SKIP
        gross_amount_operator = dictionary.get("GrossAmountOperator") if "GrossAmountOperator" in dictionary.keys() else APIHelper.SKIP
        document_type = dictionary.get("DocumentType") if "DocumentType" in dictionary.keys() else APIHelper.SKIP
        vat_issuer_country = dictionary.get("VATIssuerCountry") if "VATIssuerCountry" in dictionary.keys() else APIHelper.SKIP
        sorty_by = dictionary.get("SortyBy") if dictionary.get("SortyBy") else APIHelper.SKIP
        # Return an object of this model
        return cls(payer_number,
                   col_co_code,
                   account_number,
                   account_number_list,
                   invoice_number,
                   invoice_number_list,
                   invoice_status,
                   issuing_date_from,
                   issuing_date_to,
                   due_date_from,
                   due_date_to,
                   gross_amount,
                   gross_amount_operator,
                   document_type,
                   vat_issuer_country,
                   sorty_by)
