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

"""
    opentelematicsapi

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""

import opentelematicsapi.models.performance_thresholds

class VehiclePerformanceEvent(object):

    """Implementation of the 'Vehicle Performance Event' model.

    TODO: type model description here.

    Attributes:
        id (string): The unique identifier for the specific Entity object in
            the system.
        provider_id (string): The unique 'Provider ID' of the TSP
        server_time (string): Date and time when this object was received at
            the TSP
        event_start (string): Date and time of the start of the event (engine
            start)
        event_end (string): Date and time of the end of the event (engine
            stop)
        vehicle_id (string): The vehicle id associated with this event
        event_comment (string): a free-form comment field. Can be used for
            e.g. identifying the type of event or other unstructured data
        hours (float): the number of hours elapsed over this Vehicle
            Performance Event, in hours
        thresholds (PerformanceThresholds): TODO: type description here.
        odometer_start (float): the vehicle odometer reading at the start of
            this event, in m
        odometer_end (float): the vehicle odometer reading at the end of this
            event, in m
        engine_time (float): the total amount of time spent with engine on
            during this event, in seconds
        moving_time (float): the total amount of time spent moving during this
            event, in seconds
        start_fuel (float): vehicle fuel level total (sum of both tanks if
            present) at start of this event
        end_fuel (float): vehicle fuel level total (sum of both tanks if
            present) at end of this event
        brake_applications (float): the total number of applications of the
            vehicle brakes during this event
        engine_load_stopped (float): the average engine load while the vehicle
            was stopped during this event, in percent
        engine_load_moving (float): the average engine load while the vehicle
            was moving during this event, in percent
        headlight_time (float): the total amount of time spent with headlights
            on during this event, in seconds
        speed_governor_value (float): this vehicles particular speed governor
            setting, in km/h
        over_rpm_time (float): the total amount of time the vehicle spent
            moving while over the RPM threshold during this event, in seconds
        over_speed_time (float): the total amount of time spent over the speed
            threshold during this event, in seconds
        excess_speed_time (float): the total amount of time spent over the
            excess speed threshold, in seconds
        long_idle_time (float): the total amount of time spent in 'long' idle
            during this event, in seconds
        short_idle_time (float): the total amount of time spent in idle (not
            'long') during this event, in seconds
        short_idle_count (float): the total count of times when the vehicle
            entered an idle state, where the idle time did not exceed the
            'long' threshold
        long_idle_fuel (float): the total amount of fuel used by the vehicle
            during idle times whose durations were 'long', in litres
        short_idle_fuel (float): the total amount of fuel used by the vehicle
            during idle times whose durations were not 'long', in litres
        cruise_events (float): the total count of cruise engagements during
            this event
        cruise_time (float): the total amount of time spent in cruise during
            this event, in seconds
        cruise_fuel (float): the total amount of fuel consumed in cruise
            during this event, in seconds
        cruise_distance (float): the total distance covered in cruise during
            this event, in meters
        top_gear_value (float): this vehicle's particular top gear ratio
            including the transmission and axle
        top_gear_time (float): the total amount of time spent while in top
            gear during this event, in seconds
        top_gear_fuel (float): the total amount of fuel consumed while in top
            gear during this event, in litres
        top_gear_distance (float): the total distance covered while in top
            gear during this event, in meters
        pto_fuel (float): the total amount of fuel dispensed with 'power take
            off' liquid tanker trailer systems, in litres
        pto_time (float): the total amount of time dispensing with 'power take
            off' liquid tanker trailer systems, in seconds
        seat_belt_time (float): the total amount of time spent with seatbelt
            engaged during this event, in seconds
        particulate_filter_status (ParticulateFilterStatusEnum): the regen
            status at the end of this event
        exhaust_fluid_level (float): DEF additive levels at the end of this
            event, in litres
        overspeed_low_throttle (float): the total amount of time spent over
            the speed threshold and simultaneously below the throttle
            threshold, in seconds
        overspeed_hi_throttle (float): the total amount of time spent over the
            speed thresshold and simultaneously above the throttle threshold,
            in seconds
        overrpm_low_throttle (float): the total amount of time the vehicle
            spent moving while over the rpm threshold and simultaneously below
            the throttle threshold, in seconds
        overrpm_hi_throttle (float): the total amount of time the vehicle
            spent moving while over the rpm threshold and simultaneously above
            the throttle threshold, in seconds
        lka_active (bool): Lane Keep Assist active status
        lka_disable (bool): Lane Keep Assist disable switch status
        ldw_active (bool): Lane Departure Warning active status
        ldw_disable (bool): Lane Departure Warning disable switch status

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id":'id',
        "provider_id":'providerId',
        "server_time":'serverTime',
        "event_start":'eventStart',
        "event_end":'eventEnd',
        "vehicle_id":'vehicleId',
        "hours":'hours',
        "thresholds":'thresholds',
        "odometer_start":'odometerStart',
        "odometer_end":'odometerEnd',
        "engine_time":'engineTime',
        "moving_time":'movingTime',
        "start_fuel":'startFuel',
        "end_fuel":'endFuel',
        "brake_applications":'brakeApplications',
        "engine_load_stopped":'engineLoadStopped',
        "engine_load_moving":'engineLoadMoving',
        "headlight_time":'headlightTime',
        "speed_governor_value":'speedGovernorValue',
        "event_comment":'eventComment',
        "over_rpm_time":'overRpmTime',
        "over_speed_time":'overSpeedTime',
        "excess_speed_time":'excessSpeedTime',
        "long_idle_time":'longIdleTime',
        "short_idle_time":'shortIdleTime',
        "short_idle_count":'shortIdleCount',
        "long_idle_fuel":'longIdleFuel',
        "short_idle_fuel":'shortIdleFuel',
        "cruise_events":'cruiseEvents',
        "cruise_time":'cruiseTime',
        "cruise_fuel":'cruiseFuel',
        "cruise_distance":'cruiseDistance',
        "top_gear_value":'topGearValue',
        "top_gear_time":'topGearTime',
        "top_gear_fuel":'topGearFuel',
        "top_gear_distance":'topGearDistance',
        "pto_fuel":'ptoFuel',
        "pto_time":'ptoTime',
        "seat_belt_time":'seatBeltTime',
        "particulate_filter_status":'particulateFilterStatus',
        "exhaust_fluid_level":'exhaustFluidLevel',
        "overspeed_low_throttle":'overspeedLowThrottle',
        "overspeed_hi_throttle":'overspeedHiThrottle',
        "overrpm_low_throttle":'overrpmLowThrottle',
        "overrpm_hi_throttle":'overrpmHiThrottle',
        "lka_active":'lkaActive',
        "lka_disable":'lkaDisable',
        "ldw_active":'ldwActive',
        "ldw_disable":'ldwDisable'
    }

    def __init__(self,
                 id=None,
                 provider_id=None,
                 server_time=None,
                 event_start=None,
                 event_end=None,
                 vehicle_id=None,
                 hours=None,
                 thresholds=None,
                 odometer_start=None,
                 odometer_end=None,
                 engine_time=None,
                 moving_time=None,
                 start_fuel=None,
                 end_fuel=None,
                 brake_applications=None,
                 engine_load_stopped=None,
                 engine_load_moving=None,
                 headlight_time=None,
                 speed_governor_value=None,
                 event_comment=None,
                 over_rpm_time=None,
                 over_speed_time=None,
                 excess_speed_time=None,
                 long_idle_time=None,
                 short_idle_time=None,
                 short_idle_count=None,
                 long_idle_fuel=None,
                 short_idle_fuel=None,
                 cruise_events=None,
                 cruise_time=None,
                 cruise_fuel=None,
                 cruise_distance=None,
                 top_gear_value=None,
                 top_gear_time=None,
                 top_gear_fuel=None,
                 top_gear_distance=None,
                 pto_fuel=None,
                 pto_time=None,
                 seat_belt_time=None,
                 particulate_filter_status=None,
                 exhaust_fluid_level=None,
                 overspeed_low_throttle=None,
                 overspeed_hi_throttle=None,
                 overrpm_low_throttle=None,
                 overrpm_hi_throttle=None,
                 lka_active=None,
                 lka_disable=None,
                 ldw_active=None,
                 ldw_disable=None):
        """Constructor for the VehiclePerformanceEvent class"""

        # Initialize members of the class
        self.id = id
        self.provider_id = provider_id
        self.server_time = server_time
        self.event_start = event_start
        self.event_end = event_end
        self.vehicle_id = vehicle_id
        self.event_comment = event_comment
        self.hours = hours
        self.thresholds = thresholds
        self.odometer_start = odometer_start
        self.odometer_end = odometer_end
        self.engine_time = engine_time
        self.moving_time = moving_time
        self.start_fuel = start_fuel
        self.end_fuel = end_fuel
        self.brake_applications = brake_applications
        self.engine_load_stopped = engine_load_stopped
        self.engine_load_moving = engine_load_moving
        self.headlight_time = headlight_time
        self.speed_governor_value = speed_governor_value
        self.over_rpm_time = over_rpm_time
        self.over_speed_time = over_speed_time
        self.excess_speed_time = excess_speed_time
        self.long_idle_time = long_idle_time
        self.short_idle_time = short_idle_time
        self.short_idle_count = short_idle_count
        self.long_idle_fuel = long_idle_fuel
        self.short_idle_fuel = short_idle_fuel
        self.cruise_events = cruise_events
        self.cruise_time = cruise_time
        self.cruise_fuel = cruise_fuel
        self.cruise_distance = cruise_distance
        self.top_gear_value = top_gear_value
        self.top_gear_time = top_gear_time
        self.top_gear_fuel = top_gear_fuel
        self.top_gear_distance = top_gear_distance
        self.pto_fuel = pto_fuel
        self.pto_time = pto_time
        self.seat_belt_time = seat_belt_time
        self.particulate_filter_status = particulate_filter_status
        self.exhaust_fluid_level = exhaust_fluid_level
        self.overspeed_low_throttle = overspeed_low_throttle
        self.overspeed_hi_throttle = overspeed_hi_throttle
        self.overrpm_low_throttle = overrpm_low_throttle
        self.overrpm_hi_throttle = overrpm_hi_throttle
        self.lka_active = lka_active
        self.lka_disable = lka_disable
        self.ldw_active = ldw_active
        self.ldw_disable = ldw_disable


    @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 dictionary is None:
            return None

        # Extract variables from the dictionary
        id = dictionary.get('id')
        provider_id = dictionary.get('providerId')
        server_time = dictionary.get('serverTime')
        event_start = dictionary.get('eventStart')
        event_end = dictionary.get('eventEnd')
        vehicle_id = dictionary.get('vehicleId')
        hours = dictionary.get('hours')
        thresholds = opentelematicsapi.models.performance_thresholds.PerformanceThresholds.from_dictionary(dictionary.get('thresholds')) if dictionary.get('thresholds') else None
        odometer_start = dictionary.get('odometerStart')
        odometer_end = dictionary.get('odometerEnd')
        engine_time = dictionary.get('engineTime')
        moving_time = dictionary.get('movingTime')
        start_fuel = dictionary.get('startFuel')
        end_fuel = dictionary.get('endFuel')
        brake_applications = dictionary.get('brakeApplications')
        engine_load_stopped = dictionary.get('engineLoadStopped')
        engine_load_moving = dictionary.get('engineLoadMoving')
        headlight_time = dictionary.get('headlightTime')
        speed_governor_value = dictionary.get('speedGovernorValue')
        event_comment = dictionary.get('eventComment')
        over_rpm_time = dictionary.get('overRpmTime')
        over_speed_time = dictionary.get('overSpeedTime')
        excess_speed_time = dictionary.get('excessSpeedTime')
        long_idle_time = dictionary.get('longIdleTime')
        short_idle_time = dictionary.get('shortIdleTime')
        short_idle_count = dictionary.get('shortIdleCount')
        long_idle_fuel = dictionary.get('longIdleFuel')
        short_idle_fuel = dictionary.get('shortIdleFuel')
        cruise_events = dictionary.get('cruiseEvents')
        cruise_time = dictionary.get('cruiseTime')
        cruise_fuel = dictionary.get('cruiseFuel')
        cruise_distance = dictionary.get('cruiseDistance')
        top_gear_value = dictionary.get('topGearValue')
        top_gear_time = dictionary.get('topGearTime')
        top_gear_fuel = dictionary.get('topGearFuel')
        top_gear_distance = dictionary.get('topGearDistance')
        pto_fuel = dictionary.get('ptoFuel')
        pto_time = dictionary.get('ptoTime')
        seat_belt_time = dictionary.get('seatBeltTime')
        particulate_filter_status = dictionary.get('particulateFilterStatus')
        exhaust_fluid_level = dictionary.get('exhaustFluidLevel')
        overspeed_low_throttle = dictionary.get('overspeedLowThrottle')
        overspeed_hi_throttle = dictionary.get('overspeedHiThrottle')
        overrpm_low_throttle = dictionary.get('overrpmLowThrottle')
        overrpm_hi_throttle = dictionary.get('overrpmHiThrottle')
        lka_active = dictionary.get('lkaActive')
        lka_disable = dictionary.get('lkaDisable')
        ldw_active = dictionary.get('ldwActive')
        ldw_disable = dictionary.get('ldwDisable')

        # Return an object of this model
        return cls(id,
                   provider_id,
                   server_time,
                   event_start,
                   event_end,
                   vehicle_id,
                   hours,
                   thresholds,
                   odometer_start,
                   odometer_end,
                   engine_time,
                   moving_time,
                   start_fuel,
                   end_fuel,
                   brake_applications,
                   engine_load_stopped,
                   engine_load_moving,
                   headlight_time,
                   speed_governor_value,
                   event_comment,
                   over_rpm_time,
                   over_speed_time,
                   excess_speed_time,
                   long_idle_time,
                   short_idle_time,
                   short_idle_count,
                   long_idle_fuel,
                   short_idle_fuel,
                   cruise_events,
                   cruise_time,
                   cruise_fuel,
                   cruise_distance,
                   top_gear_value,
                   top_gear_time,
                   top_gear_fuel,
                   top_gear_distance,
                   pto_fuel,
                   pto_time,
                   seat_belt_time,
                   particulate_filter_status,
                   exhaust_fluid_level,
                   overspeed_low_throttle,
                   overspeed_hi_throttle,
                   overrpm_low_throttle,
                   overrpm_hi_throttle,
                   lka_active,
                   lka_disable,
                   ldw_active,
                   ldw_disable)


