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

"""
shelldatareportingapis

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


class PricedRequestData(object):

    """Implementation of the 'PricedRequestData' model.

    This endpoint allows querying the transaction data (i.e. Priced, Billed
    and Unbilled sales items) from SFSBI. It provides a flexible search
    criteria and supports paging

    Attributes:
        col_co_code (str): Collecting Company Code (Shell Code) of the
            selected payer.
        invoice_status (object): TODO: type description here.
        payer_number (str): Payer Number of the selected payer.
        account_id (int): Account Id (GFN customer id)
        account_number (str): Account Number of the selected account.
        driver_name (str): Driver Name (of Card record)
        card_group_id (int): Card Group Id in GFN
        card_pan (str): Full Card PAN
        product_code (str): Product Code – Global as per GFN configuration
        product_name (str): Product Name – Global as per GFN configuration
        site_code (str): Site Code in GFN
        incoming_site_number (str): Site Code as configured in GFN
        invoice_date (str): Returns the billed transaction for the given
            invoice date
        invoice_number (str): Returns the billed transaction for the given
            invoice number
        purchased_in_country_code (str): Purchased InCountryCode
        purchased_in_country (str): Network Delco PurchasedCountryName
        site_group_id (int): Site Group Id in GFN
        vehicle_registration_number (str): Vehicle Registration (of Card
            record)
        fee_type_id (int): Card Id (i.e. Unique Card Id in GFN)
        line_item_description (str): Item identifier in the transaction.
        cards (List[int]): This entity accepts the list of CardId to filter in
            the response. Note: The number of cardId allowed to be passed in
            the request is configurable to a maximum of 500 cards.
        sort_order (PricedTransactionReqV2SortOrderEnum): TODO: type
            description here.
        from_date (str): From transaction delivery date
        to_date (str): To transaction delivery date
        period (PricedTransactionReqV2PeriodEnum): Pass below one of the value
            as per the required transaction period 1. Last 7 Days 2. Last 30
            Days 3. Last 90 Days
        posting_date_from (str): Transaction posting start date and time
        posting_date_to (str): Transaction posting end date and time
        transaction_item_id (str): Unique id of the transaction that may
            include one or more salesitems
        fuel_only (bool): Is FuelOnly indicator
        include_fees (bool): When passed as ‘true’ then all sales items along
            with fees will be included in the response and the follwoing
            filteres will be ignored * InvoiceNumber * InvoiceDate *
            PostingDateFrom * PostingDateTo
        is_multipayer (bool): If true then returns all the data linked tothe
            payer group of the provided PayerNumberin the request
        valid_invoice_date_only (bool): 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): Invoice From Date, this is a search criterion
            to filter invoiced transactions with invoice date from this date.
        invoice_to_date (str): Invoice To Date, this is a search criterion to
            filter invoiced transactions with invoice date until this date.
        hosting_collecting_company_number (str): Hosting Collecting Company
            Number of the selected payer.
        search (str): Search based on DriverName or VRN
        transaction_id (str): Unique id of the transaction that may include
            one or more salesitems

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "col_co_code": 'ColCoCode',
        "invoice_status": 'InvoiceStatus',
        "payer_number": 'PayerNumber',
        "account_id": 'AccountId',
        "account_number": 'AccountNumber',
        "driver_name": 'DriverName',
        "card_group_id": 'CardGroupId',
        "card_pan": 'CardPAN',
        "product_code": 'ProductCode',
        "product_name": 'ProductName',
        "site_code": 'SiteCode',
        "incoming_site_number": 'IncomingSiteNumber',
        "invoice_date": 'InvoiceDate',
        "invoice_number": 'InvoiceNumber',
        "purchased_in_country_code": 'PurchasedInCountryCode',
        "purchased_in_country": 'PurchasedInCountry',
        "site_group_id": 'SiteGroupId',
        "vehicle_registration_number": 'VehicleRegistrationNumber',
        "fee_type_id": 'FeeTypeId',
        "line_item_description": 'LineItemDescription',
        "cards": 'Cards',
        "sort_order": 'SortOrder',
        "from_date": 'FromDate',
        "to_date": 'ToDate',
        "period": 'Period',
        "posting_date_from": 'PostingDateFrom',
        "posting_date_to": 'PostingDateTo',
        "transaction_item_id": 'TransactionItemId',
        "fuel_only": 'FuelOnly',
        "include_fees": 'IncludeFees',
        "is_multipayer": 'IsMultipayer',
        "valid_invoice_date_only": 'ValidInvoiceDateOnly',
        "invoice_from_date": 'InvoiceFromDate',
        "invoice_to_date": 'InvoiceToDate',
        "hosting_collecting_company_number": 'HostingCollectingCompanyNumber',
        "search": 'Search',
        "transaction_id": 'TransactionId'
    }

    _optionals = [
        'account_id',
        'account_number',
        'driver_name',
        'card_group_id',
        'card_pan',
        'product_code',
        'product_name',
        'site_code',
        'incoming_site_number',
        'invoice_date',
        'invoice_number',
        'purchased_in_country_code',
        'purchased_in_country',
        'site_group_id',
        'vehicle_registration_number',
        'fee_type_id',
        'line_item_description',
        'cards',
        'sort_order',
        'from_date',
        'to_date',
        'period',
        'posting_date_from',
        'posting_date_to',
        'transaction_item_id',
        'fuel_only',
        'include_fees',
        'is_multipayer',
        'valid_invoice_date_only',
        'invoice_from_date',
        'invoice_to_date',
        'hosting_collecting_company_number',
        'search',
        'transaction_id',
    ]

    _nullables = [
        'col_co_code',
        'payer_number',
        'account_id',
        'account_number',
        'driver_name',
        'card_group_id',
        'card_pan',
        'product_code',
        'product_name',
        'site_code',
        'incoming_site_number',
        'invoice_date',
        'invoice_number',
        'purchased_in_country_code',
        'purchased_in_country',
        'site_group_id',
        'vehicle_registration_number',
        'fee_type_id',
        'line_item_description',
        'from_date',
        'to_date',
        'posting_date_from',
        'posting_date_to',
        'transaction_item_id',
        'fuel_only',
        'include_fees',
        'invoice_from_date',
        'invoice_to_date',
        'hosting_collecting_company_number',
        'search',
        'transaction_id',
    ]

    def __init__(self,
                 col_co_code=None,
                 invoice_status=None,
                 payer_number=None,
                 account_id=APIHelper.SKIP,
                 account_number=APIHelper.SKIP,
                 driver_name=APIHelper.SKIP,
                 card_group_id=APIHelper.SKIP,
                 card_pan=APIHelper.SKIP,
                 product_code=APIHelper.SKIP,
                 product_name=APIHelper.SKIP,
                 site_code=APIHelper.SKIP,
                 incoming_site_number=APIHelper.SKIP,
                 invoice_date=APIHelper.SKIP,
                 invoice_number=APIHelper.SKIP,
                 purchased_in_country_code=APIHelper.SKIP,
                 purchased_in_country=APIHelper.SKIP,
                 site_group_id=APIHelper.SKIP,
                 vehicle_registration_number=APIHelper.SKIP,
                 fee_type_id=APIHelper.SKIP,
                 line_item_description=APIHelper.SKIP,
                 cards=APIHelper.SKIP,
                 sort_order=APIHelper.SKIP,
                 from_date=APIHelper.SKIP,
                 to_date=APIHelper.SKIP,
                 period=APIHelper.SKIP,
                 posting_date_from=APIHelper.SKIP,
                 posting_date_to=APIHelper.SKIP,
                 transaction_item_id=APIHelper.SKIP,
                 fuel_only=False,
                 include_fees=APIHelper.SKIP,
                 is_multipayer=APIHelper.SKIP,
                 valid_invoice_date_only=False,
                 invoice_from_date=APIHelper.SKIP,
                 invoice_to_date=APIHelper.SKIP,
                 hosting_collecting_company_number=APIHelper.SKIP,
                 search=APIHelper.SKIP,
                 transaction_id=APIHelper.SKIP):
        """Constructor for the PricedRequestData class"""

        # Initialize members of the class
        self.col_co_code = col_co_code 
        self.invoice_status = invoice_status 
        self.payer_number = payer_number 
        if account_id is not APIHelper.SKIP:
            self.account_id = account_id 
        if account_number is not APIHelper.SKIP:
            self.account_number = account_number 
        if driver_name is not APIHelper.SKIP:
            self.driver_name = driver_name 
        if card_group_id is not APIHelper.SKIP:
            self.card_group_id = card_group_id 
        if card_pan is not APIHelper.SKIP:
            self.card_pan = card_pan 
        if product_code is not APIHelper.SKIP:
            self.product_code = product_code 
        if product_name is not APIHelper.SKIP:
            self.product_name = product_name 
        if site_code is not APIHelper.SKIP:
            self.site_code = site_code 
        if incoming_site_number is not APIHelper.SKIP:
            self.incoming_site_number = incoming_site_number 
        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 purchased_in_country_code is not APIHelper.SKIP:
            self.purchased_in_country_code = purchased_in_country_code 
        if purchased_in_country is not APIHelper.SKIP:
            self.purchased_in_country = purchased_in_country 
        if site_group_id is not APIHelper.SKIP:
            self.site_group_id = site_group_id 
        if vehicle_registration_number is not APIHelper.SKIP:
            self.vehicle_registration_number = vehicle_registration_number 
        if fee_type_id is not APIHelper.SKIP:
            self.fee_type_id = fee_type_id 
        if line_item_description is not APIHelper.SKIP:
            self.line_item_description = line_item_description 
        if cards is not APIHelper.SKIP:
            self.cards = cards 
        if sort_order is not APIHelper.SKIP:
            self.sort_order = sort_order 
        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 transaction_item_id is not APIHelper.SKIP:
            self.transaction_item_id = transaction_item_id 
        self.fuel_only = fuel_only 
        if include_fees is not APIHelper.SKIP:
            self.include_fees = include_fees 
        if is_multipayer is not APIHelper.SKIP:
            self.is_multipayer = is_multipayer 
        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 hosting_collecting_company_number is not APIHelper.SKIP:
            self.hosting_collecting_company_number = hosting_collecting_company_number 
        if search is not APIHelper.SKIP:
            self.search = search 
        if transaction_id is not APIHelper.SKIP:
            self.transaction_id = transaction_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 dictionary.get("ColCoCode") else None
        invoice_status = dictionary.get("InvoiceStatus") if dictionary.get("InvoiceStatus") else None
        payer_number = dictionary.get("PayerNumber") if dictionary.get("PayerNumber") else None
        account_id = dictionary.get("AccountId") if "AccountId" in dictionary.keys() else APIHelper.SKIP
        account_number = dictionary.get("AccountNumber") if "AccountNumber" in dictionary.keys() else APIHelper.SKIP
        driver_name = dictionary.get("DriverName") if "DriverName" in dictionary.keys() else APIHelper.SKIP
        card_group_id = dictionary.get("CardGroupId") if "CardGroupId" in dictionary.keys() else APIHelper.SKIP
        card_pan = dictionary.get("CardPAN") if "CardPAN" in dictionary.keys() else APIHelper.SKIP
        product_code = dictionary.get("ProductCode") if "ProductCode" in dictionary.keys() else APIHelper.SKIP
        product_name = dictionary.get("ProductName") if "ProductName" in dictionary.keys() else APIHelper.SKIP
        site_code = dictionary.get("SiteCode") if "SiteCode" in dictionary.keys() else APIHelper.SKIP
        incoming_site_number = dictionary.get("IncomingSiteNumber") if "IncomingSiteNumber" in dictionary.keys() else APIHelper.SKIP
        invoice_date = dictionary.get("InvoiceDate") if "InvoiceDate" in dictionary.keys() else APIHelper.SKIP
        invoice_number = dictionary.get("InvoiceNumber") if "InvoiceNumber" in dictionary.keys() else APIHelper.SKIP
        purchased_in_country_code = dictionary.get("PurchasedInCountryCode") if "PurchasedInCountryCode" in dictionary.keys() else APIHelper.SKIP
        purchased_in_country = dictionary.get("PurchasedInCountry") if "PurchasedInCountry" in dictionary.keys() else APIHelper.SKIP
        site_group_id = dictionary.get("SiteGroupId") if "SiteGroupId" in dictionary.keys() else APIHelper.SKIP
        vehicle_registration_number = dictionary.get("VehicleRegistrationNumber") if "VehicleRegistrationNumber" in dictionary.keys() else APIHelper.SKIP
        fee_type_id = dictionary.get("FeeTypeId") if "FeeTypeId" in dictionary.keys() else APIHelper.SKIP
        line_item_description = dictionary.get("LineItemDescription") if "LineItemDescription" in dictionary.keys() else APIHelper.SKIP
        cards = dictionary.get("Cards") if dictionary.get("Cards") else APIHelper.SKIP
        sort_order = dictionary.get("SortOrder") if dictionary.get("SortOrder") 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 dictionary.get("Period") else APIHelper.SKIP
        posting_date_from = dictionary.get("PostingDateFrom") if "PostingDateFrom" in dictionary.keys() else APIHelper.SKIP
        posting_date_to = dictionary.get("PostingDateTo") if "PostingDateTo" in dictionary.keys() else APIHelper.SKIP
        transaction_item_id = dictionary.get("TransactionItemId") if "TransactionItemId" in dictionary.keys() else APIHelper.SKIP
        fuel_only = dictionary.get("FuelOnly") if dictionary.get("FuelOnly") else False
        include_fees = dictionary.get("IncludeFees") if "IncludeFees" in dictionary.keys() else APIHelper.SKIP
        is_multipayer = dictionary.get("IsMultipayer") if "IsMultipayer" in dictionary.keys() else APIHelper.SKIP
        valid_invoice_date_only = dictionary.get("ValidInvoiceDateOnly") if dictionary.get("ValidInvoiceDateOnly") else False
        invoice_from_date = dictionary.get("InvoiceFromDate") if "InvoiceFromDate" in dictionary.keys() else APIHelper.SKIP
        invoice_to_date = dictionary.get("InvoiceToDate") if "InvoiceToDate" in dictionary.keys() else APIHelper.SKIP
        hosting_collecting_company_number = dictionary.get("HostingCollectingCompanyNumber") if "HostingCollectingCompanyNumber" in dictionary.keys() else APIHelper.SKIP
        search = dictionary.get("Search") if "Search" in dictionary.keys() else APIHelper.SKIP
        transaction_id = dictionary.get("TransactionId") if "TransactionId" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(col_co_code,
                   invoice_status,
                   payer_number,
                   account_id,
                   account_number,
                   driver_name,
                   card_group_id,
                   card_pan,
                   product_code,
                   product_name,
                   site_code,
                   incoming_site_number,
                   invoice_date,
                   invoice_number,
                   purchased_in_country_code,
                   purchased_in_country,
                   site_group_id,
                   vehicle_registration_number,
                   fee_type_id,
                   line_item_description,
                   cards,
                   sort_order,
                   from_date,
                   to_date,
                   period,
                   posting_date_from,
                   posting_date_to,
                   transaction_item_id,
                   fuel_only,
                   include_fees,
                   is_multipayer,
                   valid_invoice_date_only,
                   invoice_from_date,
                   invoice_to_date,
                   hosting_collecting_company_number,
                   search,
                   transaction_id)
