From e7c2b7b0dba9ae547f7f02c262e0aaa12ef40b59 Mon Sep 17 00:00:00 2001 From: apify-service-account Date: Mon, 13 Apr 2026 09:51:45 +0000 Subject: [PATCH 1/2] [TODO]: update generated models from apify-docs PR #2422 --- src/apify_client/_models.py | 223 +++++++++--------------------------- 1 file changed, 55 insertions(+), 168 deletions(-) diff --git a/src/apify_client/_models.py b/src/apify_client/_models.py index fd618ad3..d0666429 100644 --- a/src/apify_client/_models.py +++ b/src/apify_client/_models.py @@ -612,104 +612,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' - - -@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( @@ -738,15 +640,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.""" @@ -1075,33 +968,81 @@ class BuildResponse(BaseModel): @docs_group('Models') -class UnknownBuildTagErrorDetail(ErrorDetail): +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' + + +@docs_group('Models') +class ErrorDetail(BaseModel): model_config = ConfigDict( extra='allow', populate_by_name=True, ) - type: Annotated[Literal['unknown-build-tag'], Field(title='ErrorType')] = 'unknown-build-tag' + type: ErrorType | None = None + message: str | None = None """ - Machine-processable error type identifier. + Human-readable error message describing what went wrong. """ @docs_group('Models') -class UnknownBuildTagError(BaseModel): +class Type1(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' + + +@docs_group('Models') +class UnknownBuildTagErrorDetail(ErrorDetail): model_config = ConfigDict( extra='allow', populate_by_name=True, ) - error: UnknownBuildTagErrorDetail | None = None + type: Annotated[Literal['unknown-build-tag'], Field(title='ErrorType')] = 'unknown-build-tag' + """ + Machine-processable error type identifier. + """ @docs_group('Models') -class ActorBuildNotFoundError(BaseModel): +class UnknownBuildTagError(BaseModel): model_config = ConfigDict( extra='allow', populate_by_name=True, ) - error: RecordNotFoundErrorDetail | None = None + error: UnknownBuildTagErrorDetail | None = None @docs_group('Models') @@ -1554,15 +1495,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( @@ -1830,15 +1762,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( @@ -1905,15 +1828,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 @@ -2048,15 +1962,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( @@ -2397,15 +2302,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.""" @@ -2825,15 +2721,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.""" From 9e7e01754cb09a41f2e8b2e0bad73d567e6de042 Mon Sep 17 00:00:00 2001 From: apify-service-account Date: Mon, 13 Apr 2026 11:49:40 +0000 Subject: [PATCH 2/2] [TODO]: update generated models from apify-docs PR #2422 --- src/apify_client/_models.py | 92 ++++++++++++------------------------- 1 file changed, 29 insertions(+), 63 deletions(-) diff --git a/src/apify_client/_models.py b/src/apify_client/_models.py index d0666429..69d88036 100644 --- a/src/apify_client/_models.py +++ b/src/apify_client/_models.py @@ -92,15 +92,38 @@ 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' + + +@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 +136,7 @@ class ErrorResponse(BaseModel): extra='allow', populate_by_name=True, ) - error: Annotated[Error, Field(title='ErrorDetail')] + error: ErrorDetail @docs_group('Models') @@ -967,63 +990,6 @@ class BuildResponse(BaseModel): data: Build -@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' - - -@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 Type1(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' - - @docs_group('Models') class UnknownBuildTagErrorDetail(ErrorDetail): model_config = ConfigDict(