Source code for bridge.core.github_pages
"""
Auto-generated Pydantic models for the GitHub Pages schema.
Do not edit this file manually — it is generated by `scripts/gen_models.py`
from the JSON schema at schemas/github_pages.json.
"""
# generated by datamodel-codegen:
# filename: github_pages.json
# timestamp: 2025-11-06T12:52:05+00:00
from __future__ import annotations
from datetime import date
from enum import Enum
from pydantic import AnyUrl, AwareDatetime, BaseModel, Field
[docs]
class Status(Enum):
"""Status of the most recent GitHub Pages build."""
built = "built"
building = "building"
errored = "errored"
NoneType_None = None
[docs]
class ProtectedDomainState(Enum):
"""State of domain verification for GitHub Pages."""
pending = "pending"
verified = "verified"
unverified = "unverified"
NoneType_None = None
[docs]
class BuildType(Enum):
"""Type of build process for GitHub Pages."""
legacy = "legacy"
workflow = "workflow"
NoneType_None = None
[docs]
class Source(BaseModel):
"""Source configuration for GitHub Pages."""
branch: str
path: str
[docs]
class State(Enum):
"""State of HTTPS certificate for GitHub Pages."""
new = "new"
authorization_created = "authorization_created"
authorization_pending = "authorization_pending"
authorized = "authorized"
authorization_revoked = "authorization_revoked"
issued = "issued"
uploaded = "uploaded"
approved = "approved"
errored = "errored"
bad_authz = "bad_authz"
destroy_pending = "destroy_pending"
dns_changed = "dns_changed"
[docs]
class HttpsCertificate(BaseModel):
"""HTTPS certificate information for GitHub Pages."""
state: State = Field(..., examples=["approved"])
description: str = Field(..., examples=["Certificate is approved"])
domains: list[str] = Field(
...,
description="Array of the domain set and its alternate name (if it is configured)",
examples=["example.com", "www.example.com"],
)
expires_at: date | None = None
[docs]
class GitHubPages(BaseModel):
"""GitHub Pages configuration and metadata."""
url: AnyUrl = Field(
...,
description="The API address for accessing this Page resource.",
examples=["https://api.github.com/repos/github/hello-world/pages"],
)
status: Status | None = Field(
..., description="The status of the most recent build of the Page.", examples=["built"]
)
cname: str | None = Field(..., description="The Pages site's custom domain", examples=["example.com"])
protected_domain_state: ProtectedDomainState | None = Field(
None, description="The state if the domain is verified", examples=["pending"]
)
pending_domain_unverified_at: AwareDatetime | None = Field(
None, description="The timestamp when a pending domain becomes unverified."
)
custom_404: bool = Field(..., description="Whether the Page has a custom 404 page.", examples=[False])
html_url: AnyUrl | None = Field(
None, description="The web address the Page can be accessed from.", examples=["https://example.com"]
)
build_type: BuildType | None = Field(
None, description="The process in which the Page will be built.", examples=["legacy"]
)
source: Source | None = Field(None, title="Pages Source Hash")
public: bool = Field(
...,
description=(
"Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to "
"anyone on the internet. If set to `false`, the site will only be accessible to users who have at "
"least `read` access to the repository that published the site."
),
examples=[True],
)
https_certificate: HttpsCertificate | None = Field(None, title="Pages Https Certificate")
https_enforced: bool | None = Field(None, description="Whether https is enabled on the domain", examples=[True])