fn translate_text(
        &self,
        input: TranslateTextRequest,
    ) -> RusotoFuture<TranslateTextResponse, TranslateTextError> {
        let mut request = SignedRequest::new("POST", "translate", &self.region, "/");

        request.set_content_type("application/x-amz-json-1.1".to_owned());
        request.add_header(
            "x-amz-target",
            "AWSShineFrontendService_20170701.TranslateText",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded.into_bytes()));

        self.client.sign_and_dispatch(request, |response| {
            if response.status.is_success() {
                Box::new(response.buffer().from_err().map(|response| {
                    let mut body = response.body;

                    if body.is_empty() || body == b"null" {
                        body = b"{}".to_vec();
                    }

                    serde_json::from_str::<TranslateTextResponse>(
                        String::from_utf8_lossy(body.as_ref()).as_ref(),
                    )
                    .unwrap()
                }))
            } else {
                Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(TranslateTextError::from_response(response))),
                )
            }
        })
    }
/// <p>Translates input text from the source language to the target language. You can translate between English (en) and one of the following languages, or between one of the following languages and English.</p> <ul> <li> <p>Arabic (ar)</p> </li> <li> <p>Chinese (Simplified) (zh)</p> </li> <li> <p>French (fr)</p> </li> <li> <p>German (de)</p> </li> <li> <p>Portuguese (pt)</p> </li> <li> <p>Spanish (es)</p> </li> </ul> <p>To have Amazon Translate determine the source language of your text, you can specify <code>auto</code> in the <code>SourceLanguageCode</code> field. If you specify <code>auto</code>, Amazon Translate will call Amazon Comprehend to determine the source language.</p>
Translates input text from the source language to the target language.
Translates input text from the source language to the target language .
fn translate_text(
        &self,
        input: TranslateTextRequest,
    ) -> RusotoFuture<TranslateTextResponse, TranslateTextError> {
        let mut request = SignedRequest::new("POST", "translate", &self.region, "/");
        request.set_content_type("application/x-amz-json-1.1".to_owned());
        request.add_header(
            "x-amz-target",
            "AWSShineFrontendService_20170701.TranslateText",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded.into_bytes()));
        self.client.sign_and_dispatch(request, |response| {
            if response.status.is_success() {
                Box::new(response.buffer().from_err().map(|response| {
                    let mut body = response.body;
                    if body.is_empty() || body == b"null" {
                        body = b"{}".to_vec();
                    }
                    serde_json::from_str::<TranslateTextResponse>(
                        String::from_utf8_lossy(body.as_ref()).as_ref(),
                    )
                    .unwrap()
                }))
            } else {
                Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(TranslateTextError::from_response(response))),
                )
            }
        })
    }
fn translate_text ( & self , input : TranslateTextRequest , ) -> RusotoFuture < TranslateTextResponse , TranslateTextError > { let mut request = SignedRequest :: new ( " " , " " , & self . region , " " ) ; request . set_content_type ( " " . to_owned ( ) ) ; request . add_header ( " " , " " , ) ; let encoded = serde_json :: to_string ( & input ) . unwrap ( ) ; request . set_payload ( Some ( encoded . into_bytes ( ) ) ) ; self . client . sign_and_dispatch ( request , | response | { if response . status . is_success ( ) { Box :: new ( response . buffer ( ) . from_err ( ) . map ( | response | { let mut body = response . body ; if body . is_empty ( ) || body == b" " { body = b" " . to_vec ( ) ; } serde_json :: from_str :: < TranslateTextResponse > ( String :: from_utf8_lossy ( body . as_ref ( ) ) . as_ref ( ) , ) . unwrap ( ) } ) ) } else { Box :: new ( response . buffer ( ) . from_err ( ) . and_then ( | response | Err ( TranslateTextError :: from_response ( response ) ) ) , ) } } ) }
<p>Translates input text from the source language to the target language.
<p > Translates input text from the source language to the target language .
&self
input
TranslateTextRequest
&self
input
TranslateTextRequest