GitHub API resource models#

The safir.github.models module contains Pydantic models for GitHub API resources. This page lists the GitHub endpoints that correspond to models included in Safir. Note that webhooks often include data modelled by safir.github.models as well (see Models for GitHub webhook payloads).

Note

The safir.github.models module is not exhaustive. Only models used by Safir applications are included. To expand the coverage, you can contribute them to Safir.

As well, the models are not guaranteed to be complete. Fields not relevant to Safir applications may not be included (Pydantic ignores undeclared fields when it parses responses from GitHub). You can include additional fields in your application either by subclassing these models or by contributing them to Safir.

Response resources#

Endpoint

Model

GET /repos/{owner}/{repo}/

GitHubRepositoryModel

GET /repos/{owner}/{repo}/branches/{branch}

GitHubBranchModel

GET /repos/{owner}/{repo}/check-runs/{check_run_id}

GitHubCheckRunModel

GET /repos/{owner}/{repo}/check-suites/{check_suite_id}

GitHubCheckSuiteModel

GET /repos/{owner}/{repo}/git/blobs/{file_sha}

GitHubBlobModel

GET /repos/{owner}/{repo}/pulls/{pull_number}

GitHubPullRequestModel