From d6748cd3e99e693dbe958a27c9a08d3ec8ba8e68 Mon Sep 17 00:00:00 2001 From: apify-service-account Date: Thu, 9 Apr 2026 11:54:58 +0000 Subject: [PATCH 1/2] [TODO]: update generated models from apify-docs PR #2412 --- src/apify_client/_models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apify_client/_models.py b/src/apify_client/_models.py index be7a738d..b66f7569 100644 --- a/src/apify_client/_models.py +++ b/src/apify_client/_models.py @@ -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-09T11:54:55+00:00 from __future__ import annotations @@ -642,6 +642,7 @@ class ErrorType(StrEnum): TOKEN_NOT_VALID = 'token-not-valid' UNKNOWN_BUILD_TAG = 'unknown-build-tag' UNSUPPORTED_CONTENT_ENCODING = 'unsupported-content-encoding' + X402_PAYMENT_REQUIRED = 'x402-payment-required' @docs_group('Models') From e8f8bd15787b47edd0272d10fbc84976740386f9 Mon Sep 17 00:00:00 2001 From: apify-service-account Date: Mon, 13 Apr 2026 15:20:06 +0000 Subject: [PATCH 2/2] [TODO]: update generated models from apify-docs PR #2412 --- src/apify_client/_models.py | 217 ++++++------------------------------ 1 file changed, 31 insertions(+), 186 deletions(-) diff --git a/src/apify_client/_models.py b/src/apify_client/_models.py index 9e940ba3..e6cec5fb 100644 --- a/src/apify_client/_models.py +++ b/src/apify_client/_models.py @@ -92,15 +92,39 @@ class ListOfActorsResponse(BaseModel): @docs_group('Models') -class Error(BaseModel): +class ErrorType(StrEnum): + """Machine-processable error type identifier.""" + + ACTOR_MEMORY_LIMIT_EXCEEDED = 'actor-memory-limit-exceeded' + ACTOR_NOT_FOUND = 'actor-not-found' + INVALID_INPUT = 'invalid-input' + METHOD_NOT_ALLOWED = 'method-not-allowed' + PAGE_NOT_FOUND = 'page-not-found' + PERMISSION_DENIED = 'permission-denied' + RATE_LIMIT_EXCEEDED = 'rate-limit-exceeded' + RECORD_NOT_FOUND = 'record-not-found' + RECORD_NOT_UNIQUE = 'record-not-unique' + RECORD_OR_TOKEN_NOT_FOUND = 'record-or-token-not-found' + REQUEST_ID_INVALID = 'request-id-invalid' + REQUEST_TOO_LARGE = 'request-too-large' + RUN_FAILED = 'run-failed' + RUN_TIMEOUT_EXCEEDED = 'run-timeout-exceeded' + SCHEDULE_ACTOR_NOT_FOUND = 'schedule-actor-not-found' + SCHEDULE_ACTOR_TASK_NOT_FOUND = 'schedule-actor-task-not-found' + TOKEN_NOT_VALID = 'token-not-valid' + UNKNOWN_BUILD_TAG = 'unknown-build-tag' + UNSUPPORTED_CONTENT_ENCODING = 'unsupported-content-encoding' + USER_NOT_FOUND = 'user-not-found' + X402_PAYMENT_REQUIRED = 'x402-payment-required' + + +@docs_group('Models') +class ErrorDetail(BaseModel): model_config = ConfigDict( extra='allow', populate_by_name=True, ) - type: Annotated[ErrorType | None, Field(title='ErrorType')] = None - """ - Machine-processable error type identifier. - """ + type: ErrorType | None = None message: str | None = None """ Human-readable error message describing what went wrong. @@ -113,7 +137,7 @@ class ErrorResponse(BaseModel): extra='allow', populate_by_name=True, ) - error: Annotated[Error, Field(title='ErrorDetail')] + error: ErrorDetail @docs_group('Models') @@ -612,105 +636,6 @@ class VersionResponse(BaseModel): data: Version -@docs_group('Models') -class ErrorType(StrEnum): - """Machine-processable error type identifier.""" - - ACTOR_MEMORY_LIMIT_EXCEEDED = 'actor-memory-limit-exceeded' - ACTOR_NOT_FOUND = 'actor-not-found' - INVALID_INPUT = 'invalid-input' - METHOD_NOT_ALLOWED = 'method-not-allowed' - PERMISSION_DENIED = 'permission-denied' - RATE_LIMIT_EXCEEDED = 'rate-limit-exceeded' - RECORD_NOT_FOUND = 'record-not-found' - RECORD_NOT_UNIQUE = 'record-not-unique' - RECORD_OR_TOKEN_NOT_FOUND = 'record-or-token-not-found' - REQUEST_ID_INVALID = 'request-id-invalid' - REQUEST_TOO_LARGE = 'request-too-large' - RUN_FAILED = 'run-failed' - RUN_TIMEOUT_EXCEEDED = 'run-timeout-exceeded' - TOKEN_NOT_VALID = 'token-not-valid' - UNKNOWN_BUILD_TAG = 'unknown-build-tag' - UNSUPPORTED_CONTENT_ENCODING = 'unsupported-content-encoding' - X402_PAYMENT_REQUIRED = 'x402-payment-required' - - -@docs_group('Models') -class ErrorDetail(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - type: ErrorType | None = None - message: str | None = None - """ - Human-readable error message describing what went wrong. - """ - - -@docs_group('Models') -class ActorNotFoundErrorDetail(ErrorDetail): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - type: Annotated[Literal['actor-not-found'], Field(title='ErrorType')] = 'actor-not-found' - """ - Machine-processable error type identifier. - """ - - -@docs_group('Models') -class ActorNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: ActorNotFoundErrorDetail | None = None - - -@docs_group('Models') -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. - """ - - -@docs_group('Models') -class RecordOrTokenNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordOrTokenNotFoundErrorDetail | None = None - - -@docs_group('Models') -class RecordNotFoundErrorDetail(ErrorDetail): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - type: Annotated[Literal['record-not-found'], Field(title='ErrorType')] = 'record-not-found' - """ - Machine-processable error type identifier. - """ - - -@docs_group('Models') -class ActorVersionNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class ListOfEnvVars(BaseModel): model_config = ConfigDict( @@ -739,15 +664,6 @@ class EnvVarResponse(BaseModel): data: EnvVar -@docs_group('Models') -class EnvironmentVariableNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class WebhookEventType(StrEnum): """Type of event that triggers the webhook.""" @@ -1096,15 +1012,6 @@ class UnknownBuildTagError(BaseModel): error: UnknownBuildTagErrorDetail | None = None -@docs_group('Models') -class ActorBuildNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class RunMeta(BaseModel): model_config = ConfigDict( @@ -1555,15 +1462,6 @@ class ActorRunTimeoutExceededError(BaseModel): error: RunTimeoutExceededErrorDetail | None = None -@docs_group('Models') -class ActorRunNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class TaskStats(BaseModel): model_config = ConfigDict( @@ -1831,15 +1729,6 @@ class KeyValueStoreResponse(BaseModel): data: KeyValueStore -@docs_group('Models') -class KeyValueStoreNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class UpdateStoreRequest(BaseModel): model_config = ConfigDict( @@ -1906,15 +1795,6 @@ class RecordResponse(BaseModel): ) -@docs_group('Models') -class RecordNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class PutRecordRequest(BaseModel): """The request body contains the value to store in the record. The content type @@ -2049,15 +1929,6 @@ class DatasetResponse(BaseModel): data: Dataset -@docs_group('Models') -class DatasetNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class UpdateDatasetRequest(BaseModel): model_config = ConfigDict( @@ -2398,15 +2269,6 @@ class RequestQueueResponse(BaseModel): data: RequestQueue -@docs_group('Models') -class RequestQueueNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class UpdateRequestQueueRequest(BaseModel): """Request object for updating a request queue.""" @@ -2443,14 +2305,6 @@ class RequestUserData(BaseModel): extra='allow', populate_by_name=True, ) - label: Annotated[str | None, Field(examples=['DETAIL'])] = None - """ - Optional label for categorizing the request. - """ - image: Annotated[AnyUrl | None, Field(examples=['https://picserver1.eu'])] = None - """ - Optional image URL associated with the request. - """ @docs_group('Models') @@ -2474,7 +2328,7 @@ class RequestBase(BaseModel): """ The number of times this request has been retried. """ - loaded_url: Annotated[AnyUrl | None, Field(alias='loadedUrl', examples=['https://apify.com/jobs'])] = None + loaded_url: Annotated[str | None, Field(alias='loadedUrl', examples=['https://apify.com/jobs'])] = None """ The final URL that was loaded, after redirects (if any). """ @@ -2826,15 +2680,6 @@ class RequestResponse(BaseModel): data: Request -@docs_group('Models') -class RequestNotFoundError(BaseModel): - model_config = ConfigDict( - extra='allow', - populate_by_name=True, - ) - error: RecordNotFoundErrorDetail | None = None - - @docs_group('Models') class UpdateRequestResponse(BaseModel): """Response containing the result of updating a request in the request queue."""