GitHubPullRequestModel

pydantic model safir.github.models.GitHubPullRequestModel

A Pydantic model for a GitHub Pull Request.

This is also the pull_request field inside the GitHubPullRequestEventModel.

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": {
         "description": "Web URL of the PR.",
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Html Url",
         "type": "string"
      },
      "number": {
         "description": "Pull request number.",
         "title": "Number",
         "type": "integer"
      },
      "title": {
         "description": "Title of the PR.",
         "title": "Title",
         "type": "string"
      },
      "state": {
         "$ref": "#/$defs/GitHubPullState",
         "description": "Whether the PR is opened or closed."
      },
      "draft": {
         "description": "True if the PR is a draft.",
         "title": "Draft",
         "type": "boolean"
      },
      "merged": {
         "description": "True if the PR is merged.",
         "title": "Merged",
         "type": "boolean"
      },
      "user": {
         "$ref": "#/$defs/GitHubUserModel",
         "description": "The user that opened the PR."
      }
   },
   "$defs": {
      "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"
         ],
         "title": "GitHubPullState",
         "type": "string"
      },
      "GitHubUserModel": {
         "description": "A Pydantic model for the ``user`` field found in GitHub API resources.\n\nThis contains brief (public) info about a user.",
         "properties": {
            "login": {
               "description": "GitHub username.",
               "title": "Login name",
               "type": "string"
            },
            "html_url": {
               "description": "Homepage for the user on GitHub.",
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "title": "Profile URL",
               "type": "string"
            },
            "url": {
               "description": "URL for the user's resource in the GitHub API.",
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "title": "API URL",
               "type": "string"
            },
            "avatar_url": {
               "description": "URL to the user's avatar.",
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "title": "Avatar image URL",
               "type": "string"
            }
         },
         "required": [
            "login",
            "html_url",
            "url",
            "avatar_url"
         ],
         "title": "GitHubUserModel",
         "type": "object"
      }
   },
   "required": [
      "html_url",
      "number",
      "title",
      "state",
      "draft",
      "merged",
      "user"
   ]
}

Fields:
field draft: bool [Required]

True if the PR is a draft.

field html_url: HttpUrl [Required]

Web URL of the PR.

field merged: bool [Required]

True if the PR is merged.

field number: int [Required]

Pull request number.

field state: GitHubPullState [Required]

Whether the PR is opened or closed.

field title: str [Required]

Title of the PR.

field user: GitHubUserModel [Required]

The user that opened the PR.