{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/github/v1/webhook-ping-payload.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": true,
  "description": "Validates GitHub ping event webhook payload.\nThis event is sent when a webhook is first created.\n",
  "properties": {
    "hook": {
      "additionalProperties": true,
      "properties": {
        "active": {
          "type": "boolean"
        },
        "config": {
          "additionalProperties": true,
          "type": "object"
        },
        "events": {
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "type": "array"
        },
        "id": {
          "minimum": 1,
          "type": "integer"
        },
        "name": {
          "enum": [
            "web"
          ],
          "type": "string"
        },
        "type": {
          "enum": [
            "Repository",
            "Organization"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "id",
        "name",
        "active",
        "events",
        "config"
      ],
      "type": "object"
    },
    "hook_id": {
      "minimum": 1,
      "type": "integer"
    },
    "organization": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "additionalProperties": true,
          "properties": {
            "login": {
              "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
              "type": "string"
            }
          },
          "required": [
            "login"
          ],
          "type": "object"
        }
      ]
    },
    "repository": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "additionalProperties": true,
          "properties": {
            "full_name": {
              "pattern": "^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$",
              "type": "string"
            },
            "name": {
              "pattern": "^[A-Za-z0-9._-]+$",
              "type": "string"
            },
            "owner": {
              "additionalProperties": true,
              "anyOf": [
                {
                  "required": [
                    "name"
                  ]
                },
                {
                  "required": [
                    "login"
                  ]
                }
              ],
              "properties": {
                "login": {
                  "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
                  "type": "string"
                },
                "name": {
                  "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
                  "type": "string"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "name",
            "full_name",
            "owner"
          ],
          "type": "object"
        }
      ]
    },
    "sender": {
      "additionalProperties": true,
      "properties": {
        "login": {
          "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
          "type": "string"
        }
      },
      "required": [
        "login"
      ],
      "type": "object"
    },
    "zen": {
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "zen",
    "hook_id",
    "hook",
    "sender"
  ],
  "title": "GitHub Ping Webhook Payload",
  "type": "object"
}