pub struct Builder { /* private fields */ }Expand description
A builder for DetectDominantLanguageOutput.
Implementations§
source§impl Builder
impl Builder
sourcepub fn languages(self, input: DominantLanguage) -> Self
pub fn languages(self, input: DominantLanguage) -> Self
Appends an item to languages.
To override the contents of this collection use set_languages.
The languages that Amazon Comprehend detected in the input text. For each language, the response returns the RFC 5646 language code and the level of confidence that Amazon Comprehend has in the accuracy of its inference. For more information about RFC 5646, see Tags for Identifying Languages on the IETF Tools web site.
sourcepub fn set_languages(self, input: Option<Vec<DominantLanguage>>) -> Self
pub fn set_languages(self, input: Option<Vec<DominantLanguage>>) -> Self
The languages that Amazon Comprehend detected in the input text. For each language, the response returns the RFC 5646 language code and the level of confidence that Amazon Comprehend has in the accuracy of its inference. For more information about RFC 5646, see Tags for Identifying Languages on the IETF Tools web site.
Examples found in repository?
1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850
pub(crate) fn deser_operation_crate_operation_detect_dominant_language(
value: &[u8],
mut builder: crate::output::detect_dominant_language_output::Builder,
) -> Result<
crate::output::detect_dominant_language_output::Builder,
aws_smithy_json::deserialize::error::DeserializeError,
> {
let mut tokens_owned =
aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value))
.peekable();
let tokens = &mut tokens_owned;
aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Languages" => {
builder = builder.set_languages(
crate::json_deser::deser_list_com_amazonaws_comprehend_list_of_dominant_languages(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
if tokens.next().is_some() {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"found more JSON tokens after completing parsing",
),
);
}
Ok(builder)
}sourcepub fn build(self) -> DetectDominantLanguageOutput
pub fn build(self) -> DetectDominantLanguageOutput
Consumes the builder and constructs a DetectDominantLanguageOutput.
Examples found in repository?
3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521
pub fn parse_detect_dominant_language_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DetectDominantLanguageOutput,
crate::error::DetectDominantLanguageError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::detect_dominant_language_output::Builder::default();
let _ = response;
output = crate::json_deser::deser_operation_crate_operation_detect_dominant_language(
response.body().as_ref(),
output,
)
.map_err(crate::error::DetectDominantLanguageError::unhandled)?;
output.build()
})
}