{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "PeripheralConnectionStatus",
    "type": "object",
    "additionalProperties": false,
    "description": "Schema to log details about peripheral connection events",
    "properties": {
        "log_context": {
            "$ref": "/resources/schema/analytics/client/v4/LogContext.json",
            "description": "Required Log Context Reference"
        },
        "event_name": {
            "type": "string",
            "enum": [
                "PERIPHERAL_CONNECTION_STATUS"
            ]
        },
        "schema_definition": {
            "type": "string",
            "enum": [
                "PeripheralConnectionStatus"
            ]
        },
        "trigger": {
            "enum": [
                "TRIP_START",
                "TRIP_INTERVAL",
                "CONNECTION_UPDATE",
                "TRIP_END",
                "MATCH_CAR"
            ],
            "description": "Trigger event for the peripheral connection check (e.g., trip start, trip interval, connection update, trip end, or match car)"
        },
        "channel_client_id": {
            "type": "string",
            "description": "UUID of car used to log the final match"
        },
        "reason": {
            "$ref": "/resources/schema/analytics/client/v4/type/TripAssignmentReasonType.json",
            "description": "Reason for matching a trip to channel_client_id"
        },
        "peripheral_detail": {
            "type": "array",
            "items": {
                "$ref": "/resources/schema/analytics/client/v4/item/PeripheralDetailItem.json"
            },
            "description": "Array of peripheral device details"
        }
    },
    "required": [
        "log_context",
        "event_name",
        "schema_definition",
        "trigger"
    ]
}