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": {
         "description": "Branch name (e.g. main)",
         "examples": [
            "main"
         ],
         "title": "Name",
         "type": "string"
      },
      "commit": {
         "allOf": [
            {
               "$ref": "#/$defs/GitHubBranchCommitModel"
            }
         ],
         "description": "HEAD commit info."
      }
   },
   "$defs": {
      "GitHubBranchCommitModel": {
         "description": "A Pydantic model for the commit field found in `GitHubBranchModel`.",
         "properties": {
            "sha": {
               "description": "Git commit SHA.",
               "title": "Sha",
               "type": "string"
            },
            "url": {
               "description": "URL for commit resource.",
               "format": "uri",
               "maxLength": 2083,
               "minLength": 1,
               "title": "Url",
               "type": "string"
            }
         },
         "required": [
            "sha",
            "url"
         ],
         "title": "GitHubBranchCommitModel",
         "type": "object"
      }
   },
   "required": [
      "name",
      "commit"
   ]
}

Fields:
field commit: GitHubBranchCommitModel [Required]#

HEAD commit info.

field name: str [Required]#

Branch name (e.g. main)

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.