Skip to content

Commit 255a34b

Browse files
committed
Re-generated models
1 parent f6c959f commit 255a34b

File tree

4 files changed

+54
-26
lines changed

4 files changed

+54
-26
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ check-async-docstrings:
6565
# and the run_checks.yaml GitHub Actions workflow.
6666
check-code: lint type-check unit-tests check-async-docstrings
6767

68+
generate-models:
69+
uv run datamodel-codegen
70+
6871
fix-async-docstrings:
6972
uv run python scripts/fix_async_docstrings.py
7073

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ indent-style = "space"
140140
"T201", # print found
141141
]
142142
"src/apify_client/_models.py" = [
143-
"D", # Everything from the pydocstyle
144-
"E501", # Line too long
143+
"D", # Everything from the pydocstyle
144+
"E501", # Line too long
145+
"ERA001", # Commented-out code
145146
]
146147

147148
[tool.ruff.lint.flake8-quotes]
@@ -186,7 +187,8 @@ context = 7
186187

187188
# https://koxudaxi.github.io/datamodel-code-generator/
188189
[tool.datamodel-codegen]
189-
url = "https://docs.apify.com/api/openapi.json"
190+
# url = "https://docs.apify.com/api/openapi.json"
191+
input = "../apify-docs/static/api/openapi.json"
190192
input_file_type = "openapi"
191193
output = "src/apify_client/_models.py"
192194
target_python_version = "3.10"

src/apify_client/_models.py

Lines changed: 45 additions & 23 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: 2025-12-09T16:04:03+00:00
2+
# filename: openapi.json
3+
# timestamp: 2025-12-20T10:37:13+00:00
44

55
from __future__ import annotations
66

@@ -72,7 +72,7 @@ class Version(BaseModel):
7272
source_type: Annotated[Any | VersionSourceType, Field(alias='sourceType')]
7373
env_vars: Annotated[list[EnvVar] | None, Field(alias='envVars')] = None
7474
apply_env_vars_to_build: Annotated[bool | None, Field(alias='applyEnvVarsToBuild', examples=[False])] = None
75-
build_tag: Annotated[str, Field(alias='buildTag', examples=['latest'])]
75+
build_tag: Annotated[str | None, Field(alias='buildTag', examples=['latest'])] = None
7676
source_files: Annotated[
7777
list[VersionSourceFiles1 | VersionSourceFiles2] | None, Field(alias='sourceFiles', title='VersionSourceFiles')
7878
] = None
@@ -183,6 +183,13 @@ class CreateActorRequest(BaseModel):
183183
default_run_options: Annotated[DefaultRunOptions | None, Field(alias='defaultRunOptions')] = None
184184

185185

186+
class ActorPermissionLevel(Enum):
187+
"""Determines permissions that the Actor requires to run. For more information, see the [Actor permissions documentation](https://docs.apify.com/platform/actors/development/permissions)."""
188+
189+
LIMITED_PERMISSIONS = 'LIMITED_PERMISSIONS'
190+
FULL_PERMISSIONS = 'FULL_PERMISSIONS'
191+
192+
186193
class ActorStats(BaseModel):
187194
total_builds: Annotated[float, Field(alias='totalBuilds', examples=[9])]
188195
total_runs: Annotated[float, Field(alias='totalRuns', examples=[16])]
@@ -217,6 +224,7 @@ class Actor(BaseModel):
217224
description: Annotated[str | None, Field(examples=['My favourite actor!'])] = None
218225
restart_on_error: Annotated[bool | None, Field(alias='restartOnError', examples=[False])] = None
219226
is_public: Annotated[bool, Field(alias='isPublic', examples=[False])]
227+
actor_permission_level: Annotated[ActorPermissionLevel | None, Field(alias='actorPermissionLevel')] = None
220228
created_at: Annotated[str, Field(alias='createdAt', examples=['2019-07-08T11:27:57.401Z'])]
221229
modified_at: Annotated[str, Field(alias='modifiedAt', examples=['2019-07-08T14:01:05.546Z'])]
222230
stats: ActorStats
@@ -261,6 +269,7 @@ class UpdateActorRequest(BaseModel):
261269
name: Annotated[str, Field(examples=['MyActor'])]
262270
description: Annotated[str | None, Field(examples=['My favourite actor!'])] = None
263271
is_public: Annotated[bool, Field(alias='isPublic', examples=[False])]
272+
actor_permission_level: Annotated[ActorPermissionLevel | None, Field(alias='actorPermissionLevel')] = None
264273
seo_title: Annotated[str | None, Field(alias='seoTitle', examples=['My actor'])] = None
265274
seo_description: Annotated[str | None, Field(alias='seoDescription', examples=['My actor is the best'])] = None
266275
title: Annotated[str | None, Field(examples=['My Actor'])] = None
@@ -949,6 +958,14 @@ class RunOptions(BaseModel):
949958
max_total_charge_usd: Annotated[float | None, Field(alias='maxTotalChargeUsd', examples=[5])] = None
950959

