From a1832044935392c55903f6336c102f3d4fdd3e22 Mon Sep 17 00:00:00 2001 From: "J.R. Hill" Date: Tue, 28 Jun 2022 03:37:30 -0700 Subject: [PATCH] Add Japanese flavor text to the example pokemon service (#1480) --- codegen-server-test/model/pokemon.smithy | 5 +++++ .../examples/pokemon_service/src/lib.rs | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/codegen-server-test/model/pokemon.smithy b/codegen-server-test/model/pokemon.smithy index 4c9b3c626..2f8bd5a84 100644 --- a/codegen-server-test/model/pokemon.smithy +++ b/codegen-server-test/model/pokemon.smithy @@ -98,6 +98,11 @@ structure FlavorText { value: "it", documentation: "Italiano.", }, + { + name: "JAPANESE", + value: "jp", + documentation: "日本語。", + }, ]) string Language diff --git a/rust-runtime/aws-smithy-http-server/examples/pokemon_service/src/lib.rs b/rust-runtime/aws-smithy-http-server/examples/pokemon_service/src/lib.rs index 8418e54d1..d23a7b6ad 100644 --- a/rust-runtime/aws-smithy-http-server/examples/pokemon_service/src/lib.rs +++ b/rust-runtime/aws-smithy-http-server/examples/pokemon_service/src/lib.rs @@ -23,6 +23,8 @@ const PIKACHU_SPANISH_FLAVOR_TEXT: &str = "Cuando varios de estos Pokémon se juntan, su energía puede causar fuertes tormentas."; const PIKACHU_ITALIAN_FLAVOR_TEXT: &str = "Quando vari Pokémon di questo tipo si radunano, la loro energia può causare forti tempeste."; +const PIKACHU_JAPANESE_FLAVOR_TEXT: &str = + "ほっぺたの りょうがわに ちいさい でんきぶくろを もつ。ピンチのときに ほうでんする。"; /// Setup `tracing::subscriber` to read the log level from RUST_LOG environment variable. pub fn setup_tracing() { @@ -42,6 +44,7 @@ struct PokemonTranslations { en: String, es: String, it: String, + jp: String, } /// PokémonService shared state. @@ -115,6 +118,7 @@ impl Default for State { en: String::from(PIKACHU_ENGLISH_FLAVOR_TEXT), es: String::from(PIKACHU_SPANISH_FLAVOR_TEXT), it: String::from(PIKACHU_ITALIAN_FLAVOR_TEXT), + jp: String::from(PIKACHU_JAPANESE_FLAVOR_TEXT), }, ); Self { @@ -148,6 +152,10 @@ pub async fn get_pokemon_species( flavor_text: pokemon.it.to_owned(), language: model::Language::Italian, }, + model::FlavorText { + flavor_text: pokemon.jp.to_owned(), + language: model::Language::Japanese, + }, ]; let output = output::GetPokemonSpeciesOutput { name: String::from("pikachu"),