fakecloud_translate/lib.rs
1//! Amazon Translate (`translate`) awsJson1_1 service for fakecloud.
2//!
3//! The full 19-operation Amazon Translate Smithy model: synchronous text and
4//! document translation (`TranslateText` / `TranslateDocument`), asynchronous
5//! batch translation jobs (`StartTextTranslationJob` / `DescribeTextTranslationJob`
6//! / `ListTextTranslationJobs` / `StopTextTranslationJob`), parallel data
7//! (`CreateParallelData` / `GetParallelData` / `UpdateParallelData` /
8//! `ListParallelData` / `DeleteParallelData`), custom terminologies
9//! (`ImportTerminology` / `GetTerminology` / `ListTerminologies` /
10//! `DeleteTerminology`), the supported-language catalogue (`ListLanguages`),
11//! and ARN-keyed resource tagging (`TagResource` / `UntagResource` /
12//! `ListTagsForResource`).
13//!
14//! Requests carry `X-Amz-Target: AWSShineFrontendService_20170701.<Operation>`;
15//! dispatch keys off `req.action`. Every operation runs model-driven input
16//! validation first (required / length / range / enum / pattern), then real,
17//! account-partitioned, persisted CRUD. Each resource is stored as its
18//! already-output-valid wire JSON object so a `Get*` echoes exactly what its
19//! `Create*` / `Import*` / `Start*` persisted.
20//!
21//! The asynchronous lifecycles are modelled by advancing the stored status on
22//! the next read (and reconciled again on restart so an interrupted transition
23//! never wedges): batch translation jobs settle `SUBMITTED` -> `COMPLETED`
24//! (`STOP_REQUESTED` -> `STOPPED`), parallel data settles `CREATING` ->
25//! `ACTIVE` (and an update's `LatestUpdateAttemptStatus` `UPDATING` ->
26//! `ACTIVE`).
27//!
28//! Honest machine-translation gap: Amazon Translate's value is the neural MT
29//! model that rewrites text from one language into another. fakecloud runs no
30//! MT model, so `TranslateText` / `TranslateDocument` return a structurally
31//! correct response that echoes the input content verbatim as the
32//! `TranslatedText` / `TranslatedDocument` with the requested target language
33//! applied. No fabricated translation is presented as if a real model produced
34//! it. Everything else -- terminology parsing (languages / term counts read
35//! from the imported CSV/TSV file), parallel-data records, batch-job records,
36//! tags, status lifecycle, and persistence -- is real.
37
38pub mod persistence;
39pub mod service;
40pub mod shared;
41pub mod state;
42mod validate;
43
44pub use service::{TranslateService, TRANSLATE_ACTIONS};
45pub use state::{
46 SharedTranslateState, TranslateData, TranslateSnapshot, TRANSLATE_SNAPSHOT_SCHEMA_VERSION,
47};