{
    "additionalProperties": false,
    "description": "Schema for a client-generated user session",
    "properties": {
        "firstEventId": {
            "_format": "uuid",
            "description": "The optional identifier of the first event id for this session",
            "type": [
                "null",
                "string"
            ]
        },
        "previousSessionId": {
            "_format": "uuid",
            "description": "The previous session identifier for this user",
            "type": [
                "null",
                "string"
            ]
        },
        "sessionId": {
            "_format": "uuid",
            "description": "An identifier for the session",
            "type": "string"
        },
        "sessionIndex": {
            "description": "The index of the current session for this user",
            "maximum": 2147483647,
            "minimum": 0,
            "type": "integer"
        },
        "storageMechanism": {
            "description": "The mechanism that the session information has been stored on the device",
            "enum": [
                "SQLITE",
                "COOKIE_1",
                "COOKIE_3",
                "LOCAL_STORAGE",
                "FLASH_LSO"
            ],
            "type": "string"
        },
        "userId": {
            "description": "An identifier for the user of the session",
            "maxLength": 36,
            "pattern": "^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|^[0-9a-f]{16}$",
            "type": "string"
        }
    },
    "required": [
        "userId",
        "sessionId",
        "sessionIndex",
        "previousSessionId",
        "storageMechanism"
    ],
    "self": {
        "format": "jsonschema",
        "name": "client_session",
        "vendor": "com.snowplowanalytics.snowplow",
        "version": "1-0-1"
    },
    "type": "object"
}