Skip to content

Commit 6a218f8

Browse files
fix: accept task input lists, omitted run and private user fields, and datetime usage dates (#1041)
Regenerates the models from the [published OpenAPI specification](https://docs.apify.com/api/openapi.json) (`v2-2026-08-27T071624Z` -> `v2-2026-08-30T172245Z`), which now describes the API's actual behavior after apify/apify-docs#2932. User-facing changes: - `Task.input`, `CreateTaskRequest.input`, and `UpdateTaskRequest.input` also accept a list of objects, which the API stores and returns. - `DailyServiceUsages.date` is a timezone-aware `datetime` instead of `str`. - `Run.general_access` is optional - the API omits it for a run that follows the owner's account setting. - `UserPrivateInfo.plan`, `effective_platform_features`, and `is_paying` are optional - `GET /v2/users/{userId}` responses don't carry them. Previously, responses with any of these shapes failed model validation. Closes #1040 (a manual test run of the same regeneration against a pre-merge bundle of the spec). > Generated by the [Regenerate models](https://github.com/apify/apify-client-python/actions/workflows/on_schedule_regenerate_models.yaml) workflow.
1 parent 50950de commit 6a218f8

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ keep_model_order = true
258258
# workflow committing nothing unless the models changed. A local regeneration that only moves this line is that
259259
# same case - drop it rather than committing it alone.
260260
[tool.apify.openapi-spec]
261-
version = "v2-2026-08-27T071624Z"
261+
version = "v2-2026-08-30T172245Z"
262262

263263
[tool.uv]
264264
# Minimal defense against supply-chain atatcks.

‎src/apify_client/_models.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ class CreateTaskRequest(BaseModel):
870870
act_id: Annotated[str, Field(examples=['asADASadYvn4mBZmm'])]
871871
name: Annotated[str | None, Field(examples=['my-task'])] = None
872872
options: TaskOptions | None = None
873-
input: TaskInput | None = None
873+
input: TaskInput | list[TaskInput] | None = None
874874
title: str | None = None
875875
actor_standby: ActorStandby | None = None
876876
public_config: TaskPublicConfig | None = None
@@ -941,7 +941,7 @@ class DailyServiceUsages(BaseModel):
941941
populate_by_name=True,
942942
alias_generator=to_camel,
943943
)
944-
date: Annotated[str, Field(examples=['2022-10-02T00:00:00.000Z'])]
944+
date: Annotated[AwareDatetime, Field(examples=['2022-10-02T00:00:00.000Z'])]
945945
service_usage: dict[str, UsageItem]
946946
total_usage_credits_usd: Annotated[float, Field(examples=[0.0474385791970591])]
947947

@@ -2925,7 +2925,7 @@ class Run(BaseModel):
29252925
"""
29262926
Exit code of the Actor run process.
29272927
"""
2928-
general_access: GeneralAccess
2928+
general_access: GeneralAccess | None = None
29292929
"""
29302930
General access level for the Actor run.
29312931
"""
@@ -3503,7 +3503,7 @@ class Task(BaseModel):
35033503
removed_at: AwareDatetime | None = None
35043504
stats: TaskStats | None = None
35053505
options: TaskOptions | None = None
3506-
input: TaskInput | None = None
3506+
input: TaskInput | list[TaskInput] | None = None
35073507
title: str | None = None
35083508
actor_standby: ActorStandby | None = None
35093509
standby_url: AnyUrl | None = None
@@ -3867,7 +3867,7 @@ class UpdateTaskRequest(BaseModel):
38673867
)
38683868
name: Annotated[str | None, Field(examples=['my-task'])] = None
38693869
options: TaskOptions | None = None
3870-
input: TaskInput | None = None
3870+
input: TaskInput | list[TaskInput] | None = None
38713871
title: str | None = None
38723872
actor_standby: ActorStandby | None = None
38733873
public_config: TaskPublicConfig | None = None
@@ -3925,10 +3925,10 @@ class UserPrivateInfo(BaseModel):
39253925
profile: Profile | None = None
39263926
email: Annotated[EmailStr | None, Field(examples=['bob@example.com'])] = None
39273927
proxy: Proxy | None = None
3928-
plan: Plan
3929-
effective_platform_features: EffectivePlatformFeatures
3928+
plan: Plan | None = None
3929+
effective_platform_features: EffectivePlatformFeatures | None = None
39303930
created_at: Annotated[AwareDatetime | None, Field(examples=['2022-11-29T14:48:29.381Z'])] = None
3931-
is_paying: Annotated[bool, Field(examples=[True])]
3931+
is_paying: Annotated[bool | None, Field(examples=[True])] = None
39323932

39333933

39343934
@docs_group('Models')

0 commit comments

Comments
 (0)