octomachinery.github.models.events module¶
Generic GitHub event containers.
- class octomachinery.github.models.events.GitHubEvent(name: str, payload: Mapping[str, Any] | bytes | str)[source]¶
Bases:
objectRepresentation of a generic source-agnostic GitHub event.
- async dispatch_via(*routers: OctomachineryRouterBase, ctx: Mapping[str, Any] | None = None) Iterable[Any][source]¶
Invoke this event handlers from different routers.
- classmethod from_file(event_name: str, event_path: Path | str) GitHubEvent[source]¶
Construct a GitHubEvent instance from event name and file.
- classmethod from_fixture(event_fixture_path: Path | str, *, event: str | None = None) GitHubEvent[source]¶
Make a GitHubEvent from a fixture and an optional name.
- classmethod from_fixture_fd(event_fixture_fd: TextIO, *, event: str | None = None) GitHubEvent[source]¶
Make a GitHubEvent from a fixture fd and an optional name.
- classmethod from_gidgethub(event: Event) GitHubEvent[source]¶
Construct GitHubEvent from from GidgetHub Event.
- class octomachinery.github.models.events.GitHubWebhookEvent(name: str, payload: Mapping[str, Any] | bytes | str, delivery_id: str | UUID)[source]¶
Bases:
GitHubEventRepresentation of a GitHub event arriving by HTTP.
- classmethod from_file(event_name: str, event_path: Path | str) GitHubWebhookEvent[source]¶
Explode when constructing from file.
- classmethod from_fixture(event_fixture_path: Path | str, *, event: str | None = None) GitHubWebhookEvent[source]¶
Make a GitHubWebhookEvent from fixture and optional name.
- classmethod from_fixture_fd(event_fixture_fd: TextIO, *, event: str | None = None) GitHubWebhookEvent[source]¶
Make GitHubWebhookEvent from fixture fd and optional name.
- classmethod from_gidgethub(event: Event) GitHubWebhookEvent[source]¶
Construct GitHubWebhookEvent from from GidgetHub Event.