fn put_lexicon(
        &self,
        input: PutLexiconInput,
    ) -> RusotoFuture<PutLexiconOutput, PutLexiconError> {
        let request_uri = format!("/v1/lexicons/{lexicon_name}", lexicon_name = input.name);

        let mut request = SignedRequest::new("PUT", "polly", &self.region, &request_uri);
        request.set_content_type("application/x-amz-json-1.1".to_owned());

        let encoded = Some(serde_json::to_vec(&input).unwrap());
        request.set_payload(encoded);

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

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

                    debug!("Response body: {:?}", body);
                    debug!("Response status: {}", response.status);
                    let result = serde_json::from_slice::<PutLexiconOutput>(&body).unwrap();

                    result
                }))
            } else {
                Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(PutLexiconError::from_response(response))),
                )
            }
        })
    }
/// <p>Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation.</p> <p>For more information, see <a href="http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html">Managing Lexicons</a>.</p>
Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation. For more information, see Managing Lexicons.
Stores a pronunciation lexicon in an AWS Region . If a lexicon with the same name already exists in the region it is overwritten by the new lexicon . Lexicon operations have eventual consistency therefore it might take some time before the lexicon is available to the SynthesizeSpeech operation . For more information see Managing Lexicons .
fn put_lexicon(
        &self,
        input: PutLexiconInput,
    ) -> RusotoFuture<PutLexiconOutput, PutLexiconError> {
        let request_uri = format!("/v1/lexicons/{lexicon_name}", lexicon_name = input.name);
        let mut request = SignedRequest::new("PUT", "polly", &self.region, &request_uri);
        request.set_content_type("application/x-amz-json-1.1".to_owned());
        let encoded = Some(serde_json::to_vec(&input).unwrap());
        request.set_payload(encoded);
        self.client.sign_and_dispatch(request, |response| {
            if response.status.as_u16() == 200 {
                Box::new(response.buffer().from_err().map(|response| {
                    let mut body = response.body;
                    if body == b"null" || body.is_empty() {
                        body = b"{}".to_vec();
                    }
                    debug!("Response body: {:?}", body);
                    debug!("Response status: {}", response.status);
                    let result = serde_json::from_slice::<PutLexiconOutput>(&body).unwrap();
                    result
                }))
            } else {
                Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(PutLexiconError::from_response(response))),
                )
            }
        })
    }
fn put_lexicon ( & self , input : PutLexiconInput , ) -> RusotoFuture < PutLexiconOutput , PutLexiconError > { let request_uri = format ! ( " " lexicon_name input name ) ; let mut request = SignedRequest :: new ( " " , " " , & self . region , & request_uri ) ; request . set_content_type ( " " . to_owned ( ) ) ; let encoded = Some ( serde_json :: to_vec ( & input ) . unwrap ( ) ) ; request . set_payload ( encoded ) ; self . client . sign_and_dispatch ( request , | response | { if response . status . as_u16 ( ) == 200 { Box :: new ( response . buffer ( ) . from_err ( ) . map ( | response | { let mut body = response . body ; if body == b" " || body . is_empty ( ) { body = b" " . to_vec ( ) ; } debug ! ( " " body ) ; debug ! ( " " response status ) ; let result = serde_json :: from_slice :: < PutLexiconOutput > ( & body ) . unwrap ( ) ; result } ) ) } else { Box :: new ( response . buffer ( ) . from_err ( ) . and_then ( | response | Err ( PutLexiconError :: from_response ( response ) ) ) , ) } } ) }
<p>Stores a pronunciation lexicon in an AWS Region.
<p > Stores a pronunciation lexicon in an AWS Region .
&self
input
PutLexiconInput
&self
input
PutLexiconInput