Skip to content

Commit 0fadb92

Browse files
vdusekclaude
andcommitted
refactor: Remove internal models module in favor of generated models
ActorJob and ActorJobResponse schemas were added to the OpenAPI spec (apify/apify-docs#XXXX), so they are now generated into _models.py. This removes the manually maintained _internal_models.py module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8ff80a2 commit 0fadb92

File tree

3 files changed

+24
-32
lines changed

3 files changed

+24
-32
lines changed

src/apify_client/_internal_models.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/apify_client/_models.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
2-
# filename: https://docs.apify.com/api/openapi.json
3-
# timestamp: 2026-02-24T08:34:43+00:00
2+
# filename: openapi.json
3+
# timestamp: 2026-02-25T14:54:37+00:00
44

55
from __future__ import annotations
66

@@ -2884,3 +2884,24 @@ class UpdateLimitsRequest(BaseModel):
28842884
Apify securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible. Unnamed storages and other Actor runs are automatically deleted after the retention period. If you're subscribed, you can change it to keep data for longer or to limit your usage. [Lear more](https://docs.apify.com/platform/storage/usage#data-retention).
28852885
28862886
"""
2887+
2888+
2889+
class ActorJob(BaseModel):
2890+
"""Minimal model for an Actor job (run or build) with status. Used for validation during polling operations."""
2891+
2892+
model_config = ConfigDict(
2893+
extra='allow',
2894+
)
2895+
status: ActorJobStatus
2896+
"""
2897+
Current status of the Actor job.
2898+
"""
2899+
2900+
2901+
class ActorJobResponse(BaseModel):
2902+
"""Response wrapper for an Actor job (run or build). Used for minimal validation during polling operations."""
2903+
2904+
model_config = ConfigDict(
2905+
extra='allow',
2906+
)
2907+
data: ActorJob

src/apify_client/_resource_clients/_resource_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
from apify_client._consts import DEFAULT_WAIT_FOR_FINISH, DEFAULT_WAIT_WHEN_JOB_NOT_EXIST, TERMINAL_STATUSES
1010
from apify_client._docs import docs_group
11-
from apify_client._internal_models import ActorJobResponse
1211
from apify_client._logging import WithLogDetailsClient
12+
from apify_client._models import ActorJobResponse
1313
from apify_client._utils import catch_not_found_or_throw, response_to_dict, to_safe_id, to_seconds
1414
from apify_client.errors import ApifyApiError
1515

0 commit comments

Comments
 (0)