{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "DriverDistraction",
    "type": "object",
    "additionalProperties": false,
    "description": "driver distraction including making phone call, using phone apps while driving",
    "properties": {
        "log_context": {
            "$ref": "/resources/schema/analytics/client/v4/LogContext.json",
            "description": "Required Log Context Reference"
        },
        "event_name": {
            "type": "string",
            "enum": [
                "DRIVER_DISTRACTION"
            ]
        },
        "schema_definition": {
            "type": "string",
            "enum": [
                "DriverDistraction"
            ]
        },
        "distraction_type": {
            "type": "string",
            "description": "distraction type",
            "enum": [
                "HAND_HELD_PHONE_CALL",
                "HAND_HELD_NON_CALL",
                "HANDS_FREE_PHONE_CALL"
            ]
        },
        "duration": {
            "type": "integer",
            "description": "distraction duration in millisecond"
        },
        "distance": {
            "type": "number",
            "description": "distraction distance in meters"
        },
        "speed": {
            "type": "number",
            "description": "average driving speed in meters per second during distraction happened. If there is no speed data available, use negative value, such as -100"
        },
        "speed_limit": {
            "type": "number",
            "description": "road speed limit in meters per second when distraction happened"
        },
        "distraction_start_probe_item": {
            "$ref": "/resources/schema/analytics/client/v4/type/ProbeListItemType.json",
            "description": "The first gps probe item of distraction"
        },
        "distraction_end_probe_item": {
            "$ref": "/resources/schema/analytics/client/v4/type/ProbeListItemType.json",
            "description": "The last gps probe item which exceed the speed limit"
        }
    },
    "required": [
        "log_context",
        "event_name",
        "schema_definition",
        "distraction_type",
        "speed"
    ]
}
