githubapp.events.event

Parent class to represents the Github events

Module Contents

Classes

Event

Event base class

Data

T

API

class githubapp.events.event.Event(*, gh, requester, headers, sender, repository=None, **kwargs)

Event base class

This class represents a generic GitHub webhook event. It provides common attributes and methods for parsing event data from the request headers and body.

Initialization

delivery

None

event_identifier

None

static fix_attributes(attributes)

Fix the url value

classmethod get_event(headers, body) type[githubapp.events.event.Event]

Get the event class based on the event type

Args: headers (dict): The request headers body (dict): The request body

Returns: Event: The event class

github_event

None

hook_id

None

hook_installation_target_id

None

hook_installation_target_type

None

installation_id

None

classmethod match(data)

Check if the event matches the event_identifier

Args: data: A dict containing all the event data

Returns: bool: True if the event matches the event_identifier, False otherwise

static normalize_dicts(*dicts) dict[str, str]

Normalize the event data to a common format

Args: *dicts: A list of dicts containing the event data

Returns: dict: A dict containing the normalized event data

start_check_run(name: str, sha: str, title: Optional[str] = None, summary: Optional[str] = None, text: Optional[str] = None, status: githubapp.event_check_run.CheckRunStatus = CheckRunStatus.WAITING)

Start a check run

githubapp.events.event.T

‘TypeVar(…)’