From a91adb2d5fb74285da425665d88b1d5c1b568dea Mon Sep 17 00:00:00 2001 From: Apify Service Account <64261774+apify-service-account@users.noreply.github.com> Date: Thu, 3 Sep 2026 04:10:41 +0200 Subject: [PATCH 1/3] chore: Regenerate models from the published OpenAPI spec --- pyproject.toml | 2 +- src/apify_client/_models.py | 19 +++++++++++++++---- src/apify_client/_typeddicts.py | 6 ++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dae23915..252bd50e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -245,7 +245,7 @@ keep_model_order = true # workflow committing nothing unless the models changed. A local regeneration that only moves this line is that # same case - drop it rather than committing it alone. [tool.apify.openapi-spec] -version = "v2-2026-08-30T172245Z" +version = "v2-2026-08-31T125154Z" [tool.uv] # Minimal defense against supply-chain atatcks. diff --git a/src/apify_client/_models.py b/src/apify_client/_models.py index 1f5d45ae..2f22ceb3 100644 --- a/src/apify_client/_models.py +++ b/src/apify_client/_models.py @@ -872,6 +872,7 @@ class CreateTaskRequest(BaseModel): options: TaskOptions | None = None input: TaskInput | list[TaskInput] | None = None title: str | None = None + description: str | None = None actor_standby: ActorStandby | None = None public_config: TaskPublicConfig | None = None """ @@ -1473,7 +1474,7 @@ class HeadRequest(BaseModel): """ The URL of the request. """ - method: HttpMethod | None = None + method: RequestMethod | None = None retry_count: Annotated[int | None, Field(examples=[0])] = None """ The number of times this request has been retried. @@ -1892,7 +1893,7 @@ class LockedHeadRequest(BaseModel): """ The URL of the request. """ - method: HttpMethod | None = None + method: RequestMethod | None = None retry_count: Annotated[int | None, Field(examples=[0])] = None """ The number of times this request has been retried. @@ -2432,7 +2433,7 @@ class RequestBase(BaseModel): """ The URL of the request. """ - method: HttpMethod | None = None + method: RequestMethod | None = None retry_count: Annotated[int | None, Field(examples=[0])] = None """ The number of times this request has been retried. @@ -2500,7 +2501,7 @@ class RequestDraft(BaseModel): """ The URL of the request. """ - method: HttpMethod | None = None + method: RequestMethod | None = None @docs_group('Models') @@ -2564,6 +2565,14 @@ class RequestLockInfo(BaseModel): """ +@docs_group('Models') +class RequestMethod(RootModel[HttpMethod]): + root: HttpMethod + """ + The HTTP method of the request. + """ + + @docs_group('Models') class RequestQueue(BaseModel): """A request queue object containing metadata and statistics.""" @@ -3505,6 +3514,7 @@ class Task(BaseModel): options: TaskOptions | None = None input: TaskInput | list[TaskInput] | None = None title: str | None = None + description: str | None = None actor_standby: ActorStandby | None = None standby_url: AnyUrl | None = None is_public: Annotated[bool | None, Field(examples=[False])] = None @@ -3869,6 +3879,7 @@ class UpdateTaskRequest(BaseModel): options: TaskOptions | None = None input: TaskInput | list[TaskInput] | None = None title: str | None = None + description: str | None = None actor_standby: ActorStandby | None = None public_config: TaskPublicConfig | None = None """ diff --git a/src/apify_client/_typeddicts.py b/src/apify_client/_typeddicts.py index 222e056e..da826a06 100644 --- a/src/apify_client/_typeddicts.py +++ b/src/apify_client/_typeddicts.py @@ -18,6 +18,9 @@ class RequestBaseDict(TypedDict): The URL of the request. """ method: NotRequired[Literal['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH']] + """ + The HTTP method of the request. + """ retry_count: NotRequired[int] """ The number of times this request has been retried. @@ -60,6 +63,9 @@ class RequestBaseCamelDict(TypedDict): The URL of the request. """ method: NotRequired[Literal['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH']] + """ + The HTTP method of the request. + """ retryCount: NotRequired[int] """ The number of times this request has been retried. From 4e2bec005edc0984bb15565e2b2d912646827147 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Thu, 3 Sep 2026 09:04:50 +0200 Subject: [PATCH 2/3] fix: Collapse alias schemas so request method keeps the HttpMethod type --- pyproject.toml | 3 +++ src/apify_client/_models.py | 16 ++++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 252bd50e..03f2ba08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -222,6 +222,9 @@ use_field_description = true use_union_operator = true capitalise_enum_members = true collapse_root_models = true +# Folds a schema that only aliases another one (a `$ref` plus a description) into the referenced model, so a +# bundler hoisting such an alias into its own component can't turn an enum-typed field into a `RootModel` wrapper. +collapse_root_models_name_strategy = "child" set_default_enum_member = true use_annotated = true wrap_string_literal = true diff --git a/src/apify_client/_models.py b/src/apify_client/_models.py index 2f22ceb3..70b11f4d 100644 --- a/src/apify_client/_models.py +++ b/src/apify_client/_models.py @@ -1474,7 +1474,7 @@ class HeadRequest(BaseModel): """ The URL of the request. """ - method: RequestMethod | None = None + method: HttpMethod | None = None retry_count: Annotated[int | None, Field(examples=[0])] = None """ The number of times this request has been retried. @@ -1893,7 +1893,7 @@ class LockedHeadRequest(BaseModel): """ The URL of the request. """ - method: RequestMethod | None = None + method: HttpMethod | None = None retry_count: Annotated[int | None, Field(examples=[0])] = None """ The number of times this request has been retried. @@ -2433,7 +2433,7 @@ class RequestBase(BaseModel): """ The URL of the request. """ - method: RequestMethod | None = None + method: HttpMethod | None = None retry_count: Annotated[int | None, Field(examples=[0])] = None """ The number of times this request has been retried. @@ -2501,7 +2501,7 @@ class RequestDraft(BaseModel): """ The URL of the request. """ - method: RequestMethod | None = None + method: HttpMethod | None = None @docs_group('Models') @@ -2565,14 +2565,6 @@ class RequestLockInfo(BaseModel): """ -@docs_group('Models') -class RequestMethod(RootModel[HttpMethod]): - root: HttpMethod - """ - The HTTP method of the request. - """ - - @docs_group('Models') class RequestQueue(BaseModel): """A request queue object containing metadata and statistics.""" From ca5d7d5ed61f2eb8f27f02b7ffc10dcefd3e0f6a Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Thu, 3 Sep 2026 09:12:36 +0200 Subject: [PATCH 3/3] chore: Drop the comment above collapse_root_models_name_strategy --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 03f2ba08..e2fc1538 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -222,8 +222,6 @@ use_field_description = true use_union_operator = true capitalise_enum_members = true collapse_root_models = true -# Folds a schema that only aliases another one (a `$ref` plus a description) into the referenced model, so a -# bundler hoisting such an alias into its own component can't turn an enum-typed field into a `RootModel` wrapper. collapse_root_models_name_strategy = "child" set_default_enum_member = true use_annotated = true