Skip to content

Commit 9e3612f

Browse files
[TODO]: update generated models from apify-docs PR #2403
1 parent 6065fb0 commit 9e3612f

File tree

1 file changed

+46
-58
lines changed

1 file changed

+46
-58
lines changed

src/apify_client/_models.py

Lines changed: 46 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: openapi.json
3-
# timestamp: 2026-04-09T07:50:13+00:00
3+
# timestamp: 2026-04-09T08:24:57+00:00
44

55
from __future__ import annotations
66

@@ -86,33 +86,12 @@ class ListOfActorsResponse(BaseModel):
8686
data: ListOfActors
8787

8888

89-
class Type(StrEnum):
90-
"""Machine-processable error type identifier."""
91-
92-
ACTOR_MEMORY_LIMIT_EXCEEDED = 'actor-memory-limit-exceeded'
93-
ACTOR_NOT_FOUND = 'actor-not-found'
94-
INVALID_INPUT = 'invalid-input'
95-
METHOD_NOT_ALLOWED = 'method-not-allowed'
96-
PERMISSION_DENIED = 'permission-denied'
97-
RATE_LIMIT_EXCEEDED = 'rate-limit-exceeded'
98-
RECORD_NOT_FOUND = 'record-not-found'
99-
RECORD_NOT_UNIQUE = 'record-not-unique'
100-
RECORD_OR_TOKEN_NOT_FOUND = 'record-or-token-not-found'
101-
REQUEST_ID_INVALID = 'request-id-invalid'
102-
REQUEST_TOO_LARGE = 'request-too-large'
103-
RUN_FAILED = 'run-failed'
104-
RUN_TIMEOUT_EXCEEDED = 'run-timeout-exceeded'
105-
TOKEN_NOT_VALID = 'token-not-valid'
106-
UNKNOWN_BUILD_TAG = 'unknown-build-tag'
107-
UNSUPPORTED_CONTENT_ENCODING = 'unsupported-content-encoding'
108-
109-
11089
class Error(BaseModel):
11190
model_config = ConfigDict(
11291
extra='allow',
11392
populate_by_name=True,
11493
)
115-
type: Annotated[Type | None, Field(title='ErrorType')] = None
94+
type: Annotated[ErrorType | None, Field(title='ErrorType')] = None
11695
"""
11796
Machine-processable error type identifier.
11897
"""
@@ -160,8 +139,8 @@ class SourceCodeFile(BaseModel):
160139
extra='allow',
161140
populate_by_name=True,
162141
)
163-
format: SourceCodeFileFormat
164-
content: Annotated[str, Field(examples=["console.log('This is the main.js file');"])]
142+
format: SourceCodeFileFormat | None = None
143+
content: Annotated[str | None, Field(examples=["console.log('This is the main.js file');"])] = None
165144
name: Annotated[str, Field(examples=['src/main.js'])]
166145

167146

@@ -234,13 +213,6 @@ class CommonActorPricingInfo(BaseModel):
234213
reason_for_change: Annotated[str | None, Field(alias='reasonForChange')] = None
235214

236215

