Skip to main content

Crate fakecloud_translate

Crate fakecloud_translate 

Source
Expand description

Amazon Translate (translate) awsJson1_1 service for fakecloud.

The full 19-operation Amazon Translate Smithy model: synchronous text and document translation (TranslateText / TranslateDocument), asynchronous batch translation jobs (StartTextTranslationJob / DescribeTextTranslationJob / ListTextTranslationJobs / StopTextTranslationJob), parallel data (CreateParallelData / GetParallelData / UpdateParallelData / ListParallelData / DeleteParallelData), custom terminologies (ImportTerminology / GetTerminology / ListTerminologies / DeleteTerminology), the supported-language catalogue (ListLanguages), and ARN-keyed resource tagging (TagResource / UntagResource / ListTagsForResource).

Requests carry X-Amz-Target: AWSShineFrontendService_20170701.<Operation>; dispatch keys off req.action. Every operation runs model-driven input validation first (required / length / range / enum / pattern), then real, account-partitioned, persisted CRUD. Each resource is stored as its already-output-valid wire JSON object so a Get* echoes exactly what its Create* / Import* / Start* persisted.

The asynchronous lifecycles are modelled by advancing the stored status on the next read (and reconciled again on restart so an interrupted transition never wedges): batch translation jobs settle SUBMITTED -> COMPLETED (STOP_REQUESTED -> STOPPED), parallel data settles CREATING -> ACTIVE (and an update’s LatestUpdateAttemptStatus UPDATING -> ACTIVE).

Honest machine-translation gap: Amazon Translate’s value is the neural MT model that rewrites text from one language into another. fakecloud runs no MT model, so TranslateText / TranslateDocument return a structurally correct response that echoes the input content verbatim as the TranslatedText / TranslatedDocument with the requested target language applied. No fabricated translation is presented as if a real model produced it. Everything else – terminology parsing (languages / term counts read from the imported CSV/TSV file), parallel-data records, batch-job records, tags, status lifecycle, and persistence – is real.

Re-exports§

pub use service::TranslateService;
pub use service::TRANSLATE_ACTIONS;
pub use state::SharedTranslateState;
pub use state::TranslateData;
pub use state::TranslateSnapshot;
pub use state::TRANSLATE_SNAPSHOT_SCHEMA_VERSION;

Modules§

persistence
Snapshot save/load for Amazon Translate state, with lifecycle reconciliation on restart.
service
Amazon Translate awsJson1_1 dispatch + operation handlers.
shared
Primitives shared across the Amazon Translate handlers: ARN synthesis, deterministic id derivation, timestamps, and terminology-file parsing. Kept in one place so the create / get paths cannot diverge on wire format.
state
Account-partitioned, serializable state for Amazon Translate (translate).