GitHubRepositoryModel

pydantic model safir.github.models.GitHubRepositoryModel

A Pydantic model for the repository field, often found in webhook payloads.

https://docs.github.com/en/rest/repos/repos#get-a-repository

Parameters:

data (Any)

Show JSON schema
{
   "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": {
         "description": "Excludes owner prefix.",
         "examples": [
            "times-square-demo"
         ],
         "title": "Repository name",
         "type": "string"
      },
      "full_name": {
         "description": "Full name, including owner prefix (e.g. ``lsst-sqre/times-square-demo``).)",
         "examples": [
            "lsst-sqre/times-square-demo"
         ],
         "title": "Full name",
         "type": "string"
      },
      "owner": {
         "$ref": "#/$defs/GitHubRepoOwnerModel",
         "description": "The repository's owner."
      },
      "default_branch": {
         "description": "The default branch (e.g. main).",
         "examples": [
            "main"
         ],
         "title": "Default Branch",
         "type": "string"
      },
      "html_url": {
         "description": "URL of the repository for browsers.",
         "examples": [
            "https://github.com/lsst-sqre/times-square-demo"
         ],
         "format": "uri",
         "maxLength": 2083,
         "minLength": 1,
         "title": "Html Url",
         "type": "string"
      },
      "branches_url": {
         "description": "URI template for the repo's branches endpoint.",
         "examples": [
            "https://github.com/lsst-sqre/times-square-demo/branches{/branch}"
         ],
         "title": "Branches Url",
         "type": "string"
      },
      "contents_url": {
         "description": "URI template for the contents endpoint.",
         "examples": [
            "https://github.com/lsst-sqre/times-square-demo/contents/{+path}"
         ],
         "title": "Contents Url",
         "type": "string"
      },
      "trees_url": {
         "description": "URI template for the Git tree API.",
         "examples": [
            "https://github.com/lsst-sqre/times-square-demo/git/trees{/sha}"
         ],
         "title": "Trees Url",
         "type": "string"
      },
      "blobs_url": {
         "description": "URI template for the Git blobs API.",
         "examples": [
            "https://github.com/lsst-sqre/times-square-demo/git/blobs{/sha}"
         ],
         "title": "Blobs Url",
         "type": "string"
      }
   },
   "$defs": {
      "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",
         "properties": {
            "login": {
               "description": "Login name of the owner (either a user or an organization).",
               "examples": [
                  "lsst-sqre"
               ],
               "title": "Login name",
               "type": "string"
            }
         },
         "required": [
            "login"
         ],
         "title": "GitHubRepoOwnerModel",
         "type": "object"
      }
   },
   "required": [
      "name",
      "full_name",
      "owner",
      "default_branch",
      "html_url",
      "branches_url",
      "contents_url",
      "trees_url",
      "blobs_url"
   ]
}

Fields:
field blobs_url: str [Required]

URI template for the Git blobs API.

field branches_url: str [Required]

URI template for the repo’s branches endpoint.

field contents_url: str [Required]

URI template for the contents endpoint.

field default_branch: str [Required]

The default branch (e.g. main).

field full_name: str [Required]

Full name, including owner prefix (e.g. lsst-sqre/times-square-demo).)

field html_url: HttpUrl [Required]

URL of the repository for browsers.

Constraints:
  • max_length = 2083

  • allowed_schemes = [‘http’, ‘https’]

field name: str [Required]

Excludes owner prefix.

field owner: GitHubRepoOwnerModel [Required]

The repository’s owner.

field trees_url: str [Required]

URI template for the Git tree API.