237-
class PricingModel(StrEnum):
238-
PAY_PER_EVENT = 'PAY_PER_EVENT'
239-
PRICE_PER_DATASET_ITEM = 'PRICE_PER_DATASET_ITEM'
240-
FLAT_PRICE_PER_MONTH = 'FLAT_PRICE_PER_MONTH'
241-
FREE = 'FREE'
242-
243-
244216
class ActorChargeEvent(BaseModel):
245217
model_config = ConfigDict(
246218
extra='allow',
@@ -251,6 +223,10 @@ class ActorChargeEvent(BaseModel):
251223
event_description: Annotated[str, Field(alias='eventDescription')]
252224

253225

226+
class PricingModel(StrEnum):
227+
PAY_PER_EVENT = 'PAY_PER_EVENT'
228+
229+
254230
class PricingPerEvent(BaseModel):
255231
model_config = ConfigDict(
256232
extra='allow',
@@ -269,6 +245,10 @@ class PayPerEventActorPricingInfo(CommonActorPricingInfo):
269245
minimal_max_total_charge_usd: Annotated[float | None, Field(alias='minimalMaxTotalChargeUsd')] = None
270246

271247

248+
class PricingModel1(StrEnum):
249+
PRICE_PER_DATASET_ITEM = 'PRICE_PER_DATASET_ITEM'
250+
251+
272252
class PricePerDatasetItemActorPricingInfo(CommonActorPricingInfo):
273253
model_config = ConfigDict(
274254
extra='allow',
@@ -282,6 +262,10 @@ class PricePerDatasetItemActorPricingInfo(CommonActorPricingInfo):
282262
price_per_unit_usd: Annotated[float, Field(alias='pricePerUnitUsd')]
283263

284264

265+
class PricingModel2(StrEnum):
266+
FLAT_PRICE_PER_MONTH = 'FLAT_PRICE_PER_MONTH'
267+
268+
285269
class FlatPricePerMonthActorPricingInfo(CommonActorPricingInfo):
286270
model_config = ConfigDict(
287271
extra='allow',
@@ -298,6 +282,10 @@ class FlatPricePerMonthActorPricingInfo(CommonActorPricingInfo):
298282
"""
299283

300284

285+
class PricingModel3(StrEnum):
286+
FREE = 'FREE'
287+
288+
301289
class FreeActorPricingInfo(CommonActorPricingInfo):
302290
model_config = ConfigDict(
303291
extra='allow',
@@ -657,6 +645,25 @@ class ActorNotFoundError(BaseModel):
657645
error: ActorNotFoundErrorDetail | None = None
658646

659647

648+
class RecordOrTokenNotFoundErrorDetail(ErrorDetail):
649+
model_config = ConfigDict(
650+
extra='allow',
651+
populate_by_name=True,
652+
)
653+
type: Annotated[Literal['record-or-token-not-found'], Field(title='ErrorType')] = 'record-or-token-not-found'
654+
"""
655+
Machine-processable error type identifier.
656+
"""
657+
658+
659+
class RecordOrTokenNotFoundError(BaseModel):
660+
model_config = ConfigDict(
661+
extra='allow',
662+
populate_by_name=True,
663+
)
664+
error: RecordOrTokenNotFoundErrorDetail | None = None
665+
666+
660667
class RecordNotFoundErrorDetail(ErrorDetail):
661668
model_config = ConfigDict(
662669
extra='allow',
@@ -1552,7 +1559,7 @@ class CreateTaskRequest(BaseModel):
15521559
populate_by_name=True,
15531560
)
15541561
act_id: Annotated[str, Field(alias='actId', examples=['asADASadYvn4mBZmm'])]
1555-
name: Annotated[str, Field(examples=['my-task'])]
1562+
name: Annotated[str | None, Field(examples=['my-task'])] = None
15561563
options: TaskOptions | None = None
15571564
input: TaskInput | None = None
15581565
title: str | None = None
@@ -1649,25 +1656,6 @@ class ChargeRunRequest(BaseModel):
16491656
count: Annotated[int, Field(examples=[1])]
16501657

16511658

1652-
class RecordOrTokenNotFoundErrorDetail(ErrorDetail):
1653-
model_config = ConfigDict(
1654-
extra='allow',
1655-
populate_by_name=True,
1656-
)
1657-
type: Annotated[Literal['record-or-token-not-found'], Field(title='ErrorType')] = 'record-or-token-not-found'
1658-
"""
1659-
Machine-processable error type identifier.
1660-
"""
1661-
1662-
1663-
class RecordOrTokenNotFoundError(BaseModel):
1664-
model_config = ConfigDict(
1665-
extra='allow',
1666-
populate_by_name=True,
1667-
)
1668-
error: RecordOrTokenNotFoundErrorDetail | None = None
1669-
1670-
16711659
class StorageOwnership(StrEnum):
16721660
OWNED_BY_ME = 'ownedByMe'
16731661
SHARED_WITH_ME = 'sharedWithMe'
@@ -2345,7 +2333,7 @@ class RequestBase(BaseModel):
23452333
"""
23462334
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
23472335
"""
2348-
url: Annotated[AnyUrl | None, Field(examples=['https://apify.com'])] = None
2336+
url: Annotated[str | None, Field(examples=['https://apify.com'])] = None
23492337
"""
23502338
The URL of the request.
23512339
"""
@@ -2358,7 +2346,7 @@ class RequestBase(BaseModel):
23582346
"""
23592347
The final URL that was loaded, after redirects (if any).
23602348
"""
2361-
payload: Annotated[dict[str, Any] | None, Field(examples=[None])] = None
2349+
payload: Annotated[str | dict[str, Any] | None, Field(examples=[None])] = None
23622350
"""
23632351
The request payload, typically used with POST or PUT requests.
23642352
"""
@@ -2421,7 +2409,7 @@ class RequestDraft(BaseModel):
24212409
"""
24222410
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
24232411
"""
2424-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2412+
url: Annotated[str, Field(examples=['https://apify.com'])]
24252413
"""
24262414
The URL of the request.
24272415
"""
@@ -2720,7 +2708,7 @@ class HeadRequest(BaseModel):
27202708
"""
27212709
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
27222710
"""
2723-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2711+
url: Annotated[str, Field(examples=['https://apify.com'])]
27242712
"""
27252713
The URL of the request.
27262714
"""
@@ -2781,7 +2769,7 @@ class LockedHeadRequest(BaseModel):
27812769
"""
27822770
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
27832771
"""
2784-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2772+
url: Annotated[str, Field(examples=['https://apify.com'])]
27852773
"""
27862774
The URL of the request.
27872775
"""
@@ -2877,7 +2865,7 @@ class WebhookCreate(BaseModel):
28772865
idempotency_key: Annotated[str | None, Field(alias='idempotencyKey', examples=['fdSJmdP3nfs7sfk3y'])] = None
28782866
ignore_ssl_errors: Annotated[bool | None, Field(alias='ignoreSslErrors', examples=[False])] = None
28792867
do_not_retry: Annotated[bool | None, Field(alias='doNotRetry', examples=[False])] = None
2880-
request_url: Annotated[AnyUrl, Field(alias='requestUrl', examples=['http://example.com/'])]
2868+
request_url: Annotated[str, Field(alias='requestUrl', examples=['http://example.com/'])]
28812869
payload_template: Annotated[
28822870
str | None, Field(alias='payloadTemplate', examples=['{\\n "userId": {{userId}}...'])
28832871
] = None

0 commit comments

Comments
 (0)