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

"""
shelldatareportingapis

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


class FuelConsumptionData(object):

    """Implementation of the 'FuelConsumptionData' model.

    TODO: type model description here.

    Attributes:
        account_name (str): Account Name
        account_number (str): Account Number
        payer_name (str): Payment customer Name
        payer_number (str): Payment customer number
        card_number (str): Card PAN
        card_group_id (int): Card group ID
        card_group_name (str): Card group name
        driver_name (str): Driver name
        license_number (str): Vehicle registration number
        initial_odometer (float): First transaction odometer reading
        last_odometer (float): Last transaction odometer reading
        distance (float): Distance in  KM or Miles based on Customer and Colco
            Settings
        fuel_consumption (float): Total Fuel Consumption.
        fuel_net_amount (float): Net Fuel Amount
        discount (float): Total Discount
        fuel_tax (float): Fuel Tax Amount
        fuel_volume (float): Total Fuel Volume in Litres
        gross_non_fuel_expenses (float): Gross Nonfuel Amount
        co_2_produced (float): Total Co2 produced
        transaction_count (float): Total Transaction Count

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "account_name": 'AccountName',
        "account_number": 'AccountNumber',
        "payer_name": 'PayerName',
        "payer_number": 'PayerNumber',
        "card_number": 'CardNumber',
        "card_group_id": 'CardGroupId',
        "card_group_name": 'CardGroupName',
        "driver_name": 'DriverName',
        "license_number": 'LicenseNumber',
        "initial_odometer": 'InitialOdometer',
        "last_odometer": 'LastOdometer',
        "distance": 'Distance',
        "fuel_consumption": 'FuelConsumption',
        "fuel_net_amount": 'FuelNetAmount',
        "discount": 'Discount',
        "fuel_tax": 'FuelTax',
        "fuel_volume": 'FuelVolume',
        "gross_non_fuel_expenses": 'GrossNonFuelExpenses',
        "co_2_produced": 'CO2Produced',
        "transaction_count": 'TransactionCount'
    }

    _optionals = [
        'account_name',
        'account_number',
        'payer_name',
        'payer_number',
        'card_number',
        'card_group_id',
        'card_group_name',
        'driver_name',
        'license_number',
        'initial_odometer',
        'last_odometer',
        'distance',
        'fuel_consumption',
        'fuel_net_amount',
        'discount',
        'fuel_tax',
        'fuel_volume',
        'gross_non_fuel_expenses',
        'co_2_produced',
        'transaction_count',
    ]

    _nullables = [
        'account_name',
        'account_number',
        'payer_name',
        'payer_number',
        'card_number',
        'card_group_id',
        'card_group_name',
        'driver_name',
        'license_number',
        'initial_odometer',
        'last_odometer',
        'distance',
        'fuel_consumption',
        'fuel_net_amount',
        'discount',
        'fuel_tax',
        'fuel_volume',
        'gross_non_fuel_expenses',
        'co_2_produced',
        'transaction_count',
    ]

    def __init__(self,
                 account_name=APIHelper.SKIP,
                 account_number=APIHelper.SKIP,
                 payer_name=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 card_number=APIHelper.SKIP,
                 card_group_id=APIHelper.SKIP,
                 card_group_name=APIHelper.SKIP,
                 driver_name=APIHelper.SKIP,
                 license_number=APIHelper.SKIP,
                 initial_odometer=APIHelper.SKIP,
                 last_odometer=APIHelper.SKIP,
                 distance=APIHelper.SKIP,
                 fuel_consumption=APIHelper.SKIP,
                 fuel_net_amount=APIHelper.SKIP,
                 discount=APIHelper.SKIP,
                 fuel_tax=APIHelper.SKIP,
                 fuel_volume=APIHelper.SKIP,
                 gross_non_fuel_expenses=APIHelper.SKIP,
                 co_2_produced=APIHelper.SKIP,
                 transaction_count=APIHelper.SKIP):
        """Constructor for the FuelConsumptionData class"""

        # Initialize members of the class
        if account_name is not APIHelper.SKIP:
            self.account_name = account_name 
        if account_number is not APIHelper.SKIP:
            self.account_number = account_number 
        if payer_name is not APIHelper.SKIP:
            self.payer_name = payer_name 
        if payer_number is not APIHelper.SKIP:
            self.payer_number = payer_number 
        if card_number is not APIHelper.SKIP:
            self.card_number = card_number 
        if card_group_id is not APIHelper.SKIP:
            self.card_group_id = card_group_id 
        if card_group_name is not APIHelper.SKIP:
            self.card_group_name = card_group_name 
        if driver_name is not APIHelper.SKIP:
            self.driver_name = driver_name 
        if license_number is not APIHelper.SKIP:
            self.license_number = license_number 
        if initial_odometer is not APIHelper.SKIP:
            self.initial_odometer = initial_odometer 
        if last_odometer is not APIHelper.SKIP:
            self.last_odometer = last_odometer 
        if distance is not APIHelper.SKIP:
            self.distance = distance 
        if fuel_consumption is not APIHelper.SKIP:
            self.fuel_consumption = fuel_consumption 
        if fuel_net_amount is not APIHelper.SKIP:
            self.fuel_net_amount = fuel_net_amount 
        if discount is not APIHelper.SKIP:
            self.discount = discount 
        if fuel_tax is not APIHelper.SKIP:
            self.fuel_tax = fuel_tax 
        if fuel_volume is not APIHelper.SKIP:
            self.fuel_volume = fuel_volume 
        if gross_non_fuel_expenses is not APIHelper.SKIP:
            self.gross_non_fuel_expenses = gross_non_fuel_expenses 
        if co_2_produced is not APIHelper.SKIP:
            self.co_2_produced = co_2_produced 
        if transaction_count is not APIHelper.SKIP:
            self.transaction_count = transaction_count 

    @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
        account_name = dictionary.get("AccountName") if "AccountName" in dictionary.keys() else APIHelper.SKIP
        account_number = dictionary.get("AccountNumber") if "AccountNumber" in dictionary.keys() else APIHelper.SKIP
        payer_name = dictionary.get("PayerName") if "PayerName" in dictionary.keys() else APIHelper.SKIP
        payer_number = dictionary.get("PayerNumber") if "PayerNumber" in dictionary.keys() else APIHelper.SKIP
        card_number = dictionary.get("CardNumber") if "CardNumber" in dictionary.keys() else APIHelper.SKIP
        card_group_id = dictionary.get("CardGroupId") if "CardGroupId" in dictionary.keys() else APIHelper.SKIP
        card_group_name = dictionary.get("CardGroupName") if "CardGroupName" in dictionary.keys() else APIHelper.SKIP
        driver_name = dictionary.get("DriverName") if "DriverName" in dictionary.keys() else APIHelper.SKIP
        license_number = dictionary.get("LicenseNumber") if "LicenseNumber" in dictionary.keys() else APIHelper.SKIP
        initial_odometer = dictionary.get("InitialOdometer") if "InitialOdometer" in dictionary.keys() else APIHelper.SKIP
        last_odometer = dictionary.get("LastOdometer") if "LastOdometer" in dictionary.keys() else APIHelper.SKIP
        distance = dictionary.get("Distance") if "Distance" in dictionary.keys() else APIHelper.SKIP
        fuel_consumption = dictionary.get("FuelConsumption") if "FuelConsumption" in dictionary.keys() else APIHelper.SKIP
        fuel_net_amount = dictionary.get("FuelNetAmount") if "FuelNetAmount" in dictionary.keys() else APIHelper.SKIP
        discount = dictionary.get("Discount") if "Discount" in dictionary.keys() else APIHelper.SKIP
        fuel_tax = dictionary.get("FuelTax") if "FuelTax" in dictionary.keys() else APIHelper.SKIP
        fuel_volume = dictionary.get("FuelVolume") if "FuelVolume" in dictionary.keys() else APIHelper.SKIP
        gross_non_fuel_expenses = dictionary.get("GrossNonFuelExpenses") if "GrossNonFuelExpenses" in dictionary.keys() else APIHelper.SKIP
        co_2_produced = dictionary.get("CO2Produced") if "CO2Produced" in dictionary.keys() else APIHelper.SKIP
        transaction_count = dictionary.get("TransactionCount") if "TransactionCount" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(account_name,
                   account_number,
                   payer_name,
                   payer_number,
                   card_number,
                   card_group_id,
                   card_group_name,
                   driver_name,
                   license_number,
                   initial_odometer,
                   last_odometer,
                   distance,
                   fuel_consumption,
                   fuel_net_amount,
                   discount,
                   fuel_tax,
                   fuel_volume,
                   gross_non_fuel_expenses,
                   co_2_produced,
                   transaction_count)
