Skip to content

pydantic_gitlab_webhooks.validators

validate_event_body_dict

validate_event_body_dict(event: dict) -> AnyEvent

Validate an incoming event body against the incoming webhook schema.

Parameters:

Name Type Description Default
event dict

Python dictionary representing the received event body

required

Returns:

Type Description
AnyEvent

a validated and parsed event

validate_event_header_and_body_dict

validate_event_header_and_body_dict(
    header: str, body: dict
) -> AnyEvent

Validate an event header body against the webhook schema.

Parameters:

Name Type Description Default
header str

Value of the X-Gitlab-Event header

required
body dict

Python dictionary representing the received event body

required

Returns:

Type Description
AnyEvent

a validated and parsed event