951960

961+
class GeneralAccessEnum(Enum):
962+
"""Defines the general access level for the resource."""
963+
964+
RESTRICTED = 'RESTRICTED'
965+
ANYONE_WITH_ID_CAN_READ = 'ANYONE_WITH_ID_CAN_READ'
966+
FOLLOW_USER_SETTING = 'FOLLOW_USER_SETTING'
967+
968+
952969
class RunUsage(BaseModel):
953970
actor_compute_units: Annotated[float | None, Field(alias='ACTOR_COMPUTE_UNITS', examples=[3])] = None
954971
dataset_reads: Annotated[float | None, Field(alias='DATASET_READS', examples=[4])] = None
@@ -992,7 +1009,7 @@ class Run(BaseModel):
9921009
user_id: Annotated[str, Field(alias='userId', examples=['7sT5jcggjjA9fNcxF'])]
9931010
actor_task_id: Annotated[str | None, Field(alias='actorTaskId', examples=['KJHSKHausidyaJKHs'])] = None
9941011
started_at: Annotated[str, Field(alias='startedAt', examples=['2019-11-30T07:34:24.202Z'])]
995-
finished_at: Annotated[str, Field(alias='finishedAt', examples=['2019-12-12T09:30:12.202Z'])]
1012+
finished_at: Annotated[str | None, Field(alias='finishedAt', examples=['2019-12-12T09:30:12.202Z'])] = None
9961013
status: Annotated[str, Field(examples=['RUNNING'])]
9971014
status_message: Annotated[str | None, Field(alias='statusMessage', examples=['Actor is running'])] = None
9981015
is_status_message_terminal: Annotated[bool | None, Field(alias='isStatusMessageTerminal', examples=[False])] = None
@@ -1010,6 +1027,7 @@ class Run(BaseModel):
10101027
options: RunOptions
10111028
build_id: Annotated[str, Field(alias='buildId', examples=['7sT5jcggjjA9fNcxF'])]
10121029
exit_code: Annotated[float | None, Field(alias='exitCode', examples=[0])] = None
1030+
general_access: Annotated[GeneralAccessEnum, Field(alias='generalAccess')]
10131031
default_key_value_store_id: Annotated[str, Field(alias='defaultKeyValueStoreId', examples=['eJNzqsbPiopwJcgGQ'])]
10141032
default_dataset_id: Annotated[str, Field(alias='defaultDatasetId', examples=['wmKPijuyDnPZAPRMk'])]
10151033
default_request_queue_id: Annotated[str, Field(alias='defaultRequestQueueId', examples=['FL35cSF7jrxr3BY39'])]
@@ -1194,9 +1212,10 @@ class Webhook(BaseModel):
11941212

11951213

11961214
class UpdateRunRequest(BaseModel):
1197-
run_id: Annotated[str, Field(alias='runId', examples=['3KH8gEpp4d8uQSe8T'])]
1198-
status_message: Annotated[str, Field(alias='statusMessage', examples=['Actor has finished'])]
1215+
run_id: Annotated[str | None, Field(alias='runId', examples=['3KH8gEpp4d8uQSe8T'])] = None
1216+
status_message: Annotated[str | None, Field(alias='statusMessage', examples=['Actor has finished'])] = None
11991217
is_status_message_terminal: Annotated[bool | None, Field(alias='isStatusMessageTerminal', examples=[True])] = None
1218+
general_access: Annotated[GeneralAccessEnum | None, Field(alias='generalAccess')] = None
12001219

