# -*- 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 PriceTransSummaryRequest(object):

    """Implementation of the 'PriceTransSummaryRequest' 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
        payer_id (int): Payer Id  of the selected payer. Optional if
            PayerNumber is passed else Mandatory
        payer_number (str): Payer Number (Ex: GB000000123) of the selected
            payer. Optional if PayerId is passed else Mandatory Example:
            GB000000123
        accounts (Accounts): TODO: type description here.
        card_id (int): Card Id (i.e. Unique Card Id in GFN) Optional When both
            Card Id and Card PAN are not present on request, the response will
            have transactions of all cards under the selected payer or account
        card_pan (str): Full Card PAN Optional When both Card Id and Card PAN
            are not present on request, the response will have transactions of
            all cards under the selected payer or account.
        driver_name (str): Driver Name (of Card record) Optional Minimum of 4
            characters should be provided else not considered Transactions of
            the card having the entered value at any part of the Driver Name
            will be returned
        vehicle_registration_number (str): Vehicle Registration (of Card
            record) Optional Minimum of 4 characters should be provided else
            not considered Transactions of the card having the entered value
            at any part of the VRN will be returned
        invoice_status (str): Invoice status of the transactions. Mandatory
            Possible options: I - Invoiced U – Un-Invoiced A – All
        product_id (int): Product Id  Example:   21    Unleaded - High octane 
            22    Unleaded - Medium octane  23    Unleaded - Low octane  24   
            Unleaded Environmental
        product_code (str): Product Code – Global as per GFN configuration 
            Optional  Max Length: 8  Example:   10    TMF Charges  11   
            Tunnel/Bridges  12    Motorway toll  13    Ferries
        purchased_in_country (str): ISO Country Code (ex: UK, FR)   Note: If
            IncludeFees is true then this filter will be ignored
        card_group_id (int): Card Group Id in GFN
        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.  Optional- Refer
            introduction section of this operation for the priority and
            sequence of different date and invoice number filters that are
            conditionally applied.  Note:  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  Optional - Refer
            introduction section of this operation for the priority and
            sequence of different date and invoice number filters that are
            conditionally applied.
        site_code (str): Site Code as configured in GFN Example: 050001 -   
            CHARNOCK RICHARD NTHBOUND MWSA 0755 050002 -    CHARNOCK RICHARD
            STHBOUND MWSA 0755 050005 -    HARTSHEAD MOOR EASTBOUND MWSA 0761.
            050006 -    HARTSHEAD MOOR WESTBOUND MWSA. Note: If IncludeFees is
            true then this filter will be ignored
        site_group_id (int): Site Group Id in GFN Optional Example: 202 Note:
            If IncludeFees is true then this filter will be ignored
        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
        sales_item_id (str): Unique SalesItemId (Either Billed on Unbilled)
            Optional Note: If IncludeFees is true then this filter will be
            ignored
        transaction_id (str): Unique Transaction Id Optional Note: If
            IncludeFees is true then this filter will be ignored
        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.    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.
        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) day’s
            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.
        include_fees (bool): True/False Optional Default value: False When
            passed as ‘True’ then  ignore few filters, all sales items along
            with fees included on the same response

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "col_co_id": 'ColCoId',
        "col_co_code": 'ColCoCode',
        "payer_id": 'PayerId',
        "payer_number": 'PayerNumber',
        "accounts": 'Accounts',
        "card_id": 'CardId',
        "card_pan": 'CardPAN',
        "driver_name": 'DriverName',
        "vehicle_registration_number": 'VehicleRegistrationNumber',
        "invoice_status": 'InvoiceStatus',
        "product_id": 'ProductId',
        "product_code": 'ProductCode',
        "purchased_in_country": 'PurchasedInCountry',
        "card_group_id": 'CardGroupId',
        "from_date": 'FromDate',
        "to_date": 'ToDate',
        "period": 'Period',
        "site_code": 'SiteCode',
        "site_group_id": 'SiteGroupId',
        "posting_date_from": 'PostingDateFrom',
        "posting_date_to": 'PostingDateTo',
        "sales_item_id": 'SalesItemId',
        "transaction_id": 'TransactionId',
        "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'
    }

    _optionals = [
        'col_co_id',
        'col_co_code',
        'payer_id',
        'payer_number',
        'accounts',
        'card_id',
        'card_pan',
        'driver_name',
        'vehicle_registration_number',
        'invoice_status',
        'product_id',
        'product_code',
        'purchased_in_country',
        'card_group_id',
        'from_date',
        'to_date',
        'period',
        'site_code',
        'site_group_id',
        'posting_date_from',
        'posting_date_to',
        'sales_item_id',
        'transaction_id',
        'invoice_date',
        'invoice_number',
        'valid_invoice_date_only',
        'invoice_from_date',
        'invoice_to_date',
        'fuel_only',
        'include_fees',
    ]

    def __init__(self,
                 col_co_id=APIHelper.SKIP,
                 col_co_code=APIHelper.SKIP,
                 payer_id=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 accounts=APIHelper.SKIP,
                 card_id=APIHelper.SKIP,
                 card_pan=APIHelper.SKIP,
                 driver_name=APIHelper.SKIP,
                 vehicle_registration_number=APIHelper.SKIP,
                 invoice_status=APIHelper.SKIP,
                 product_id=APIHelper.SKIP,
                 product_code=APIHelper.SKIP,
                 purchased_in_country=APIHelper.SKIP,
                 card_group_id=APIHelper.SKIP,
                 from_date=APIHelper.SKIP,
                 to_date=APIHelper.SKIP,
                 period=APIHelper.SKIP,
                 site_code=APIHelper.SKIP,
                 site_group_id=APIHelper.SKIP,
                 posting_date_from=APIHelper.SKIP,
                 posting_date_to=APIHelper.SKIP,
                 sales_item_id=APIHelper.SKIP,
                 transaction_id=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):
        """Constructor for the PriceTransSummaryRequest class"""

        # Initialize members of the class
        if col_co_id is not APIHelper.SKIP:
            self.col_co_id = col_co_id 
        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 accounts is not APIHelper.SKIP:
            self.accounts = accounts 
        if card_id is not APIHelper.SKIP:
            self.card_id = card_id 
        if card_pan is not APIHelper.SKIP:
            self.card_pan = card_pan 
        if driver_name is not APIHelper.SKIP:
            self.driver_name = driver_name 
        if vehicle_registration_number is not APIHelper.SKIP:
            self.vehicle_registration_number = vehicle_registration_number 
        if invoice_status is not APIHelper.SKIP:
            self.invoice_status = invoice_status 
        if product_id is not APIHelper.SKIP:
            self.product_id = product_id 
        if product_code is not APIHelper.SKIP:
            self.product_code = product_code 
        if purchased_in_country is not APIHelper.SKIP:
            self.purchased_in_country = purchased_in_country 
        if card_group_id is not APIHelper.SKIP:
            self.card_group_id = card_group_id 
        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 site_code is not APIHelper.SKIP:
            self.site_code = site_code 
        if site_group_id is not APIHelper.SKIP:
            self.site_group_id = site_group_id 
        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 sales_item_id is not APIHelper.SKIP:
            self.sales_item_id = sales_item_id 
        if transaction_id is not APIHelper.SKIP:
            self.transaction_id = transaction_id 
        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 

    @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_id = dictionary.get("ColCoId") if dictionary.get("ColCoId") else APIHelper.SKIP
        col_co_code = dictionary.get("ColCoCode") if dictionary.get("ColCoCode") else APIHelper.SKIP
        payer_id = dictionary.get("PayerId") if dictionary.get("PayerId") else APIHelper.SKIP
        payer_number = dictionary.get("PayerNumber") if dictionary.get("PayerNumber") else APIHelper.SKIP
        accounts = Accounts.from_dictionary(dictionary.get('Accounts')) if 'Accounts' in dictionary.keys() else APIHelper.SKIP
        card_id = dictionary.get("CardId") if dictionary.get("CardId") else APIHelper.SKIP
        card_pan = dictionary.get("CardPAN") if dictionary.get("CardPAN") else APIHelper.SKIP
        driver_name = dictionary.get("DriverName") if dictionary.get("DriverName") else APIHelper.SKIP
        vehicle_registration_number = dictionary.get("VehicleRegistrationNumber") if dictionary.get("VehicleRegistrationNumber") else APIHelper.SKIP
        invoice_status = dictionary.get("InvoiceStatus") if dictionary.get("InvoiceStatus") else APIHelper.SKIP
        product_id = dictionary.get("ProductId") if dictionary.get("ProductId") else APIHelper.SKIP
        product_code = dictionary.get("ProductCode") if dictionary.get("ProductCode") else APIHelper.SKIP
        purchased_in_country = dictionary.get("PurchasedInCountry") if dictionary.get("PurchasedInCountry") else APIHelper.SKIP
        card_group_id = dictionary.get("CardGroupId") if dictionary.get("CardGroupId") 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
        site_code = dictionary.get("SiteCode") if dictionary.get("SiteCode") else APIHelper.SKIP
        site_group_id = dictionary.get("SiteGroupId") if dictionary.get("SiteGroupId") 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
        sales_item_id = dictionary.get("SalesItemId") if dictionary.get("SalesItemId") else APIHelper.SKIP
        transaction_id = dictionary.get("TransactionId") if dictionary.get("TransactionId") 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
        # Return an object of this model
        return cls(col_co_id,
                   col_co_code,
                   payer_id,
                   payer_number,
                   accounts,
                   card_id,
                   card_pan,
                   driver_name,
                   vehicle_registration_number,
                   invoice_status,
                   product_id,
                   product_code,
                   purchased_in_country,
                   card_group_id,
                   from_date,
                   to_date,
                   period,
                   site_code,
                   site_group_id,
                   posting_date_from,
                   posting_date_to,
                   sales_item_id,
                   transaction_id,
                   invoice_date,
                   invoice_number,
                   valid_invoice_date_only,
                   invoice_from_date,
                   invoice_to_date,
                   fuel_only,
                   include_fees)
