typed_endpoint: Rename WebhookPayload to JsonBodyPayload.

This kind of payload that's loaded from json in the body of the request
is not only used for webhooks, but also in the push bouncer, and may get
used elsewhere too - so a general name is better.
This commit is contained in:
Mateusz Mandera
2023-09-27 19:01:31 +02:00
committed by Tim Abbott
parent 31af4fb24b
commit ac14a8bcf5
78 changed files with 155 additions and 155 deletions

View File

@@ -7,7 +7,7 @@ from returns.curry import partial
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventTypeError
from zerver.lib.response import json_success
from zerver.lib.typed_endpoint import WebhookPayload, typed_endpoint
from zerver.lib.typed_endpoint import JsonBodyPayload, typed_endpoint
from zerver.lib.validator import WildValue, check_int, check_none_or, check_string, check_url
from zerver.lib.webhooks.common import (
check_send_webhook_message,
@@ -107,7 +107,7 @@ def api_groove_webhook(
request: HttpRequest,
user_profile: UserProfile,
*,
payload: WebhookPayload[WildValue],
payload: JsonBodyPayload[WildValue],
) -> HttpResponse:
event = validate_extract_webhook_http_header(request, "X-Groove-Event", "Groove")
assert event is not None