12011220

12021221
class ChargeRunRequest(BaseModel):
@@ -1209,7 +1228,7 @@ class KeyValueStoreStats(BaseModel):
12091228
write_count: Annotated[float, Field(alias='writeCount', examples=[3])]
12101229
delete_count: Annotated[float, Field(alias='deleteCount', examples=[6])]
12111230
list_count: Annotated[float, Field(alias='listCount', examples=[2])]
1212-
s3_storage_bytes: Annotated[float, Field(alias='s3StorageBytes', examples=[18])]
1231+
s3_storage_bytes: Annotated[float | None, Field(alias='s3StorageBytes', examples=[18])] = None
12131232

12141233

12151234
class KeyValueStore(BaseModel):
@@ -1240,6 +1259,7 @@ class KeyValueStore(BaseModel):
12401259
"""
12411260
A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the key-value store.
12421261
"""
1262+
general_access: Annotated[GeneralAccessEnum | None, Field(alias='generalAccess')] = None
12431263
stats: KeyValueStoreStats | None = None
12441264

12451265

@@ -1260,7 +1280,8 @@ class GetStoreResponse(BaseModel):
12601280

12611281

12621282
class UpdateStoreRequest(BaseModel):
1263-
name: str
1283+
name: str | None = None
1284+
general_access: Annotated[GeneralAccessEnum | None, Field(alias='generalAccess')] = None
12641285

12651286

12661287
class UpdateStoreResponse(BaseModel):
@@ -1384,6 +1405,7 @@ class Dataset(BaseModel):
13841405
"""
13851406
A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the dataset.
13861407
"""
1408+
general_access: Annotated[GeneralAccessEnum | None, Field(alias='generalAccess')] = None
13871409
stats: DatasetStats | None = None
13881410

13891411

@@ -1392,7 +1414,8 @@ class DatasetResponse(BaseModel):
13921414

13931415

13941416
class UpdateDatasetRequest(BaseModel):
1395-
name: str
1417+
name: str | None = None
1418+
general_access: Annotated[GeneralAccessEnum | None, Field(alias='generalAccess')] = None
13961419

13971420

13981421
class PutItemsRequest(BaseModel):
@@ -1537,6 +1560,7 @@ class RequestQueue(BaseModel):
15371560
console_url: Annotated[
15381561
str, Field(alias='consoleUrl', examples=['https://api.apify.com/v2/request-queues/27TmTznX9YPeAYhkC'])
15391562
]
1563+
general_access: Annotated[GeneralAccessEnum | None, Field(alias='generalAccess')] = None
15401564

15411565

15421566
class CreateRequestQueueResponse(BaseModel):
@@ -1548,7 +1572,8 @@ class GetRequestQueueResponse(BaseModel):
15481572

15491573

15501574
class UpdateRequestQueueRequest(BaseModel):
1551-
name: str
1575+
name: str | None = None
1576+
general_access: Annotated[GeneralAccessEnum | None, Field(alias='generalAccess')] = None
15521577

15531578

15541579
class UpdateRequestQueueResponse(BaseModel):
@@ -1562,10 +1587,10 @@ class RequestWithoutId(BaseModel):
15621587

15631588

15641589
class ProcessedRequest(BaseModel):
1565-
request_id: Annotated[str, Field(alias='requestId', examples=['sbJ7klsdf7ujN9l'])]
1590+
request_id: Annotated[str | None, Field(alias='requestId', examples=['sbJ7klsdf7ujN9l'])] = None
15661591
unique_key: Annotated[str, Field(alias='uniqueKey', examples=['http://example.com'])]
1567-
was_already_present: Annotated[bool, Field(alias='wasAlreadyPresent', examples=[False])]
1568-
was_already_handled: Annotated[bool, Field(alias='wasAlreadyHandled', examples=[False])]
1592+
was_already_present: Annotated[bool | None, Field(alias='wasAlreadyPresent', examples=[False])] = None
1593+
was_already_handled: Annotated[bool | None, Field(alias='wasAlreadyHandled', examples=[False])] = None
15691594

