{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Task",
  "type": "object",
  "properties": {
    "createdAt": {
      "type": "string",
      "description": "Date and time of the task creation.",
      "example": "2022-04-28T14:20:04.000Z",
      "format": "date-time"
    },
    "duration": {
      "type": "integer",
      "description": "Duration of the task in milliseconds.",
      "example": 123456789,
      "format": "int64"
    },
    "error": {
      "type": "string",
      "example": "abc123"
    },
    "finishedAt": {
      "type": "string",
      "description": "Date and time of the task end.",
      "example": "2022-04-28T14:20:04.000Z",
      "format": "date-time"
    },
    "isFinished": {
      "type": "boolean",
      "description": "Shortcut for status != \"processing\".",
      "example": false
    },
    "outputs": {
      "$ref": "#/definitions/TaskOutputs"
    },
    "result": {
      "type": "string",
      "example": "abc123"
    },
    "status": {
      "type": "string",
      "description": "Task status, one of: processing, success, error",
      "example": "success",
      "enum": [
        "processing",
        "success",
        "error"
      ]
    },
    "taskId": {
      "type": "string",
      "example": "task_1234"
    },
    "type": {
      "type": "string",
      "description": "Task type.",
      "example": "abc123"
    },
    "url": {
      "type": "string",
      "description": "URL of the task.",
      "example": "abc123"
    }
  },
  "example": {
    "taskId": "task_1234",
    "type": "abc123",
    "url": "abc123",
    "status": "success",
    "isFinished": false,
    "createdAt": "2022-04-28T14:20:04.000Z",
    "finishedAt": "2022-04-28T14:20:04.000Z",
    "duration": 123456789,
    "result": "abc123",
    "error": "abc123",
    "outputs": {
      "url": "abc123",
      "projectId": 123,
      "branchId": 345,
      "sourceId": "github-webhook-source",
      "sinkId": "github-pr-table-sink"
    }
  },
  "required": [
    "taskId",
    "type",
    "url",
    "status",
    "isFinished",
    "createdAt"
  ]
}