GitHubPullRequestModel#
- pydantic model safir.github.models.GitHubPullRequestModel#
A Pydantic model for a GitHub Pull Request.
This is also the
pull_request
field inside theGitHubPullRequestEventModel
.https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request
- Parameters:
data (
Any
) –
Show JSON schema
{ "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" ], "definitions": { "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" ] } } }
- Fields:
-
field html_url:
HttpUrl
[Required]# Web URL of the PR.
- Constraints:
minLength = 1
maxLength = 2083
format = uri
-
field state:
GitHubPullState
[Required]# Whether the PR is opened or closed.
-
field user:
GitHubUserModel
[Required]# The user that opened the PR.