{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/github/v1/webhook-installation-payload.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": true,
  "description": "Validates GitHub installation event webhook payload.\n",
  "properties": {
    "action": {
      "description": "The action performed on the installation.\nKnown values: created, deleted, suspend, unsuspend, new_permissions_accepted.\nGitHub may add new action types; validation accepts any non-empty string.\n",
      "minLength": 1,
      "type": "string"
    },
    "installation": {
      "additionalProperties": true,
      "properties": {
        "account": {
          "additionalProperties": true,
          "properties": {
            "id": {
              "minimum": 1,
              "type": "integer"
            },
            "login": {
              "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
              "type": "string"
            },
            "type": {
              "enum": [
                "User",
                "Organization"
              ],
              "type": "string"
            }
          },
          "required": [
            "login",
            "id",
            "type"
          ],
          "type": "object"
        },
        "id": {
          "minimum": 1,
          "type": "integer"
        },
        "repository_selection": {
          "enum": [
            "all",
            "selected"
          ],
          "type": "string"
        },
        "target_id": {
          "minimum": 1,
          "type": "integer"
        },
        "target_type": {
          "enum": [
            "User",
            "Organization"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "account",
        "repository_selection",
        "target_id",
        "target_type"
      ],
      "type": "object"
    },
    "repositories": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "full_name": {
            "pattern": "^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$",
            "type": "string"
          },
          "id": {
            "minimum": 1,
            "type": "integer"
          },
          "name": {
            "pattern": "^[A-Za-z0-9._-]+$",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "full_name"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "sender": {
      "additionalProperties": true,
      "properties": {
        "login": {
          "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
          "type": "string"
        }
      },
      "required": [
        "login"
      ],
      "type": "object"
    }
  },
  "required": [
    "action",
    "installation",
    "sender"
  ],
  "title": "GitHub Installation Webhook Payload",
  "type": "object"
}