use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto::xml::error::*;
use rusoto_core::proto::xml::util::{
characters, deserialize_elements, end_element, find_start_element, peek_at_name, skip_tree,
start_element,
};
use rusoto_core::proto::xml::util::{Next, Peek, XmlParseError, XmlResponse};
use rusoto_core::signature::SignedRequest;
use serde_urlencoded;
use std::str::FromStr;
use xml::reader::ParserConfig;
use xml::EventReader;
struct APIVersionDeserializer;
impl APIVersionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct ARNDeserializer;
impl ARNDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AccessPoliciesStatus {
pub options: String,
pub status: OptionStatus,
}
struct AccessPoliciesStatusDeserializer;
impl AccessPoliciesStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AccessPoliciesStatus, XmlParseError> {
deserialize_elements::<_, AccessPoliciesStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"Options" => {
obj.options = PolicyDocumentDeserializer::deserialize("Options", stack)?;
}
"Status" => {
obj.status = OptionStatusDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AlgorithmicStemmingDeserializer;
impl AlgorithmicStemmingDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AnalysisOptions {
pub algorithmic_stemming: Option<String>,
pub japanese_tokenization_dictionary: Option<String>,
pub stemming_dictionary: Option<String>,
pub stopwords: Option<String>,
pub synonyms: Option<String>,
}
struct AnalysisOptionsDeserializer;
impl AnalysisOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AnalysisOptions, XmlParseError> {
deserialize_elements::<_, AnalysisOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"AlgorithmicStemming" => {
obj.algorithmic_stemming = Some(AlgorithmicStemmingDeserializer::deserialize(
"AlgorithmicStemming",
stack,
)?);
}
"JapaneseTokenizationDictionary" => {
obj.japanese_tokenization_dictionary = Some(StringDeserializer::deserialize(
"JapaneseTokenizationDictionary",
stack,
)?);
}
"StemmingDictionary" => {
obj.stemming_dictionary = Some(StringDeserializer::deserialize(
"StemmingDictionary",
stack,
)?);
}
"Stopwords" => {
obj.stopwords = Some(StringDeserializer::deserialize("Stopwords", stack)?);
}
"Synonyms" => {
obj.synonyms = Some(StringDeserializer::deserialize("Synonyms", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AnalysisOptionsSerializer;
impl AnalysisOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &AnalysisOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.algorithmic_stemming {
params.put(
&format!("{}{}", prefix, "AlgorithmicStemming"),
&field_value,
);
}
if let Some(ref field_value) = obj.japanese_tokenization_dictionary {
params.put(
&format!("{}{}", prefix, "JapaneseTokenizationDictionary"),
&field_value,
);
}
if let Some(ref field_value) = obj.stemming_dictionary {
params.put(&format!("{}{}", prefix, "StemmingDictionary"), &field_value);
}
if let Some(ref field_value) = obj.stopwords {
params.put(&format!("{}{}", prefix, "Stopwords"), &field_value);
}
if let Some(ref field_value) = obj.synonyms {
params.put(&format!("{}{}", prefix, "Synonyms"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AnalysisScheme {
pub analysis_options: Option<AnalysisOptions>,
pub analysis_scheme_language: String,
pub analysis_scheme_name: String,
}
struct AnalysisSchemeDeserializer;
impl AnalysisSchemeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AnalysisScheme, XmlParseError> {
deserialize_elements::<_, AnalysisScheme, _>(tag_name, stack, |name, stack, obj| {
match name {
"AnalysisOptions" => {
obj.analysis_options = Some(AnalysisOptionsDeserializer::deserialize(
"AnalysisOptions",
stack,
)?);
}
"AnalysisSchemeLanguage" => {
obj.analysis_scheme_language = AnalysisSchemeLanguageDeserializer::deserialize(
"AnalysisSchemeLanguage",
stack,
)?;
}
"AnalysisSchemeName" => {
obj.analysis_scheme_name =
StandardNameDeserializer::deserialize("AnalysisSchemeName", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AnalysisSchemeSerializer;
impl AnalysisSchemeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &AnalysisScheme) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.analysis_options {
AnalysisOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "AnalysisOptions"),
field_value,
);
}
params.put(
&format!("{}{}", prefix, "AnalysisSchemeLanguage"),
&obj.analysis_scheme_language,
);
params.put(
&format!("{}{}", prefix, "AnalysisSchemeName"),
&obj.analysis_scheme_name,
);
}
}
struct AnalysisSchemeLanguageDeserializer;
impl AnalysisSchemeLanguageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AnalysisSchemeStatus {
pub options: AnalysisScheme,
pub status: OptionStatus,
}
struct AnalysisSchemeStatusDeserializer;
impl AnalysisSchemeStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AnalysisSchemeStatus, XmlParseError> {
deserialize_elements::<_, AnalysisSchemeStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"Options" => {
obj.options = AnalysisSchemeDeserializer::deserialize("Options", stack)?;
}
"Status" => {
obj.status = OptionStatusDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AnalysisSchemeStatusListDeserializer;
impl AnalysisSchemeStatusListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<AnalysisSchemeStatus>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(AnalysisSchemeStatusDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AvailabilityOptionsStatus {
pub options: bool,
pub status: OptionStatus,
}
struct AvailabilityOptionsStatusDeserializer;
impl AvailabilityOptionsStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AvailabilityOptionsStatus, XmlParseError> {
deserialize_elements::<_, AvailabilityOptionsStatus, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Options" => {
obj.options = MultiAZDeserializer::deserialize("Options", stack)?;
}
"Status" => {
obj.status = OptionStatusDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct BooleanDeserializer;
impl BooleanDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<bool, XmlParseError> {
start_element(tag_name, stack)?;
let obj = bool::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct BuildSuggestersRequest {
pub domain_name: String,
}
struct BuildSuggestersRequestSerializer;
impl BuildSuggestersRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &BuildSuggestersRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct BuildSuggestersResponse {
pub field_names: Option<Vec<String>>,
}
struct BuildSuggestersResponseDeserializer;
impl BuildSuggestersResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<BuildSuggestersResponse, XmlParseError> {
deserialize_elements::<_, BuildSuggestersResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"FieldNames" => {
obj.field_names
.get_or_insert(vec![])
.extend(FieldNameListDeserializer::deserialize("FieldNames", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateDomainRequest {
pub domain_name: String,
}
struct CreateDomainRequestSerializer;
impl CreateDomainRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateDomainRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateDomainResponse {
pub domain_status: Option<DomainStatus>,
}
struct CreateDomainResponseDeserializer;
impl CreateDomainResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateDomainResponse, XmlParseError> {
deserialize_elements::<_, CreateDomainResponse, _>(tag_name, stack, |name, stack, obj| {
match name {
"DomainStatus" => {
obj.domain_status = Some(DomainStatusDeserializer::deserialize(
"DomainStatus",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DateArrayOptions {
pub default_value: Option<String>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub source_fields: Option<String>,
}
struct DateArrayOptionsDeserializer;
impl DateArrayOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DateArrayOptions, XmlParseError> {
deserialize_elements::<_, DateArrayOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value =
Some(FieldValueDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SourceFields" => {
obj.source_fields = Some(FieldNameCommaListDeserializer::deserialize(
"SourceFields",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct DateArrayOptionsSerializer;
impl DateArrayOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DateArrayOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_fields {
params.put(&format!("{}{}", prefix, "SourceFields"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DateOptions {
pub default_value: Option<String>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub sort_enabled: Option<bool>,
pub source_field: Option<String>,
}
struct DateOptionsDeserializer;
impl DateOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DateOptions, XmlParseError> {
deserialize_elements::<_, DateOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value =
Some(FieldValueDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SortEnabled" => {
obj.sort_enabled =
Some(BooleanDeserializer::deserialize("SortEnabled", stack)?);
}
"SourceField" => {
obj.source_field =
Some(FieldNameDeserializer::deserialize("SourceField", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct DateOptionsSerializer;
impl DateOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DateOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.sort_enabled {
params.put(&format!("{}{}", prefix, "SortEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_field {
params.put(&format!("{}{}", prefix, "SourceField"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefineAnalysisSchemeRequest {
pub analysis_scheme: AnalysisScheme,
pub domain_name: String,
}
struct DefineAnalysisSchemeRequestSerializer;
impl DefineAnalysisSchemeRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DefineAnalysisSchemeRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
AnalysisSchemeSerializer::serialize(
params,
&format!("{}{}", prefix, "AnalysisScheme"),
&obj.analysis_scheme,
);
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefineAnalysisSchemeResponse {
pub analysis_scheme: AnalysisSchemeStatus,
}
struct DefineAnalysisSchemeResponseDeserializer;
impl DefineAnalysisSchemeResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DefineAnalysisSchemeResponse, XmlParseError> {
deserialize_elements::<_, DefineAnalysisSchemeResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AnalysisScheme" => {
obj.analysis_scheme =
AnalysisSchemeStatusDeserializer::deserialize("AnalysisScheme", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefineExpressionRequest {
pub domain_name: String,
pub expression: Expression,
}
struct DefineExpressionRequestSerializer;
impl DefineExpressionRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DefineExpressionRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
ExpressionSerializer::serialize(
params,
&format!("{}{}", prefix, "Expression"),
&obj.expression,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefineExpressionResponse {
pub expression: ExpressionStatus,
}
struct DefineExpressionResponseDeserializer;
impl DefineExpressionResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DefineExpressionResponse, XmlParseError> {
deserialize_elements::<_, DefineExpressionResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Expression" => {
obj.expression =
ExpressionStatusDeserializer::deserialize("Expression", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefineIndexFieldRequest {
pub domain_name: String,
pub index_field: IndexField,
}
struct DefineIndexFieldRequestSerializer;
impl DefineIndexFieldRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DefineIndexFieldRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
IndexFieldSerializer::serialize(
params,
&format!("{}{}", prefix, "IndexField"),
&obj.index_field,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefineIndexFieldResponse {
pub index_field: IndexFieldStatus,
}
struct DefineIndexFieldResponseDeserializer;
impl DefineIndexFieldResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DefineIndexFieldResponse, XmlParseError> {
deserialize_elements::<_, DefineIndexFieldResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"IndexField" => {
obj.index_field =
IndexFieldStatusDeserializer::deserialize("IndexField", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefineSuggesterRequest {
pub domain_name: String,
pub suggester: Suggester,
}
struct DefineSuggesterRequestSerializer;
impl DefineSuggesterRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DefineSuggesterRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
SuggesterSerializer::serialize(
params,
&format!("{}{}", prefix, "Suggester"),
&obj.suggester,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DefineSuggesterResponse {
pub suggester: SuggesterStatus,
}
struct DefineSuggesterResponseDeserializer;
impl DefineSuggesterResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DefineSuggesterResponse, XmlParseError> {
deserialize_elements::<_, DefineSuggesterResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Suggester" => {
obj.suggester =
SuggesterStatusDeserializer::deserialize("Suggester", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteAnalysisSchemeRequest {
pub analysis_scheme_name: String,
pub domain_name: String,
}
struct DeleteAnalysisSchemeRequestSerializer;
impl DeleteAnalysisSchemeRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteAnalysisSchemeRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AnalysisSchemeName"),
&obj.analysis_scheme_name,
);
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteAnalysisSchemeResponse {
pub analysis_scheme: AnalysisSchemeStatus,
}
struct DeleteAnalysisSchemeResponseDeserializer;
impl DeleteAnalysisSchemeResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteAnalysisSchemeResponse, XmlParseError> {
deserialize_elements::<_, DeleteAnalysisSchemeResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AnalysisScheme" => {
obj.analysis_scheme =
AnalysisSchemeStatusDeserializer::deserialize("AnalysisScheme", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteDomainRequest {
pub domain_name: String,
}
struct DeleteDomainRequestSerializer;
impl DeleteDomainRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteDomainRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteDomainResponse {
pub domain_status: Option<DomainStatus>,
}
struct DeleteDomainResponseDeserializer;
impl DeleteDomainResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteDomainResponse, XmlParseError> {
deserialize_elements::<_, DeleteDomainResponse, _>(tag_name, stack, |name, stack, obj| {
match name {
"DomainStatus" => {
obj.domain_status = Some(DomainStatusDeserializer::deserialize(
"DomainStatus",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteExpressionRequest {
pub domain_name: String,
pub expression_name: String,
}
struct DeleteExpressionRequestSerializer;
impl DeleteExpressionRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteExpressionRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
params.put(
&format!("{}{}", prefix, "ExpressionName"),
&obj.expression_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteExpressionResponse {
pub expression: ExpressionStatus,
}
struct DeleteExpressionResponseDeserializer;
impl DeleteExpressionResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteExpressionResponse, XmlParseError> {
deserialize_elements::<_, DeleteExpressionResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Expression" => {
obj.expression =
ExpressionStatusDeserializer::deserialize("Expression", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteIndexFieldRequest {
pub domain_name: String,
pub index_field_name: String,
}
struct DeleteIndexFieldRequestSerializer;
impl DeleteIndexFieldRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteIndexFieldRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
params.put(
&format!("{}{}", prefix, "IndexFieldName"),
&obj.index_field_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteIndexFieldResponse {
pub index_field: IndexFieldStatus,
}
struct DeleteIndexFieldResponseDeserializer;
impl DeleteIndexFieldResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteIndexFieldResponse, XmlParseError> {
deserialize_elements::<_, DeleteIndexFieldResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"IndexField" => {
obj.index_field =
IndexFieldStatusDeserializer::deserialize("IndexField", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteSuggesterRequest {
pub domain_name: String,
pub suggester_name: String,
}
struct DeleteSuggesterRequestSerializer;
impl DeleteSuggesterRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteSuggesterRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
params.put(
&format!("{}{}", prefix, "SuggesterName"),
&obj.suggester_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteSuggesterResponse {
pub suggester: SuggesterStatus,
}
struct DeleteSuggesterResponseDeserializer;
impl DeleteSuggesterResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteSuggesterResponse, XmlParseError> {
deserialize_elements::<_, DeleteSuggesterResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Suggester" => {
obj.suggester =
SuggesterStatusDeserializer::deserialize("Suggester", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeAnalysisSchemesRequest {
pub analysis_scheme_names: Option<Vec<String>>,
pub deployed: Option<bool>,
pub domain_name: String,
}
struct DescribeAnalysisSchemesRequestSerializer;
impl DescribeAnalysisSchemesRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeAnalysisSchemesRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.analysis_scheme_names {
StandardNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "AnalysisSchemeNames"),
field_value,
);
}
if let Some(ref field_value) = obj.deployed {
params.put(&format!("{}{}", prefix, "Deployed"), &field_value);
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeAnalysisSchemesResponse {
pub analysis_schemes: Vec<AnalysisSchemeStatus>,
}
struct DescribeAnalysisSchemesResponseDeserializer;
impl DescribeAnalysisSchemesResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeAnalysisSchemesResponse, XmlParseError> {
deserialize_elements::<_, DescribeAnalysisSchemesResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AnalysisSchemes" => {
obj.analysis_schemes.extend(
AnalysisSchemeStatusListDeserializer::deserialize(
"AnalysisSchemes",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeAvailabilityOptionsRequest {
pub deployed: Option<bool>,
pub domain_name: String,
}
struct DescribeAvailabilityOptionsRequestSerializer;
impl DescribeAvailabilityOptionsRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeAvailabilityOptionsRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.deployed {
params.put(&format!("{}{}", prefix, "Deployed"), &field_value);
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeAvailabilityOptionsResponse {
pub availability_options: Option<AvailabilityOptionsStatus>,
}
struct DescribeAvailabilityOptionsResponseDeserializer;
impl DescribeAvailabilityOptionsResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeAvailabilityOptionsResponse, XmlParseError> {
deserialize_elements::<_, DescribeAvailabilityOptionsResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AvailabilityOptions" => {
obj.availability_options =
Some(AvailabilityOptionsStatusDeserializer::deserialize(
"AvailabilityOptions",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeDomainsRequest {
pub domain_names: Option<Vec<String>>,
}
struct DescribeDomainsRequestSerializer;
impl DescribeDomainsRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeDomainsRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.domain_names {
DomainNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "DomainNames"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeDomainsResponse {
pub domain_status_list: Vec<DomainStatus>,
}
struct DescribeDomainsResponseDeserializer;
impl DescribeDomainsResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeDomainsResponse, XmlParseError> {
deserialize_elements::<_, DescribeDomainsResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"DomainStatusList" => {
obj.domain_status_list
.extend(DomainStatusListDeserializer::deserialize(
"DomainStatusList",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeExpressionsRequest {
pub deployed: Option<bool>,
pub domain_name: String,
pub expression_names: Option<Vec<String>>,
}
struct DescribeExpressionsRequestSerializer;
impl DescribeExpressionsRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeExpressionsRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.deployed {
params.put(&format!("{}{}", prefix, "Deployed"), &field_value);
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
if let Some(ref field_value) = obj.expression_names {
StandardNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "ExpressionNames"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeExpressionsResponse {
pub expressions: Vec<ExpressionStatus>,
}
struct DescribeExpressionsResponseDeserializer;
impl DescribeExpressionsResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeExpressionsResponse, XmlParseError> {
deserialize_elements::<_, DescribeExpressionsResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Expressions" => {
obj.expressions
.extend(ExpressionStatusListDeserializer::deserialize(
"Expressions",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeIndexFieldsRequest {
pub deployed: Option<bool>,
pub domain_name: String,
pub field_names: Option<Vec<String>>,
}
struct DescribeIndexFieldsRequestSerializer;
impl DescribeIndexFieldsRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeIndexFieldsRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.deployed {
params.put(&format!("{}{}", prefix, "Deployed"), &field_value);
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
if let Some(ref field_value) = obj.field_names {
DynamicFieldNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "FieldNames"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeIndexFieldsResponse {
pub index_fields: Vec<IndexFieldStatus>,
}
struct DescribeIndexFieldsResponseDeserializer;
impl DescribeIndexFieldsResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeIndexFieldsResponse, XmlParseError> {
deserialize_elements::<_, DescribeIndexFieldsResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"IndexFields" => {
obj.index_fields
.extend(IndexFieldStatusListDeserializer::deserialize(
"IndexFields",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeScalingParametersRequest {
pub domain_name: String,
}
struct DescribeScalingParametersRequestSerializer;
impl DescribeScalingParametersRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeScalingParametersRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeScalingParametersResponse {
pub scaling_parameters: ScalingParametersStatus,
}
struct DescribeScalingParametersResponseDeserializer;
impl DescribeScalingParametersResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeScalingParametersResponse, XmlParseError> {
deserialize_elements::<_, DescribeScalingParametersResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ScalingParameters" => {
obj.scaling_parameters = ScalingParametersStatusDeserializer::deserialize(
"ScalingParameters",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeServiceAccessPoliciesRequest {
pub deployed: Option<bool>,
pub domain_name: String,
}
struct DescribeServiceAccessPoliciesRequestSerializer;
impl DescribeServiceAccessPoliciesRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeServiceAccessPoliciesRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.deployed {
params.put(&format!("{}{}", prefix, "Deployed"), &field_value);
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeServiceAccessPoliciesResponse {
pub access_policies: AccessPoliciesStatus,
}
struct DescribeServiceAccessPoliciesResponseDeserializer;
impl DescribeServiceAccessPoliciesResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeServiceAccessPoliciesResponse, XmlParseError> {
deserialize_elements::<_, DescribeServiceAccessPoliciesResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AccessPolicies" => {
obj.access_policies =
AccessPoliciesStatusDeserializer::deserialize("AccessPolicies", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeSuggestersRequest {
pub deployed: Option<bool>,
pub domain_name: String,
pub suggester_names: Option<Vec<String>>,
}
struct DescribeSuggestersRequestSerializer;
impl DescribeSuggestersRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeSuggestersRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.deployed {
params.put(&format!("{}{}", prefix, "Deployed"), &field_value);
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
if let Some(ref field_value) = obj.suggester_names {
StandardNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "SuggesterNames"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeSuggestersResponse {
pub suggesters: Vec<SuggesterStatus>,
}
struct DescribeSuggestersResponseDeserializer;
impl DescribeSuggestersResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeSuggestersResponse, XmlParseError> {
deserialize_elements::<_, DescribeSuggestersResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Suggesters" => {
obj.suggesters
.extend(SuggesterStatusListDeserializer::deserialize(
"Suggesters",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DocumentSuggesterOptions {
pub fuzzy_matching: Option<String>,
pub sort_expression: Option<String>,
pub source_field: String,
}
struct DocumentSuggesterOptionsDeserializer;
impl DocumentSuggesterOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DocumentSuggesterOptions, XmlParseError> {
deserialize_elements::<_, DocumentSuggesterOptions, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"FuzzyMatching" => {
obj.fuzzy_matching = Some(SuggesterFuzzyMatchingDeserializer::deserialize(
"FuzzyMatching",
stack,
)?);
}
"SortExpression" => {
obj.sort_expression =
Some(StringDeserializer::deserialize("SortExpression", stack)?);
}
"SourceField" => {
obj.source_field =
FieldNameDeserializer::deserialize("SourceField", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct DocumentSuggesterOptionsSerializer;
impl DocumentSuggesterOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DocumentSuggesterOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.fuzzy_matching {
params.put(&format!("{}{}", prefix, "FuzzyMatching"), &field_value);
}
if let Some(ref field_value) = obj.sort_expression {
params.put(&format!("{}{}", prefix, "SortExpression"), &field_value);
}
params.put(&format!("{}{}", prefix, "SourceField"), &obj.source_field);
}
}
struct DomainIdDeserializer;
impl DomainIdDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct DomainNameDeserializer;
impl DomainNameDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct DomainNameListSerializer;
impl DomainNameListSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
params.put(&key, &obj);
}
}
}
struct DomainNameMapDeserializer;
impl DomainNameMapDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<::std::collections::HashMap<String, String>, XmlParseError> {
start_element(tag_name, stack)?;
let mut obj = ::std::collections::HashMap::new();
while peek_at_name(stack)? == "entry" {
start_element("entry", stack)?;
let key = DomainNameDeserializer::deserialize("key", stack)?;
let value = APIVersionDeserializer::deserialize("value", stack)?;
obj.insert(key, value);
end_element("entry", stack)?;
}
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DomainStatus {
pub arn: Option<String>,
pub created: Option<bool>,
pub deleted: Option<bool>,
pub doc_service: Option<ServiceEndpoint>,
pub domain_id: String,
pub domain_name: String,
pub limits: Option<Limits>,
pub processing: Option<bool>,
pub requires_index_documents: bool,
pub search_instance_count: Option<i64>,
pub search_instance_type: Option<String>,
pub search_partition_count: Option<i64>,
pub search_service: Option<ServiceEndpoint>,
}
struct DomainStatusDeserializer;
impl DomainStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DomainStatus, XmlParseError> {
deserialize_elements::<_, DomainStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"ARN" => {
obj.arn = Some(ARNDeserializer::deserialize("ARN", stack)?);
}
"Created" => {
obj.created = Some(BooleanDeserializer::deserialize("Created", stack)?);
}
"Deleted" => {
obj.deleted = Some(BooleanDeserializer::deserialize("Deleted", stack)?);
}
"DocService" => {
obj.doc_service = Some(ServiceEndpointDeserializer::deserialize(
"DocService",
stack,
)?);
}
"DomainId" => {
obj.domain_id = DomainIdDeserializer::deserialize("DomainId", stack)?;
}
"DomainName" => {
obj.domain_name = DomainNameDeserializer::deserialize("DomainName", stack)?;
}
"Limits" => {
obj.limits = Some(LimitsDeserializer::deserialize("Limits", stack)?);
}
"Processing" => {
obj.processing = Some(BooleanDeserializer::deserialize("Processing", stack)?);
}
"RequiresIndexDocuments" => {
obj.requires_index_documents =
BooleanDeserializer::deserialize("RequiresIndexDocuments", stack)?;
}
"SearchInstanceCount" => {
obj.search_instance_count = Some(InstanceCountDeserializer::deserialize(
"SearchInstanceCount",
stack,
)?);
}
"SearchInstanceType" => {
obj.search_instance_type = Some(SearchInstanceTypeDeserializer::deserialize(
"SearchInstanceType",
stack,
)?);
}
"SearchPartitionCount" => {
obj.search_partition_count = Some(PartitionCountDeserializer::deserialize(
"SearchPartitionCount",
stack,
)?);
}
"SearchService" => {
obj.search_service = Some(ServiceEndpointDeserializer::deserialize(
"SearchService",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct DomainStatusListDeserializer;
impl DomainStatusListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<DomainStatus>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(DomainStatusDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct DoubleDeserializer;
impl DoubleDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<f64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = f64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DoubleArrayOptions {
pub default_value: Option<f64>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub source_fields: Option<String>,
}
struct DoubleArrayOptionsDeserializer;
impl DoubleArrayOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DoubleArrayOptions, XmlParseError> {
deserialize_elements::<_, DoubleArrayOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value =
Some(DoubleDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SourceFields" => {
obj.source_fields = Some(FieldNameCommaListDeserializer::deserialize(
"SourceFields",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct DoubleArrayOptionsSerializer;
impl DoubleArrayOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DoubleArrayOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_fields {
params.put(&format!("{}{}", prefix, "SourceFields"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DoubleOptions {
pub default_value: Option<f64>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub sort_enabled: Option<bool>,
pub source_field: Option<String>,
}
struct DoubleOptionsDeserializer;
impl DoubleOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DoubleOptions, XmlParseError> {
deserialize_elements::<_, DoubleOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value =
Some(DoubleDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SortEnabled" => {
obj.sort_enabled =
Some(BooleanDeserializer::deserialize("SortEnabled", stack)?);
}
"SourceField" => {
obj.source_field =
Some(FieldNameDeserializer::deserialize("SourceField", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct DoubleOptionsSerializer;
impl DoubleOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DoubleOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.sort_enabled {
params.put(&format!("{}{}", prefix, "SortEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_field {
params.put(&format!("{}{}", prefix, "SourceField"), &field_value);
}
}
}
struct DynamicFieldNameDeserializer;
impl DynamicFieldNameDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct DynamicFieldNameListSerializer;
impl DynamicFieldNameListSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
params.put(&key, &obj);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Expression {
pub expression_name: String,
pub expression_value: String,
}
struct ExpressionDeserializer;
impl ExpressionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Expression, XmlParseError> {
deserialize_elements::<_, Expression, _>(tag_name, stack, |name, stack, obj| {
match name {
"ExpressionName" => {
obj.expression_name =
StandardNameDeserializer::deserialize("ExpressionName", stack)?;
}
"ExpressionValue" => {
obj.expression_value =
ExpressionValueDeserializer::deserialize("ExpressionValue", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ExpressionSerializer;
impl ExpressionSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Expression) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "ExpressionName"),
&obj.expression_name,
);
params.put(
&format!("{}{}", prefix, "ExpressionValue"),
&obj.expression_value,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ExpressionStatus {
pub options: Expression,
pub status: OptionStatus,
}
struct ExpressionStatusDeserializer;
impl ExpressionStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ExpressionStatus, XmlParseError> {
deserialize_elements::<_, ExpressionStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"Options" => {
obj.options = ExpressionDeserializer::deserialize("Options", stack)?;
}
"Status" => {
obj.status = OptionStatusDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ExpressionStatusListDeserializer;
impl ExpressionStatusListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ExpressionStatus>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(ExpressionStatusDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct ExpressionValueDeserializer;
impl ExpressionValueDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct FieldNameDeserializer;
impl FieldNameDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct FieldNameCommaListDeserializer;
impl FieldNameCommaListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct FieldNameListDeserializer;
impl FieldNameListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<String>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(FieldNameDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct FieldValueDeserializer;
impl FieldValueDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct IndexDocumentsRequest {
pub domain_name: String,
}
struct IndexDocumentsRequestSerializer;
impl IndexDocumentsRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &IndexDocumentsRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct IndexDocumentsResponse {
pub field_names: Option<Vec<String>>,
}
struct IndexDocumentsResponseDeserializer;
impl IndexDocumentsResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<IndexDocumentsResponse, XmlParseError> {
deserialize_elements::<_, IndexDocumentsResponse, _>(tag_name, stack, |name, stack, obj| {
match name {
"FieldNames" => {
obj.field_names
.get_or_insert(vec![])
.extend(FieldNameListDeserializer::deserialize("FieldNames", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct IndexField {
pub date_array_options: Option<DateArrayOptions>,
pub date_options: Option<DateOptions>,
pub double_array_options: Option<DoubleArrayOptions>,
pub double_options: Option<DoubleOptions>,
pub index_field_name: String,
pub index_field_type: String,
pub int_array_options: Option<IntArrayOptions>,
pub int_options: Option<IntOptions>,
pub lat_lon_options: Option<LatLonOptions>,
pub literal_array_options: Option<LiteralArrayOptions>,
pub literal_options: Option<LiteralOptions>,
pub text_array_options: Option<TextArrayOptions>,
pub text_options: Option<TextOptions>,
}
struct IndexFieldDeserializer;
impl IndexFieldDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<IndexField, XmlParseError> {
deserialize_elements::<_, IndexField, _>(tag_name, stack, |name, stack, obj| {
match name {
"DateArrayOptions" => {
obj.date_array_options = Some(DateArrayOptionsDeserializer::deserialize(
"DateArrayOptions",
stack,
)?);
}
"DateOptions" => {
obj.date_options =
Some(DateOptionsDeserializer::deserialize("DateOptions", stack)?);
}
"DoubleArrayOptions" => {
obj.double_array_options = Some(DoubleArrayOptionsDeserializer::deserialize(
"DoubleArrayOptions",
stack,
)?);
}
"DoubleOptions" => {
obj.double_options = Some(DoubleOptionsDeserializer::deserialize(
"DoubleOptions",
stack,
)?);
}
"IndexFieldName" => {
obj.index_field_name =
DynamicFieldNameDeserializer::deserialize("IndexFieldName", stack)?;
}
"IndexFieldType" => {
obj.index_field_type =
IndexFieldTypeDeserializer::deserialize("IndexFieldType", stack)?;
}
"IntArrayOptions" => {
obj.int_array_options = Some(IntArrayOptionsDeserializer::deserialize(
"IntArrayOptions",
stack,
)?);
}
"IntOptions" => {
obj.int_options =
Some(IntOptionsDeserializer::deserialize("IntOptions", stack)?);
}
"LatLonOptions" => {
obj.lat_lon_options = Some(LatLonOptionsDeserializer::deserialize(
"LatLonOptions",
stack,
)?);
}
"LiteralArrayOptions" => {
obj.literal_array_options = Some(LiteralArrayOptionsDeserializer::deserialize(
"LiteralArrayOptions",
stack,
)?);
}
"LiteralOptions" => {
obj.literal_options = Some(LiteralOptionsDeserializer::deserialize(
"LiteralOptions",
stack,
)?);
}
"TextArrayOptions" => {
obj.text_array_options = Some(TextArrayOptionsDeserializer::deserialize(
"TextArrayOptions",
stack,
)?);
}
"TextOptions" => {
obj.text_options =
Some(TextOptionsDeserializer::deserialize("TextOptions", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct IndexFieldSerializer;
impl IndexFieldSerializer {
fn serialize(params: &mut Params, name: &str, obj: &IndexField) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.date_array_options {
DateArrayOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "DateArrayOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.date_options {
DateOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "DateOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.double_array_options {
DoubleArrayOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "DoubleArrayOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.double_options {
DoubleOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "DoubleOptions"),
field_value,
);
}
params.put(
&format!("{}{}", prefix, "IndexFieldName"),
&obj.index_field_name,
);
params.put(
&format!("{}{}", prefix, "IndexFieldType"),
&obj.index_field_type,
);
if let Some(ref field_value) = obj.int_array_options {
IntArrayOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "IntArrayOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.int_options {
IntOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "IntOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.lat_lon_options {
LatLonOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "LatLonOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.literal_array_options {
LiteralArrayOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "LiteralArrayOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.literal_options {
LiteralOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "LiteralOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.text_array_options {
TextArrayOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "TextArrayOptions"),
field_value,
);
}
if let Some(ref field_value) = obj.text_options {
TextOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "TextOptions"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct IndexFieldStatus {
pub options: IndexField,
pub status: OptionStatus,
}
struct IndexFieldStatusDeserializer;
impl IndexFieldStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<IndexFieldStatus, XmlParseError> {
deserialize_elements::<_, IndexFieldStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"Options" => {
obj.options = IndexFieldDeserializer::deserialize("Options", stack)?;
}
"Status" => {
obj.status = OptionStatusDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct IndexFieldStatusListDeserializer;
impl IndexFieldStatusListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<IndexFieldStatus>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(IndexFieldStatusDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct IndexFieldTypeDeserializer;
impl IndexFieldTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct InstanceCountDeserializer;
impl InstanceCountDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct IntArrayOptions {
pub default_value: Option<i64>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub source_fields: Option<String>,
}
struct IntArrayOptionsDeserializer;
impl IntArrayOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<IntArrayOptions, XmlParseError> {
deserialize_elements::<_, IntArrayOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value = Some(LongDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SourceFields" => {
obj.source_fields = Some(FieldNameCommaListDeserializer::deserialize(
"SourceFields",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct IntArrayOptionsSerializer;
impl IntArrayOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &IntArrayOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_fields {
params.put(&format!("{}{}", prefix, "SourceFields"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct IntOptions {
pub default_value: Option<i64>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub sort_enabled: Option<bool>,
pub source_field: Option<String>,
}
struct IntOptionsDeserializer;
impl IntOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<IntOptions, XmlParseError> {
deserialize_elements::<_, IntOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value = Some(LongDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SortEnabled" => {
obj.sort_enabled =
Some(BooleanDeserializer::deserialize("SortEnabled", stack)?);
}
"SourceField" => {
obj.source_field =
Some(FieldNameDeserializer::deserialize("SourceField", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct IntOptionsSerializer;
impl IntOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &IntOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.sort_enabled {
params.put(&format!("{}{}", prefix, "SortEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_field {
params.put(&format!("{}{}", prefix, "SourceField"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LatLonOptions {
pub default_value: Option<String>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub sort_enabled: Option<bool>,
pub source_field: Option<String>,
}
struct LatLonOptionsDeserializer;
impl LatLonOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LatLonOptions, XmlParseError> {
deserialize_elements::<_, LatLonOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value =
Some(FieldValueDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SortEnabled" => {
obj.sort_enabled =
Some(BooleanDeserializer::deserialize("SortEnabled", stack)?);
}
"SourceField" => {
obj.source_field =
Some(FieldNameDeserializer::deserialize("SourceField", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct LatLonOptionsSerializer;
impl LatLonOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LatLonOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.sort_enabled {
params.put(&format!("{}{}", prefix, "SortEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_field {
params.put(&format!("{}{}", prefix, "SourceField"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Limits {
pub maximum_partition_count: i64,
pub maximum_replication_count: i64,
}
struct LimitsDeserializer;
impl LimitsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Limits, XmlParseError> {
deserialize_elements::<_, Limits, _>(tag_name, stack, |name, stack, obj| {
match name {
"MaximumPartitionCount" => {
obj.maximum_partition_count = MaximumPartitionCountDeserializer::deserialize(
"MaximumPartitionCount",
stack,
)?;
}
"MaximumReplicationCount" => {
obj.maximum_replication_count =
MaximumReplicationCountDeserializer::deserialize(
"MaximumReplicationCount",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListDomainNamesResponse {
pub domain_names: Option<::std::collections::HashMap<String, String>>,
}
struct ListDomainNamesResponseDeserializer;
impl ListDomainNamesResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ListDomainNamesResponse, XmlParseError> {
deserialize_elements::<_, ListDomainNamesResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"DomainNames" => {
obj.domain_names = Some(DomainNameMapDeserializer::deserialize(
"DomainNames",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LiteralArrayOptions {
pub default_value: Option<String>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub source_fields: Option<String>,
}
struct LiteralArrayOptionsDeserializer;
impl LiteralArrayOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LiteralArrayOptions, XmlParseError> {
deserialize_elements::<_, LiteralArrayOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value =
Some(FieldValueDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SourceFields" => {
obj.source_fields = Some(FieldNameCommaListDeserializer::deserialize(
"SourceFields",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct LiteralArrayOptionsSerializer;
impl LiteralArrayOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LiteralArrayOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_fields {
params.put(&format!("{}{}", prefix, "SourceFields"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LiteralOptions {
pub default_value: Option<String>,
pub facet_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub search_enabled: Option<bool>,
pub sort_enabled: Option<bool>,
pub source_field: Option<String>,
}
struct LiteralOptionsDeserializer;
impl LiteralOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LiteralOptions, XmlParseError> {
deserialize_elements::<_, LiteralOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"DefaultValue" => {
obj.default_value =
Some(FieldValueDeserializer::deserialize("DefaultValue", stack)?);
}
"FacetEnabled" => {
obj.facet_enabled =
Some(BooleanDeserializer::deserialize("FacetEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SearchEnabled" => {
obj.search_enabled =
Some(BooleanDeserializer::deserialize("SearchEnabled", stack)?);
}
"SortEnabled" => {
obj.sort_enabled =
Some(BooleanDeserializer::deserialize("SortEnabled", stack)?);
}
"SourceField" => {
obj.source_field =
Some(FieldNameDeserializer::deserialize("SourceField", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct LiteralOptionsSerializer;
impl LiteralOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LiteralOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.facet_enabled {
params.put(&format!("{}{}", prefix, "FacetEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.search_enabled {
params.put(&format!("{}{}", prefix, "SearchEnabled"), &field_value);
}
if let Some(ref field_value) = obj.sort_enabled {
params.put(&format!("{}{}", prefix, "SortEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_field {
params.put(&format!("{}{}", prefix, "SourceField"), &field_value);
}
}
}
struct LongDeserializer;
impl LongDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct MaximumPartitionCountDeserializer;
impl MaximumPartitionCountDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct MaximumReplicationCountDeserializer;
impl MaximumReplicationCountDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct MultiAZDeserializer;
impl MultiAZDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<bool, XmlParseError> {
start_element(tag_name, stack)?;
let obj = bool::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct OptionStateDeserializer;
impl OptionStateDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct OptionStatus {
pub creation_date: String,
pub pending_deletion: Option<bool>,
pub state: String,
pub update_date: String,
pub update_version: Option<i64>,
}
struct OptionStatusDeserializer;
impl OptionStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<OptionStatus, XmlParseError> {
deserialize_elements::<_, OptionStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"CreationDate" => {
obj.creation_date =
UpdateTimestampDeserializer::deserialize("CreationDate", stack)?;
}
"PendingDeletion" => {
obj.pending_deletion =
Some(BooleanDeserializer::deserialize("PendingDeletion", stack)?);
}
"State" => {
obj.state = OptionStateDeserializer::deserialize("State", stack)?;
}
"UpdateDate" => {
obj.update_date =
UpdateTimestampDeserializer::deserialize("UpdateDate", stack)?;
}
"UpdateVersion" => {
obj.update_version =
Some(UIntValueDeserializer::deserialize("UpdateVersion", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct PartitionCountDeserializer;
impl PartitionCountDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct PartitionInstanceTypeDeserializer;
impl PartitionInstanceTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct PolicyDocumentDeserializer;
impl PolicyDocumentDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ScalingParameters {
pub desired_instance_type: Option<String>,
pub desired_partition_count: Option<i64>,
pub desired_replication_count: Option<i64>,
}
struct ScalingParametersDeserializer;
impl ScalingParametersDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ScalingParameters, XmlParseError> {
deserialize_elements::<_, ScalingParameters, _>(tag_name, stack, |name, stack, obj| {
match name {
"DesiredInstanceType" => {
obj.desired_instance_type =
Some(PartitionInstanceTypeDeserializer::deserialize(
"DesiredInstanceType",
stack,
)?);
}
"DesiredPartitionCount" => {
obj.desired_partition_count = Some(UIntValueDeserializer::deserialize(
"DesiredPartitionCount",
stack,
)?);
}
"DesiredReplicationCount" => {
obj.desired_replication_count = Some(UIntValueDeserializer::deserialize(
"DesiredReplicationCount",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ScalingParametersSerializer;
impl ScalingParametersSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ScalingParameters) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.desired_instance_type {
params.put(
&format!("{}{}", prefix, "DesiredInstanceType"),
&field_value,
);
}
if let Some(ref field_value) = obj.desired_partition_count {
params.put(
&format!("{}{}", prefix, "DesiredPartitionCount"),
&field_value,
);
}
if let Some(ref field_value) = obj.desired_replication_count {
params.put(
&format!("{}{}", prefix, "DesiredReplicationCount"),
&field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ScalingParametersStatus {
pub options: ScalingParameters,
pub status: OptionStatus,
}
struct ScalingParametersStatusDeserializer;
impl ScalingParametersStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ScalingParametersStatus, XmlParseError> {
deserialize_elements::<_, ScalingParametersStatus, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Options" => {
obj.options = ScalingParametersDeserializer::deserialize("Options", stack)?;
}
"Status" => {
obj.status = OptionStatusDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct SearchInstanceTypeDeserializer;
impl SearchInstanceTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ServiceEndpoint {
pub endpoint: Option<String>,
}
struct ServiceEndpointDeserializer;
impl ServiceEndpointDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ServiceEndpoint, XmlParseError> {
deserialize_elements::<_, ServiceEndpoint, _>(tag_name, stack, |name, stack, obj| {
match name {
"Endpoint" => {
obj.endpoint = Some(ServiceUrlDeserializer::deserialize("Endpoint", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ServiceUrlDeserializer;
impl ServiceUrlDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct StandardNameDeserializer;
impl StandardNameDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct StandardNameListSerializer;
impl StandardNameListSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
params.put(&key, &obj);
}
}
}
struct StringDeserializer;
impl StringDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Suggester {
pub document_suggester_options: DocumentSuggesterOptions,
pub suggester_name: String,
}
struct SuggesterDeserializer;
impl SuggesterDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Suggester, XmlParseError> {
deserialize_elements::<_, Suggester, _>(tag_name, stack, |name, stack, obj| {
match name {
"DocumentSuggesterOptions" => {
obj.document_suggester_options =
DocumentSuggesterOptionsDeserializer::deserialize(
"DocumentSuggesterOptions",
stack,
)?;
}
"SuggesterName" => {
obj.suggester_name =
StandardNameDeserializer::deserialize("SuggesterName", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct SuggesterSerializer;
impl SuggesterSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Suggester) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
DocumentSuggesterOptionsSerializer::serialize(
params,
&format!("{}{}", prefix, "DocumentSuggesterOptions"),
&obj.document_suggester_options,
);
params.put(
&format!("{}{}", prefix, "SuggesterName"),
&obj.suggester_name,
);
}
}
struct SuggesterFuzzyMatchingDeserializer;
impl SuggesterFuzzyMatchingDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct SuggesterStatus {
pub options: Suggester,
pub status: OptionStatus,
}
struct SuggesterStatusDeserializer;
impl SuggesterStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<SuggesterStatus, XmlParseError> {
deserialize_elements::<_, SuggesterStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"Options" => {
obj.options = SuggesterDeserializer::deserialize("Options", stack)?;
}
"Status" => {
obj.status = OptionStatusDeserializer::deserialize("Status", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct SuggesterStatusListDeserializer;
impl SuggesterStatusListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<SuggesterStatus>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(SuggesterStatusDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TextArrayOptions {
pub analysis_scheme: Option<String>,
pub default_value: Option<String>,
pub highlight_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub source_fields: Option<String>,
}
struct TextArrayOptionsDeserializer;
impl TextArrayOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<TextArrayOptions, XmlParseError> {
deserialize_elements::<_, TextArrayOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"AnalysisScheme" => {
obj.analysis_scheme =
Some(WordDeserializer::deserialize("AnalysisScheme", stack)?);
}
"DefaultValue" => {
obj.default_value =
Some(FieldValueDeserializer::deserialize("DefaultValue", stack)?);
}
"HighlightEnabled" => {
obj.highlight_enabled =
Some(BooleanDeserializer::deserialize("HighlightEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SourceFields" => {
obj.source_fields = Some(FieldNameCommaListDeserializer::deserialize(
"SourceFields",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct TextArrayOptionsSerializer;
impl TextArrayOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &TextArrayOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.analysis_scheme {
params.put(&format!("{}{}", prefix, "AnalysisScheme"), &field_value);
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.highlight_enabled {
params.put(&format!("{}{}", prefix, "HighlightEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_fields {
params.put(&format!("{}{}", prefix, "SourceFields"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TextOptions {
pub analysis_scheme: Option<String>,
pub default_value: Option<String>,
pub highlight_enabled: Option<bool>,
pub return_enabled: Option<bool>,
pub sort_enabled: Option<bool>,
pub source_field: Option<String>,
}
struct TextOptionsDeserializer;
impl TextOptionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<TextOptions, XmlParseError> {
deserialize_elements::<_, TextOptions, _>(tag_name, stack, |name, stack, obj| {
match name {
"AnalysisScheme" => {
obj.analysis_scheme =
Some(WordDeserializer::deserialize("AnalysisScheme", stack)?);
}
"DefaultValue" => {
obj.default_value =
Some(FieldValueDeserializer::deserialize("DefaultValue", stack)?);
}
"HighlightEnabled" => {
obj.highlight_enabled =
Some(BooleanDeserializer::deserialize("HighlightEnabled", stack)?);
}
"ReturnEnabled" => {
obj.return_enabled =
Some(BooleanDeserializer::deserialize("ReturnEnabled", stack)?);
}
"SortEnabled" => {
obj.sort_enabled =
Some(BooleanDeserializer::deserialize("SortEnabled", stack)?);
}
"SourceField" => {
obj.source_field =
Some(FieldNameDeserializer::deserialize("SourceField", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct TextOptionsSerializer;
impl TextOptionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &TextOptions) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.analysis_scheme {
params.put(&format!("{}{}", prefix, "AnalysisScheme"), &field_value);
}
if let Some(ref field_value) = obj.default_value {
params.put(&format!("{}{}", prefix, "DefaultValue"), &field_value);
}
if let Some(ref field_value) = obj.highlight_enabled {
params.put(&format!("{}{}", prefix, "HighlightEnabled"), &field_value);
}
if let Some(ref field_value) = obj.return_enabled {
params.put(&format!("{}{}", prefix, "ReturnEnabled"), &field_value);
}
if let Some(ref field_value) = obj.sort_enabled {
params.put(&format!("{}{}", prefix, "SortEnabled"), &field_value);
}
if let Some(ref field_value) = obj.source_field {
params.put(&format!("{}{}", prefix, "SourceField"), &field_value);
}
}
}
struct UIntValueDeserializer;
impl UIntValueDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateAvailabilityOptionsRequest {
pub domain_name: String,
pub multi_az: bool,
}
struct UpdateAvailabilityOptionsRequestSerializer;
impl UpdateAvailabilityOptionsRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &UpdateAvailabilityOptionsRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
params.put(&format!("{}{}", prefix, "MultiAZ"), &obj.multi_az);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateAvailabilityOptionsResponse {
pub availability_options: Option<AvailabilityOptionsStatus>,
}
struct UpdateAvailabilityOptionsResponseDeserializer;
impl UpdateAvailabilityOptionsResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateAvailabilityOptionsResponse, XmlParseError> {
deserialize_elements::<_, UpdateAvailabilityOptionsResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AvailabilityOptions" => {
obj.availability_options =
Some(AvailabilityOptionsStatusDeserializer::deserialize(
"AvailabilityOptions",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateScalingParametersRequest {
pub domain_name: String,
pub scaling_parameters: ScalingParameters,
}
struct UpdateScalingParametersRequestSerializer;
impl UpdateScalingParametersRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &UpdateScalingParametersRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
ScalingParametersSerializer::serialize(
params,
&format!("{}{}", prefix, "ScalingParameters"),
&obj.scaling_parameters,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateScalingParametersResponse {
pub scaling_parameters: ScalingParametersStatus,
}
struct UpdateScalingParametersResponseDeserializer;
impl UpdateScalingParametersResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateScalingParametersResponse, XmlParseError> {
deserialize_elements::<_, UpdateScalingParametersResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ScalingParameters" => {
obj.scaling_parameters = ScalingParametersStatusDeserializer::deserialize(
"ScalingParameters",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateServiceAccessPoliciesRequest {
pub access_policies: String,
pub domain_name: String,
}
struct UpdateServiceAccessPoliciesRequestSerializer;
impl UpdateServiceAccessPoliciesRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &UpdateServiceAccessPoliciesRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AccessPolicies"),
&obj.access_policies,
);
params.put(&format!("{}{}", prefix, "DomainName"), &obj.domain_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateServiceAccessPoliciesResponse {
pub access_policies: AccessPoliciesStatus,
}
struct UpdateServiceAccessPoliciesResponseDeserializer;
impl UpdateServiceAccessPoliciesResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateServiceAccessPoliciesResponse, XmlParseError> {
deserialize_elements::<_, UpdateServiceAccessPoliciesResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AccessPolicies" => {
obj.access_policies =
AccessPoliciesStatusDeserializer::deserialize("AccessPolicies", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct UpdateTimestampDeserializer;
impl UpdateTimestampDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
struct WordDeserializer;
impl WordDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Debug, PartialEq)]
pub enum BuildSuggestersError {
Base(String),
Internal(String),
ResourceNotFound(String),
}
impl BuildSuggestersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BuildSuggestersError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(BuildSuggestersError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(BuildSuggestersError::Internal(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(BuildSuggestersError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for BuildSuggestersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BuildSuggestersError {
fn description(&self) -> &str {
match *self {
BuildSuggestersError::Base(ref cause) => cause,
BuildSuggestersError::Internal(ref cause) => cause,
BuildSuggestersError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDomainError {
Base(String),
Internal(String),
LimitExceeded(String),
}
impl CreateDomainError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDomainError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(CreateDomainError::Base(parsed_error.message))
}
"InternalException" => {
return RusotoError::Service(CreateDomainError::Internal(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(CreateDomainError::LimitExceeded(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for CreateDomainError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDomainError {
fn description(&self) -> &str {
match *self {
CreateDomainError::Base(ref cause) => cause,
CreateDomainError::Internal(ref cause) => cause,
CreateDomainError::LimitExceeded(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DefineAnalysisSchemeError {
Base(String),
Internal(String),
InvalidType(String),
LimitExceeded(String),
ResourceNotFound(String),
}
impl DefineAnalysisSchemeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DefineAnalysisSchemeError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DefineAnalysisSchemeError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DefineAnalysisSchemeError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DefineAnalysisSchemeError::InvalidType(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(DefineAnalysisSchemeError::LimitExceeded(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DefineAnalysisSchemeError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DefineAnalysisSchemeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DefineAnalysisSchemeError {
fn description(&self) -> &str {
match *self {
DefineAnalysisSchemeError::Base(ref cause) => cause,
DefineAnalysisSchemeError::Internal(ref cause) => cause,
DefineAnalysisSchemeError::InvalidType(ref cause) => cause,
DefineAnalysisSchemeError::LimitExceeded(ref cause) => cause,
DefineAnalysisSchemeError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DefineExpressionError {
Base(String),
Internal(String),
InvalidType(String),
LimitExceeded(String),
ResourceNotFound(String),
}
impl DefineExpressionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DefineExpressionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DefineExpressionError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DefineExpressionError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DefineExpressionError::InvalidType(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(DefineExpressionError::LimitExceeded(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DefineExpressionError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DefineExpressionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DefineExpressionError {
fn description(&self) -> &str {
match *self {
DefineExpressionError::Base(ref cause) => cause,
DefineExpressionError::Internal(ref cause) => cause,
DefineExpressionError::InvalidType(ref cause) => cause,
DefineExpressionError::LimitExceeded(ref cause) => cause,
DefineExpressionError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DefineIndexFieldError {
Base(String),
Internal(String),
InvalidType(String),
LimitExceeded(String),
ResourceNotFound(String),
}
impl DefineIndexFieldError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DefineIndexFieldError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DefineIndexFieldError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DefineIndexFieldError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DefineIndexFieldError::InvalidType(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(DefineIndexFieldError::LimitExceeded(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DefineIndexFieldError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DefineIndexFieldError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DefineIndexFieldError {
fn description(&self) -> &str {
match *self {
DefineIndexFieldError::Base(ref cause) => cause,
DefineIndexFieldError::Internal(ref cause) => cause,
DefineIndexFieldError::InvalidType(ref cause) => cause,
DefineIndexFieldError::LimitExceeded(ref cause) => cause,
DefineIndexFieldError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DefineSuggesterError {
Base(String),
Internal(String),
InvalidType(String),
LimitExceeded(String),
ResourceNotFound(String),
}
impl DefineSuggesterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DefineSuggesterError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DefineSuggesterError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DefineSuggesterError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DefineSuggesterError::InvalidType(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(DefineSuggesterError::LimitExceeded(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DefineSuggesterError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DefineSuggesterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DefineSuggesterError {
fn description(&self) -> &str {
match *self {
DefineSuggesterError::Base(ref cause) => cause,
DefineSuggesterError::Internal(ref cause) => cause,
DefineSuggesterError::InvalidType(ref cause) => cause,
DefineSuggesterError::LimitExceeded(ref cause) => cause,
DefineSuggesterError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAnalysisSchemeError {
Base(String),
Internal(String),
InvalidType(String),
ResourceNotFound(String),
}
impl DeleteAnalysisSchemeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAnalysisSchemeError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DeleteAnalysisSchemeError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DeleteAnalysisSchemeError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DeleteAnalysisSchemeError::InvalidType(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DeleteAnalysisSchemeError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteAnalysisSchemeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAnalysisSchemeError {
fn description(&self) -> &str {
match *self {
DeleteAnalysisSchemeError::Base(ref cause) => cause,
DeleteAnalysisSchemeError::Internal(ref cause) => cause,
DeleteAnalysisSchemeError::InvalidType(ref cause) => cause,
DeleteAnalysisSchemeError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDomainError {
Base(String),
Internal(String),
}
impl DeleteDomainError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDomainError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DeleteDomainError::Base(parsed_error.message))
}
"InternalException" => {
return RusotoError::Service(DeleteDomainError::Internal(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteDomainError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDomainError {
fn description(&self) -> &str {
match *self {
DeleteDomainError::Base(ref cause) => cause,
DeleteDomainError::Internal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteExpressionError {
Base(String),
Internal(String),
InvalidType(String),
ResourceNotFound(String),
}
impl DeleteExpressionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteExpressionError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DeleteExpressionError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DeleteExpressionError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DeleteExpressionError::InvalidType(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DeleteExpressionError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteExpressionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteExpressionError {
fn description(&self) -> &str {
match *self {
DeleteExpressionError::Base(ref cause) => cause,
DeleteExpressionError::Internal(ref cause) => cause,
DeleteExpressionError::InvalidType(ref cause) => cause,
DeleteExpressionError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteIndexFieldError {
Base(String),
Internal(String),
InvalidType(String),
ResourceNotFound(String),
}
impl DeleteIndexFieldError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteIndexFieldError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DeleteIndexFieldError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DeleteIndexFieldError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DeleteIndexFieldError::InvalidType(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DeleteIndexFieldError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteIndexFieldError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteIndexFieldError {
fn description(&self) -> &str {
match *self {
DeleteIndexFieldError::Base(ref cause) => cause,
DeleteIndexFieldError::Internal(ref cause) => cause,
DeleteIndexFieldError::InvalidType(ref cause) => cause,
DeleteIndexFieldError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteSuggesterError {
Base(String),
Internal(String),
InvalidType(String),
ResourceNotFound(String),
}
impl DeleteSuggesterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSuggesterError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DeleteSuggesterError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DeleteSuggesterError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DeleteSuggesterError::InvalidType(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DeleteSuggesterError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DeleteSuggesterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteSuggesterError {
fn description(&self) -> &str {
match *self {
DeleteSuggesterError::Base(ref cause) => cause,
DeleteSuggesterError::Internal(ref cause) => cause,
DeleteSuggesterError::InvalidType(ref cause) => cause,
DeleteSuggesterError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAnalysisSchemesError {
Base(String),
Internal(String),
ResourceNotFound(String),
}
impl DescribeAnalysisSchemesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAnalysisSchemesError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DescribeAnalysisSchemesError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DescribeAnalysisSchemesError::Internal(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(
DescribeAnalysisSchemesError::ResourceNotFound(parsed_error.message),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DescribeAnalysisSchemesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAnalysisSchemesError {
fn description(&self) -> &str {
match *self {
DescribeAnalysisSchemesError::Base(ref cause) => cause,
DescribeAnalysisSchemesError::Internal(ref cause) => cause,
DescribeAnalysisSchemesError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAvailabilityOptionsError {
Base(String),
DisabledOperation(String),
Internal(String),
InvalidType(String),
LimitExceeded(String),
ResourceNotFound(String),
}
impl DescribeAvailabilityOptionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeAvailabilityOptionsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DescribeAvailabilityOptionsError::Base(
parsed_error.message,
))
}
"DisabledAction" => {
return RusotoError::Service(
DescribeAvailabilityOptionsError::DisabledOperation(
parsed_error.message,
),
)
}
"InternalException" => {
return RusotoError::Service(DescribeAvailabilityOptionsError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(DescribeAvailabilityOptionsError::InvalidType(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(
DescribeAvailabilityOptionsError::LimitExceeded(parsed_error.message),
)
}
"ResourceNotFound" => {
return RusotoError::Service(
DescribeAvailabilityOptionsError::ResourceNotFound(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DescribeAvailabilityOptionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAvailabilityOptionsError {
fn description(&self) -> &str {
match *self {
DescribeAvailabilityOptionsError::Base(ref cause) => cause,
DescribeAvailabilityOptionsError::DisabledOperation(ref cause) => cause,
DescribeAvailabilityOptionsError::Internal(ref cause) => cause,
DescribeAvailabilityOptionsError::InvalidType(ref cause) => cause,
DescribeAvailabilityOptionsError::LimitExceeded(ref cause) => cause,
DescribeAvailabilityOptionsError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeDomainsError {
Base(String),
Internal(String),
}
impl DescribeDomainsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDomainsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DescribeDomainsError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DescribeDomainsError::Internal(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DescribeDomainsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDomainsError {
fn description(&self) -> &str {
match *self {
DescribeDomainsError::Base(ref cause) => cause,
DescribeDomainsError::Internal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeExpressionsError {
Base(String),
Internal(String),
ResourceNotFound(String),
}
impl DescribeExpressionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeExpressionsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DescribeExpressionsError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DescribeExpressionsError::Internal(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DescribeExpressionsError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DescribeExpressionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeExpressionsError {
fn description(&self) -> &str {
match *self {
DescribeExpressionsError::Base(ref cause) => cause,
DescribeExpressionsError::Internal(ref cause) => cause,
DescribeExpressionsError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeIndexFieldsError {
Base(String),
Internal(String),
ResourceNotFound(String),
}
impl DescribeIndexFieldsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeIndexFieldsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DescribeIndexFieldsError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DescribeIndexFieldsError::Internal(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DescribeIndexFieldsError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DescribeIndexFieldsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeIndexFieldsError {
fn description(&self) -> &str {
match *self {
DescribeIndexFieldsError::Base(ref cause) => cause,
DescribeIndexFieldsError::Internal(ref cause) => cause,
DescribeIndexFieldsError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeScalingParametersError {
Base(String),
Internal(String),
ResourceNotFound(String),
}
impl DescribeScalingParametersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeScalingParametersError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DescribeScalingParametersError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DescribeScalingParametersError::Internal(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(
DescribeScalingParametersError::ResourceNotFound(parsed_error.message),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DescribeScalingParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeScalingParametersError {
fn description(&self) -> &str {
match *self {
DescribeScalingParametersError::Base(ref cause) => cause,
DescribeScalingParametersError::Internal(ref cause) => cause,
DescribeScalingParametersError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeServiceAccessPoliciesError {
Base(String),
Internal(String),
ResourceNotFound(String),
}
impl DescribeServiceAccessPoliciesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeServiceAccessPoliciesError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DescribeServiceAccessPoliciesError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DescribeServiceAccessPoliciesError::Internal(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(
DescribeServiceAccessPoliciesError::ResourceNotFound(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DescribeServiceAccessPoliciesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeServiceAccessPoliciesError {
fn description(&self) -> &str {
match *self {
DescribeServiceAccessPoliciesError::Base(ref cause) => cause,
DescribeServiceAccessPoliciesError::Internal(ref cause) => cause,
DescribeServiceAccessPoliciesError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSuggestersError {
Base(String),
Internal(String),
ResourceNotFound(String),
}
impl DescribeSuggestersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeSuggestersError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(DescribeSuggestersError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(DescribeSuggestersError::Internal(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(DescribeSuggestersError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for DescribeSuggestersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSuggestersError {
fn description(&self) -> &str {
match *self {
DescribeSuggestersError::Base(ref cause) => cause,
DescribeSuggestersError::Internal(ref cause) => cause,
DescribeSuggestersError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum IndexDocumentsError {
Base(String),
Internal(String),
ResourceNotFound(String),
}
impl IndexDocumentsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<IndexDocumentsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(IndexDocumentsError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(IndexDocumentsError::Internal(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(IndexDocumentsError::ResourceNotFound(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for IndexDocumentsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for IndexDocumentsError {
fn description(&self) -> &str {
match *self {
IndexDocumentsError::Base(ref cause) => cause,
IndexDocumentsError::Internal(ref cause) => cause,
IndexDocumentsError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDomainNamesError {
Base(String),
}
impl ListDomainNamesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDomainNamesError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(ListDomainNamesError::Base(
parsed_error.message,
))
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for ListDomainNamesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDomainNamesError {
fn description(&self) -> &str {
match *self {
ListDomainNamesError::Base(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateAvailabilityOptionsError {
Base(String),
DisabledOperation(String),
Internal(String),
InvalidType(String),
LimitExceeded(String),
ResourceNotFound(String),
}
impl UpdateAvailabilityOptionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAvailabilityOptionsError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(UpdateAvailabilityOptionsError::Base(
parsed_error.message,
))
}
"DisabledAction" => {
return RusotoError::Service(
UpdateAvailabilityOptionsError::DisabledOperation(parsed_error.message),
)
}
"InternalException" => {
return RusotoError::Service(UpdateAvailabilityOptionsError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(UpdateAvailabilityOptionsError::InvalidType(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(UpdateAvailabilityOptionsError::LimitExceeded(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(
UpdateAvailabilityOptionsError::ResourceNotFound(parsed_error.message),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdateAvailabilityOptionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateAvailabilityOptionsError {
fn description(&self) -> &str {
match *self {
UpdateAvailabilityOptionsError::Base(ref cause) => cause,
UpdateAvailabilityOptionsError::DisabledOperation(ref cause) => cause,
UpdateAvailabilityOptionsError::Internal(ref cause) => cause,
UpdateAvailabilityOptionsError::InvalidType(ref cause) => cause,
UpdateAvailabilityOptionsError::LimitExceeded(ref cause) => cause,
UpdateAvailabilityOptionsError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateScalingParametersError {
Base(String),
Internal(String),
InvalidType(String),
LimitExceeded(String),
ResourceNotFound(String),
}
impl UpdateScalingParametersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateScalingParametersError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(UpdateScalingParametersError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(UpdateScalingParametersError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(UpdateScalingParametersError::InvalidType(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(UpdateScalingParametersError::LimitExceeded(
parsed_error.message,
))
}
"ResourceNotFound" => {
return RusotoError::Service(
UpdateScalingParametersError::ResourceNotFound(parsed_error.message),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdateScalingParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateScalingParametersError {
fn description(&self) -> &str {
match *self {
UpdateScalingParametersError::Base(ref cause) => cause,
UpdateScalingParametersError::Internal(ref cause) => cause,
UpdateScalingParametersError::InvalidType(ref cause) => cause,
UpdateScalingParametersError::LimitExceeded(ref cause) => cause,
UpdateScalingParametersError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateServiceAccessPoliciesError {
Base(String),
Internal(String),
InvalidType(String),
LimitExceeded(String),
ResourceNotFound(String),
}
impl UpdateServiceAccessPoliciesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateServiceAccessPoliciesError> {
{
let reader = EventReader::new(res.body.as_ref());
let mut stack = XmlResponse::new(reader.into_iter().peekable());
find_start_element(&mut stack);
if let Ok(parsed_error) = Self::deserialize(&mut stack) {
match &parsed_error.code[..] {
"BaseException" => {
return RusotoError::Service(UpdateServiceAccessPoliciesError::Base(
parsed_error.message,
))
}
"InternalException" => {
return RusotoError::Service(UpdateServiceAccessPoliciesError::Internal(
parsed_error.message,
))
}
"InvalidType" => {
return RusotoError::Service(UpdateServiceAccessPoliciesError::InvalidType(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(
UpdateServiceAccessPoliciesError::LimitExceeded(parsed_error.message),
)
}
"ResourceNotFound" => {
return RusotoError::Service(
UpdateServiceAccessPoliciesError::ResourceNotFound(
parsed_error.message,
),
)
}
_ => {}
}
}
}
RusotoError::Unknown(res)
}
fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
where
T: Peek + Next,
{
start_element("ErrorResponse", stack)?;
XmlErrorDeserializer::deserialize("Error", stack)
}
}
impl fmt::Display for UpdateServiceAccessPoliciesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateServiceAccessPoliciesError {
fn description(&self) -> &str {
match *self {
UpdateServiceAccessPoliciesError::Base(ref cause) => cause,
UpdateServiceAccessPoliciesError::Internal(ref cause) => cause,
UpdateServiceAccessPoliciesError::InvalidType(ref cause) => cause,
UpdateServiceAccessPoliciesError::LimitExceeded(ref cause) => cause,
UpdateServiceAccessPoliciesError::ResourceNotFound(ref cause) => cause,
}
}
}
pub trait CloudSearch {
fn build_suggesters(
&self,
input: BuildSuggestersRequest,
) -> RusotoFuture<BuildSuggestersResponse, BuildSuggestersError>;
fn create_domain(
&self,
input: CreateDomainRequest,
) -> RusotoFuture<CreateDomainResponse, CreateDomainError>;
fn define_analysis_scheme(
&self,
input: DefineAnalysisSchemeRequest,
) -> RusotoFuture<DefineAnalysisSchemeResponse, DefineAnalysisSchemeError>;
fn define_expression(
&self,
input: DefineExpressionRequest,
) -> RusotoFuture<DefineExpressionResponse, DefineExpressionError>;
fn define_index_field(
&self,
input: DefineIndexFieldRequest,
) -> RusotoFuture<DefineIndexFieldResponse, DefineIndexFieldError>;
fn define_suggester(
&self,
input: DefineSuggesterRequest,
) -> RusotoFuture<DefineSuggesterResponse, DefineSuggesterError>;
fn delete_analysis_scheme(
&self,
input: DeleteAnalysisSchemeRequest,
) -> RusotoFuture<DeleteAnalysisSchemeResponse, DeleteAnalysisSchemeError>;
fn delete_domain(
&self,
input: DeleteDomainRequest,
) -> RusotoFuture<DeleteDomainResponse, DeleteDomainError>;
fn delete_expression(
&self,
input: DeleteExpressionRequest,
) -> RusotoFuture<DeleteExpressionResponse, DeleteExpressionError>;
fn delete_index_field(
&self,
input: DeleteIndexFieldRequest,
) -> RusotoFuture<DeleteIndexFieldResponse, DeleteIndexFieldError>;
fn delete_suggester(
&self,
input: DeleteSuggesterRequest,
) -> RusotoFuture<DeleteSuggesterResponse, DeleteSuggesterError>;
fn describe_analysis_schemes(
&self,
input: DescribeAnalysisSchemesRequest,
) -> RusotoFuture<DescribeAnalysisSchemesResponse, DescribeAnalysisSchemesError>;
fn describe_availability_options(
&self,
input: DescribeAvailabilityOptionsRequest,
) -> RusotoFuture<DescribeAvailabilityOptionsResponse, DescribeAvailabilityOptionsError>;
fn describe_domains(
&self,
input: DescribeDomainsRequest,
) -> RusotoFuture<DescribeDomainsResponse, DescribeDomainsError>;
fn describe_expressions(
&self,
input: DescribeExpressionsRequest,
) -> RusotoFuture<DescribeExpressionsResponse, DescribeExpressionsError>;
fn describe_index_fields(
&self,
input: DescribeIndexFieldsRequest,
) -> RusotoFuture<DescribeIndexFieldsResponse, DescribeIndexFieldsError>;
fn describe_scaling_parameters(
&self,
input: DescribeScalingParametersRequest,
) -> RusotoFuture<DescribeScalingParametersResponse, DescribeScalingParametersError>;
fn describe_service_access_policies(
&self,
input: DescribeServiceAccessPoliciesRequest,
) -> RusotoFuture<DescribeServiceAccessPoliciesResponse, DescribeServiceAccessPoliciesError>;
fn describe_suggesters(
&self,
input: DescribeSuggestersRequest,
) -> RusotoFuture<DescribeSuggestersResponse, DescribeSuggestersError>;
fn index_documents(
&self,
input: IndexDocumentsRequest,
) -> RusotoFuture<IndexDocumentsResponse, IndexDocumentsError>;
fn list_domain_names(&self) -> RusotoFuture<ListDomainNamesResponse, ListDomainNamesError>;
fn update_availability_options(
&self,
input: UpdateAvailabilityOptionsRequest,
) -> RusotoFuture<UpdateAvailabilityOptionsResponse, UpdateAvailabilityOptionsError>;
fn update_scaling_parameters(
&self,
input: UpdateScalingParametersRequest,
) -> RusotoFuture<UpdateScalingParametersResponse, UpdateScalingParametersError>;
fn update_service_access_policies(
&self,
input: UpdateServiceAccessPoliciesRequest,
) -> RusotoFuture<UpdateServiceAccessPoliciesResponse, UpdateServiceAccessPoliciesError>;
}
#[derive(Clone)]
pub struct CloudSearchClient {
client: Client,
region: region::Region,
}
impl CloudSearchClient {
pub fn new(region: region::Region) -> CloudSearchClient {
CloudSearchClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> CloudSearchClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
CloudSearchClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl CloudSearch for CloudSearchClient {
fn build_suggesters(
&self,
input: BuildSuggestersRequest,
) -> RusotoFuture<BuildSuggestersResponse, BuildSuggestersError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "BuildSuggesters");
params.put("Version", "2013-01-01");
BuildSuggestersRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(BuildSuggestersError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = BuildSuggestersResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = BuildSuggestersResponseDeserializer::deserialize(
"BuildSuggestersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn create_domain(
&self,
input: CreateDomainRequest,
) -> RusotoFuture<CreateDomainResponse, CreateDomainError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateDomain");
params.put("Version", "2013-01-01");
CreateDomainRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDomainError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CreateDomainResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = CreateDomainResponseDeserializer::deserialize(
"CreateDomainResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn define_analysis_scheme(
&self,
input: DefineAnalysisSchemeRequest,
) -> RusotoFuture<DefineAnalysisSchemeResponse, DefineAnalysisSchemeError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DefineAnalysisScheme");
params.put("Version", "2013-01-01");
DefineAnalysisSchemeRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response.buffer().from_err().and_then(|response| {
Err(DefineAnalysisSchemeError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DefineAnalysisSchemeResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DefineAnalysisSchemeResponseDeserializer::deserialize(
"DefineAnalysisSchemeResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn define_expression(
&self,
input: DefineExpressionRequest,
) -> RusotoFuture<DefineExpressionResponse, DefineExpressionError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DefineExpression");
params.put("Version", "2013-01-01");
DefineExpressionRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DefineExpressionError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DefineExpressionResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DefineExpressionResponseDeserializer::deserialize(
"DefineExpressionResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn define_index_field(
&self,
input: DefineIndexFieldRequest,
) -> RusotoFuture<DefineIndexFieldResponse, DefineIndexFieldError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DefineIndexField");
params.put("Version", "2013-01-01");
DefineIndexFieldRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DefineIndexFieldError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DefineIndexFieldResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DefineIndexFieldResponseDeserializer::deserialize(
"DefineIndexFieldResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn define_suggester(
&self,
input: DefineSuggesterRequest,
) -> RusotoFuture<DefineSuggesterResponse, DefineSuggesterError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DefineSuggester");
params.put("Version", "2013-01-01");
DefineSuggesterRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DefineSuggesterError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DefineSuggesterResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DefineSuggesterResponseDeserializer::deserialize(
"DefineSuggesterResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_analysis_scheme(
&self,
input: DeleteAnalysisSchemeRequest,
) -> RusotoFuture<DeleteAnalysisSchemeResponse, DeleteAnalysisSchemeError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteAnalysisScheme");
params.put("Version", "2013-01-01");
DeleteAnalysisSchemeRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteAnalysisSchemeError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteAnalysisSchemeResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DeleteAnalysisSchemeResponseDeserializer::deserialize(
"DeleteAnalysisSchemeResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_domain(
&self,
input: DeleteDomainRequest,
) -> RusotoFuture<DeleteDomainResponse, DeleteDomainError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteDomain");
params.put("Version", "2013-01-01");
DeleteDomainRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDomainError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteDomainResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DeleteDomainResponseDeserializer::deserialize(
"DeleteDomainResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_expression(
&self,
input: DeleteExpressionRequest,
) -> RusotoFuture<DeleteExpressionResponse, DeleteExpressionError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteExpression");
params.put("Version", "2013-01-01");
DeleteExpressionRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteExpressionError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteExpressionResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DeleteExpressionResponseDeserializer::deserialize(
"DeleteExpressionResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_index_field(
&self,
input: DeleteIndexFieldRequest,
) -> RusotoFuture<DeleteIndexFieldResponse, DeleteIndexFieldError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteIndexField");
params.put("Version", "2013-01-01");
DeleteIndexFieldRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteIndexFieldError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteIndexFieldResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DeleteIndexFieldResponseDeserializer::deserialize(
"DeleteIndexFieldResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_suggester(
&self,
input: DeleteSuggesterRequest,
) -> RusotoFuture<DeleteSuggesterResponse, DeleteSuggesterError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteSuggester");
params.put("Version", "2013-01-01");
DeleteSuggesterRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteSuggesterError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteSuggesterResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DeleteSuggesterResponseDeserializer::deserialize(
"DeleteSuggesterResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_analysis_schemes(
&self,
input: DescribeAnalysisSchemesRequest,
) -> RusotoFuture<DescribeAnalysisSchemesResponse, DescribeAnalysisSchemesError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeAnalysisSchemes");
params.put("Version", "2013-01-01");
DescribeAnalysisSchemesRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAnalysisSchemesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeAnalysisSchemesResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DescribeAnalysisSchemesResponseDeserializer::deserialize(
"DescribeAnalysisSchemesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_availability_options(
&self,
input: DescribeAvailabilityOptionsRequest,
) -> RusotoFuture<DescribeAvailabilityOptionsResponse, DescribeAvailabilityOptionsError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeAvailabilityOptions");
params.put("Version", "2013-01-01");
DescribeAvailabilityOptionsRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAvailabilityOptionsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeAvailabilityOptionsResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DescribeAvailabilityOptionsResponseDeserializer::deserialize(
"DescribeAvailabilityOptionsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_domains(
&self,
input: DescribeDomainsRequest,
) -> RusotoFuture<DescribeDomainsResponse, DescribeDomainsError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeDomains");
params.put("Version", "2013-01-01");
DescribeDomainsRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeDomainsError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeDomainsResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DescribeDomainsResponseDeserializer::deserialize(
"DescribeDomainsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_expressions(
&self,
input: DescribeExpressionsRequest,
) -> RusotoFuture<DescribeExpressionsResponse, DescribeExpressionsError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeExpressions");
params.put("Version", "2013-01-01");
DescribeExpressionsRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeExpressionsError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeExpressionsResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DescribeExpressionsResponseDeserializer::deserialize(
"DescribeExpressionsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_index_fields(
&self,
input: DescribeIndexFieldsRequest,
) -> RusotoFuture<DescribeIndexFieldsResponse, DescribeIndexFieldsError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeIndexFields");
params.put("Version", "2013-01-01");
DescribeIndexFieldsRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeIndexFieldsError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeIndexFieldsResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DescribeIndexFieldsResponseDeserializer::deserialize(
"DescribeIndexFieldsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_scaling_parameters(
&self,
input: DescribeScalingParametersRequest,
) -> RusotoFuture<DescribeScalingParametersResponse, DescribeScalingParametersError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeScalingParameters");
params.put("Version", "2013-01-01");
DescribeScalingParametersRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeScalingParametersError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeScalingParametersResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DescribeScalingParametersResponseDeserializer::deserialize(
"DescribeScalingParametersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_service_access_policies(
&self,
input: DescribeServiceAccessPoliciesRequest,
) -> RusotoFuture<DescribeServiceAccessPoliciesResponse, DescribeServiceAccessPoliciesError>
{
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeServiceAccessPolicies");
params.put("Version", "2013-01-01");
DescribeServiceAccessPoliciesRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeServiceAccessPoliciesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeServiceAccessPoliciesResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DescribeServiceAccessPoliciesResponseDeserializer::deserialize(
"DescribeServiceAccessPoliciesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_suggesters(
&self,
input: DescribeSuggestersRequest,
) -> RusotoFuture<DescribeSuggestersResponse, DescribeSuggestersError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeSuggesters");
params.put("Version", "2013-01-01");
DescribeSuggestersRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeSuggestersError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeSuggestersResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = DescribeSuggestersResponseDeserializer::deserialize(
"DescribeSuggestersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn index_documents(
&self,
input: IndexDocumentsRequest,
) -> RusotoFuture<IndexDocumentsResponse, IndexDocumentsError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "IndexDocuments");
params.put("Version", "2013-01-01");
IndexDocumentsRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(IndexDocumentsError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = IndexDocumentsResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = IndexDocumentsResponseDeserializer::deserialize(
"IndexDocumentsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn list_domain_names(&self) -> RusotoFuture<ListDomainNamesResponse, ListDomainNamesError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ListDomainNames");
params.put("Version", "2013-01-01");
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListDomainNamesError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ListDomainNamesResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = ListDomainNamesResponseDeserializer::deserialize(
"ListDomainNamesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn update_availability_options(
&self,
input: UpdateAvailabilityOptionsRequest,
) -> RusotoFuture<UpdateAvailabilityOptionsResponse, UpdateAvailabilityOptionsError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "UpdateAvailabilityOptions");
params.put("Version", "2013-01-01");
UpdateAvailabilityOptionsRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateAvailabilityOptionsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = UpdateAvailabilityOptionsResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = UpdateAvailabilityOptionsResponseDeserializer::deserialize(
"UpdateAvailabilityOptionsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn update_scaling_parameters(
&self,
input: UpdateScalingParametersRequest,
) -> RusotoFuture<UpdateScalingParametersResponse, UpdateScalingParametersError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "UpdateScalingParameters");
params.put("Version", "2013-01-01");
UpdateScalingParametersRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateScalingParametersError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = UpdateScalingParametersResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = UpdateScalingParametersResponseDeserializer::deserialize(
"UpdateScalingParametersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn update_service_access_policies(
&self,
input: UpdateServiceAccessPoliciesRequest,
) -> RusotoFuture<UpdateServiceAccessPoliciesResponse, UpdateServiceAccessPoliciesError> {
let mut request = SignedRequest::new("POST", "cloudsearch", &self.region, "/");
let mut params = Params::new();
params.put("Action", "UpdateServiceAccessPolicies");
params.put("Version", "2013-01-01");
UpdateServiceAccessPoliciesRequestSerializer::serialize(&mut params, "", &input);
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateServiceAccessPoliciesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = UpdateServiceAccessPoliciesResponse::default();
} else {
let reader = EventReader::new_with_config(
response.body.as_ref(),
ParserConfig::new().trim_whitespace(true),
);
let mut stack = XmlResponse::new(reader.into_iter().peekable());
let _start_document = stack.next();
let actual_tag_name = peek_at_name(&mut stack)?;
start_element(&actual_tag_name, &mut stack)?;
result = UpdateServiceAccessPoliciesResponseDeserializer::deserialize(
"UpdateServiceAccessPoliciesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
}