You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bump apify-client to v3 (>=3.0.0,<4.0.0) and re-use its models, literals,
and constants instead of maintaining SDK-side duplicates.
- Replace SDK models with apify-client equivalents (e.g. `Run` instead of
`ActorRun`) and import pricing models from the client; remove the now
redundant `src/apify/_models.py`.
- Drop the `apify-shared` dependency and define the few needed constants
locally in `_consts.py`.
- Adapt `Actor.start`/`call`/`call_task` to the v3 `run_timeout` API and
tolerate platform pricing-info env var omissions.
- Adapt the Apify storage clients (dataset, key-value store, request queue)
to the v3 client surface.
- Refresh `uv.lock` (apify-client 3.0.2, drops apify-shared, adds
dnspython/email-validator).
- Align unit, integration, and e2e tests with the v3 type and model changes.
BREAKING CHANGE: requires apify-client v3; SDK-side model and literal
duplicates are removed in favor of those exported by apify-client.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/04_upgrading/upgrading_to_v3.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,41 @@ Some changes in the related model classes:
67
67
-`stats` field in `RequestQueueMetadata` - removed as it was unused.
68
68
-`RequestQueueHead` - replaced by `RequestQueueHeadWithLocks`.
69
69
70
+
## Webhook model changes
71
+
72
+
The SDK no longer ships its own `Webhook` Pydantic model. The webhook models from `apify-client` are now used directly:
73
+
74
+
-`apify.Webhook` is now an alias of `apify_client._models.WebhookRepresentation`. It still has the same shape used in `Actor.start`, `Actor.call`, and `Actor.call_task` (`event_types`, `request_url`, `payload_template`, `headers_template`).
75
+
-`Actor.add_webhook` now accepts an `apify.WebhookCreate` instance instead of `apify.Webhook` + separate kwargs. All fields (`ignore_ssl_errors`, `do_not_retry`, `idempotency_key`, `headers_template`, etc.) move onto the `WebhookCreate` instance. `condition` is required by the underlying type — pass `WebhookCondition()` when you do not need to scope to other resources.
from apify import Actor, WebhookCondition, WebhookCreate
92
+
93
+
await Actor.add_webhook(
94
+
WebhookCreate(
95
+
event_types=['ACTOR.RUN.FAILED'],
96
+
request_url='https://example.com',
97
+
condition=WebhookCondition(),
98
+
idempotency_key='my-key',
99
+
)
100
+
)
101
+
```
102
+
103
+
`WebhookCondition`, `WebhookCreate`, `WebhookRepresentation`, `WebhookEventType`, and `ActorPermissionLevel` are all re-exported from `apify` for convenience.
104
+
70
105
## Removed Actor.config property
71
106
-`Actor.config` property has been removed. Use `Actor.configuration` instead.
0 commit comments