# -*- 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.multi_priced_transaction_request_accounts_items import MultiPricedTransactionRequestAccountsItems


class MultiPricedTransactionRequest(object):

    """Implementation of the 'MultiPricedTransactionRequest' model.

    TODO: type model description here.

    Attributes:
        col_co_id (int): Collecting Company Id of the selected payer.  
            Optional if ColCoCode is passed else Mandatory.  Example:  1 for
            Philippines  5 for UK
        col_co_code (int): Collecting Company Code of the selected payer.  
            Mandatory for serviced OUs such as Romania, Latvia, Lithuania,
            Estonia, Ukraine etc. It is optional for other countries if
            ColCoID is provided.  Example:  86 for Philippines  5 for UK
        accounts (List[MultiPricedTransactionRequestAccountsItems]): List of
            Payers/Accounts entity.  Mandatory.  •    Max number of payers
            allowed in the input is 10, if it exceeds in the input it will
            throw an error.  •    This value is configurable. Initial
            configuration will be 100 and will change to 10 once SFH changes
            are integrated.  Note:   1.    At least one payer should be
            present.  Accounts information are optional.
        invoice_status (str): Invoice status of the transactions Mandatory
            Possible options: I - Invoiced U – Un-Invoiced A – All Max Length:
            1
        purchased_in_country (str): ISO Country Code (ex: UK, FR) Optional  
            Note: If IncludeFees is true then this filter will be ignored
        from_date (str): Transactions from Date/Time.   Optional – When
            provided, it should be with in last 24 months.     Format: yyyyMMdd
        to_date (str): Transactions to Date/Time.    1) When the value is
            blank and FromDate is provided on the input, all transactions took
            place 210(Configurable) days after the given FromDate is returned.
            2) Difference between FromDate and ToDate cannot be more than 210
            (Configurable) days.    Format: yyyyMMdd
        period (int): Transactions Period.   Possible values are:  1.    Last
            7 Days  2.    Last 30 Days  3.    Last 90 Days
        posting_date_from (str): Transaction Posting Date/time in the Cards
            Platform - From Date/time.     Note: 1) When the value of both
            PostingDateFrom and PostingDateTo are present in the request then
            the value of PostingDateFrom must be less than PostingDateTo. 2)
            If IncludeFees is true then this filter will be ignored   Format:
            yyyyMMdd HH:mm:ss
        posting_date_to (str): Transaction Posting Date/time in the Cards
            Platform – To Date/time.    Note:   1) If IncludeFees is true then
            this filter will be ignored.  2) When the value of both
            PostingDateFrom and PostingDateTo are present in the request then
            the value of PostingDateFrom must be less than PostingDateTo.   
            Format: yyyyMMdd HH:mm:ss
        invoice_date (str): Invoice Date.  Optional    Note:   1) If value is
            not blank then the system will ignore the InvoiceStatus parameter
            and it will return all the billed transactions for the given
            invoice date.    2) If IncludeFees is true then this filter will
            be ignored     Format: yyyyMMdd
        invoice_number (str): Invoice Number.  Optional  Note:   1) If value
            is not blank then the system will ignore the InvoiceStatus
            parameter and it will return all the billed transactions for the
            given invoice date.
        valid_invoice_date_only (bool): True/False  Optional  Default value:
            True.   When passed as ‘True’ the transactions records with report
            date not equal to 9999-12-30 will be returned.  When passed as
            ‘False’ the above condition will not be checked.  Note: If
            IncludeFees is ‘True’ then this filter will be ignored
        invoice_from_date (str): Start date for transaction search by invoice
            date.  Optional  Note:   1) Value should be with in last 24 months
            (if provided).  2) Maximum of 90(Configurable) days duration
            allowed per search.  3) When provided, InvoiceFromDate has to be
            less than or equal to InvoiceToDate.    Format: yyyyMMdd
        invoice_to_date (str): End date for transaction search by invoice
            date.  Optional  Note:     1) When InvoiceFromDate is provided and
            InvoiceToDate is null, then InvoiceToDate will be calculated as
            (InvoiceFromDate + 90 days) or (CurrentDate) whichever is lesser. 
            Format: yyyyMMdd
        fuel_only (bool): True/False  Optional  Default value: False.   When
            passed as ‘True’ Only returned records with Fuel transactions. 
            When passed as ‘False’ the above condition will not be checked. 
            Note: If IncludeFees is ‘True’ then this filter will be ignored
        include_fees (bool): True/False Optional Default value: False When
            passed as ‘True’ then  ignore complex filters, all sales items
            along with fees included on the same response
        sort_order (str): Allowed Sorting Options: 1.   
            TransactionDateAscending 2.    TransactionDateDescending 3.   
            GrossAmountDescending 4.    GrossAmountAscending 5.   
            NetAmountAscending 6.    NetAmountDescensding Example value to be
            passed: 1,3 Note: If IncludeFees is ‘True’ then sorting is not
            allowed. This parameter will be ignored.
        current_page (int): Page Number (as shown to the users) Optional
            Default value 1 Note: If IncludeFees is ‘True’ then pagination is
            not allowed. This parameter will be ignored.
        page_size (int): Page Size – Number of records to show on a page
            Optional Default value 50   Note: If IncludeFees is ‘True’ then
            pagination is not allowed. This parameter will be ignored.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "col_co_code": 'ColCoCode',
        "accounts": 'Accounts',
        "col_co_id": 'ColCoId',
        "invoice_status": 'InvoiceStatus',
        "purchased_in_country": 'PurchasedInCountry',
        "from_date": 'FromDate',
        "to_date": 'ToDate',
        "period": 'Period',
        "posting_date_from": 'PostingDateFrom',
        "posting_date_to": 'PostingDateTo',
        "invoice_date": 'InvoiceDate',
        "invoice_number": 'InvoiceNumber',
        "valid_invoice_date_only": 'ValidInvoiceDateOnly',
        "invoice_from_date": 'InvoiceFromDate',
        "invoice_to_date": 'InvoiceToDate',
        "fuel_only": 'FuelOnly',
        "include_fees": 'IncludeFees',
        "sort_order": 'SortOrder',
        "current_page": 'CurrentPage',
        "page_size": 'PageSize'
    }

    _optionals = [
        'col_co_id',
        'invoice_status',
        'purchased_in_country',
        'from_date',
        'to_date',
        'period',
        'posting_date_from',
        'posting_date_to',
        'invoice_date',
        'invoice_number',
        'valid_invoice_date_only',
        'invoice_from_date',
        'invoice_to_date',
        'fuel_only',
        'include_fees',
        'sort_order',
        'current_page',
        'page_size',
    ]

    def __init__(self,
                 col_co_code=None,
                 accounts=None,
                 col_co_id=APIHelper.SKIP,
                 invoice_status=APIHelper.SKIP,
                 purchased_in_country=APIHelper.SKIP,
                 from_date=APIHelper.SKIP,
                 to_date=APIHelper.SKIP,
                 period=APIHelper.SKIP,
                 posting_date_from=APIHelper.SKIP,
                 posting_date_to=APIHelper.SKIP,
                 invoice_date=APIHelper.SKIP,
                 invoice_number=APIHelper.SKIP,
                 valid_invoice_date_only=APIHelper.SKIP,
                 invoice_from_date=APIHelper.SKIP,
                 invoice_to_date=APIHelper.SKIP,
                 fuel_only=APIHelper.SKIP,
                 include_fees=APIHelper.SKIP,
                 sort_order=APIHelper.SKIP,
                 current_page=APIHelper.SKIP,
                 page_size=APIHelper.SKIP):
        """Constructor for the MultiPricedTransactionRequest class"""

        # Initialize members of the class
        if col_co_id is not APIHelper.SKIP:
            self.col_co_id = col_co_id 
        self.col_co_code = col_co_code 
        self.accounts = accounts 
        if invoice_status is not APIHelper.SKIP:
            self.invoice_status = invoice_status 
        if purchased_in_country is not APIHelper.SKIP:
            self.purchased_in_country = purchased_in_country 
        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 posting_date_from is not APIHelper.SKIP:
            self.posting_date_from = posting_date_from 
        if posting_date_to is not APIHelper.SKIP:
            self.posting_date_to = posting_date_to 
        if invoice_date is not APIHelper.SKIP:
            self.invoice_date = invoice_date 
        if invoice_number is not APIHelper.SKIP:
            self.invoice_number = invoice_number 
        if valid_invoice_date_only is not APIHelper.SKIP:
            self.valid_invoice_date_only = valid_invoice_date_only 
        if invoice_from_date is not APIHelper.SKIP:
            self.invoice_from_date = invoice_from_date 
        if invoice_to_date is not APIHelper.SKIP:
            self.invoice_to_date = invoice_to_date 
        if fuel_only is not APIHelper.SKIP:
            self.fuel_only = fuel_only 
        if include_fees is not APIHelper.SKIP:
            self.include_fees = include_fees 
        if sort_order is not APIHelper.SKIP:
            self.sort_order = sort_order 
        if current_page is not APIHelper.SKIP:
            self.current_page = current_page 
        if page_size is not APIHelper.SKIP:
            self.page_size = page_size 

    @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
        accounts = None
        if dictionary.get('Accounts') is not None:
            accounts = [MultiPricedTransactionRequestAccountsItems.from_dictionary(x) for x in dictionary.get('Accounts')]
        col_co_id = dictionary.get("ColCoId") if dictionary.get("ColCoId") else APIHelper.SKIP
        invoice_status = dictionary.get("InvoiceStatus") if dictionary.get("InvoiceStatus") else APIHelper.SKIP
        purchased_in_country = dictionary.get("PurchasedInCountry") if dictionary.get("PurchasedInCountry") else APIHelper.SKIP
        from_date = dictionary.get("FromDate") if dictionary.get("FromDate") else APIHelper.SKIP
        to_date = dictionary.get("ToDate") if dictionary.get("ToDate") else APIHelper.SKIP
        period = dictionary.get("Period") if dictionary.get("Period") else APIHelper.SKIP
        posting_date_from = dictionary.get("PostingDateFrom") if dictionary.get("PostingDateFrom") else APIHelper.SKIP
        posting_date_to = dictionary.get("PostingDateTo") if dictionary.get("PostingDateTo") else APIHelper.SKIP
        invoice_date = dictionary.get("InvoiceDate") if dictionary.get("InvoiceDate") else APIHelper.SKIP
        invoice_number = dictionary.get("InvoiceNumber") if dictionary.get("InvoiceNumber") else APIHelper.SKIP
        valid_invoice_date_only = dictionary.get("ValidInvoiceDateOnly") if "ValidInvoiceDateOnly" in dictionary.keys() else APIHelper.SKIP
        invoice_from_date = dictionary.get("InvoiceFromDate") if dictionary.get("InvoiceFromDate") else APIHelper.SKIP
        invoice_to_date = dictionary.get("InvoiceToDate") if dictionary.get("InvoiceToDate") else APIHelper.SKIP
        fuel_only = dictionary.get("FuelOnly") if "FuelOnly" in dictionary.keys() else APIHelper.SKIP
        include_fees = dictionary.get("IncludeFees") if "IncludeFees" in dictionary.keys() else APIHelper.SKIP
        sort_order = dictionary.get("SortOrder") if dictionary.get("SortOrder") else APIHelper.SKIP
        current_page = dictionary.get("CurrentPage") if dictionary.get("CurrentPage") else APIHelper.SKIP
        page_size = dictionary.get("PageSize") if dictionary.get("PageSize") else APIHelper.SKIP
        # Return an object of this model
        return cls(col_co_code,
                   accounts,
                   col_co_id,
                   invoice_status,
                   purchased_in_country,
                   from_date,
                   to_date,
                   period,
                   posting_date_from,
                   posting_date_to,
                   invoice_date,
                   invoice_number,
                   valid_invoice_date_only,
                   invoice_from_date,
                   invoice_to_date,
                   fuel_only,
                   include_fees,
                   sort_order,
                   current_page,
                   page_size)
