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

"""
shelldatareportingapis

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


class SearchSOAReq(object):

    """Implementation of the 'SearchSOAReq' model.

    TODO: type model description here.

    Attributes:
        col_co_code (int): Collecting Company Code of the selected payer.
        payer_number (str): Payer Number of the selected payer. Optional if
            PayerId is passed else Mandatory.
        invoice_number (str): Invoice number. Optional. This input is a search
            criterion, if given.
        from_date (str): SOA searched from this date. Optional. This input is
            a search criterion, if given. Date format: yyyy/MM/dd
        to_date (str): Invoice date searched until this date. Optional. This
            input is a search criterion, if given.
        period (int): Invoice date search period. Valid values - Last 7 days –
            Issued in last 7 days. Last 30 days – Issued in last 30 days. Last
            90 days – Issued in last 90 days. Optional. This input is a search
            criterion, if given.
        invoice_date (str): Date of invoicing. Optional. This input is a
            search criterion, if given.
        invoice_status (List[str]): Possible options are: 1.    StatementDate
            ASC 2.    StatementDate DESC Optional Note: This option uses a
            column name with a combination of “ASC or DESC” for sorting. If
            only the column name is provided, it is sorted by ascending. 
            Sorting is allowed only ASC or DESC, If both provided in the input
            ASC will be taken as precedence.
        sort_by (List[int]): Possible options are: 1.    StatementDate ASC 2. 
            StatementDate DESC Optional Note: This option uses a column name
            with a combination of “ASC or DESC” for sorting. If only the
            column name is provided, it is sorted by ascending.  Sorting is
            allowed only ASC or DESC, If both provided in the input ASC will
            be taken as precedence.
        col_co_id (int): Collecting Company Id  of the selected payer.  
            Optional if ColCoCode is passed else Mandatory.  Example: 
            1-Philippines  5-UK
        payer_id (int): Payer Id  of the selected payer.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "col_co_code": 'ColCoCode',
        "payer_number": 'PayerNumber',
        "invoice_number": 'InvoiceNumber',
        "from_date": 'FromDate',
        "to_date": 'ToDate',
        "period": 'Period',
        "invoice_date": 'InvoiceDate',
        "invoice_status": 'InvoiceStatus',
        "sort_by": 'SortBy',
        "col_co_id": 'ColCoId',
        "payer_id": 'PayerId'
    }

    _optionals = [
        'col_co_code',
        'payer_number',
        'invoice_number',
        'from_date',
        'to_date',
        'period',
        'invoice_date',
        'invoice_status',
        'sort_by',
        'col_co_id',
        'payer_id',
    ]

    _nullables = [
        'col_co_code',
        'payer_number',
        'invoice_number',
        'from_date',
        'to_date',
        'period',
        'invoice_date',
        'col_co_id',
        'payer_id',
    ]

    def __init__(self,
                 col_co_code=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 invoice_number=APIHelper.SKIP,
                 from_date=APIHelper.SKIP,
                 to_date=APIHelper.SKIP,
                 period=APIHelper.SKIP,
                 invoice_date=APIHelper.SKIP,
                 invoice_status=APIHelper.SKIP,
                 sort_by=APIHelper.SKIP,
                 col_co_id=APIHelper.SKIP,
                 payer_id=APIHelper.SKIP):
        """Constructor for the SearchSOAReq class"""

        # Initialize members of the class
        if col_co_code is not APIHelper.SKIP:
            self.col_co_code = col_co_code 
        if payer_number is not APIHelper.SKIP:
            self.payer_number = payer_number 
        if invoice_number is not APIHelper.SKIP:
            self.invoice_number = invoice_number 
        if from_date is not APIHelper.SKIP:
            self.from_date = from_date 
        if to_date is not APIHelper.SKIP:
            self.to_date = to_date 
        if period is not APIHelper.SKIP:
            self.period = period 
        if invoice_date is not APIHelper.SKIP:
            self.invoice_date = invoice_date 
        if invoice_status is not APIHelper.SKIP:
            self.invoice_status = invoice_status 
        if sort_by is not APIHelper.SKIP:
            self.sort_by = sort_by 
        if col_co_id is not APIHelper.SKIP:
            self.col_co_id = col_co_id 
        if payer_id is not APIHelper.SKIP:
            self.payer_id = payer_id 

    @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_number = dictionary.get("PayerNumber") if "PayerNumber" in dictionary.keys() else APIHelper.SKIP
        invoice_number = dictionary.get("InvoiceNumber") if "InvoiceNumber" in dictionary.keys() else APIHelper.SKIP
        from_date = dictionary.get("FromDate") if "FromDate" in dictionary.keys() else APIHelper.SKIP
        to_date = dictionary.get("ToDate") if "ToDate" in dictionary.keys() else APIHelper.SKIP
        period = dictionary.get("Period") if "Period" in dictionary.keys() else APIHelper.SKIP
        invoice_date = dictionary.get("InvoiceDate") if "InvoiceDate" in dictionary.keys() else APIHelper.SKIP
        invoice_status = dictionary.get("InvoiceStatus") if dictionary.get("InvoiceStatus") else APIHelper.SKIP
        sort_by = dictionary.get("SortBy") if dictionary.get("SortBy") else APIHelper.SKIP
        col_co_id = dictionary.get("ColCoId") if "ColCoId" in dictionary.keys() else APIHelper.SKIP
        payer_id = dictionary.get("PayerId") if "PayerId" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(col_co_code,
                   payer_number,
                   invoice_number,
                   from_date,
                   to_date,
                   period,
                   invoice_date,
                   invoice_status,
                   sort_by,
                   col_co_id,
                   payer_id)
