Skip to content

Commit b37ed16

Browse files
[TODO]: update generated models from apify-docs PR #2403
1 parent 2021928 commit b37ed16

File tree

1 file changed

+46
-37
lines changed

1 file changed

+46
-37
lines changed

src/apify_client/_models.py

Lines changed: 46 additions & 37 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: 2026-04-09T08:30:29+00:00
2+
# filename: openapi.json
3+
# timestamp: 2026-04-09T09:53:48+00:00
44

55
from __future__ import annotations
66

@@ -139,8 +139,8 @@ class SourceCodeFile(BaseModel):
139139
extra='allow',
140140
populate_by_name=True,
141141
)
142-
format: SourceCodeFileFormat
143-
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
144144
name: Annotated[str, Field(examples=['src/main.js'])]
145145

146146

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

215215

216-
class PricingModel(StrEnum):
217-
PAY_PER_EVENT = 'PAY_PER_EVENT'
218-
PRICE_PER_DATASET_ITEM = 'PRICE_PER_DATASET_ITEM'
219-
FLAT_PRICE_PER_MONTH = 'FLAT_PRICE_PER_MONTH'
220-
FREE = 'FREE'
221-
222-
223216
class ActorChargeEvent(BaseModel):
224217
model_config = ConfigDict(
225218
extra='allow',
@@ -230,6 +223,10 @@ class ActorChargeEvent(BaseModel):
230223
event_description: Annotated[str, Field(alias='eventDescription')]
231224

232225

226+
class PricingModel(StrEnum):
227+
PAY_PER_EVENT = 'PAY_PER_EVENT'
228+
229+
233230
class PricingPerEvent(BaseModel):
234231
model_config = ConfigDict(
235232
extra='allow',
@@ -248,6 +245,10 @@ class PayPerEventActorPricingInfo(CommonActorPricingInfo):
248245
minimal_max_total_charge_usd: Annotated[float | None, Field(alias='minimalMaxTotalChargeUsd')] = None
249246

250247

248+
class PricingModel1(StrEnum):
249+
PRICE_PER_DATASET_ITEM = 'PRICE_PER_DATASET_ITEM'
250+
251+
251252
class PricePerDatasetItemActorPricingInfo(CommonActorPricingInfo):
252253
model_config = ConfigDict(
253254
extra='allow',
@@ -261,6 +262,10 @@ class PricePerDatasetItemActorPricingInfo(CommonActorPricingInfo):
261262
price_per_unit_usd: Annotated[float, Field(alias='pricePerUnitUsd')]
262263

263264

265+
class PricingModel2(StrEnum):
266+
FLAT_PRICE_PER_MONTH = 'FLAT_PRICE_PER_MONTH'
267+
268+
264269
class FlatPricePerMonthActorPricingInfo(CommonActorPricingInfo):
265270
model_config = ConfigDict(
266271
extra='allow',
@@ -277,6 +282,10 @@ class FlatPricePerMonthActorPricingInfo(CommonActorPricingInfo):
277282
"""
278283

279284

285+
class PricingModel3(StrEnum):
286+
FREE = 'FREE'
287+
288+
280289
class FreeActorPricingInfo(CommonActorPricingInfo):
281290
model_config = ConfigDict(
282291
extra='allow',
@@ -636,6 +645,25 @@ class ActorNotFoundError(BaseModel):
636645
error: ActorNotFoundErrorDetail | None = None
637646

638647

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+
639667
class RecordNotFoundErrorDetail(ErrorDetail):
640668
model_config = ConfigDict(
641669
extra='allow',
@@ -1531,7 +1559,7 @@ class CreateTaskRequest(BaseModel):
15311559
populate_by_name=True,
15321560
)
15331561
act_id: Annotated[str, Field(alias='actId', examples=['asADASadYvn4mBZmm'])]
1534-
name: Annotated[str, Field(examples=['my-task'])]
1562+
name: Annotated[str | None, Field(examples=['my-task'])] = None
15351563
options: TaskOptions | None = None
15361564
input: TaskInput | None = None
15371565
title: str | None = None
@@ -1628,25 +1656,6 @@ class ChargeRunRequest(BaseModel):
16281656
count: Annotated[int, Field(examples=[1])]
16291657

16301658

1631-
class RecordOrTokenNotFoundErrorDetail(ErrorDetail):
1632-
model_config = ConfigDict(
1633-
extra='allow',
1634-
populate_by_name=True,
1635-
)
1636-
type: Annotated[Literal['record-or-token-not-found'], Field(title='ErrorType')] = 'record-or-token-not-found'
1637-
"""
1638-
Machine-processable error type identifier.
1639-
"""
1640-
1641-
1642-
class RecordOrTokenNotFoundError(BaseModel):
1643-
model_config = ConfigDict(
1644-
extra='allow',
1645-
populate_by_name=True,
1646-
)
1647-
error: RecordOrTokenNotFoundErrorDetail | None = None
1648-
1649-
16501659
class StorageOwnership(StrEnum):
16511660
OWNED_BY_ME = 'ownedByMe'
16521661
SHARED_WITH_ME = 'sharedWithMe'
@@ -2324,7 +2333,7 @@ class RequestBase(BaseModel):
23242333
"""
23252334
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
23262335
"""
2327-
url: Annotated[AnyUrl | None, Field(examples=['https://apify.com'])] = None
2336+
url: Annotated[str | None, Field(examples=['https://apify.com'])] = None
23282337
"""
23292338
The URL of the request.
23302339
"""
@@ -2337,7 +2346,7 @@ class RequestBase(BaseModel):
23372346
"""
23382347
The final URL that was loaded, after redirects (if any).
23392348
"""
2340-
payload: Annotated[dict[str, Any] | None, Field(examples=[None])] = None
2349+
payload: Annotated[str | dict[str, Any] | None, Field(examples=[None])] = None
23412350
"""
23422351
The request payload, typically used with POST or PUT requests.
23432352
"""
@@ -2400,7 +2409,7 @@ class RequestDraft(BaseModel):
24002409
"""
24012410
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
24022411
"""
2403-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2412+
url: Annotated[str, Field(examples=['https://apify.com'])]
24042413
"""
24052414
The URL of the request.
24062415
"""
@@ -2699,7 +2708,7 @@ class HeadRequest(BaseModel):
26992708
"""
27002709
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
27012710
"""
2702-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2711+
url: Annotated[str, Field(examples=['https://apify.com'])]
27032712
"""
27042713
The URL of the request.
27052714
"""
@@ -2760,7 +2769,7 @@ class LockedHeadRequest(BaseModel):
27602769
"""
27612770
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
27622771
"""
2763-
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
2772+
url: Annotated[str, Field(examples=['https://apify.com'])]
27642773
"""
27652774
The URL of the request.
27662775
"""
@@ -2856,7 +2865,7 @@ class WebhookCreate(BaseModel):
28562865
idempotency_key: Annotated[str | None, Field(alias='idempotencyKey', examples=['fdSJmdP3nfs7sfk3y'])] = None
28572866
ignore_ssl_errors: Annotated[bool | None, Field(alias='ignoreSslErrors', examples=[False])] = None
28582867
do_not_retry: Annotated[bool | None, Field(alias='doNotRetry', examples=[False])] = None
2859-
request_url: Annotated[AnyUrl, Field(alias='requestUrl', examples=['http://example.com/'])]
2868+
request_url: Annotated[str, Field(alias='requestUrl', examples=['http://example.com/'])]
28602869
payload_template: Annotated[
28612870
str | None, Field(alias='payloadTemplate', examples=['{\\n "userId": {{userId}}...'])
28622871
] = None

0 commit comments

Comments
 (0)