close
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## [1.7.1](../../releases/tag/v1.7.1) - Unreleased

...
### Add

- add `headers_template` kwarg to webhook create and update

## [1.7.0](../../releases/tag/v1.7.0) - 2024-05-20

Expand Down
8 changes: 8 additions & 0 deletions src/apify_client/clients/resource_clients/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def get_webhook_representation(
event_types: list[WebhookEventType] | None = None,
request_url: str | None = None,
payload_template: str | None = None,
headers_template: str | None = None,
actor_id: str | None = None,
actor_task_id: str | None = None,
actor_run_id: str | None = None,
Expand All @@ -35,6 +36,7 @@ def get_webhook_representation(
webhook: dict = {
'requestUrl': request_url,
'payloadTemplate': payload_template,
'headersTemplate': headers_template,
'ignoreSslErrors': ignore_ssl_errors,
'doNotRetry': do_not_retry,
'idempotencyKey': idempotency_key,
Expand Down Expand Up @@ -80,6 +82,7 @@ def update(
event_types: list[WebhookEventType] | None = None,
request_url: str | None = None,
payload_template: str | None = None,
headers_template: str | None = None,
actor_id: str | None = None,
actor_task_id: str | None = None,
actor_run_id: str | None = None,
Expand All @@ -95,6 +98,7 @@ def update(
event_types (list of WebhookEventType, optional): List of event types that should trigger the webhook. At least one is required.
request_url (str, optional): URL that will be invoked once the webhook is triggered.
payload_template (str, optional): Specification of the payload that will be sent to request_url
headers_template (str, optional): Headers that will be sent to the request_url
actor_id (str, optional): Id of the actor whose runs should trigger the webhook.
actor_task_id (str, optional): Id of the actor task whose runs should trigger the webhook.
actor_run_id (str, optional): Id of the actor run which should trigger the webhook.
Expand All @@ -111,6 +115,7 @@ def update(
event_types=event_types,
request_url=request_url,
payload_template=payload_template,
headers_template=headers_template,
actor_id=actor_id,
actor_task_id=actor_task_id,
actor_run_id=actor_run_id,
Expand Down Expand Up @@ -190,6 +195,7 @@ async def update(
event_types: list[WebhookEventType] | None = None,
request_url: str | None = None,
payload_template: str | None = None,
headers_template: str | None = None,
actor_id: str | None = None,
actor_task_id: str | None = None,
actor_run_id: str | None = None,
Expand All @@ -205,6 +211,7 @@ async def update(
event_types (list of WebhookEventType, optional): List of event types that should trigger the webhook. At least one is required.
request_url (str, optional): URL that will be invoked once the webhook is triggered.
payload_template (str, optional): Specification of the payload that will be sent to request_url
headers_template (str, optional): Headers that will be sent to the request_url
actor_id (str, optional): Id of the actor whose runs should trigger the webhook.
actor_task_id (str, optional): Id of the actor task whose runs should trigger the webhook.
actor_run_id (str, optional): Id of the actor run which should trigger the webhook.
Expand All @@ -221,6 +228,7 @@ async def update(
event_types=event_types,
request_url=request_url,
payload_template=payload_template,
headers_template=headers_template,
actor_id=actor_id,
actor_task_id=actor_task_id,
actor_run_id=actor_run_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def create(
event_types: list[WebhookEventType], # type: ignore
request_url: str,
payload_template: str | None = None,
headers_template: str | None = None,
actor_id: str | None = None,
actor_task_id: str | None = None,
actor_run_id: str | None = None,
Expand All @@ -66,6 +67,7 @@ def create(
event_types (list of WebhookEventType): List of event types that should trigger the webhook. At least one is required.
request_url (str): URL that will be invoked once the webhook is triggered.
payload_template (str, optional): Specification of the payload that will be sent to request_url
headers_template (str, optional): Headers that will be sent to the request_url
actor_id (str, optional): Id of the actor whose runs should trigger the webhook.
actor_task_id (str, optional): Id of the actor task whose runs should trigger the webhook.
actor_run_id (str, optional): Id of the actor run which should trigger the webhook.
Expand All @@ -84,6 +86,7 @@ def create(
event_types=event_types,
request_url=request_url,
payload_template=payload_template,
headers_template=headers_template,
actor_id=actor_id,
actor_task_id=actor_task_id,
actor_run_id=actor_run_id,
Expand Down Expand Up @@ -132,6 +135,7 @@ async def create(
event_types: list[WebhookEventType], # type: ignore
request_url: str,
payload_template: str | None = None,
headers_template: str | None = None,
actor_id: str | None = None,
actor_task_id: str | None = None,
actor_run_id: str | None = None,
Expand All @@ -150,6 +154,7 @@ async def create(
event_types (list of WebhookEventType): List of event types that should trigger the webhook. At least one is required.
request_url (str): URL that will be invoked once the webhook is triggered.
payload_template (str, optional): Specification of the payload that will be sent to request_url
headers_template (str, optional): Headers that will be sent to the request_url
actor_id (str, optional): Id of the actor whose runs should trigger the webhook.
actor_task_id (str, optional): Id of the actor task whose runs should trigger the webhook.
actor_run_id (str, optional): Id of the actor run which should trigger the webhook.
Expand All @@ -168,6 +173,7 @@ async def create(
event_types=event_types,
request_url=request_url,
payload_template=payload_template,
headers_template=headers_template,
actor_id=actor_id,
actor_task_id=actor_task_id,
actor_run_id=actor_run_id,
Expand Down