{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.sportsnip.com/schemas/v1/clip.json",
  "title": "SportSnip clip (v1)",
  "description": "A clip made from the event.",
  "type": "object",
  "required": [
    "id",
    "event_id",
    "game_id",
    "kind",
    "label",
    "start_stream_s",
    "end_stream_s",
    "created_at",
    "ready_lag_s",
    "versions",
    "cursor"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "event_id": {
      "type": "string",
      "format": "uuid"
    },
    "game_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "kind": {
      "enum": [
        "score",
        "kick",
        "card",
        "big_moment",
        "replay",
        "partner",
        "manual"
      ]
    },
    "label": {
      "type": "string"
    },
    "start_stream_s": {
      "type": [
        "number",
        "null"
      ],
      "description": "Seconds from the start of the event's recording"
    },
    "end_stream_s": {
      "type": [
        "number",
        "null"
      ],
      "description": "Seconds from the start of the event's recording"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601, UTC"
    },
    "ready_lag_s": {
      "type": [
        "number",
        "null"
      ],
      "description": "Seconds from the moment to the clip being ready"
    },
    "versions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "format",
          "url",
          "bytes"
        ],
        "properties": {
          "format": {
            "type": "string",
            "description": "16x9, 9x16, 1x1, raw or still"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Signed download link, valid for 15 minutes"
          },
          "bytes": {
            "type": "integer"
          }
        }
      }
    },
    "cursor": {
      "type": "string"
    }
  }
}
