{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/github/v1/build-list.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": false,
  "description": "A paginated list of builds\n",
  "properties": {
    "builds": {
      "description": "A simple list of builds.\n",
      "items": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "description": "The initial creation time of the build. This is when it became pending.\n",
            "format": "date-time",
            "type": "string"
          },
          "eventId": {
            "description": "The GitHub webhook deliveryId. Extracted from the header 'X-GitHub-Delivery'\n",
            "oneOf": [
              {
                "pattern": "^[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}$",
                "title": "Github GUID",
                "type": "string"
              },
              {
                "enum": [
                  "Unknown"
                ],
                "title": "Unknown Github GUID",
                "type": "string"
              }
            ],
            "type": "string"
          },
          "eventType": {
            "description": "Type of Github event that triggered the build (i.e. push, pull_request.opened).",
            "type": "string"
          },
          "organization": {
            "description": "Github organization associated with the build.",
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^([a-zA-Z0-9-_%]*)$",
            "type": "string"
          },
          "pullRequestNumber": {
            "description": "Associated pull request number for 'pull_request' events.\n",
            "type": "integer"
          },
          "repository": {
            "description": "Github repository associated with the build.",
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^([a-zA-Z0-9-_%]*)$",
            "type": "string"
          },
          "sha": {
            "description": "Github revision associated with the build.",
            "maxLength": 40,
            "minLength": 40,
            "type": "string"
          },
          "state": {
            "description": "Github status associated with the build.",
            "enum": [
              "pending",
              "success",
              "error",
              "failure",
              "cancelled"
            ],
            "type": "string"
          },
          "taskGroupId": {
            "description": "Taskcluster task-group associated with the build.",
            "pattern": "^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$",
            "type": "string"
          },
          "updated": {
            "description": "The last updated of the build. If it is done, this is when it finished.\n",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "organization",
          "repository",
          "sha",
          "state",
          "taskGroupId",
          "eventType",
          "eventId",
          "created",
          "updated"
        ],
        "title": "Build",
        "type": "object"
      },
      "type": "array",
      "uniqueItems": false
    },
    "continuationToken": {
      "description": "Passed back from Azure to allow us to page through long result sets.",
      "type": "string"
    }
  },
  "required": [
    "builds"
  ],
  "title": "Builds Response",
  "type": "object"
}