Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 30 additions & 37 deletions src/apify_client/_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: https://docs.apify.com/api/openapi.json
# timestamp: 2026-04-09T08:30:29+00:00
# filename: openapi.json
# timestamp: 2026-04-10T06:09:49+00:00

from __future__ import annotations

Expand Down Expand Up @@ -139,8 +139,8 @@ class SourceCodeFile(BaseModel):
extra='allow',
populate_by_name=True,
)
format: SourceCodeFileFormat
content: Annotated[str, Field(examples=["console.log('This is the main.js file');"])]
format: SourceCodeFileFormat | None = None
content: Annotated[str | None, Field(examples=["console.log('This is the main.js file');"])] = None
name: Annotated[str, Field(examples=['src/main.js'])]


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


class PricingModel(StrEnum):
PAY_PER_EVENT = 'PAY_PER_EVENT'
PRICE_PER_DATASET_ITEM = 'PRICE_PER_DATASET_ITEM'
FLAT_PRICE_PER_MONTH = 'FLAT_PRICE_PER_MONTH'
FREE = 'FREE'


class ActorChargeEvent(BaseModel):
model_config = ConfigDict(
extra='allow',
Expand Down Expand Up @@ -636,6 +629,25 @@ class ActorNotFoundError(BaseModel):
error: ActorNotFoundErrorDetail | None = None


class RecordOrTokenNotFoundErrorDetail(ErrorDetail):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
type: Annotated[Literal['record-or-token-not-found'], Field(title='ErrorType')] = 'record-or-token-not-found'
"""
Machine-processable error type identifier.
"""


class RecordOrTokenNotFoundError(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
error: RecordOrTokenNotFoundErrorDetail | None = None


class RecordNotFoundErrorDetail(ErrorDetail):
model_config = ConfigDict(
extra='allow',
Expand Down Expand Up @@ -1531,7 +1543,7 @@ class CreateTaskRequest(BaseModel):
populate_by_name=True,
)
act_id: Annotated[str, Field(alias='actId', examples=['asADASadYvn4mBZmm'])]
name: Annotated[str, Field(examples=['my-task'])]
name: Annotated[str | None, Field(examples=['my-task'])] = None
options: TaskOptions | None = None
input: TaskInput | None = None
title: str | None = None
Expand Down Expand Up @@ -1628,25 +1640,6 @@ class ChargeRunRequest(BaseModel):
count: Annotated[int, Field(examples=[1])]


class RecordOrTokenNotFoundErrorDetail(ErrorDetail):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
type: Annotated[Literal['record-or-token-not-found'], Field(title='ErrorType')] = 'record-or-token-not-found'
"""
Machine-processable error type identifier.
"""


class RecordOrTokenNotFoundError(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
error: RecordOrTokenNotFoundErrorDetail | None = None


class StorageOwnership(StrEnum):
OWNED_BY_ME = 'ownedByMe'
SHARED_WITH_ME = 'sharedWithMe'
Expand Down Expand Up @@ -2324,7 +2317,7 @@ class RequestBase(BaseModel):
"""
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
"""
url: Annotated[AnyUrl | None, Field(examples=['https://apify.com'])] = None
url: Annotated[str | None, Field(examples=['https://apify.com'])] = None
"""
The URL of the request.
"""
Expand All @@ -2337,7 +2330,7 @@ class RequestBase(BaseModel):
"""
The final URL that was loaded, after redirects (if any).
"""
payload: Annotated[dict[str, Any] | None, Field(examples=[None])] = None
payload: Annotated[str | dict[str, Any] | None, Field(examples=[None])] = None
"""
The request payload, typically used with POST or PUT requests.
"""
Expand Down Expand Up @@ -2400,7 +2393,7 @@ class RequestDraft(BaseModel):
"""
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
"""
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
url: Annotated[str, Field(examples=['https://apify.com'])]
"""
The URL of the request.
"""
Expand Down Expand Up @@ -2699,7 +2692,7 @@ class HeadRequest(BaseModel):
"""
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
"""
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
url: Annotated[str, Field(examples=['https://apify.com'])]
"""
The URL of the request.
"""
Expand Down Expand Up @@ -2760,7 +2753,7 @@ class LockedHeadRequest(BaseModel):
"""
A unique key used for request de-duplication. Requests with the same unique key are considered identical.
"""
url: Annotated[AnyUrl, Field(examples=['https://apify.com'])]
url: Annotated[str, Field(examples=['https://apify.com'])]
"""
The URL of the request.
"""
Expand Down Expand Up @@ -2856,7 +2849,7 @@ class WebhookCreate(BaseModel):
idempotency_key: Annotated[str | None, Field(alias='idempotencyKey', examples=['fdSJmdP3nfs7sfk3y'])] = None
ignore_ssl_errors: Annotated[bool | None, Field(alias='ignoreSslErrors', examples=[False])] = None
do_not_retry: Annotated[bool | None, Field(alias='doNotRetry', examples=[False])] = None
request_url: Annotated[AnyUrl, Field(alias='requestUrl', examples=['http://example.com/'])]
request_url: Annotated[str, Field(alias='requestUrl', examples=['http://example.com/'])]
payload_template: Annotated[
str | None, Field(alias='payloadTemplate', examples=['{\\n "userId": {{userId}}...'])
] = None
Expand Down