GitHubBranchModel#

pydantic model safir.github.models.GitHubBranchModel#

A Pydantic model for a GitHub branch.

https://docs.github.com/en/rest/branches/branches#get-a-branch

Parameters:

data (Any) –

Show JSON schema
{
   "title": "GitHubBranchModel",
   "description": "A Pydantic model for a GitHub branch.\n\nhttps://docs.github.com/en/rest/branches/branches#get-a-branch",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "description": "Branch name (e.g. main)",
         "example": "main",
         "type": "string"
      },
      "commit": {
         "title": "Commit",
         "description": "HEAD commit info.",
         "allOf": [
            {
               "$ref": "#/definitions/GitHubBranchCommitModel"
            }
         ]
      }
   },
   "required": [
      "name",
      "commit"
   ],
   "definitions": {
      "GitHubBranchCommitModel": {
         "title": "GitHubBranchCommitModel",
         "description": "A Pydantic model for the commit field found in `GitHubBranchModel`.",
         "type": "object",
         "properties": {
            "sha": {
               "title": "Sha",
               "description": "Git commit SHA.",
               "type": "string"
            },
            "url": {
               "title": "Url",
               "description": "URL for commit resource.",
               "minLength": 1,
               "maxLength": 2083,
               "format": "uri",
               "type": "string"
            }
         },
         "required": [
            "sha",
            "url"
         ]
      }
   }
}

Fields:
field commit: GitHubBranchCommitModel [Required]#

HEAD commit info.

field name: str [Required]#

Branch name (e.g. main)