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

@@ -4,7 +4,7 @@ from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
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_string
from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import UserProfile
@@ -23,7 +23,7 @@ def api_insping_webhook(
request: HttpRequest,
user_profile: UserProfile,
*,
payload: WebhookPayload[WildValue],
payload: JsonBodyPayload[WildValue],
) -> HttpResponse:
data = payload["webhook_event_data"]