GitHubPullRequestEventModel#
- pydantic model safir.github.webhooks.GitHubPullRequestEventModel#
A Pydantic model for a
pull_request
webhook.https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request
- Parameters:
data (
Any
) –
Show JSON schema
{ "title": "GitHubPullRequestEventModel", "description": "A Pydantic model for a ``pull_request`` webhook.\n\nhttps://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request", "type": "object", "properties": { "repository": { "title": "Repository", "description": "The repository that the pull request was opened against.", "allOf": [ { "$ref": "#/definitions/GitHubRepositoryModel" } ] }, "installation": { "title": "Installation", "description": "Information about the GitHub App installation.", "allOf": [ { "$ref": "#/definitions/GitHubAppInstallationModel" } ] }, "action": { "description": "The action that was performed.", "allOf": [ { "$ref": "#/definitions/GitHubPullRequestEventAction" } ] }, "number": { "title": "Number", "description": "Pull request number", "type": "integer" }, "pull_request": { "title": "Pull Request", "description": "Information about the pull request.", "allOf": [ { "$ref": "#/definitions/GitHubPullRequestModel" } ] } }, "required": [ "repository", "installation", "action", "number", "pull_request" ], "definitions": { "GitHubRepoOwnerModel": { "title": "GitHubRepoOwnerModel", "description": "A Pydantic model for the ``owner`` field found in repository objects.\n\nhttps://docs.github.com/en/rest/repos/repos#get-a-repository", "type": "object", "properties": { "login": { "title": "Login name", "description": "Login name of the owner (either a user or an organization).", "example": "lsst-sqre", "type": "string" } }, "required": [ "login" ] }, "GitHubRepositoryModel": { "title": "GitHubRepositoryModel", "description": "A Pydantic model for the ``repository`` field, often found in webhook\npayloads.\n\nhttps://docs.github.com/en/rest/repos/repos#get-a-repository", "type": "object", "properties": { "name": { "title": "Repository name", "description": "Excludes owner prefix.", "example": "times-square-demo", "type": "string" }, "full_name": { "title": "Full name", "description": "Full name, including owner prefix (e.g. ``lsst-sqre/times-square-demo``).)", "example": "lsst-sqre/times-square-demo", "type": "string" }, "owner": { "title": "Owner", "description": "The repository's owner.", "allOf": [ { "$ref": "#/definitions/GitHubRepoOwnerModel" } ] }, "default_branch": { "title": "Default Branch", "description": "The default branch (e.g. main).", "example": "main", "type": "string" }, "html_url": { "title": "Html Url", "description": "URL of the repository for browsers.", "example": "https://github.com/lsst-sqre/times-square-demo", "minLength": 1, "maxLength": 2083, "format": "uri", "type": "string" }, "branches_url": { "title": "Branches Url", "description": "URI template for the repo's branches endpoint.", "example": "https://github.com/lsst-sqre/times-square-demo/branches{/branch}", "type": "string" }, "contents_url": { "title": "Contents Url", "description": "URI template for the contents endpoint.", "example": "https://github.com/lsst-sqre/times-square-demo/contents/{+path}", "type": "string" }, "trees_url": { "title": "Trees Url", "description": "URI template for the Git tree API.", "example": "https://github.com/lsst-sqre/times-square-demo/git/trees{/sha}", "type": "string" }, "blobs_url": { "title": "Blobs Url", "description": "URI template for the Git blobs API.", "example": "https://github.com/lsst-sqre/times-square-demo/git/blobs{/sha}", "type": "string" } }, "required": [ "name", "full_name", "owner", "default_branch", "html_url", "branches_url", "contents_url", "trees_url", "blobs_url" ] }, "GitHubAppInstallationModel": { "title": "GitHubAppInstallationModel", "description": "A Pydantic model for the ``installation`` field found in webhook\npayloads for GitHub Apps.", "type": "object", "properties": { "id": { "title": "Id", "description": "The installation ID.", "type": "string" } }, "required": [ "id" ] }, "GitHubPullRequestEventAction": { "title": "GitHubPullRequestEventAction", "description": "The action performed on a GitHub ``pull_request`` webhook\n(`GitHubPullRequestEventModel`).", "enum": [ "assigned", "auto_merge_disabled", "auto_merge_enabled", "closed", "converted_to_draft", "demilestoned", "dequeued", "edited", "labeled", "locked", "milestoned", "opened", "ready_for_review", "reopened", "review_request_removed", "review_requested", "synchronize", "unassigned", "unlabeled", "unlocked" ], "type": "string" }, "GitHubPullState": { "title": "GitHubPullState", "description": "The state of a GitHub pull request (PR).\n\nhttps://docs.github.com/en/rest/pulls/pulls#get-a-pull-request", "enum": [ "open", "closed" ], "type": "string" }, "GitHubUserModel": { "title": "GitHubUserModel", "description": "A Pydantic model for the ``user`` field found in GitHub API resources.\n\nThis contains brief (public) info about a user.", "type": "object", "properties": { "login": { "title": "Login name", "description": "GitHub username.", "type": "string" }, "html_url": { "title": "Profile URL", "description": "Homepage for the user on GitHub.", "minLength": 1, "maxLength": 2083, "format": "uri", "type": "string" }, "url": { "title": "API URL", "description": "URL for the user's resource in the GitHub API.", "minLength": 1, "maxLength": 2083, "format": "uri", "type": "string" }, "avatar_url": { "title": "Avatar image URL", "description": "URL to the user's avatar.", "minLength": 1, "maxLength": 2083, "format": "uri", "type": "string" } }, "required": [ "login", "html_url", "url", "avatar_url" ] }, "GitHubPullRequestModel": { "title": "GitHubPullRequestModel", "description": "A Pydantic model for a GitHub Pull Request.\n\nThis is also the ``pull_request`` field inside the\n`~safir.github.webhooks.GitHubPullRequestEventModel`.\n\nhttps://docs.github.com/en/rest/pulls/pulls#get-a-pull-request", "type": "object", "properties": { "html_url": { "title": "Html Url", "description": "Web URL of the PR.", "minLength": 1, "maxLength": 2083, "format": "uri", "type": "string" }, "number": { "title": "Number", "description": "Pull request number.", "type": "integer" }, "title": { "title": "Title", "description": "Title of the PR.", "type": "string" }, "state": { "description": "Whether the PR is opened or closed.", "allOf": [ { "$ref": "#/definitions/GitHubPullState" } ] }, "draft": { "title": "Draft", "description": "True if the PR is a draft.", "type": "boolean" }, "merged": { "title": "Merged", "description": "True if the PR is merged.", "type": "boolean" }, "user": { "title": "User", "description": "The user that opened the PR.", "allOf": [ { "$ref": "#/definitions/GitHubUserModel" } ] } }, "required": [ "html_url", "number", "title", "state", "draft", "merged", "user" ] } } }
- Fields:
-
field action:
GitHubPullRequestEventAction
[Required]# The action that was performed.
-
field installation:
GitHubAppInstallationModel
[Required]# Information about the GitHub App installation.
-
field pull_request:
GitHubPullRequestModel
[Required]# Information about the pull request.
-
field repository:
GitHubRepositoryModel
[Required]# The repository that the pull request was opened against.