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