refactor: Generate all models and TypedDicts from OpenAPI spec (#765)
Closes: #758
## Summary
Every Pydantic model and TypedDict now comes from the
OpenAPI spec — no more hand-maintained shapes alongside the generated
ones.
- Deleted the hand-written `src/apify_client/_models.py` and
`src/apify_client/_typeddicts.py`.
- Renamed `_models_generated.py` → `_models.py`,
`_typeddicts_generated.py` → `_typeddicts.py`. The `_generated` suffix
is no longer needed now that there is no parallel hand-written file.
- Regenerated models pick up the new `WebhookRepresentation` schema
added in apify/apify-docs#2469.
### Knock-on changes
- `WebhookRepresentationList` class is gone — replaced by a single
`encode_webhooks_to_base64()` helper in `_utils.py`. Callers in
`actor.py` / `task.py` simplified to
`webhooks=encode_webhooks_to_base64(webhooks)`.
- `_wait_for_finish` already returns a plain dict and each caller
validates it against the concrete `Run` / `Build` model, so the
hand-written `ActorJob` / `ActorJobResponse` shapes are no longer
needed.
- `RequestInput` → `RequestDraft`, `RequestDeleteInput` →
`RequestDraftDelete` (and matching `*Dict` names) — these were
hand-rolled aliases for shapes that are already in the spec under the
canonical names. The v3 upgrade guide is updated to match.
- Bumped `RESOURCE_INPUT_TYPEDDICTS` in
`scripts/postprocess_generated_models.py` to seed the typed-dict
reachability walk with `RequestDraft`, `RequestDraftDelete`, and
`WebhookRepresentation`.
- Updated lint per-file-ignores from `_*_generated.py` to
`_{models,typeddicts}.py` to match the new filenames.
## Pairs with
- apify/apify-docs#2469 — adds the `WebhookRepresentation` schema
component and references it from the `webhooks` query parameter. The
docs PR should land first; this PR's regenerated models depend on it. V
Vlada Dusek committed
fe6546b151ccc8d627312deeeeb4c7384d63c6e3
Parent: 4d7b67d
Committed by GitHub <noreply@github.com>
on 4/29/2026, 9:43:15 PM