calmlens 0.1.1

Rust SDK for CalmLens moderation, storage and CDN delivery
Documentation
// @generated by packages/sdk-contract/generate.ts from packages/shared/src/PublicErrorCodes.ts.
error_codes! {
    /// `validation/invalid-cursor` (HTTP 400): The cursor is invalid or belongs to a different query.
    InvalidCursor = "validation/invalid-cursor", 400;
    /// `auth/missing-token` (HTTP 401): Authentication required. Send your project API key in the X-Api-Key header.
    MissingToken = "auth/missing-token", 401;
    /// `auth/invalid-api-key` (HTTP 401): The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
    InvalidApiKey = "auth/invalid-api-key", 401;
    /// `auth/project-mismatch` (HTTP 403): This API key belongs to a different project. Use a key created for the project that owns this resource.
    ApiKeyProjectMismatch = "auth/project-mismatch", 403;
    /// `auth/api-key-not-accepted` (HTTP 403): API keys are only accepted by the public API at /v1.
    ApiKeyNotAccepted = "auth/api-key-not-accepted", 403;
    /// `upload/file-too-large` (HTTP 400): File size exceeds limit. Maximum direct image size is 10MB, audio/video size is 50MiB, and other files is 5GB.
    FileTooLarge = "upload/file-too-large", 400;
    /// `upload/image-requires-multipart-upload` (HTTP 400): Images of 10MB or more must use a multipart upload.
    ImageRequiresMultipartUpload = "upload/image-requires-multipart-upload", 400;
    /// `upload/multipart-image-too-small` (HTTP 400): Multipart image uploads must total at least 10MB.
    MultipartImageTooSmall = "upload/multipart-image-too-small", 400;
    /// `upload/multipart-image-too-large` (HTTP 400): Multipart image uploads cannot exceed 20MB.
    MultipartImageTooLarge = "upload/multipart-image-too-large", 400;
    /// `upload/image-exceeded-max-dimensions` (HTTP 400): Image exceeds maximum dimensions. Maximum dimensions are 12,000px.
    ImageExceededMaxDimensions = "upload/image-exceeded-max-dimensions", 400;
    /// `upload/limit-exceeded` (HTTP 403): Upload limit exceeded. You have used all your free uploads. Please upgrade to Plus or Pro for unlimited uploads.
    UploadLimitExceeded = "upload/limit-exceeded", 403;
    /// `upload/spend-limit-reached` (HTTP 402): The project owner's spend limit for this billing period has been reached. Raise the limit in Billing to resume uploads.
    SpendLimitReached = "upload/spend-limit-reached", 402;
    /// `upload/invalid-mime-type` (HTTP 400): Upload file type is not supported. Uploads must use a concrete file MIME type that CalmLens can store and process, such as image/png, image/jpeg, application/pdf, or text/plain.
    InvalidUploadMimeType = "upload/invalid-mime-type", 400;
    /// `events/invalid-cursor` (HTTP 400): The events cursor is invalid. Use the cursor from a previous response, or omit it to start from now.
    InvalidEventCursor = "events/invalid-cursor", 400;
    /// `upload/invalid-payload` (HTTP 400): Upload payload is invalid.
    InvalidUploadPayload = "upload/invalid-payload", 400;
    /// `upload/use-upload-part` (HTTP 409): Use uploadPart for multipart upload parts after the first part
    UseUploadPart = "upload/use-upload-part", 409;
    /// `upload/not-open` (HTTP 409): Asset is not accepting additional parts
    UploadNotOpen = "upload/not-open", 409;
    /// `upload/invalid-part-number` (HTTP 409): Multipart upload part number is invalid.
    InvalidUploadPartNumber = "upload/invalid-part-number", 409;
    /// `upload/missing` (HTTP 409): Multipart upload state is missing
    UploadMissing = "upload/missing", 409;
    /// `upload/size-mismatch` (HTTP 400): The uploaded parts do not add up to the totalSizeInBytes declared when the multipart upload started.
    UploadSizeMismatch = "upload/size-mismatch", 400;
    /// `idempotency/invalid-key` (HTTP 400): The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.
    InvalidIdempotencyKey = "idempotency/invalid-key", 400;
    /// `idempotency/key-reused` (HTTP 409): This Idempotency-Key was already used for a different request. Use a new key for each distinct request.
    IdempotencyKeyReused = "idempotency/key-reused", 409;
    /// `idempotency/request-in-progress` (HTTP 409): A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.
    IdempotentRequestInProgress = "idempotency/request-in-progress", 409;
    /// `asset/not-found` (HTTP 404): Asset not found
    AssetNotFound = "asset/not-found", 404;
    /// `project/not-found` (HTTP 404): Project not found
    ProjectNotFound = "project/not-found", 404;
    /// `asset/update-failed` (HTTP 500): Failed to update asset
    AssetUpdateFailed = "asset/update-failed", 500;
    /// `asset/safety-held` (HTTP 423): Asset access is restricted by a safety hold.
    AssetSafetyHeld = "asset/safety-held", 423;
    /// `asset/not-retryable` (HTTP 409): Only assets that failed to process (status error) can be retried.
    AssetNotRetryable = "asset/not-retryable", 409;
    /// `asset/content-unavailable` (HTTP 409): This asset's content is no longer stored, so it can't be processed again. Upload it again instead.
    AssetContentUnavailable = "asset/content-unavailable", 409;
    /// `support/ticket-not-found` (HTTP 404): Support ticket not found.
    SupportTicketNotFound = "support/ticket-not-found", 404;
    /// `asset/duplicate-external-id` (HTTP 409): An asset with this externalId already exists in the project.
    DuplicateExternalId = "asset/duplicate-external-id", 409;
    /// `folder/not-found` (HTTP 404): Folder not found
    FolderNotFound = "folder/not-found", 404;
    /// `folder/duplicate-name` (HTTP 409): A folder with this name already exists in this location.
    DuplicateFolderName = "folder/duplicate-name", 409;
    /// `folder/not-empty` (HTTP 409): Folder must be empty before it can be deleted.
    FolderNotEmpty = "folder/not-empty", 409;
    /// `folder/parent-cycle` (HTTP 409): A folder cannot be moved inside itself or one of its descendants.
    FolderParentCycle = "folder/parent-cycle", 409;
    /// `lens/version-conflict` (HTTP 409): Lens updates require a version greater than the current version.
    LensVersionConflict = "lens/version-conflict", 409;
    /// `upload-preset/not-found` (HTTP 404): Upload preset not found. Check the preset ID in the portal.
    UploadPresetNotFound = "upload-preset/not-found", 404;
    /// `upload-preset/disabled` (HTTP 403): This upload preset is paused. Turn it on in the portal to accept uploads.
    UploadPresetDisabled = "upload-preset/disabled", 403;
    /// `upload-preset/token-required` (HTTP 401): This upload preset only accepts uploads with an upload token. Sign one on your server with uploadTokens.sign and pass it to the client.
    UploadPresetTokenRequired = "upload-preset/token-required", 401;
    /// `upload/remote-url-not-allowed` (HTTP 403): This project doesn't accept URLs from this domain. Change the allowed or blocked domains under Project settings.
    RemoteUrlNotAllowed = "upload/remote-url-not-allowed", 403;
    /// `upload/website-rate-limit-exceeded` (HTTP 429): This project has submitted too many websites in the last minute. Wait for the Retry-After period, or lower the pace of submissions.
    WebsiteRateLimitExceeded = "upload/website-rate-limit-exceeded", 429;
    /// `upload-preset/content-type-not-allowed` (HTTP 415): This upload preset doesn't accept this file type.
    UploadPresetContentTypeNotAllowed = "upload-preset/content-type-not-allowed", 415;
    /// `upload-preset/too-large` (HTTP 413): This file is larger than the upload preset allows.
    UploadPresetTooLarge = "upload-preset/too-large", 413;
    /// `upload-preset/daily-limit-reached` (HTTP 429): This upload preset has reached its daily upload limit. Try again after midnight UTC, or raise the limit in the portal.
    UploadPresetDailyLimitReached = "upload-preset/daily-limit-reached", 429;
    /// `upload-preset/origin-not-allowed` (HTTP 403): This site isn't allowed to upload through this upload preset.
    UploadPresetOriginNotAllowed = "upload-preset/origin-not-allowed", 403;
    /// `upload-preset/field-not-allowed` (HTTP 400): This field is set by the upload preset or the upload token and can't be changed by the upload.
    UploadPresetFieldNotAllowed = "upload-preset/field-not-allowed", 400;
    /// `upload-token/invalid` (HTTP 401): The upload token is invalid. Sign a new one on your server with an active API key for this project.
    UploadTokenInvalid = "upload-token/invalid", 401;
    /// `upload-token/expired` (HTTP 401): The upload token has expired. Sign a new one on your server.
    UploadTokenExpired = "upload-token/expired", 401;
    /// `upload-token/used` (HTTP 409): The upload token has already been used. Each token uploads one asset.
    UploadTokenUsed = "upload-token/used", 409;
    /// `asset/invalid-remote-url` (HTTP 400): Remote URLs must use HTTP or HTTPS and cannot target private networks, localhost names or URL credentials.
    InvalidRemoteUrl = "asset/invalid-remote-url", 400;
    /// `asset/remote-url-unavailable` (HTTP 422): The URL responded with an error status. Check that it is publicly reachable.
    RemoteUrlUnavailable = "asset/remote-url-unavailable", 422;
    /// `appeal/not-found` (HTTP 404): The appeal does not exist in this project.
    AppealNotFound = "appeal/not-found", 404;
    /// `appeal/judgment-not-found` (HTTP 404): The judgment event is unavailable, belongs to another project or cannot supply an asset decision. Supply explicit context instead.
    AppealJudgmentNotFound = "appeal/judgment-not-found", 404;
    /// `appeal/asset-not-found` (HTTP 404): The linked asset does not exist in this project.
    AppealAssetNotFound = "appeal/asset-not-found", 404;
    /// `appeal/permission-denied` (HTTP 403): You cannot review this project's appeals.
    AppealPermissionDenied = "appeal/permission-denied", 403;
    /// `appeal/already-reviewed` (HTTP 409): A reviewer already resolved this appeal.
    AppealAlreadyReviewed = "appeal/already-reviewed", 409;
    /// `appeal/decision-changed` (HTTP 409): The linked asset's decision changed after the appealed decision. Submit a new appeal for the current decision.
    AppealDecisionChanged = "appeal/decision-changed", 409;
    /// `appeal/invalid-action` (HTTP 400): The decision's action is not valid for this appeal.
    AppealInvalidAction = "appeal/invalid-action", 400;
    /// `appeal/safety-held` (HTTP 409): A safety hold prevents this appeal from being submitted or applied.
    AppealSafetyHeld = "appeal/safety-held", 409;
    /// `appeal/content-unavailable` (HTTP 409): The appeal's content is unavailable, or approval would require restoring removed content.
    AppealContentUnavailable = "appeal/content-unavailable", 409;
}