Amazon Textract
Amazon Textract (textract) on fakecloud: a complete 25-operation surface (100% conformance). awsJson1_1.
fakecloud implements Amazon Textract as an awsJson1_1 service (target prefix Textract.<Operation>, SigV4 signing name textract). All 25 operations ship with 100% conformance against AWS's own Smithy model, backed by account-partitioned state that persists across restarts in persistent mode.
Textract on fakecloud is a faithful API surface: the request/response shapes, model-driven validation, asynchronous job lifecycle, custom-adapter CRUD, and tagging are all real and persisted. The one honest gap is the OCR / ML inference itself.
Honest gap: no OCR/ML model. fakecloud does not run a real text-extraction or document-understanding model, so the analysis operations return a structurally correct response derived from the input (a DocumentMetadata with the page count taken from the request, and well-formed but empty Blocks / ExpenseDocuments / IdentityDocuments / lending Results collections) rather than fabricated extracted text. This is the same posture as other ML services on fakecloud: real API + validation + persistence, with the inference documented as a gap instead of stubbed with invented data.
Operations
Synchronous analysis
DetectDocumentText- validates the requiredDocument(which must carry either inlineBytesor anS3Object) and returnsDocumentMetadata, an emptyBlockslist, andDetectDocumentTextModelVersion.AnalyzeDocument- validatesDocument+ the requiredFeatureTypes(TABLES/FORMS/QUERIES/SIGNATURES/LAYOUT) and returns theBlocks/AnalyzeDocumentModelVersionshape.AnalyzeExpense- validatesDocumentand returnsExpenseDocuments.AnalyzeID- validates the requiredDocumentPages(1-2 documents) and returnsIdentityDocumentswith the page count reflected inDocumentMetadata.
An empty or malformed Document is rejected with InvalidParameterException, matching the live service.
Asynchronous document processing
StartDocumentTextDetection,StartDocumentAnalysis,StartExpenseAnalysis,StartLendingAnalysis- each validates the requiredDocumentLocation(S3Object), accepts and persists the optionalClientRequestToken(idempotent - a repeated token returns the same job),JobTag,NotificationChannel,OutputConfig, andKMSKeyId, and mints a real 64-characterJobId.GetDocumentTextDetection,GetDocumentAnalysis,GetExpenseAnalysis,GetLendingAnalysis,GetLendingAnalysisSummary- look up the job, settle its status fromIN_PROGRESStoSUCCEEDEDon the first read, and return the per-kind result shape (Blocks/ExpenseDocuments/ lendingResults/Summary) plusDocumentMetadata,JobStatus,Warnings, and the model-version field. An unknown or wrong-kind job id returnsInvalidJobIdException.
Custom adapters
CreateAdapter- validates the requiredAdapterName+FeatureTypes, acceptsDescription/AutoUpdate/Tags/ClientRequestToken(idempotent), and mints anAdapterId.GetAdapter/UpdateAdapter/DeleteAdapter/ListAdapters- full CRUD; a missing adapter returnsResourceNotFoundException.ListAdapterspaginates withMaxResults/NextToken.CreateAdapterVersion- requires an existingAdapterIdplus theDatasetConfig+OutputConfig, mints a monotonicAdapterVersion, and starts itCREATION_IN_PROGRESS.GetAdapterVersion/DeleteAdapterVersion/ListAdapterVersions- full read/delete/list;GetAdapterVersionsettles a versionCREATION_IN_PROGRESS->ACTIVEon the first read and reportsEvaluationMetrics.
Tagging
TagResource/UntagResource/ListTagsForResource- keyed by the adapter (or adapter-version) ARN (arn:aws:textract:<region>:<account>:adapter/<id>); an unknown ARN returnsResourceNotFoundException.
Validation
Every request runs model-driven validation (required / length / range / enum) against the embedded Smithy model before any handler logic, surfaced as InvalidParameterException - the client-error shape every Textract operation declares. Resource-dereference failures return ResourceNotFoundException (adapters / versions) or InvalidJobIdException (jobs).
Persistence
All Textract state - adapters, adapter versions, asynchronous jobs, tags, and idempotency tokens - is account-partitioned and, in persistent mode, snapshotted to disk so it survives a restart.