Skip to content

Commit 28efd13

Browse files
fix: Require unique_key and url in RequestBase, add RequestWithoutId (#1030)
- Regenerates the Pydantic models, TypedDicts, and literal aliases from the [published OpenAPI specification](https://docs.apify.com/api/openapi.json), and records its version in `pyproject.toml`. - Specification version: `v2-2026-08-14T072928Z` -> `v2-2026-08-24T085852Z`.
1 parent eada909 commit 28efd13

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ keep_model_order = true
257257
# workflow committing nothing unless the models changed. A local regeneration that only moves this line is that
258258
# same case - drop it rather than committing it alone.
259259
[tool.apify.openapi-spec]
260-
version = "v2-2026-08-14T072928Z"
260+
version = "v2-2026-08-24T085852Z"
261261

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

‎src/apify_client/_models.py‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,11 +2430,11 @@ class RequestBase(BaseModel):
24302430
populate_by_name=True,
24312431
alias_generator=to_camel,
24322432
)
2433-
unique_key: Annotated[str | None, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])] = None
2433+
unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])]
24342434
"""
24352435
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
24362436
"""
2437-
url: Annotated[str | None, Field(examples=['https://apify.com'])] = None
2437+
url: Annotated[str, Field(examples=['https://apify.com'])]
24382438
"""
24392439
The URL of the request.
24402440
"""
@@ -2838,6 +2838,17 @@ class RequestUserData(BaseModel):
28382838
)
28392839

28402840

2841+
@docs_group('Models')
2842+
class RequestWithoutId(RequestBase):
2843+
"""A request stored in the request queue, including its metadata and processing state, without the assigned ID."""
2844+
2845+
model_config = ConfigDict(
2846+
extra='allow',
2847+
populate_by_name=True,
2848+
alias_generator=to_camel,
2849+
)
2850+
2851+
28412852
@docs_group('Models')
28422853
class Run(BaseModel):
28432854
"""Represents an Actor run and its associated data."""

‎src/apify_client/_typeddicts.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
@docs_group('Typed dicts')
1111
class RequestBaseDict(TypedDict):
12-
unique_key: NotRequired[str]
12+
unique_key: str
1313
"""
1414
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
1515
"""
16-
url: NotRequired[str]
16+
url: str
1717
"""
1818
The URL of the request.
1919
"""
@@ -51,11 +51,11 @@ class RequestBaseDict(TypedDict):
5151

5252
@docs_group('Typed dicts')
5353
class RequestBaseCamelDict(TypedDict):
54-
uniqueKey: NotRequired[str]
54+
uniqueKey: str
5555
"""
5656
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
5757
"""
58-
url: NotRequired[str]
58+
url: str
5959
"""
6060
The URL of the request.
6161
"""

0 commit comments

Comments
 (0)