Skip to content

Commit cec286c

Browse files
refactor: Add WebhookRepresentation schema for ad-hoc webhooks (#767)
This PR updates the auto-generated Pydantic models and TypedDicts based on OpenAPI specification changes in [apify-docs PR #2469](apify/apify-docs#2469). Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
1 parent 0c5112e commit cec286c

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

src/apify_client/_models_generated.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3951,6 +3951,37 @@ class WebhookEventType(StrEnum):
39513951
TEST = 'TEST'
39523952

39533953

3954+
@docs_group('Models')
3955+
class WebhookRepresentation(BaseModel):
3956+
"""Minimal representation of an ad-hoc webhook attached to a single Actor run or build via the
3957+
`webhooks` query parameter. The query parameter value is a Base64-encoded JSON array whose
3958+
items match this schema. Persistent webhook fields (e.g. `condition`) are not used here.
3959+
3960+
"""
3961+
3962+
model_config = ConfigDict(
3963+
extra='allow',
3964+
populate_by_name=True,
3965+
)
3966+
event_types: Annotated[list[WebhookEventType], Field(alias='eventTypes', examples=[['ACTOR.RUN.SUCCEEDED']])]
3967+
request_url: Annotated[str, Field(alias='requestUrl', examples=['http://example.com/'])]
3968+
"""
3969+
The URL to which the webhook sends its payload.
3970+
"""
3971+
payload_template: Annotated[
3972+
str | None, Field(alias='payloadTemplate', examples=['{\\n "userId": {{userId}}...'])
3973+
] = None
3974+
"""
3975+
Optional template for the JSON payload sent by the webhook.
3976+
"""
3977+
headers_template: Annotated[
3978+
str | None, Field(alias='headersTemplate', examples=['{\\n "Authorization": "Bearer ..."}'])
3979+
] = None
3980+
"""
3981+
Optional template for the HTTP headers sent by the webhook.
3982+
"""
3983+
3984+
39543985
@docs_group('Models')
39553986
class WebhookResponse(BaseModel):
39563987
"""Response containing webhook data."""

0 commit comments

Comments
 (0)