15701595

15711596
class UnprocessedRequest(BaseModel):
@@ -1590,10 +1615,10 @@ class UserData(BaseModel):
15901615

15911616
class RequestQueueItems(BaseModel):
15921617
id: Annotated[str, Field(examples=['dnjkDMKLmdlkmlkmld'])]
1593-
retry_count: Annotated[float, Field(alias='retryCount', examples=[0])]
1618+
retry_count: Annotated[float | None, Field(alias='retryCount', examples=[0])] = None
15941619
unique_key: Annotated[str, Field(alias='uniqueKey', examples=['http://example.com'])]
15951620
url: Annotated[str, Field(examples=['http://example.com'])]
1596-
method: Annotated[str, Field(examples=['GET'])]
1621+
method: Annotated[str | None, Field(examples=['GET'])] = None
15971622
loaded_url: Annotated[str | None, Field(alias='loadedUrl', examples=['http://example.com/example-1'])] = None
15981623
payload: dict[str, Any] | None = None
15991624
no_retry: Annotated[bool | None, Field(alias='noRetry', examples=[False])] = None
@@ -1605,7 +1630,7 @@ class RequestQueueItems(BaseModel):
16051630

16061631
class Data13(BaseModel):
16071632
items: list[RequestQueueItems]
1608-
count: Annotated[float, Field(examples=[2])]
1633+
count: Annotated[float | None, Field(examples=[2])] = None
16091634
limit: Annotated[float, Field(examples=[2])]
16101635
exclusive_start_id: Annotated[str | None, Field(alias='exclusiveStartId', examples=['Ihnsp8YrvJ8102Kj'])] = None
16111636

@@ -1653,10 +1678,10 @@ class GetHeadResponse(BaseModel):
16531678

16541679
class Item2(BaseModel):
16551680
id: Annotated[str, Field(examples=['8OamqXBCpPHxyj9'])]
1656-
retry_count: Annotated[float, Field(alias='retryCount', examples=[0])]
1681+
retry_count: Annotated[float | None, Field(alias='retryCount', examples=[0])] = None
16571682
unique_key: Annotated[str, Field(alias='uniqueKey', examples=['http://example.com'])]
16581683
url: Annotated[str, Field(examples=['http://example.com'])]
1659-
method: Annotated[str, Field(examples=['GET'])]
1684+
method: Annotated[str | None, Field(examples=['GET'])] = None
16601685
lock_expires_at: Annotated[str, Field(alias='lockExpiresAt', examples=['2022-06-14T23:00:00.000Z'])]
16611686

16621687

@@ -2128,14 +2153,11 @@ class GetLimitsResponse(BaseModel):
21282153
class UpdateLimitsRequest(BaseModel):
21292154
max_monthly_usage_usd: Annotated[float | None, Field(alias='maxMonthlyUsageUsd', examples=[300])] = None
21302155
"""
2131-
If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra.
2132-
Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges
2156+
If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra. Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges.
21332157
21342158
"""
21352159
data_retention_days: Annotated[float | None, Field(alias='dataRetentionDays', examples=[90])] = None
21362160
"""
2137-
Apify securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible.
2138-
Unnamed storages and other Actor runs are automatically deleted after the retention period.
2139-
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)
2161+
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).
21402162
21412163
"""

tests/unit/test_logging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def _create_minimal_run_data(self, message: str, status: str, *, is_terminal: bo
106106
'diskMbytes': 2048,
107107
},
108108
'buildId': 'test_build_id',
109+
'generalAccess': 'RESTRICTED',
109110
'defaultKeyValueStoreId': 'test_kvs_id',
110111
'defaultDatasetId': 'test_dataset_id',
111112
'defaultRequestQueueId': 'test_rq_id',

0 commit comments

Comments
 (0)