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;
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AddTagsToResourceMessage {
pub resource_name: String,
pub tags: Vec<Tag>,
}
struct AddTagsToResourceMessageSerializer;
impl AddTagsToResourceMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &AddTagsToResourceMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "ResourceName"), &obj.resource_name);
TagListSerializer::serialize(params, &format!("{}{}", prefix, "Tag"), &obj.tags);
}
}
struct AllowedNodeGroupIdDeserializer;
impl AllowedNodeGroupIdDeserializer {
#[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 AllowedNodeTypeModificationsMessage {
pub scale_up_modifications: Option<Vec<String>>,
}
struct AllowedNodeTypeModificationsMessageDeserializer;
impl AllowedNodeTypeModificationsMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AllowedNodeTypeModificationsMessage, XmlParseError> {
deserialize_elements::<_, AllowedNodeTypeModificationsMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ScaleUpModifications" => {
obj.scale_up_modifications.get_or_insert(vec![]).extend(
NodeTypeListDeserializer::deserialize("ScaleUpModifications", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AuthorizeCacheSecurityGroupIngressMessage {
pub cache_security_group_name: String,
pub ec2_security_group_name: String,
pub ec2_security_group_owner_id: String,
}
struct AuthorizeCacheSecurityGroupIngressMessageSerializer;
impl AuthorizeCacheSecurityGroupIngressMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &AuthorizeCacheSecurityGroupIngressMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheSecurityGroupName"),
&obj.cache_security_group_name,
);
params.put(
&format!("{}{}", prefix, "EC2SecurityGroupName"),
&obj.ec2_security_group_name,
);
params.put(
&format!("{}{}", prefix, "EC2SecurityGroupOwnerId"),
&obj.ec2_security_group_owner_id,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AuthorizeCacheSecurityGroupIngressResult {
pub cache_security_group: Option<CacheSecurityGroup>,
}
struct AuthorizeCacheSecurityGroupIngressResultDeserializer;
impl AuthorizeCacheSecurityGroupIngressResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AuthorizeCacheSecurityGroupIngressResult, XmlParseError> {
deserialize_elements::<_, AuthorizeCacheSecurityGroupIngressResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheSecurityGroup" => {
obj.cache_security_group =
Some(CacheSecurityGroupDeserializer::deserialize(
"CacheSecurityGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct AutomaticFailoverStatusDeserializer;
impl AutomaticFailoverStatusDeserializer {
#[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 AvailabilityZone {
pub name: Option<String>,
}
struct AvailabilityZoneDeserializer;
impl AvailabilityZoneDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AvailabilityZone, XmlParseError> {
deserialize_elements::<_, AvailabilityZone, _>(tag_name, stack, |name, stack, obj| {
match name {
"Name" => {
obj.name = Some(StringDeserializer::deserialize("Name", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AvailabilityZonesListDeserializer;
impl AvailabilityZonesListDeserializer {
#[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 == "AvailabilityZone" {
obj.push(StringDeserializer::deserialize("AvailabilityZone", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct AvailabilityZonesListSerializer;
impl AvailabilityZonesListSerializer {
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 BatchApplyUpdateActionMessage {
pub replication_group_ids: Vec<String>,
pub service_update_name: String,
}
struct BatchApplyUpdateActionMessageSerializer;
impl BatchApplyUpdateActionMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &BatchApplyUpdateActionMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
ReplicationGroupIdListSerializer::serialize(
params,
&format!("{}{}", prefix, "ReplicationGroupIds"),
&obj.replication_group_ids,
);
params.put(
&format!("{}{}", prefix, "ServiceUpdateName"),
&obj.service_update_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct BatchStopUpdateActionMessage {
pub replication_group_ids: Vec<String>,
pub service_update_name: String,
}
struct BatchStopUpdateActionMessageSerializer;
impl BatchStopUpdateActionMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &BatchStopUpdateActionMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
ReplicationGroupIdListSerializer::serialize(
params,
&format!("{}{}", prefix, "ReplicationGroupIds"),
&obj.replication_group_ids,
);
params.put(
&format!("{}{}", prefix, "ServiceUpdateName"),
&obj.service_update_name,
);
}
}
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)
}
}
struct BooleanOptionalDeserializer;
impl BooleanOptionalDeserializer {
#[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 CacheCluster {
pub at_rest_encryption_enabled: Option<bool>,
pub auth_token_enabled: Option<bool>,
pub auto_minor_version_upgrade: Option<bool>,
pub cache_cluster_create_time: Option<String>,
pub cache_cluster_id: Option<String>,
pub cache_cluster_status: Option<String>,
pub cache_node_type: Option<String>,
pub cache_nodes: Option<Vec<CacheNode>>,
pub cache_parameter_group: Option<CacheParameterGroupStatus>,
pub cache_security_groups: Option<Vec<CacheSecurityGroupMembership>>,
pub cache_subnet_group_name: Option<String>,
pub client_download_landing_page: Option<String>,
pub configuration_endpoint: Option<Endpoint>,
pub engine: Option<String>,
pub engine_version: Option<String>,
pub notification_configuration: Option<NotificationConfiguration>,
pub num_cache_nodes: Option<i64>,
pub pending_modified_values: Option<PendingModifiedValues>,
pub preferred_availability_zone: Option<String>,
pub preferred_maintenance_window: Option<String>,
pub replication_group_id: Option<String>,
pub security_groups: Option<Vec<SecurityGroupMembership>>,
pub snapshot_retention_limit: Option<i64>,
pub snapshot_window: Option<String>,
pub transit_encryption_enabled: Option<bool>,
}
struct CacheClusterDeserializer;
impl CacheClusterDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheCluster, XmlParseError> {
deserialize_elements::<_, CacheCluster, _>(tag_name, stack, |name, stack, obj| {
match name {
"AtRestEncryptionEnabled" => {
obj.at_rest_encryption_enabled = Some(
BooleanOptionalDeserializer::deserialize("AtRestEncryptionEnabled", stack)?,
);
}
"AuthTokenEnabled" => {
obj.auth_token_enabled = Some(BooleanOptionalDeserializer::deserialize(
"AuthTokenEnabled",
stack,
)?);
}
"AutoMinorVersionUpgrade" => {
obj.auto_minor_version_upgrade = Some(BooleanDeserializer::deserialize(
"AutoMinorVersionUpgrade",
stack,
)?);
}
"CacheClusterCreateTime" => {
obj.cache_cluster_create_time = Some(TStampDeserializer::deserialize(
"CacheClusterCreateTime",
stack,
)?);
}
"CacheClusterId" => {
obj.cache_cluster_id =
Some(StringDeserializer::deserialize("CacheClusterId", stack)?);
}
"CacheClusterStatus" => {
obj.cache_cluster_status = Some(StringDeserializer::deserialize(
"CacheClusterStatus",
stack,
)?);
}
"CacheNodeType" => {
obj.cache_node_type =
Some(StringDeserializer::deserialize("CacheNodeType", stack)?);
}
"CacheNodes" => {
obj.cache_nodes
.get_or_insert(vec![])
.extend(CacheNodeListDeserializer::deserialize("CacheNodes", stack)?);
}
"CacheParameterGroup" => {
obj.cache_parameter_group =
Some(CacheParameterGroupStatusDeserializer::deserialize(
"CacheParameterGroup",
stack,
)?);
}
"CacheSecurityGroups" => {
obj.cache_security_groups.get_or_insert(vec![]).extend(
CacheSecurityGroupMembershipListDeserializer::deserialize(
"CacheSecurityGroups",
stack,
)?,
);
}
"CacheSubnetGroupName" => {
obj.cache_subnet_group_name = Some(StringDeserializer::deserialize(
"CacheSubnetGroupName",
stack,
)?);
}
"ClientDownloadLandingPage" => {
obj.client_download_landing_page = Some(StringDeserializer::deserialize(
"ClientDownloadLandingPage",
stack,
)?);
}
"ConfigurationEndpoint" => {
obj.configuration_endpoint = Some(EndpointDeserializer::deserialize(
"ConfigurationEndpoint",
stack,
)?);
}
"Engine" => {
obj.engine = Some(StringDeserializer::deserialize("Engine", stack)?);
}
"EngineVersion" => {
obj.engine_version =
Some(StringDeserializer::deserialize("EngineVersion", stack)?);
}
"NotificationConfiguration" => {
obj.notification_configuration =
Some(NotificationConfigurationDeserializer::deserialize(
"NotificationConfiguration",
stack,
)?);
}
"NumCacheNodes" => {
obj.num_cache_nodes = Some(IntegerOptionalDeserializer::deserialize(
"NumCacheNodes",
stack,
)?);
}
"PendingModifiedValues" => {
obj.pending_modified_values =
Some(PendingModifiedValuesDeserializer::deserialize(
"PendingModifiedValues",
stack,
)?);
}
"PreferredAvailabilityZone" => {
obj.preferred_availability_zone = Some(StringDeserializer::deserialize(
"PreferredAvailabilityZone",
stack,
)?);
}
"PreferredMaintenanceWindow" => {
obj.preferred_maintenance_window = Some(StringDeserializer::deserialize(
"PreferredMaintenanceWindow",
stack,
)?);
}
"ReplicationGroupId" => {
obj.replication_group_id = Some(StringDeserializer::deserialize(
"ReplicationGroupId",
stack,
)?);
}
"SecurityGroups" => {
obj.security_groups.get_or_insert(vec![]).extend(
SecurityGroupMembershipListDeserializer::deserialize(
"SecurityGroups",
stack,
)?,
);
}
"SnapshotRetentionLimit" => {
obj.snapshot_retention_limit = Some(IntegerOptionalDeserializer::deserialize(
"SnapshotRetentionLimit",
stack,
)?);
}
"SnapshotWindow" => {
obj.snapshot_window =
Some(StringDeserializer::deserialize("SnapshotWindow", stack)?);
}
"TransitEncryptionEnabled" => {
obj.transit_encryption_enabled =
Some(BooleanOptionalDeserializer::deserialize(
"TransitEncryptionEnabled",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct CacheClusterListDeserializer;
impl CacheClusterListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheCluster>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheCluster" {
obj.push(CacheClusterDeserializer::deserialize(
"CacheCluster",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheClusterMessage {
pub cache_clusters: Option<Vec<CacheCluster>>,
pub marker: Option<String>,
}
struct CacheClusterMessageDeserializer;
impl CacheClusterMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheClusterMessage, XmlParseError> {
deserialize_elements::<_, CacheClusterMessage, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheClusters" => {
obj.cache_clusters.get_or_insert(vec![]).extend(
CacheClusterListDeserializer::deserialize("CacheClusters", stack)?,
);
}
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheEngineVersion {
pub cache_engine_description: Option<String>,
pub cache_engine_version_description: Option<String>,
pub cache_parameter_group_family: Option<String>,
pub engine: Option<String>,
pub engine_version: Option<String>,
}
struct CacheEngineVersionDeserializer;
impl CacheEngineVersionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheEngineVersion, XmlParseError> {
deserialize_elements::<_, CacheEngineVersion, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheEngineDescription" => {
obj.cache_engine_description = Some(StringDeserializer::deserialize(
"CacheEngineDescription",
stack,
)?);
}
"CacheEngineVersionDescription" => {
obj.cache_engine_version_description = Some(StringDeserializer::deserialize(
"CacheEngineVersionDescription",
stack,
)?);
}
"CacheParameterGroupFamily" => {
obj.cache_parameter_group_family = Some(StringDeserializer::deserialize(
"CacheParameterGroupFamily",
stack,
)?);
}
"Engine" => {
obj.engine = Some(StringDeserializer::deserialize("Engine", stack)?);
}
"EngineVersion" => {
obj.engine_version =
Some(StringDeserializer::deserialize("EngineVersion", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct CacheEngineVersionListDeserializer;
impl CacheEngineVersionListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheEngineVersion>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheEngineVersion" {
obj.push(CacheEngineVersionDeserializer::deserialize(
"CacheEngineVersion",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheEngineVersionMessage {
pub cache_engine_versions: Option<Vec<CacheEngineVersion>>,
pub marker: Option<String>,
}
struct CacheEngineVersionMessageDeserializer;
impl CacheEngineVersionMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheEngineVersionMessage, XmlParseError> {
deserialize_elements::<_, CacheEngineVersionMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheEngineVersions" => {
obj.cache_engine_versions.get_or_insert(vec![]).extend(
CacheEngineVersionListDeserializer::deserialize(
"CacheEngineVersions",
stack,
)?,
);
}
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheNode {
pub cache_node_create_time: Option<String>,
pub cache_node_id: Option<String>,
pub cache_node_status: Option<String>,
pub customer_availability_zone: Option<String>,
pub endpoint: Option<Endpoint>,
pub parameter_group_status: Option<String>,
pub source_cache_node_id: Option<String>,
}
struct CacheNodeDeserializer;
impl CacheNodeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheNode, XmlParseError> {
deserialize_elements::<_, CacheNode, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheNodeCreateTime" => {
obj.cache_node_create_time = Some(TStampDeserializer::deserialize(
"CacheNodeCreateTime",
stack,
)?);
}
"CacheNodeId" => {
obj.cache_node_id =
Some(StringDeserializer::deserialize("CacheNodeId", stack)?);
}
"CacheNodeStatus" => {
obj.cache_node_status =
Some(StringDeserializer::deserialize("CacheNodeStatus", stack)?);
}
"CustomerAvailabilityZone" => {
obj.customer_availability_zone = Some(StringDeserializer::deserialize(
"CustomerAvailabilityZone",
stack,
)?);
}
"Endpoint" => {
obj.endpoint = Some(EndpointDeserializer::deserialize("Endpoint", stack)?);
}
"ParameterGroupStatus" => {
obj.parameter_group_status = Some(StringDeserializer::deserialize(
"ParameterGroupStatus",
stack,
)?);
}
"SourceCacheNodeId" => {
obj.source_cache_node_id =
Some(StringDeserializer::deserialize("SourceCacheNodeId", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct CacheNodeIdsListDeserializer;
impl CacheNodeIdsListDeserializer {
#[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 == "CacheNodeId" {
obj.push(StringDeserializer::deserialize("CacheNodeId", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct CacheNodeIdsListSerializer;
impl CacheNodeIdsListSerializer {
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 CacheNodeListDeserializer;
impl CacheNodeListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheNode>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheNode" {
obj.push(CacheNodeDeserializer::deserialize("CacheNode", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheNodeTypeSpecificParameter {
pub allowed_values: Option<String>,
pub cache_node_type_specific_values: Option<Vec<CacheNodeTypeSpecificValue>>,
pub change_type: Option<String>,
pub data_type: Option<String>,
pub description: Option<String>,
pub is_modifiable: Option<bool>,
pub minimum_engine_version: Option<String>,
pub parameter_name: Option<String>,
pub source: Option<String>,
}
struct CacheNodeTypeSpecificParameterDeserializer;
impl CacheNodeTypeSpecificParameterDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheNodeTypeSpecificParameter, XmlParseError> {
deserialize_elements::<_, CacheNodeTypeSpecificParameter, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AllowedValues" => {
obj.allowed_values =
Some(StringDeserializer::deserialize("AllowedValues", stack)?);
}
"CacheNodeTypeSpecificValues" => {
obj.cache_node_type_specific_values
.get_or_insert(vec![])
.extend(CacheNodeTypeSpecificValueListDeserializer::deserialize(
"CacheNodeTypeSpecificValues",
stack,
)?);
}
"ChangeType" => {
obj.change_type =
Some(ChangeTypeDeserializer::deserialize("ChangeType", stack)?);
}
"DataType" => {
obj.data_type = Some(StringDeserializer::deserialize("DataType", stack)?);
}
"Description" => {
obj.description =
Some(StringDeserializer::deserialize("Description", stack)?);
}
"IsModifiable" => {
obj.is_modifiable =
Some(BooleanDeserializer::deserialize("IsModifiable", stack)?);
}
"MinimumEngineVersion" => {
obj.minimum_engine_version = Some(StringDeserializer::deserialize(
"MinimumEngineVersion",
stack,
)?);
}
"ParameterName" => {
obj.parameter_name =
Some(StringDeserializer::deserialize("ParameterName", stack)?);
}
"Source" => {
obj.source = Some(StringDeserializer::deserialize("Source", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct CacheNodeTypeSpecificParametersListDeserializer;
impl CacheNodeTypeSpecificParametersListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheNodeTypeSpecificParameter>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheNodeTypeSpecificParameter" {
obj.push(CacheNodeTypeSpecificParameterDeserializer::deserialize(
"CacheNodeTypeSpecificParameter",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheNodeTypeSpecificValue {
pub cache_node_type: Option<String>,
pub value: Option<String>,
}
struct CacheNodeTypeSpecificValueDeserializer;
impl CacheNodeTypeSpecificValueDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheNodeTypeSpecificValue, XmlParseError> {
deserialize_elements::<_, CacheNodeTypeSpecificValue, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheNodeType" => {
obj.cache_node_type =
Some(StringDeserializer::deserialize("CacheNodeType", stack)?);
}
"Value" => {
obj.value = Some(StringDeserializer::deserialize("Value", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct CacheNodeTypeSpecificValueListDeserializer;
impl CacheNodeTypeSpecificValueListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheNodeTypeSpecificValue>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheNodeTypeSpecificValue" {
obj.push(CacheNodeTypeSpecificValueDeserializer::deserialize(
"CacheNodeTypeSpecificValue",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheParameterGroup {
pub cache_parameter_group_family: Option<String>,
pub cache_parameter_group_name: Option<String>,
pub description: Option<String>,
}
struct CacheParameterGroupDeserializer;
impl CacheParameterGroupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheParameterGroup, XmlParseError> {
deserialize_elements::<_, CacheParameterGroup, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheParameterGroupFamily" => {
obj.cache_parameter_group_family = Some(StringDeserializer::deserialize(
"CacheParameterGroupFamily",
stack,
)?);
}
"CacheParameterGroupName" => {
obj.cache_parameter_group_name = Some(StringDeserializer::deserialize(
"CacheParameterGroupName",
stack,
)?);
}
"Description" => {
obj.description = Some(StringDeserializer::deserialize("Description", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheParameterGroupDetails {
pub cache_node_type_specific_parameters: Option<Vec<CacheNodeTypeSpecificParameter>>,
pub marker: Option<String>,
pub parameters: Option<Vec<Parameter>>,
}
struct CacheParameterGroupDetailsDeserializer;
impl CacheParameterGroupDetailsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheParameterGroupDetails, XmlParseError> {
deserialize_elements::<_, CacheParameterGroupDetails, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheNodeTypeSpecificParameters" => {
obj.cache_node_type_specific_parameters
.get_or_insert(vec![])
.extend(
CacheNodeTypeSpecificParametersListDeserializer::deserialize(
"CacheNodeTypeSpecificParameters",
stack,
)?,
);
}
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
"Parameters" => {
obj.parameters.get_or_insert(vec![]).extend(
ParametersListDeserializer::deserialize("Parameters", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct CacheParameterGroupListDeserializer;
impl CacheParameterGroupListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheParameterGroup>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheParameterGroup" {
obj.push(CacheParameterGroupDeserializer::deserialize(
"CacheParameterGroup",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheParameterGroupNameMessage {
pub cache_parameter_group_name: Option<String>,
}
struct CacheParameterGroupNameMessageDeserializer;
impl CacheParameterGroupNameMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheParameterGroupNameMessage, XmlParseError> {
deserialize_elements::<_, CacheParameterGroupNameMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheParameterGroupName" => {
obj.cache_parameter_group_name = Some(StringDeserializer::deserialize(
"CacheParameterGroupName",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheParameterGroupStatus {
pub cache_node_ids_to_reboot: Option<Vec<String>>,
pub cache_parameter_group_name: Option<String>,
pub parameter_apply_status: Option<String>,
}
struct CacheParameterGroupStatusDeserializer;
impl CacheParameterGroupStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheParameterGroupStatus, XmlParseError> {
deserialize_elements::<_, CacheParameterGroupStatus, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheNodeIdsToReboot" => {
obj.cache_node_ids_to_reboot.get_or_insert(vec![]).extend(
CacheNodeIdsListDeserializer::deserialize(
"CacheNodeIdsToReboot",
stack,
)?,
);
}
"CacheParameterGroupName" => {
obj.cache_parameter_group_name = Some(StringDeserializer::deserialize(
"CacheParameterGroupName",
stack,
)?);
}
"ParameterApplyStatus" => {
obj.parameter_apply_status = Some(StringDeserializer::deserialize(
"ParameterApplyStatus",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheParameterGroupsMessage {
pub cache_parameter_groups: Option<Vec<CacheParameterGroup>>,
pub marker: Option<String>,
}
struct CacheParameterGroupsMessageDeserializer;
impl CacheParameterGroupsMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheParameterGroupsMessage, XmlParseError> {
deserialize_elements::<_, CacheParameterGroupsMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheParameterGroups" => {
obj.cache_parameter_groups.get_or_insert(vec![]).extend(
CacheParameterGroupListDeserializer::deserialize(
"CacheParameterGroups",
stack,
)?,
);
}
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheSecurityGroup {
pub cache_security_group_name: Option<String>,
pub description: Option<String>,
pub ec2_security_groups: Option<Vec<EC2SecurityGroup>>,
pub owner_id: Option<String>,
}
struct CacheSecurityGroupDeserializer;
impl CacheSecurityGroupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheSecurityGroup, XmlParseError> {
deserialize_elements::<_, CacheSecurityGroup, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheSecurityGroupName" => {
obj.cache_security_group_name = Some(StringDeserializer::deserialize(
"CacheSecurityGroupName",
stack,
)?);
}
"Description" => {
obj.description = Some(StringDeserializer::deserialize("Description", stack)?);
}
"EC2SecurityGroups" => {
obj.ec2_security_groups.get_or_insert(vec![]).extend(
EC2SecurityGroupListDeserializer::deserialize("EC2SecurityGroups", stack)?,
);
}
"OwnerId" => {
obj.owner_id = Some(StringDeserializer::deserialize("OwnerId", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheSecurityGroupMembership {
pub cache_security_group_name: Option<String>,
pub status: Option<String>,
}
struct CacheSecurityGroupMembershipDeserializer;
impl CacheSecurityGroupMembershipDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheSecurityGroupMembership, XmlParseError> {
deserialize_elements::<_, CacheSecurityGroupMembership, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheSecurityGroupName" => {
obj.cache_security_group_name = Some(StringDeserializer::deserialize(
"CacheSecurityGroupName",
stack,
)?);
}
"Status" => {
obj.status = Some(StringDeserializer::deserialize("Status", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct CacheSecurityGroupMembershipListDeserializer;
impl CacheSecurityGroupMembershipListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheSecurityGroupMembership>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheSecurityGroup" {
obj.push(CacheSecurityGroupMembershipDeserializer::deserialize(
"CacheSecurityGroup",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheSecurityGroupMessage {
pub cache_security_groups: Option<Vec<CacheSecurityGroup>>,
pub marker: Option<String>,
}
struct CacheSecurityGroupMessageDeserializer;
impl CacheSecurityGroupMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheSecurityGroupMessage, XmlParseError> {
deserialize_elements::<_, CacheSecurityGroupMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheSecurityGroups" => {
obj.cache_security_groups.get_or_insert(vec![]).extend(
CacheSecurityGroupsDeserializer::deserialize(
"CacheSecurityGroups",
stack,
)?,
);
}
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct CacheSecurityGroupNameListSerializer;
impl CacheSecurityGroupNameListSerializer {
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 CacheSecurityGroupsDeserializer;
impl CacheSecurityGroupsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheSecurityGroup>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheSecurityGroup" {
obj.push(CacheSecurityGroupDeserializer::deserialize(
"CacheSecurityGroup",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheSubnetGroup {
pub cache_subnet_group_description: Option<String>,
pub cache_subnet_group_name: Option<String>,
pub subnets: Option<Vec<Subnet>>,
pub vpc_id: Option<String>,
}
struct CacheSubnetGroupDeserializer;
impl CacheSubnetGroupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheSubnetGroup, XmlParseError> {
deserialize_elements::<_, CacheSubnetGroup, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheSubnetGroupDescription" => {
obj.cache_subnet_group_description = Some(StringDeserializer::deserialize(
"CacheSubnetGroupDescription",
stack,
)?);
}
"CacheSubnetGroupName" => {
obj.cache_subnet_group_name = Some(StringDeserializer::deserialize(
"CacheSubnetGroupName",
stack,
)?);
}
"Subnets" => {
obj.subnets
.get_or_insert(vec![])
.extend(SubnetListDeserializer::deserialize("Subnets", stack)?);
}
"VpcId" => {
obj.vpc_id = Some(StringDeserializer::deserialize("VpcId", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CacheSubnetGroupMessage {
pub cache_subnet_groups: Option<Vec<CacheSubnetGroup>>,
pub marker: Option<String>,
}
struct CacheSubnetGroupMessageDeserializer;
impl CacheSubnetGroupMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CacheSubnetGroupMessage, XmlParseError> {
deserialize_elements::<_, CacheSubnetGroupMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheSubnetGroups" => {
obj.cache_subnet_groups.get_or_insert(vec![]).extend(
CacheSubnetGroupsDeserializer::deserialize("CacheSubnetGroups", stack)?,
);
}
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct CacheSubnetGroupsDeserializer;
impl CacheSubnetGroupsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<CacheSubnetGroup>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "CacheSubnetGroup" {
obj.push(CacheSubnetGroupDeserializer::deserialize(
"CacheSubnetGroup",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct ChangeTypeDeserializer;
impl ChangeTypeDeserializer {
#[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 ClusterIdListDeserializer;
impl ClusterIdListDeserializer {
#[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 == "ClusterId" {
obj.push(StringDeserializer::deserialize("ClusterId", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ConfigureShard {
pub new_replica_count: i64,
pub node_group_id: String,
pub preferred_availability_zones: Option<Vec<String>>,
}
struct ConfigureShardSerializer;
impl ConfigureShardSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ConfigureShard) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "NewReplicaCount"),
&obj.new_replica_count,
);
params.put(&format!("{}{}", prefix, "NodeGroupId"), &obj.node_group_id);
if let Some(ref field_value) = obj.preferred_availability_zones {
PreferredAvailabilityZoneListSerializer::serialize(
params,
&format!("{}{}", prefix, "PreferredAvailabilityZone"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CopySnapshotMessage {
pub source_snapshot_name: String,
pub target_bucket: Option<String>,
pub target_snapshot_name: String,
}
struct CopySnapshotMessageSerializer;
impl CopySnapshotMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CopySnapshotMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "SourceSnapshotName"),
&obj.source_snapshot_name,
);
if let Some(ref field_value) = obj.target_bucket {
params.put(&format!("{}{}", prefix, "TargetBucket"), &field_value);
}
params.put(
&format!("{}{}", prefix, "TargetSnapshotName"),
&obj.target_snapshot_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CopySnapshotResult {
pub snapshot: Option<Snapshot>,
}
struct CopySnapshotResultDeserializer;
impl CopySnapshotResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CopySnapshotResult, XmlParseError> {
deserialize_elements::<_, CopySnapshotResult, _>(tag_name, stack, |name, stack, obj| {
match name {
"Snapshot" => {
obj.snapshot = Some(SnapshotDeserializer::deserialize("Snapshot", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCacheClusterMessage {
pub az_mode: Option<String>,
pub auth_token: Option<String>,
pub auto_minor_version_upgrade: Option<bool>,
pub cache_cluster_id: String,
pub cache_node_type: Option<String>,
pub cache_parameter_group_name: Option<String>,
pub cache_security_group_names: Option<Vec<String>>,
pub cache_subnet_group_name: Option<String>,
pub engine: Option<String>,
pub engine_version: Option<String>,
pub notification_topic_arn: Option<String>,
pub num_cache_nodes: Option<i64>,
pub port: Option<i64>,
pub preferred_availability_zone: Option<String>,
pub preferred_availability_zones: Option<Vec<String>>,
pub preferred_maintenance_window: Option<String>,
pub replication_group_id: Option<String>,
pub security_group_ids: Option<Vec<String>>,
pub snapshot_arns: Option<Vec<String>>,
pub snapshot_name: Option<String>,
pub snapshot_retention_limit: Option<i64>,
pub snapshot_window: Option<String>,
pub tags: Option<Vec<Tag>>,
}
struct CreateCacheClusterMessageSerializer;
impl CreateCacheClusterMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateCacheClusterMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.az_mode {
params.put(&format!("{}{}", prefix, "AZMode"), &field_value);
}
if let Some(ref field_value) = obj.auth_token {
params.put(&format!("{}{}", prefix, "AuthToken"), &field_value);
}
if let Some(ref field_value) = obj.auto_minor_version_upgrade {
params.put(
&format!("{}{}", prefix, "AutoMinorVersionUpgrade"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "CacheClusterId"),
&obj.cache_cluster_id,
);
if let Some(ref field_value) = obj.cache_node_type {
params.put(&format!("{}{}", prefix, "CacheNodeType"), &field_value);
}
if let Some(ref field_value) = obj.cache_parameter_group_name {
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.cache_security_group_names {
CacheSecurityGroupNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "CacheSecurityGroupName"),
field_value,
);
}
if let Some(ref field_value) = obj.cache_subnet_group_name {
params.put(
&format!("{}{}", prefix, "CacheSubnetGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.engine {
params.put(&format!("{}{}", prefix, "Engine"), &field_value);
}
if let Some(ref field_value) = obj.engine_version {
params.put(&format!("{}{}", prefix, "EngineVersion"), &field_value);
}
if let Some(ref field_value) = obj.notification_topic_arn {
params.put(
&format!("{}{}", prefix, "NotificationTopicArn"),
&field_value,
);
}
if let Some(ref field_value) = obj.num_cache_nodes {
params.put(&format!("{}{}", prefix, "NumCacheNodes"), &field_value);
}
if let Some(ref field_value) = obj.port {
params.put(&format!("{}{}", prefix, "Port"), &field_value);
}
if let Some(ref field_value) = obj.preferred_availability_zone {
params.put(
&format!("{}{}", prefix, "PreferredAvailabilityZone"),
&field_value,
);
}
if let Some(ref field_value) = obj.preferred_availability_zones {
PreferredAvailabilityZoneListSerializer::serialize(
params,
&format!("{}{}", prefix, "PreferredAvailabilityZone"),
field_value,
);
}
if let Some(ref field_value) = obj.preferred_maintenance_window {
params.put(
&format!("{}{}", prefix, "PreferredMaintenanceWindow"),
&field_value,
);
}
if let Some(ref field_value) = obj.replication_group_id {
params.put(&format!("{}{}", prefix, "ReplicationGroupId"), &field_value);
}
if let Some(ref field_value) = obj.security_group_ids {
SecurityGroupIdsListSerializer::serialize(
params,
&format!("{}{}", prefix, "SecurityGroupId"),
field_value,
);
}
if let Some(ref field_value) = obj.snapshot_arns {
SnapshotArnsListSerializer::serialize(
params,
&format!("{}{}", prefix, "SnapshotArn"),
field_value,
);
}
if let Some(ref field_value) = obj.snapshot_name {
params.put(&format!("{}{}", prefix, "SnapshotName"), &field_value);
}
if let Some(ref field_value) = obj.snapshot_retention_limit {
params.put(
&format!("{}{}", prefix, "SnapshotRetentionLimit"),
&field_value,
);
}
if let Some(ref field_value) = obj.snapshot_window {
params.put(&format!("{}{}", prefix, "SnapshotWindow"), &field_value);
}
if let Some(ref field_value) = obj.tags {
TagListSerializer::serialize(params, &format!("{}{}", prefix, "Tag"), field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCacheClusterResult {
pub cache_cluster: Option<CacheCluster>,
}
struct CreateCacheClusterResultDeserializer;
impl CreateCacheClusterResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateCacheClusterResult, XmlParseError> {
deserialize_elements::<_, CreateCacheClusterResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheCluster" => {
obj.cache_cluster = Some(CacheClusterDeserializer::deserialize(
"CacheCluster",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCacheParameterGroupMessage {
pub cache_parameter_group_family: String,
pub cache_parameter_group_name: String,
pub description: String,
}
struct CreateCacheParameterGroupMessageSerializer;
impl CreateCacheParameterGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateCacheParameterGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheParameterGroupFamily"),
&obj.cache_parameter_group_family,
);
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&obj.cache_parameter_group_name,
);
params.put(&format!("{}{}", prefix, "Description"), &obj.description);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCacheParameterGroupResult {
pub cache_parameter_group: Option<CacheParameterGroup>,
}
struct CreateCacheParameterGroupResultDeserializer;
impl CreateCacheParameterGroupResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateCacheParameterGroupResult, XmlParseError> {
deserialize_elements::<_, CreateCacheParameterGroupResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheParameterGroup" => {
obj.cache_parameter_group =
Some(CacheParameterGroupDeserializer::deserialize(
"CacheParameterGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCacheSecurityGroupMessage {
pub cache_security_group_name: String,
pub description: String,
}
struct CreateCacheSecurityGroupMessageSerializer;
impl CreateCacheSecurityGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateCacheSecurityGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheSecurityGroupName"),
&obj.cache_security_group_name,
);
params.put(&format!("{}{}", prefix, "Description"), &obj.description);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCacheSecurityGroupResult {
pub cache_security_group: Option<CacheSecurityGroup>,
}
struct CreateCacheSecurityGroupResultDeserializer;
impl CreateCacheSecurityGroupResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateCacheSecurityGroupResult, XmlParseError> {
deserialize_elements::<_, CreateCacheSecurityGroupResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheSecurityGroup" => {
obj.cache_security_group =
Some(CacheSecurityGroupDeserializer::deserialize(
"CacheSecurityGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCacheSubnetGroupMessage {
pub cache_subnet_group_description: String,
pub cache_subnet_group_name: String,
pub subnet_ids: Vec<String>,
}
struct CreateCacheSubnetGroupMessageSerializer;
impl CreateCacheSubnetGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateCacheSubnetGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheSubnetGroupDescription"),
&obj.cache_subnet_group_description,
);
params.put(
&format!("{}{}", prefix, "CacheSubnetGroupName"),
&obj.cache_subnet_group_name,
);
SubnetIdentifierListSerializer::serialize(
params,
&format!("{}{}", prefix, "SubnetIdentifier"),
&obj.subnet_ids,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateCacheSubnetGroupResult {
pub cache_subnet_group: Option<CacheSubnetGroup>,
}
struct CreateCacheSubnetGroupResultDeserializer;
impl CreateCacheSubnetGroupResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateCacheSubnetGroupResult, XmlParseError> {
deserialize_elements::<_, CreateCacheSubnetGroupResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheSubnetGroup" => {
obj.cache_subnet_group = Some(CacheSubnetGroupDeserializer::deserialize(
"CacheSubnetGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateReplicationGroupMessage {
pub at_rest_encryption_enabled: Option<bool>,
pub auth_token: Option<String>,
pub auto_minor_version_upgrade: Option<bool>,
pub automatic_failover_enabled: Option<bool>,
pub cache_node_type: Option<String>,
pub cache_parameter_group_name: Option<String>,
pub cache_security_group_names: Option<Vec<String>>,
pub cache_subnet_group_name: Option<String>,
pub engine: Option<String>,
pub engine_version: Option<String>,
pub node_group_configuration: Option<Vec<NodeGroupConfiguration>>,
pub notification_topic_arn: Option<String>,
pub num_cache_clusters: Option<i64>,
pub num_node_groups: Option<i64>,
pub port: Option<i64>,
pub preferred_cache_cluster_a_zs: Option<Vec<String>>,
pub preferred_maintenance_window: Option<String>,
pub primary_cluster_id: Option<String>,
pub replicas_per_node_group: Option<i64>,
pub replication_group_description: String,
pub replication_group_id: String,
pub security_group_ids: Option<Vec<String>>,
pub snapshot_arns: Option<Vec<String>>,
pub snapshot_name: Option<String>,
pub snapshot_retention_limit: Option<i64>,
pub snapshot_window: Option<String>,
pub tags: Option<Vec<Tag>>,
pub transit_encryption_enabled: Option<bool>,
}
struct CreateReplicationGroupMessageSerializer;
impl CreateReplicationGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateReplicationGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.at_rest_encryption_enabled {
params.put(
&format!("{}{}", prefix, "AtRestEncryptionEnabled"),
&field_value,
);
}
if let Some(ref field_value) = obj.auth_token {
params.put(&format!("{}{}", prefix, "AuthToken"), &field_value);
}
if let Some(ref field_value) = obj.auto_minor_version_upgrade {
params.put(
&format!("{}{}", prefix, "AutoMinorVersionUpgrade"),
&field_value,
);
}
if let Some(ref field_value) = obj.automatic_failover_enabled {
params.put(
&format!("{}{}", prefix, "AutomaticFailoverEnabled"),
&field_value,
);
}
if let Some(ref field_value) = obj.cache_node_type {
params.put(&format!("{}{}", prefix, "CacheNodeType"), &field_value);
}
if let Some(ref field_value) = obj.cache_parameter_group_name {
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.cache_security_group_names {
CacheSecurityGroupNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "CacheSecurityGroupName"),
field_value,
);
}
if let Some(ref field_value) = obj.cache_subnet_group_name {
params.put(
&format!("{}{}", prefix, "CacheSubnetGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.engine {
params.put(&format!("{}{}", prefix, "Engine"), &field_value);
}
if let Some(ref field_value) = obj.engine_version {
params.put(&format!("{}{}", prefix, "EngineVersion"), &field_value);
}
if let Some(ref field_value) = obj.node_group_configuration {
NodeGroupConfigurationListSerializer::serialize(
params,
&format!("{}{}", prefix, "NodeGroupConfiguration"),
field_value,
);
}
if let Some(ref field_value) = obj.notification_topic_arn {
params.put(
&format!("{}{}", prefix, "NotificationTopicArn"),
&field_value,
);
}
if let Some(ref field_value) = obj.num_cache_clusters {
params.put(&format!("{}{}", prefix, "NumCacheClusters"), &field_value);
}
if let Some(ref field_value) = obj.num_node_groups {
params.put(&format!("{}{}", prefix, "NumNodeGroups"), &field_value);
}
if let Some(ref field_value) = obj.port {
params.put(&format!("{}{}", prefix, "Port"), &field_value);
}
if let Some(ref field_value) = obj.preferred_cache_cluster_a_zs {
AvailabilityZonesListSerializer::serialize(
params,
&format!("{}{}", prefix, "AvailabilityZone"),
field_value,
);
}
if let Some(ref field_value) = obj.preferred_maintenance_window {
params.put(
&format!("{}{}", prefix, "PreferredMaintenanceWindow"),
&field_value,
);
}
if let Some(ref field_value) = obj.primary_cluster_id {
params.put(&format!("{}{}", prefix, "PrimaryClusterId"), &field_value);
}
if let Some(ref field_value) = obj.replicas_per_node_group {
params.put(
&format!("{}{}", prefix, "ReplicasPerNodeGroup"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "ReplicationGroupDescription"),
&obj.replication_group_description,
);
params.put(
&format!("{}{}", prefix, "ReplicationGroupId"),
&obj.replication_group_id,
);
if let Some(ref field_value) = obj.security_group_ids {
SecurityGroupIdsListSerializer::serialize(
params,
&format!("{}{}", prefix, "SecurityGroupId"),
field_value,
);
}
if let Some(ref field_value) = obj.snapshot_arns {
SnapshotArnsListSerializer::serialize(
params,
&format!("{}{}", prefix, "SnapshotArn"),
field_value,
);
}
if let Some(ref field_value) = obj.snapshot_name {
params.put(&format!("{}{}", prefix, "SnapshotName"), &field_value);
}
if let Some(ref field_value) = obj.snapshot_retention_limit {
params.put(
&format!("{}{}", prefix, "SnapshotRetentionLimit"),
&field_value,
);
}
if let Some(ref field_value) = obj.snapshot_window {
params.put(&format!("{}{}", prefix, "SnapshotWindow"), &field_value);
}
if let Some(ref field_value) = obj.tags {
TagListSerializer::serialize(params, &format!("{}{}", prefix, "Tag"), field_value);
}
if let Some(ref field_value) = obj.transit_encryption_enabled {
params.put(
&format!("{}{}", prefix, "TransitEncryptionEnabled"),
&field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateReplicationGroupResult {
pub replication_group: Option<ReplicationGroup>,
}
struct CreateReplicationGroupResultDeserializer;
impl CreateReplicationGroupResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateReplicationGroupResult, XmlParseError> {
deserialize_elements::<_, CreateReplicationGroupResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ReplicationGroup" => {
obj.replication_group = Some(ReplicationGroupDeserializer::deserialize(
"ReplicationGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateSnapshotMessage {
pub cache_cluster_id: Option<String>,
pub replication_group_id: Option<String>,
pub snapshot_name: String,
}
struct CreateSnapshotMessageSerializer;
impl CreateSnapshotMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateSnapshotMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_cluster_id {
params.put(&format!("{}{}", prefix, "CacheClusterId"), &field_value);
}
if let Some(ref field_value) = obj.replication_group_id {
params.put(&format!("{}{}", prefix, "ReplicationGroupId"), &field_value);
}
params.put(&format!("{}{}", prefix, "SnapshotName"), &obj.snapshot_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateSnapshotResult {
pub snapshot: Option<Snapshot>,
}
struct CreateSnapshotResultDeserializer;
impl CreateSnapshotResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CreateSnapshotResult, XmlParseError> {
deserialize_elements::<_, CreateSnapshotResult, _>(tag_name, stack, |name, stack, obj| {
match name {
"Snapshot" => {
obj.snapshot = Some(SnapshotDeserializer::deserialize("Snapshot", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DecreaseReplicaCountMessage {
pub apply_immediately: bool,
pub new_replica_count: Option<i64>,
pub replica_configuration: Option<Vec<ConfigureShard>>,
pub replicas_to_remove: Option<Vec<String>>,
pub replication_group_id: String,
}
struct DecreaseReplicaCountMessageSerializer;
impl DecreaseReplicaCountMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DecreaseReplicaCountMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "ApplyImmediately"),
&obj.apply_immediately,
);
if let Some(ref field_value) = obj.new_replica_count {
params.put(&format!("{}{}", prefix, "NewReplicaCount"), &field_value);
}
if let Some(ref field_value) = obj.replica_configuration {
ReplicaConfigurationListSerializer::serialize(
params,
&format!("{}{}", prefix, "ConfigureShard"),
field_value,
);
}
if let Some(ref field_value) = obj.replicas_to_remove {
RemoveReplicasListSerializer::serialize(
params,
&format!("{}{}", prefix, "ReplicasToRemove"),
field_value,
);
}
params.put(
&format!("{}{}", prefix, "ReplicationGroupId"),
&obj.replication_group_id,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DecreaseReplicaCountResult {
pub replication_group: Option<ReplicationGroup>,
}
struct DecreaseReplicaCountResultDeserializer;
impl DecreaseReplicaCountResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DecreaseReplicaCountResult, XmlParseError> {
deserialize_elements::<_, DecreaseReplicaCountResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ReplicationGroup" => {
obj.replication_group = Some(ReplicationGroupDeserializer::deserialize(
"ReplicationGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteCacheClusterMessage {
pub cache_cluster_id: String,
pub final_snapshot_identifier: Option<String>,
}
struct DeleteCacheClusterMessageSerializer;
impl DeleteCacheClusterMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteCacheClusterMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheClusterId"),
&obj.cache_cluster_id,
);
if let Some(ref field_value) = obj.final_snapshot_identifier {
params.put(
&format!("{}{}", prefix, "FinalSnapshotIdentifier"),
&field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteCacheClusterResult {
pub cache_cluster: Option<CacheCluster>,
}
struct DeleteCacheClusterResultDeserializer;
impl DeleteCacheClusterResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteCacheClusterResult, XmlParseError> {
deserialize_elements::<_, DeleteCacheClusterResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheCluster" => {
obj.cache_cluster = Some(CacheClusterDeserializer::deserialize(
"CacheCluster",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteCacheParameterGroupMessage {
pub cache_parameter_group_name: String,
}
struct DeleteCacheParameterGroupMessageSerializer;
impl DeleteCacheParameterGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteCacheParameterGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&obj.cache_parameter_group_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteCacheSecurityGroupMessage {
pub cache_security_group_name: String,
}
struct DeleteCacheSecurityGroupMessageSerializer;
impl DeleteCacheSecurityGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteCacheSecurityGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheSecurityGroupName"),
&obj.cache_security_group_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteCacheSubnetGroupMessage {
pub cache_subnet_group_name: String,
}
struct DeleteCacheSubnetGroupMessageSerializer;
impl DeleteCacheSubnetGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteCacheSubnetGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheSubnetGroupName"),
&obj.cache_subnet_group_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteReplicationGroupMessage {
pub final_snapshot_identifier: Option<String>,
pub replication_group_id: String,
pub retain_primary_cluster: Option<bool>,
}
struct DeleteReplicationGroupMessageSerializer;
impl DeleteReplicationGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteReplicationGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.final_snapshot_identifier {
params.put(
&format!("{}{}", prefix, "FinalSnapshotIdentifier"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "ReplicationGroupId"),
&obj.replication_group_id,
);
if let Some(ref field_value) = obj.retain_primary_cluster {
params.put(
&format!("{}{}", prefix, "RetainPrimaryCluster"),
&field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteReplicationGroupResult {
pub replication_group: Option<ReplicationGroup>,
}
struct DeleteReplicationGroupResultDeserializer;
impl DeleteReplicationGroupResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteReplicationGroupResult, XmlParseError> {
deserialize_elements::<_, DeleteReplicationGroupResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ReplicationGroup" => {
obj.replication_group = Some(ReplicationGroupDeserializer::deserialize(
"ReplicationGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteSnapshotMessage {
pub snapshot_name: String,
}
struct DeleteSnapshotMessageSerializer;
impl DeleteSnapshotMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteSnapshotMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "SnapshotName"), &obj.snapshot_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteSnapshotResult {
pub snapshot: Option<Snapshot>,
}
struct DeleteSnapshotResultDeserializer;
impl DeleteSnapshotResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteSnapshotResult, XmlParseError> {
deserialize_elements::<_, DeleteSnapshotResult, _>(tag_name, stack, |name, stack, obj| {
match name {
"Snapshot" => {
obj.snapshot = Some(SnapshotDeserializer::deserialize("Snapshot", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeCacheClustersMessage {
pub cache_cluster_id: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
pub show_cache_clusters_not_in_replication_groups: Option<bool>,
pub show_cache_node_info: Option<bool>,
}
struct DescribeCacheClustersMessageSerializer;
impl DescribeCacheClustersMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeCacheClustersMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_cluster_id {
params.put(&format!("{}{}", prefix, "CacheClusterId"), &field_value);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.show_cache_clusters_not_in_replication_groups {
params.put(
&format!("{}{}", prefix, "ShowCacheClustersNotInReplicationGroups"),
&field_value,
);
}
if let Some(ref field_value) = obj.show_cache_node_info {
params.put(&format!("{}{}", prefix, "ShowCacheNodeInfo"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeCacheEngineVersionsMessage {
pub cache_parameter_group_family: Option<String>,
pub default_only: Option<bool>,
pub engine: Option<String>,
pub engine_version: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
}
struct DescribeCacheEngineVersionsMessageSerializer;
impl DescribeCacheEngineVersionsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeCacheEngineVersionsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_parameter_group_family {
params.put(
&format!("{}{}", prefix, "CacheParameterGroupFamily"),
&field_value,
);
}
if let Some(ref field_value) = obj.default_only {
params.put(&format!("{}{}", prefix, "DefaultOnly"), &field_value);
}
if let Some(ref field_value) = obj.engine {
params.put(&format!("{}{}", prefix, "Engine"), &field_value);
}
if let Some(ref field_value) = obj.engine_version {
params.put(&format!("{}{}", prefix, "EngineVersion"), &field_value);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeCacheParameterGroupsMessage {
pub cache_parameter_group_name: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
}
struct DescribeCacheParameterGroupsMessageSerializer;
impl DescribeCacheParameterGroupsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeCacheParameterGroupsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_parameter_group_name {
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeCacheParametersMessage {
pub cache_parameter_group_name: String,
pub marker: Option<String>,
pub max_records: Option<i64>,
pub source: Option<String>,
}
struct DescribeCacheParametersMessageSerializer;
impl DescribeCacheParametersMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeCacheParametersMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&obj.cache_parameter_group_name,
);
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.source {
params.put(&format!("{}{}", prefix, "Source"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeCacheSecurityGroupsMessage {
pub cache_security_group_name: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
}
struct DescribeCacheSecurityGroupsMessageSerializer;
impl DescribeCacheSecurityGroupsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeCacheSecurityGroupsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_security_group_name {
params.put(
&format!("{}{}", prefix, "CacheSecurityGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeCacheSubnetGroupsMessage {
pub cache_subnet_group_name: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
}
struct DescribeCacheSubnetGroupsMessageSerializer;
impl DescribeCacheSubnetGroupsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeCacheSubnetGroupsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_subnet_group_name {
params.put(
&format!("{}{}", prefix, "CacheSubnetGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeEngineDefaultParametersMessage {
pub cache_parameter_group_family: String,
pub marker: Option<String>,
pub max_records: Option<i64>,
}
struct DescribeEngineDefaultParametersMessageSerializer;
impl DescribeEngineDefaultParametersMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeEngineDefaultParametersMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheParameterGroupFamily"),
&obj.cache_parameter_group_family,
);
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeEngineDefaultParametersResult {
pub engine_defaults: Option<EngineDefaults>,
}
struct DescribeEngineDefaultParametersResultDeserializer;
impl DescribeEngineDefaultParametersResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeEngineDefaultParametersResult, XmlParseError> {
deserialize_elements::<_, DescribeEngineDefaultParametersResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"EngineDefaults" => {
obj.engine_defaults = Some(EngineDefaultsDeserializer::deserialize(
"EngineDefaults",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeEventsMessage {
pub duration: Option<i64>,
pub end_time: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
pub source_identifier: Option<String>,
pub source_type: Option<String>,
pub start_time: Option<String>,
}
struct DescribeEventsMessageSerializer;
impl DescribeEventsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeEventsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.duration {
params.put(&format!("{}{}", prefix, "Duration"), &field_value);
}
if let Some(ref field_value) = obj.end_time {
params.put(&format!("{}{}", prefix, "EndTime"), &field_value);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.source_identifier {
params.put(&format!("{}{}", prefix, "SourceIdentifier"), &field_value);
}
if let Some(ref field_value) = obj.source_type {
params.put(&format!("{}{}", prefix, "SourceType"), &field_value);
}
if let Some(ref field_value) = obj.start_time {
params.put(&format!("{}{}", prefix, "StartTime"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeReplicationGroupsMessage {
pub marker: Option<String>,
pub max_records: Option<i64>,
pub replication_group_id: Option<String>,
}
struct DescribeReplicationGroupsMessageSerializer;
impl DescribeReplicationGroupsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeReplicationGroupsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.replication_group_id {
params.put(&format!("{}{}", prefix, "ReplicationGroupId"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeReservedCacheNodesMessage {
pub cache_node_type: Option<String>,
pub duration: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
pub offering_type: Option<String>,
pub product_description: Option<String>,
pub reserved_cache_node_id: Option<String>,
pub reserved_cache_nodes_offering_id: Option<String>,
}
struct DescribeReservedCacheNodesMessageSerializer;
impl DescribeReservedCacheNodesMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeReservedCacheNodesMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_node_type {
params.put(&format!("{}{}", prefix, "CacheNodeType"), &field_value);
}
if let Some(ref field_value) = obj.duration {
params.put(&format!("{}{}", prefix, "Duration"), &field_value);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.offering_type {
params.put(&format!("{}{}", prefix, "OfferingType"), &field_value);
}
if let Some(ref field_value) = obj.product_description {
params.put(&format!("{}{}", prefix, "ProductDescription"), &field_value);
}
if let Some(ref field_value) = obj.reserved_cache_node_id {
params.put(
&format!("{}{}", prefix, "ReservedCacheNodeId"),
&field_value,
);
}
if let Some(ref field_value) = obj.reserved_cache_nodes_offering_id {
params.put(
&format!("{}{}", prefix, "ReservedCacheNodesOfferingId"),
&field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeReservedCacheNodesOfferingsMessage {
pub cache_node_type: Option<String>,
pub duration: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
pub offering_type: Option<String>,
pub product_description: Option<String>,
pub reserved_cache_nodes_offering_id: Option<String>,
}
struct DescribeReservedCacheNodesOfferingsMessageSerializer;
impl DescribeReservedCacheNodesOfferingsMessageSerializer {
fn serialize(
params: &mut Params,
name: &str,
obj: &DescribeReservedCacheNodesOfferingsMessage,
) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_node_type {
params.put(&format!("{}{}", prefix, "CacheNodeType"), &field_value);
}
if let Some(ref field_value) = obj.duration {
params.put(&format!("{}{}", prefix, "Duration"), &field_value);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.offering_type {
params.put(&format!("{}{}", prefix, "OfferingType"), &field_value);
}
if let Some(ref field_value) = obj.product_description {
params.put(&format!("{}{}", prefix, "ProductDescription"), &field_value);
}
if let Some(ref field_value) = obj.reserved_cache_nodes_offering_id {
params.put(
&format!("{}{}", prefix, "ReservedCacheNodesOfferingId"),
&field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeServiceUpdatesMessage {
pub marker: Option<String>,
pub max_records: Option<i64>,
pub service_update_name: Option<String>,
pub service_update_status: Option<Vec<String>>,
}
struct DescribeServiceUpdatesMessageSerializer;
impl DescribeServiceUpdatesMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeServiceUpdatesMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.service_update_name {
params.put(&format!("{}{}", prefix, "ServiceUpdateName"), &field_value);
}
if let Some(ref field_value) = obj.service_update_status {
ServiceUpdateStatusListSerializer::serialize(
params,
&format!("{}{}", prefix, "ServiceUpdateStatus"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeSnapshotsListMessage {
pub marker: Option<String>,
pub snapshots: Option<Vec<Snapshot>>,
}
struct DescribeSnapshotsListMessageDeserializer;
impl DescribeSnapshotsListMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeSnapshotsListMessage, XmlParseError> {
deserialize_elements::<_, DescribeSnapshotsListMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
"Snapshots" => {
obj.snapshots
.get_or_insert(vec![])
.extend(SnapshotListDeserializer::deserialize("Snapshots", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeSnapshotsMessage {
pub cache_cluster_id: Option<String>,
pub marker: Option<String>,
pub max_records: Option<i64>,
pub replication_group_id: Option<String>,
pub show_node_group_config: Option<bool>,
pub snapshot_name: Option<String>,
pub snapshot_source: Option<String>,
}
struct DescribeSnapshotsMessageSerializer;
impl DescribeSnapshotsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeSnapshotsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_cluster_id {
params.put(&format!("{}{}", prefix, "CacheClusterId"), &field_value);
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.replication_group_id {
params.put(&format!("{}{}", prefix, "ReplicationGroupId"), &field_value);
}
if let Some(ref field_value) = obj.show_node_group_config {
params.put(
&format!("{}{}", prefix, "ShowNodeGroupConfig"),
&field_value,
);
}
if let Some(ref field_value) = obj.snapshot_name {
params.put(&format!("{}{}", prefix, "SnapshotName"), &field_value);
}
if let Some(ref field_value) = obj.snapshot_source {
params.put(&format!("{}{}", prefix, "SnapshotSource"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeUpdateActionsMessage {
pub marker: Option<String>,
pub max_records: Option<i64>,
pub replication_group_ids: Option<Vec<String>>,
pub service_update_name: Option<String>,
pub service_update_status: Option<Vec<String>>,
pub service_update_time_range: Option<TimeRangeFilter>,
pub show_node_level_update_status: Option<bool>,
pub update_action_status: Option<Vec<String>>,
}
struct DescribeUpdateActionsMessageSerializer;
impl DescribeUpdateActionsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeUpdateActionsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.marker {
params.put(&format!("{}{}", prefix, "Marker"), &field_value);
}
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.replication_group_ids {
ReplicationGroupIdListSerializer::serialize(
params,
&format!("{}{}", prefix, "ReplicationGroupIds"),
field_value,
);
}
if let Some(ref field_value) = obj.service_update_name {
params.put(&format!("{}{}", prefix, "ServiceUpdateName"), &field_value);
}
if let Some(ref field_value) = obj.service_update_status {
ServiceUpdateStatusListSerializer::serialize(
params,
&format!("{}{}", prefix, "ServiceUpdateStatus"),
field_value,
);
}
if let Some(ref field_value) = obj.service_update_time_range {
TimeRangeFilterSerializer::serialize(
params,
&format!("{}{}", prefix, "ServiceUpdateTimeRange"),
field_value,
);
}
if let Some(ref field_value) = obj.show_node_level_update_status {
params.put(
&format!("{}{}", prefix, "ShowNodeLevelUpdateStatus"),
&field_value,
);
}
if let Some(ref field_value) = obj.update_action_status {
UpdateActionStatusListSerializer::serialize(
params,
&format!("{}{}", prefix, "UpdateActionStatus"),
field_value,
);
}
}
}
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 EC2SecurityGroup {
pub ec2_security_group_name: Option<String>,
pub ec2_security_group_owner_id: Option<String>,
pub status: Option<String>,
}
struct EC2SecurityGroupDeserializer;
impl EC2SecurityGroupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<EC2SecurityGroup, XmlParseError> {
deserialize_elements::<_, EC2SecurityGroup, _>(tag_name, stack, |name, stack, obj| {
match name {
"EC2SecurityGroupName" => {
obj.ec2_security_group_name = Some(StringDeserializer::deserialize(
"EC2SecurityGroupName",
stack,
)?);
}
"EC2SecurityGroupOwnerId" => {
obj.ec2_security_group_owner_id = Some(StringDeserializer::deserialize(
"EC2SecurityGroupOwnerId",
stack,
)?);
}
"Status" => {
obj.status = Some(StringDeserializer::deserialize("Status", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct EC2SecurityGroupListDeserializer;
impl EC2SecurityGroupListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<EC2SecurityGroup>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "EC2SecurityGroup" {
obj.push(EC2SecurityGroupDeserializer::deserialize(
"EC2SecurityGroup",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Endpoint {
pub address: Option<String>,
pub port: Option<i64>,
}
struct EndpointDeserializer;
impl EndpointDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Endpoint, XmlParseError> {
deserialize_elements::<_, Endpoint, _>(tag_name, stack, |name, stack, obj| {
match name {
"Address" => {
obj.address = Some(StringDeserializer::deserialize("Address", stack)?);
}
"Port" => {
obj.port = Some(IntegerDeserializer::deserialize("Port", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct EngineDefaults {
pub cache_node_type_specific_parameters: Option<Vec<CacheNodeTypeSpecificParameter>>,
pub cache_parameter_group_family: Option<String>,
pub marker: Option<String>,
pub parameters: Option<Vec<Parameter>>,
}
struct EngineDefaultsDeserializer;
impl EngineDefaultsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<EngineDefaults, XmlParseError> {
deserialize_elements::<_, EngineDefaults, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheNodeTypeSpecificParameters" => {
obj.cache_node_type_specific_parameters
.get_or_insert(vec![])
.extend(
CacheNodeTypeSpecificParametersListDeserializer::deserialize(
"CacheNodeTypeSpecificParameters",
stack,
)?,
);
}
"CacheParameterGroupFamily" => {
obj.cache_parameter_group_family = Some(StringDeserializer::deserialize(
"CacheParameterGroupFamily",
stack,
)?);
}
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
"Parameters" => {
obj.parameters.get_or_insert(vec![]).extend(
ParametersListDeserializer::deserialize("Parameters", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Event {
pub date: Option<String>,
pub message: Option<String>,
pub source_identifier: Option<String>,
pub source_type: Option<String>,
}
struct EventDeserializer;
impl EventDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Event, XmlParseError> {
deserialize_elements::<_, Event, _>(tag_name, stack, |name, stack, obj| {
match name {
"Date" => {
obj.date = Some(TStampDeserializer::deserialize("Date", stack)?);
}
"Message" => {
obj.message = Some(StringDeserializer::deserialize("Message", stack)?);
}
"SourceIdentifier" => {
obj.source_identifier =
Some(StringDeserializer::deserialize("SourceIdentifier", stack)?);
}
"SourceType" => {
obj.source_type =
Some(SourceTypeDeserializer::deserialize("SourceType", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct EventListDeserializer;
impl EventListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Event>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Event" {
obj.push(EventDeserializer::deserialize("Event", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct EventsMessage {
pub events: Option<Vec<Event>>,
pub marker: Option<String>,
}
struct EventsMessageDeserializer;
impl EventsMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<EventsMessage, XmlParseError> {
deserialize_elements::<_, EventsMessage, _>(tag_name, stack, |name, stack, obj| {
match name {
"Events" => {
obj.events
.get_or_insert(vec![])
.extend(EventListDeserializer::deserialize("Events", stack)?);
}
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct IncreaseReplicaCountMessage {
pub apply_immediately: bool,
pub new_replica_count: Option<i64>,
pub replica_configuration: Option<Vec<ConfigureShard>>,
pub replication_group_id: String,
}
struct IncreaseReplicaCountMessageSerializer;
impl IncreaseReplicaCountMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &IncreaseReplicaCountMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "ApplyImmediately"),
&obj.apply_immediately,
);
if let Some(ref field_value) = obj.new_replica_count {
params.put(&format!("{}{}", prefix, "NewReplicaCount"), &field_value);
}
if let Some(ref field_value) = obj.replica_configuration {
ReplicaConfigurationListSerializer::serialize(
params,
&format!("{}{}", prefix, "ConfigureShard"),
field_value,
);
}
params.put(
&format!("{}{}", prefix, "ReplicationGroupId"),
&obj.replication_group_id,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct IncreaseReplicaCountResult {
pub replication_group: Option<ReplicationGroup>,
}
struct IncreaseReplicaCountResultDeserializer;
impl IncreaseReplicaCountResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<IncreaseReplicaCountResult, XmlParseError> {
deserialize_elements::<_, IncreaseReplicaCountResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ReplicationGroup" => {
obj.replication_group = Some(ReplicationGroupDeserializer::deserialize(
"ReplicationGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct IntegerDeserializer;
impl IntegerDeserializer {
#[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 IntegerOptionalDeserializer;
impl IntegerOptionalDeserializer {
#[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 KeyListSerializer;
impl KeyListSerializer {
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 ListAllowedNodeTypeModificationsMessage {
pub cache_cluster_id: Option<String>,
pub replication_group_id: Option<String>,
}
struct ListAllowedNodeTypeModificationsMessageSerializer;
impl ListAllowedNodeTypeModificationsMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ListAllowedNodeTypeModificationsMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_cluster_id {
params.put(&format!("{}{}", prefix, "CacheClusterId"), &field_value);
}
if let Some(ref field_value) = obj.replication_group_id {
params.put(&format!("{}{}", prefix, "ReplicationGroupId"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListTagsForResourceMessage {
pub resource_name: String,
}
struct ListTagsForResourceMessageSerializer;
impl ListTagsForResourceMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ListTagsForResourceMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "ResourceName"), &obj.resource_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyCacheClusterMessage {
pub az_mode: Option<String>,
pub apply_immediately: Option<bool>,
pub auto_minor_version_upgrade: Option<bool>,
pub cache_cluster_id: String,
pub cache_node_ids_to_remove: Option<Vec<String>>,
pub cache_node_type: Option<String>,
pub cache_parameter_group_name: Option<String>,
pub cache_security_group_names: Option<Vec<String>>,
pub engine_version: Option<String>,
pub new_availability_zones: Option<Vec<String>>,
pub notification_topic_arn: Option<String>,
pub notification_topic_status: Option<String>,
pub num_cache_nodes: Option<i64>,
pub preferred_maintenance_window: Option<String>,
pub security_group_ids: Option<Vec<String>>,
pub snapshot_retention_limit: Option<i64>,
pub snapshot_window: Option<String>,
}
struct ModifyCacheClusterMessageSerializer;
impl ModifyCacheClusterMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ModifyCacheClusterMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.az_mode {
params.put(&format!("{}{}", prefix, "AZMode"), &field_value);
}
if let Some(ref field_value) = obj.apply_immediately {
params.put(&format!("{}{}", prefix, "ApplyImmediately"), &field_value);
}
if let Some(ref field_value) = obj.auto_minor_version_upgrade {
params.put(
&format!("{}{}", prefix, "AutoMinorVersionUpgrade"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "CacheClusterId"),
&obj.cache_cluster_id,
);
if let Some(ref field_value) = obj.cache_node_ids_to_remove {
CacheNodeIdsListSerializer::serialize(
params,
&format!("{}{}", prefix, "CacheNodeId"),
field_value,
);
}
if let Some(ref field_value) = obj.cache_node_type {
params.put(&format!("{}{}", prefix, "CacheNodeType"), &field_value);
}
if let Some(ref field_value) = obj.cache_parameter_group_name {
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.cache_security_group_names {
CacheSecurityGroupNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "CacheSecurityGroupName"),
field_value,
);
}
if let Some(ref field_value) = obj.engine_version {
params.put(&format!("{}{}", prefix, "EngineVersion"), &field_value);
}
if let Some(ref field_value) = obj.new_availability_zones {
PreferredAvailabilityZoneListSerializer::serialize(
params,
&format!("{}{}", prefix, "PreferredAvailabilityZone"),
field_value,
);
}
if let Some(ref field_value) = obj.notification_topic_arn {
params.put(
&format!("{}{}", prefix, "NotificationTopicArn"),
&field_value,
);
}
if let Some(ref field_value) = obj.notification_topic_status {
params.put(
&format!("{}{}", prefix, "NotificationTopicStatus"),
&field_value,
);
}
if let Some(ref field_value) = obj.num_cache_nodes {
params.put(&format!("{}{}", prefix, "NumCacheNodes"), &field_value);
}
if let Some(ref field_value) = obj.preferred_maintenance_window {
params.put(
&format!("{}{}", prefix, "PreferredMaintenanceWindow"),
&field_value,
);
}
if let Some(ref field_value) = obj.security_group_ids {
SecurityGroupIdsListSerializer::serialize(
params,
&format!("{}{}", prefix, "SecurityGroupId"),
field_value,
);
}
if let Some(ref field_value) = obj.snapshot_retention_limit {
params.put(
&format!("{}{}", prefix, "SnapshotRetentionLimit"),
&field_value,
);
}
if let Some(ref field_value) = obj.snapshot_window {
params.put(&format!("{}{}", prefix, "SnapshotWindow"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyCacheClusterResult {
pub cache_cluster: Option<CacheCluster>,
}
struct ModifyCacheClusterResultDeserializer;
impl ModifyCacheClusterResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ModifyCacheClusterResult, XmlParseError> {
deserialize_elements::<_, ModifyCacheClusterResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheCluster" => {
obj.cache_cluster = Some(CacheClusterDeserializer::deserialize(
"CacheCluster",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyCacheParameterGroupMessage {
pub cache_parameter_group_name: String,
pub parameter_name_values: Vec<ParameterNameValue>,
}
struct ModifyCacheParameterGroupMessageSerializer;
impl ModifyCacheParameterGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ModifyCacheParameterGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&obj.cache_parameter_group_name,
);
ParameterNameValueListSerializer::serialize(
params,
&format!("{}{}", prefix, "ParameterNameValue"),
&obj.parameter_name_values,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyCacheSubnetGroupMessage {
pub cache_subnet_group_description: Option<String>,
pub cache_subnet_group_name: String,
pub subnet_ids: Option<Vec<String>>,
}
struct ModifyCacheSubnetGroupMessageSerializer;
impl ModifyCacheSubnetGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ModifyCacheSubnetGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_subnet_group_description {
params.put(
&format!("{}{}", prefix, "CacheSubnetGroupDescription"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "CacheSubnetGroupName"),
&obj.cache_subnet_group_name,
);
if let Some(ref field_value) = obj.subnet_ids {
SubnetIdentifierListSerializer::serialize(
params,
&format!("{}{}", prefix, "SubnetIdentifier"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyCacheSubnetGroupResult {
pub cache_subnet_group: Option<CacheSubnetGroup>,
}
struct ModifyCacheSubnetGroupResultDeserializer;
impl ModifyCacheSubnetGroupResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ModifyCacheSubnetGroupResult, XmlParseError> {
deserialize_elements::<_, ModifyCacheSubnetGroupResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheSubnetGroup" => {
obj.cache_subnet_group = Some(CacheSubnetGroupDeserializer::deserialize(
"CacheSubnetGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyReplicationGroupMessage {
pub apply_immediately: Option<bool>,
pub auto_minor_version_upgrade: Option<bool>,
pub automatic_failover_enabled: Option<bool>,
pub cache_node_type: Option<String>,
pub cache_parameter_group_name: Option<String>,
pub cache_security_group_names: Option<Vec<String>>,
pub engine_version: Option<String>,
pub notification_topic_arn: Option<String>,
pub notification_topic_status: Option<String>,
pub preferred_maintenance_window: Option<String>,
pub primary_cluster_id: Option<String>,
pub replication_group_description: Option<String>,
pub replication_group_id: String,
pub security_group_ids: Option<Vec<String>>,
pub snapshot_retention_limit: Option<i64>,
pub snapshot_window: Option<String>,
pub snapshotting_cluster_id: Option<String>,
}
struct ModifyReplicationGroupMessageSerializer;
impl ModifyReplicationGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ModifyReplicationGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.apply_immediately {
params.put(&format!("{}{}", prefix, "ApplyImmediately"), &field_value);
}
if let Some(ref field_value) = obj.auto_minor_version_upgrade {
params.put(
&format!("{}{}", prefix, "AutoMinorVersionUpgrade"),
&field_value,
);
}
if let Some(ref field_value) = obj.automatic_failover_enabled {
params.put(
&format!("{}{}", prefix, "AutomaticFailoverEnabled"),
&field_value,
);
}
if let Some(ref field_value) = obj.cache_node_type {
params.put(&format!("{}{}", prefix, "CacheNodeType"), &field_value);
}
if let Some(ref field_value) = obj.cache_parameter_group_name {
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.cache_security_group_names {
CacheSecurityGroupNameListSerializer::serialize(
params,
&format!("{}{}", prefix, "CacheSecurityGroupName"),
field_value,
);
}
if let Some(ref field_value) = obj.engine_version {
params.put(&format!("{}{}", prefix, "EngineVersion"), &field_value);
}
if let Some(ref field_value) = obj.notification_topic_arn {
params.put(
&format!("{}{}", prefix, "NotificationTopicArn"),
&field_value,
);
}
if let Some(ref field_value) = obj.notification_topic_status {
params.put(
&format!("{}{}", prefix, "NotificationTopicStatus"),
&field_value,
);
}
if let Some(ref field_value) = obj.preferred_maintenance_window {
params.put(
&format!("{}{}", prefix, "PreferredMaintenanceWindow"),
&field_value,
);
}
if let Some(ref field_value) = obj.primary_cluster_id {
params.put(&format!("{}{}", prefix, "PrimaryClusterId"), &field_value);
}
if let Some(ref field_value) = obj.replication_group_description {
params.put(
&format!("{}{}", prefix, "ReplicationGroupDescription"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "ReplicationGroupId"),
&obj.replication_group_id,
);
if let Some(ref field_value) = obj.security_group_ids {
SecurityGroupIdsListSerializer::serialize(
params,
&format!("{}{}", prefix, "SecurityGroupId"),
field_value,
);
}
if let Some(ref field_value) = obj.snapshot_retention_limit {
params.put(
&format!("{}{}", prefix, "SnapshotRetentionLimit"),
&field_value,
);
}
if let Some(ref field_value) = obj.snapshot_window {
params.put(&format!("{}{}", prefix, "SnapshotWindow"), &field_value);
}
if let Some(ref field_value) = obj.snapshotting_cluster_id {
params.put(
&format!("{}{}", prefix, "SnapshottingClusterId"),
&field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyReplicationGroupResult {
pub replication_group: Option<ReplicationGroup>,
}
struct ModifyReplicationGroupResultDeserializer;
impl ModifyReplicationGroupResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ModifyReplicationGroupResult, XmlParseError> {
deserialize_elements::<_, ModifyReplicationGroupResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ReplicationGroup" => {
obj.replication_group = Some(ReplicationGroupDeserializer::deserialize(
"ReplicationGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyReplicationGroupShardConfigurationMessage {
pub apply_immediately: bool,
pub node_group_count: i64,
pub node_groups_to_remove: Option<Vec<String>>,
pub node_groups_to_retain: Option<Vec<String>>,
pub replication_group_id: String,
pub resharding_configuration: Option<Vec<ReshardingConfiguration>>,
}
struct ModifyReplicationGroupShardConfigurationMessageSerializer;
impl ModifyReplicationGroupShardConfigurationMessageSerializer {
fn serialize(
params: &mut Params,
name: &str,
obj: &ModifyReplicationGroupShardConfigurationMessage,
) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "ApplyImmediately"),
&obj.apply_immediately,
);
params.put(
&format!("{}{}", prefix, "NodeGroupCount"),
&obj.node_group_count,
);
if let Some(ref field_value) = obj.node_groups_to_remove {
NodeGroupsToRemoveListSerializer::serialize(
params,
&format!("{}{}", prefix, "NodeGroupToRemove"),
field_value,
);
}
if let Some(ref field_value) = obj.node_groups_to_retain {
NodeGroupsToRetainListSerializer::serialize(
params,
&format!("{}{}", prefix, "NodeGroupToRetain"),
field_value,
);
}
params.put(
&format!("{}{}", prefix, "ReplicationGroupId"),
&obj.replication_group_id,
);
if let Some(ref field_value) = obj.resharding_configuration {
ReshardingConfigurationListSerializer::serialize(
params,
&format!("{}{}", prefix, "ReshardingConfiguration"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ModifyReplicationGroupShardConfigurationResult {
pub replication_group: Option<ReplicationGroup>,
}
struct ModifyReplicationGroupShardConfigurationResultDeserializer;
impl ModifyReplicationGroupShardConfigurationResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ModifyReplicationGroupShardConfigurationResult, XmlParseError> {
deserialize_elements::<_, ModifyReplicationGroupShardConfigurationResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ReplicationGroup" => {
obj.replication_group = Some(ReplicationGroupDeserializer::deserialize(
"ReplicationGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct NodeGroup {
pub node_group_id: Option<String>,
pub node_group_members: Option<Vec<NodeGroupMember>>,
pub primary_endpoint: Option<Endpoint>,
pub slots: Option<String>,
pub status: Option<String>,
}
struct NodeGroupDeserializer;
impl NodeGroupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<NodeGroup, XmlParseError> {
deserialize_elements::<_, NodeGroup, _>(tag_name, stack, |name, stack, obj| {
match name {
"NodeGroupId" => {
obj.node_group_id =
Some(StringDeserializer::deserialize("NodeGroupId", stack)?);
}
"NodeGroupMembers" => {
obj.node_group_members.get_or_insert(vec![]).extend(
NodeGroupMemberListDeserializer::deserialize("NodeGroupMembers", stack)?,
);
}
"PrimaryEndpoint" => {
obj.primary_endpoint =
Some(EndpointDeserializer::deserialize("PrimaryEndpoint", stack)?);
}
"Slots" => {
obj.slots = Some(StringDeserializer::deserialize("Slots", stack)?);
}
"Status" => {
obj.status = Some(StringDeserializer::deserialize("Status", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct NodeGroupConfiguration {
pub node_group_id: Option<String>,
pub primary_availability_zone: Option<String>,
pub replica_availability_zones: Option<Vec<String>>,
pub replica_count: Option<i64>,
pub slots: Option<String>,
}
struct NodeGroupConfigurationDeserializer;
impl NodeGroupConfigurationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<NodeGroupConfiguration, XmlParseError> {
deserialize_elements::<_, NodeGroupConfiguration, _>(tag_name, stack, |name, stack, obj| {
match name {
"NodeGroupId" => {
obj.node_group_id = Some(AllowedNodeGroupIdDeserializer::deserialize(
"NodeGroupId",
stack,
)?);
}
"PrimaryAvailabilityZone" => {
obj.primary_availability_zone = Some(StringDeserializer::deserialize(
"PrimaryAvailabilityZone",
stack,
)?);
}
"ReplicaAvailabilityZones" => {
obj.replica_availability_zones.get_or_insert(vec![]).extend(
AvailabilityZonesListDeserializer::deserialize(
"ReplicaAvailabilityZones",
stack,
)?,
);
}
"ReplicaCount" => {
obj.replica_count = Some(IntegerOptionalDeserializer::deserialize(
"ReplicaCount",
stack,
)?);
}
"Slots" => {
obj.slots = Some(StringDeserializer::deserialize("Slots", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct NodeGroupConfigurationSerializer;
impl NodeGroupConfigurationSerializer {
fn serialize(params: &mut Params, name: &str, obj: &NodeGroupConfiguration) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.node_group_id {
params.put(&format!("{}{}", prefix, "NodeGroupId"), &field_value);
}
if let Some(ref field_value) = obj.primary_availability_zone {
params.put(
&format!("{}{}", prefix, "PrimaryAvailabilityZone"),
&field_value,
);
}
if let Some(ref field_value) = obj.replica_availability_zones {
AvailabilityZonesListSerializer::serialize(
params,
&format!("{}{}", prefix, "AvailabilityZone"),
field_value,
);
}
if let Some(ref field_value) = obj.replica_count {
params.put(&format!("{}{}", prefix, "ReplicaCount"), &field_value);
}
if let Some(ref field_value) = obj.slots {
params.put(&format!("{}{}", prefix, "Slots"), &field_value);
}
}
}
struct NodeGroupConfigurationListSerializer;
impl NodeGroupConfigurationListSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<NodeGroupConfiguration>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
NodeGroupConfigurationSerializer::serialize(params, &key, obj);
}
}
}
struct NodeGroupListDeserializer;
impl NodeGroupListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<NodeGroup>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "NodeGroup" {
obj.push(NodeGroupDeserializer::deserialize("NodeGroup", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct NodeGroupMember {
pub cache_cluster_id: Option<String>,
pub cache_node_id: Option<String>,
pub current_role: Option<String>,
pub preferred_availability_zone: Option<String>,
pub read_endpoint: Option<Endpoint>,
}
struct NodeGroupMemberDeserializer;
impl NodeGroupMemberDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<NodeGroupMember, XmlParseError> {
deserialize_elements::<_, NodeGroupMember, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheClusterId" => {
obj.cache_cluster_id =
Some(StringDeserializer::deserialize("CacheClusterId", stack)?);
}
"CacheNodeId" => {
obj.cache_node_id =
Some(StringDeserializer::deserialize("CacheNodeId", stack)?);
}
"CurrentRole" => {
obj.current_role = Some(StringDeserializer::deserialize("CurrentRole", stack)?);
}
"PreferredAvailabilityZone" => {
obj.preferred_availability_zone = Some(StringDeserializer::deserialize(
"PreferredAvailabilityZone",
stack,
)?);
}
"ReadEndpoint" => {
obj.read_endpoint =
Some(EndpointDeserializer::deserialize("ReadEndpoint", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct NodeGroupMemberListDeserializer;
impl NodeGroupMemberListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<NodeGroupMember>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "NodeGroupMember" {
obj.push(NodeGroupMemberDeserializer::deserialize(
"NodeGroupMember",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct NodeGroupMemberUpdateStatus {
pub cache_cluster_id: Option<String>,
pub cache_node_id: Option<String>,
pub node_deletion_date: Option<String>,
pub node_update_end_date: Option<String>,
pub node_update_initiated_by: Option<String>,
pub node_update_initiated_date: Option<String>,
pub node_update_start_date: Option<String>,
pub node_update_status: Option<String>,
pub node_update_status_modified_date: Option<String>,
}
struct NodeGroupMemberUpdateStatusDeserializer;
impl NodeGroupMemberUpdateStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<NodeGroupMemberUpdateStatus, XmlParseError> {
deserialize_elements::<_, NodeGroupMemberUpdateStatus, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheClusterId" => {
obj.cache_cluster_id =
Some(StringDeserializer::deserialize("CacheClusterId", stack)?);
}
"CacheNodeId" => {
obj.cache_node_id =
Some(StringDeserializer::deserialize("CacheNodeId", stack)?);
}
"NodeDeletionDate" => {
obj.node_deletion_date =
Some(TStampDeserializer::deserialize("NodeDeletionDate", stack)?);
}
"NodeUpdateEndDate" => {
obj.node_update_end_date =
Some(TStampDeserializer::deserialize("NodeUpdateEndDate", stack)?);
}
"NodeUpdateInitiatedBy" => {
obj.node_update_initiated_by =
Some(NodeUpdateInitiatedByDeserializer::deserialize(
"NodeUpdateInitiatedBy",
stack,
)?);
}
"NodeUpdateInitiatedDate" => {
obj.node_update_initiated_date = Some(TStampDeserializer::deserialize(
"NodeUpdateInitiatedDate",
stack,
)?);
}
"NodeUpdateStartDate" => {
obj.node_update_start_date = Some(TStampDeserializer::deserialize(
"NodeUpdateStartDate",
stack,
)?);
}
"NodeUpdateStatus" => {
obj.node_update_status = Some(NodeUpdateStatusDeserializer::deserialize(
"NodeUpdateStatus",
stack,
)?);
}
"NodeUpdateStatusModifiedDate" => {
obj.node_update_status_modified_date = Some(
TStampDeserializer::deserialize("NodeUpdateStatusModifiedDate", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct NodeGroupMemberUpdateStatusListDeserializer;
impl NodeGroupMemberUpdateStatusListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<NodeGroupMemberUpdateStatus>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "NodeGroupMemberUpdateStatus" {
obj.push(NodeGroupMemberUpdateStatusDeserializer::deserialize(
"NodeGroupMemberUpdateStatus",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct NodeGroupUpdateStatus {
pub node_group_id: Option<String>,
pub node_group_member_update_status: Option<Vec<NodeGroupMemberUpdateStatus>>,
}
struct NodeGroupUpdateStatusDeserializer;
impl NodeGroupUpdateStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<NodeGroupUpdateStatus, XmlParseError> {
deserialize_elements::<_, NodeGroupUpdateStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"NodeGroupId" => {
obj.node_group_id =
Some(StringDeserializer::deserialize("NodeGroupId", stack)?);
}
"NodeGroupMemberUpdateStatus" => {
obj.node_group_member_update_status
.get_or_insert(vec![])
.extend(NodeGroupMemberUpdateStatusListDeserializer::deserialize(
"NodeGroupMemberUpdateStatus",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct NodeGroupUpdateStatusListDeserializer;
impl NodeGroupUpdateStatusListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<NodeGroupUpdateStatus>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "NodeGroupUpdateStatus" {
obj.push(NodeGroupUpdateStatusDeserializer::deserialize(
"NodeGroupUpdateStatus",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct NodeGroupsToRemoveListSerializer;
impl NodeGroupsToRemoveListSerializer {
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 NodeGroupsToRetainListSerializer;
impl NodeGroupsToRetainListSerializer {
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 NodeSnapshot {
pub cache_cluster_id: Option<String>,
pub cache_node_create_time: Option<String>,
pub cache_node_id: Option<String>,
pub cache_size: Option<String>,
pub node_group_configuration: Option<NodeGroupConfiguration>,
pub node_group_id: Option<String>,
pub snapshot_create_time: Option<String>,
}
struct NodeSnapshotDeserializer;
impl NodeSnapshotDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<NodeSnapshot, XmlParseError> {
deserialize_elements::<_, NodeSnapshot, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheClusterId" => {
obj.cache_cluster_id =
Some(StringDeserializer::deserialize("CacheClusterId", stack)?);
}
"CacheNodeCreateTime" => {
obj.cache_node_create_time = Some(TStampDeserializer::deserialize(
"CacheNodeCreateTime",
stack,
)?);
}
"CacheNodeId" => {
obj.cache_node_id =
Some(StringDeserializer::deserialize("CacheNodeId", stack)?);
}
"CacheSize" => {
obj.cache_size = Some(StringDeserializer::deserialize("CacheSize", stack)?);
}
"NodeGroupConfiguration" => {
obj.node_group_configuration =
Some(NodeGroupConfigurationDeserializer::deserialize(
"NodeGroupConfiguration",
stack,
)?);
}
"NodeGroupId" => {
obj.node_group_id =
Some(StringDeserializer::deserialize("NodeGroupId", stack)?);
}
"SnapshotCreateTime" => {
obj.snapshot_create_time = Some(TStampDeserializer::deserialize(
"SnapshotCreateTime",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct NodeSnapshotListDeserializer;
impl NodeSnapshotListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<NodeSnapshot>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "NodeSnapshot" {
obj.push(NodeSnapshotDeserializer::deserialize(
"NodeSnapshot",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct NodeTypeListDeserializer;
impl NodeTypeListDeserializer {
#[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(StringDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct NodeUpdateInitiatedByDeserializer;
impl NodeUpdateInitiatedByDeserializer {
#[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 NodeUpdateStatusDeserializer;
impl NodeUpdateStatusDeserializer {
#[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 NotificationConfiguration {
pub topic_arn: Option<String>,
pub topic_status: Option<String>,
}
struct NotificationConfigurationDeserializer;
impl NotificationConfigurationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<NotificationConfiguration, XmlParseError> {
deserialize_elements::<_, NotificationConfiguration, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"TopicArn" => {
obj.topic_arn = Some(StringDeserializer::deserialize("TopicArn", stack)?);
}
"TopicStatus" => {
obj.topic_status =
Some(StringDeserializer::deserialize("TopicStatus", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Parameter {
pub allowed_values: Option<String>,
pub change_type: Option<String>,
pub data_type: Option<String>,
pub description: Option<String>,
pub is_modifiable: Option<bool>,
pub minimum_engine_version: Option<String>,
pub parameter_name: Option<String>,
pub parameter_value: Option<String>,
pub source: Option<String>,
}
struct ParameterDeserializer;
impl ParameterDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Parameter, XmlParseError> {
deserialize_elements::<_, Parameter, _>(tag_name, stack, |name, stack, obj| {
match name {
"AllowedValues" => {
obj.allowed_values =
Some(StringDeserializer::deserialize("AllowedValues", stack)?);
}
"ChangeType" => {
obj.change_type =
Some(ChangeTypeDeserializer::deserialize("ChangeType", stack)?);
}
"DataType" => {
obj.data_type = Some(StringDeserializer::deserialize("DataType", stack)?);
}
"Description" => {
obj.description = Some(StringDeserializer::deserialize("Description", stack)?);
}
"IsModifiable" => {
obj.is_modifiable =
Some(BooleanDeserializer::deserialize("IsModifiable", stack)?);
}
"MinimumEngineVersion" => {
obj.minimum_engine_version = Some(StringDeserializer::deserialize(
"MinimumEngineVersion",
stack,
)?);
}
"ParameterName" => {
obj.parameter_name =
Some(StringDeserializer::deserialize("ParameterName", stack)?);
}
"ParameterValue" => {
obj.parameter_value =
Some(StringDeserializer::deserialize("ParameterValue", stack)?);
}
"Source" => {
obj.source = Some(StringDeserializer::deserialize("Source", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ParameterNameValue {
pub parameter_name: Option<String>,
pub parameter_value: Option<String>,
}
struct ParameterNameValueSerializer;
impl ParameterNameValueSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ParameterNameValue) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.parameter_name {
params.put(&format!("{}{}", prefix, "ParameterName"), &field_value);
}
if let Some(ref field_value) = obj.parameter_value {
params.put(&format!("{}{}", prefix, "ParameterValue"), &field_value);
}
}
}
struct ParameterNameValueListSerializer;
impl ParameterNameValueListSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<ParameterNameValue>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
ParameterNameValueSerializer::serialize(params, &key, obj);
}
}
}
struct ParametersListDeserializer;
impl ParametersListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Parameter>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Parameter" {
obj.push(ParameterDeserializer::deserialize("Parameter", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct PendingAutomaticFailoverStatusDeserializer;
impl PendingAutomaticFailoverStatusDeserializer {
#[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 PendingModifiedValues {
pub cache_node_ids_to_remove: Option<Vec<String>>,
pub cache_node_type: Option<String>,
pub engine_version: Option<String>,
pub num_cache_nodes: Option<i64>,
}
struct PendingModifiedValuesDeserializer;
impl PendingModifiedValuesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PendingModifiedValues, XmlParseError> {
deserialize_elements::<_, PendingModifiedValues, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheNodeIdsToRemove" => {
obj.cache_node_ids_to_remove.get_or_insert(vec![]).extend(
CacheNodeIdsListDeserializer::deserialize("CacheNodeIdsToRemove", stack)?,
);
}
"CacheNodeType" => {
obj.cache_node_type =
Some(StringDeserializer::deserialize("CacheNodeType", stack)?);
}
"EngineVersion" => {
obj.engine_version =
Some(StringDeserializer::deserialize("EngineVersion", stack)?);
}
"NumCacheNodes" => {
obj.num_cache_nodes = Some(IntegerOptionalDeserializer::deserialize(
"NumCacheNodes",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct PreferredAvailabilityZoneListSerializer;
impl PreferredAvailabilityZoneListSerializer {
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 ProcessedUpdateAction {
pub replication_group_id: Option<String>,
pub service_update_name: Option<String>,
pub update_action_status: Option<String>,
}
struct ProcessedUpdateActionDeserializer;
impl ProcessedUpdateActionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ProcessedUpdateAction, XmlParseError> {
deserialize_elements::<_, ProcessedUpdateAction, _>(tag_name, stack, |name, stack, obj| {
match name {
"ReplicationGroupId" => {
obj.replication_group_id = Some(StringDeserializer::deserialize(
"ReplicationGroupId",
stack,
)?);
}
"ServiceUpdateName" => {
obj.service_update_name =
Some(StringDeserializer::deserialize("ServiceUpdateName", stack)?);
}
"UpdateActionStatus" => {
obj.update_action_status = Some(UpdateActionStatusDeserializer::deserialize(
"UpdateActionStatus",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ProcessedUpdateActionListDeserializer;
impl ProcessedUpdateActionListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ProcessedUpdateAction>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "ProcessedUpdateAction" {
obj.push(ProcessedUpdateActionDeserializer::deserialize(
"ProcessedUpdateAction",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PurchaseReservedCacheNodesOfferingMessage {
pub cache_node_count: Option<i64>,
pub reserved_cache_node_id: Option<String>,
pub reserved_cache_nodes_offering_id: String,
}
struct PurchaseReservedCacheNodesOfferingMessageSerializer;
impl PurchaseReservedCacheNodesOfferingMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &PurchaseReservedCacheNodesOfferingMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.cache_node_count {
params.put(&format!("{}{}", prefix, "CacheNodeCount"), &field_value);
}
if let Some(ref field_value) = obj.reserved_cache_node_id {
params.put(
&format!("{}{}", prefix, "ReservedCacheNodeId"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "ReservedCacheNodesOfferingId"),
&obj.reserved_cache_nodes_offering_id,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PurchaseReservedCacheNodesOfferingResult {
pub reserved_cache_node: Option<ReservedCacheNode>,
}
struct PurchaseReservedCacheNodesOfferingResultDeserializer;
impl PurchaseReservedCacheNodesOfferingResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PurchaseReservedCacheNodesOfferingResult, XmlParseError> {
deserialize_elements::<_, PurchaseReservedCacheNodesOfferingResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ReservedCacheNode" => {
obj.reserved_cache_node = Some(ReservedCacheNodeDeserializer::deserialize(
"ReservedCacheNode",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct RebootCacheClusterMessage {
pub cache_cluster_id: String,
pub cache_node_ids_to_reboot: Vec<String>,
}
struct RebootCacheClusterMessageSerializer;
impl RebootCacheClusterMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &RebootCacheClusterMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheClusterId"),
&obj.cache_cluster_id,
);
CacheNodeIdsListSerializer::serialize(
params,
&format!("{}{}", prefix, "CacheNodeId"),
&obj.cache_node_ids_to_reboot,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct RebootCacheClusterResult {
pub cache_cluster: Option<CacheCluster>,
}
struct RebootCacheClusterResultDeserializer;
impl RebootCacheClusterResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<RebootCacheClusterResult, XmlParseError> {
deserialize_elements::<_, RebootCacheClusterResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheCluster" => {
obj.cache_cluster = Some(CacheClusterDeserializer::deserialize(
"CacheCluster",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct RecurringCharge {
pub recurring_charge_amount: Option<f64>,
pub recurring_charge_frequency: Option<String>,
}
struct RecurringChargeDeserializer;
impl RecurringChargeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<RecurringCharge, XmlParseError> {
deserialize_elements::<_, RecurringCharge, _>(tag_name, stack, |name, stack, obj| {
match name {
"RecurringChargeAmount" => {
obj.recurring_charge_amount = Some(DoubleDeserializer::deserialize(
"RecurringChargeAmount",
stack,
)?);
}
"RecurringChargeFrequency" => {
obj.recurring_charge_frequency = Some(StringDeserializer::deserialize(
"RecurringChargeFrequency",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct RecurringChargeListDeserializer;
impl RecurringChargeListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<RecurringCharge>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "RecurringCharge" {
obj.push(RecurringChargeDeserializer::deserialize(
"RecurringCharge",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct RemoveReplicasListSerializer;
impl RemoveReplicasListSerializer {
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 RemoveTagsFromResourceMessage {
pub resource_name: String,
pub tag_keys: Vec<String>,
}
struct RemoveTagsFromResourceMessageSerializer;
impl RemoveTagsFromResourceMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &RemoveTagsFromResourceMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "ResourceName"), &obj.resource_name);
KeyListSerializer::serialize(params, &format!("{}{}", prefix, "TagKeys"), &obj.tag_keys);
}
}
struct ReplicaConfigurationListSerializer;
impl ReplicaConfigurationListSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<ConfigureShard>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
ConfigureShardSerializer::serialize(params, &key, obj);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReplicationGroup {
pub at_rest_encryption_enabled: Option<bool>,
pub auth_token_enabled: Option<bool>,
pub automatic_failover: Option<String>,
pub cache_node_type: Option<String>,
pub cluster_enabled: Option<bool>,
pub configuration_endpoint: Option<Endpoint>,
pub description: Option<String>,
pub member_clusters: Option<Vec<String>>,
pub node_groups: Option<Vec<NodeGroup>>,
pub pending_modified_values: Option<ReplicationGroupPendingModifiedValues>,
pub replication_group_id: Option<String>,
pub snapshot_retention_limit: Option<i64>,
pub snapshot_window: Option<String>,
pub snapshotting_cluster_id: Option<String>,
pub status: Option<String>,
pub transit_encryption_enabled: Option<bool>,
}
struct ReplicationGroupDeserializer;
impl ReplicationGroupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ReplicationGroup, XmlParseError> {
deserialize_elements::<_, ReplicationGroup, _>(tag_name, stack, |name, stack, obj| {
match name {
"AtRestEncryptionEnabled" => {
obj.at_rest_encryption_enabled = Some(
BooleanOptionalDeserializer::deserialize("AtRestEncryptionEnabled", stack)?,
);
}
"AuthTokenEnabled" => {
obj.auth_token_enabled = Some(BooleanOptionalDeserializer::deserialize(
"AuthTokenEnabled",
stack,
)?);
}
"AutomaticFailover" => {
obj.automatic_failover =
Some(AutomaticFailoverStatusDeserializer::deserialize(
"AutomaticFailover",
stack,
)?);
}
"CacheNodeType" => {
obj.cache_node_type =
Some(StringDeserializer::deserialize("CacheNodeType", stack)?);
}
"ClusterEnabled" => {
obj.cluster_enabled = Some(BooleanOptionalDeserializer::deserialize(
"ClusterEnabled",
stack,
)?);
}
"ConfigurationEndpoint" => {
obj.configuration_endpoint = Some(EndpointDeserializer::deserialize(
"ConfigurationEndpoint",
stack,
)?);
}
"Description" => {
obj.description = Some(StringDeserializer::deserialize("Description", stack)?);
}
"MemberClusters" => {
obj.member_clusters.get_or_insert(vec![]).extend(
ClusterIdListDeserializer::deserialize("MemberClusters", stack)?,
);
}
"NodeGroups" => {
obj.node_groups
.get_or_insert(vec![])
.extend(NodeGroupListDeserializer::deserialize("NodeGroups", stack)?);
}
"PendingModifiedValues" => {
obj.pending_modified_values = Some(
ReplicationGroupPendingModifiedValuesDeserializer::deserialize(
"PendingModifiedValues",
stack,
)?,
);
}
"ReplicationGroupId" => {
obj.replication_group_id = Some(StringDeserializer::deserialize(
"ReplicationGroupId",
stack,
)?);
}
"SnapshotRetentionLimit" => {
obj.snapshot_retention_limit = Some(IntegerOptionalDeserializer::deserialize(
"SnapshotRetentionLimit",
stack,
)?);
}
"SnapshotWindow" => {
obj.snapshot_window =
Some(StringDeserializer::deserialize("SnapshotWindow", stack)?);
}
"SnapshottingClusterId" => {
obj.snapshotting_cluster_id = Some(StringDeserializer::deserialize(
"SnapshottingClusterId",
stack,
)?);
}
"Status" => {
obj.status = Some(StringDeserializer::deserialize("Status", stack)?);
}
"TransitEncryptionEnabled" => {
obj.transit_encryption_enabled =
Some(BooleanOptionalDeserializer::deserialize(
"TransitEncryptionEnabled",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ReplicationGroupIdListSerializer;
impl ReplicationGroupIdListSerializer {
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 ReplicationGroupListDeserializer;
impl ReplicationGroupListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ReplicationGroup>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "ReplicationGroup" {
obj.push(ReplicationGroupDeserializer::deserialize(
"ReplicationGroup",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReplicationGroupMessage {
pub marker: Option<String>,
pub replication_groups: Option<Vec<ReplicationGroup>>,
}
struct ReplicationGroupMessageDeserializer;
impl ReplicationGroupMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ReplicationGroupMessage, XmlParseError> {
deserialize_elements::<_, ReplicationGroupMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
"ReplicationGroups" => {
obj.replication_groups.get_or_insert(vec![]).extend(
ReplicationGroupListDeserializer::deserialize(
"ReplicationGroups",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReplicationGroupPendingModifiedValues {
pub automatic_failover_status: Option<String>,
pub primary_cluster_id: Option<String>,
pub resharding: Option<ReshardingStatus>,
}
struct ReplicationGroupPendingModifiedValuesDeserializer;
impl ReplicationGroupPendingModifiedValuesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ReplicationGroupPendingModifiedValues, XmlParseError> {
deserialize_elements::<_, ReplicationGroupPendingModifiedValues, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AutomaticFailoverStatus" => {
obj.automatic_failover_status =
Some(PendingAutomaticFailoverStatusDeserializer::deserialize(
"AutomaticFailoverStatus",
stack,
)?);
}
"PrimaryClusterId" => {
obj.primary_cluster_id =
Some(StringDeserializer::deserialize("PrimaryClusterId", stack)?);
}
"Resharding" => {
obj.resharding = Some(ReshardingStatusDeserializer::deserialize(
"Resharding",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReservedCacheNode {
pub cache_node_count: Option<i64>,
pub cache_node_type: Option<String>,
pub duration: Option<i64>,
pub fixed_price: Option<f64>,
pub offering_type: Option<String>,
pub product_description: Option<String>,
pub recurring_charges: Option<Vec<RecurringCharge>>,
pub reservation_arn: Option<String>,
pub reserved_cache_node_id: Option<String>,
pub reserved_cache_nodes_offering_id: Option<String>,
pub start_time: Option<String>,
pub state: Option<String>,
pub usage_price: Option<f64>,
}
struct ReservedCacheNodeDeserializer;
impl ReservedCacheNodeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ReservedCacheNode, XmlParseError> {
deserialize_elements::<_, ReservedCacheNode, _>(tag_name, stack, |name, stack, obj| {
match name {
"CacheNodeCount" => {
obj.cache_node_count =
Some(IntegerDeserializer::deserialize("CacheNodeCount", stack)?);
}
"CacheNodeType" => {
obj.cache_node_type =
Some(StringDeserializer::deserialize("CacheNodeType", stack)?);
}
"Duration" => {
obj.duration = Some(IntegerDeserializer::deserialize("Duration", stack)?);
}
"FixedPrice" => {
obj.fixed_price = Some(DoubleDeserializer::deserialize("FixedPrice", stack)?);
}
"OfferingType" => {
obj.offering_type =
Some(StringDeserializer::deserialize("OfferingType", stack)?);
}
"ProductDescription" => {
obj.product_description = Some(StringDeserializer::deserialize(
"ProductDescription",
stack,
)?);
}
"RecurringCharges" => {
obj.recurring_charges.get_or_insert(vec![]).extend(
RecurringChargeListDeserializer::deserialize("RecurringCharges", stack)?,
);
}
"ReservationARN" => {
obj.reservation_arn =
Some(StringDeserializer::deserialize("ReservationARN", stack)?);
}
"ReservedCacheNodeId" => {
obj.reserved_cache_node_id = Some(StringDeserializer::deserialize(
"ReservedCacheNodeId",
stack,
)?);
}
"ReservedCacheNodesOfferingId" => {
obj.reserved_cache_nodes_offering_id = Some(StringDeserializer::deserialize(
"ReservedCacheNodesOfferingId",
stack,
)?);
}
"StartTime" => {
obj.start_time = Some(TStampDeserializer::deserialize("StartTime", stack)?);
}
"State" => {
obj.state = Some(StringDeserializer::deserialize("State", stack)?);
}
"UsagePrice" => {
obj.usage_price = Some(DoubleDeserializer::deserialize("UsagePrice", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ReservedCacheNodeListDeserializer;
impl ReservedCacheNodeListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ReservedCacheNode>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "ReservedCacheNode" {
obj.push(ReservedCacheNodeDeserializer::deserialize(
"ReservedCacheNode",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReservedCacheNodeMessage {
pub marker: Option<String>,
pub reserved_cache_nodes: Option<Vec<ReservedCacheNode>>,
}
struct ReservedCacheNodeMessageDeserializer;
impl ReservedCacheNodeMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ReservedCacheNodeMessage, XmlParseError> {
deserialize_elements::<_, ReservedCacheNodeMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
"ReservedCacheNodes" => {
obj.reserved_cache_nodes.get_or_insert(vec![]).extend(
ReservedCacheNodeListDeserializer::deserialize(
"ReservedCacheNodes",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReservedCacheNodesOffering {
pub cache_node_type: Option<String>,
pub duration: Option<i64>,
pub fixed_price: Option<f64>,
pub offering_type: Option<String>,
pub product_description: Option<String>,
pub recurring_charges: Option<Vec<RecurringCharge>>,
pub reserved_cache_nodes_offering_id: Option<String>,
pub usage_price: Option<f64>,
}
struct ReservedCacheNodesOfferingDeserializer;
impl ReservedCacheNodesOfferingDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ReservedCacheNodesOffering, XmlParseError> {
deserialize_elements::<_, ReservedCacheNodesOffering, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheNodeType" => {
obj.cache_node_type =
Some(StringDeserializer::deserialize("CacheNodeType", stack)?);
}
"Duration" => {
obj.duration = Some(IntegerDeserializer::deserialize("Duration", stack)?);
}
"FixedPrice" => {
obj.fixed_price =
Some(DoubleDeserializer::deserialize("FixedPrice", stack)?);
}
"OfferingType" => {
obj.offering_type =
Some(StringDeserializer::deserialize("OfferingType", stack)?);
}
"ProductDescription" => {
obj.product_description = Some(StringDeserializer::deserialize(
"ProductDescription",
stack,
)?);
}
"RecurringCharges" => {
obj.recurring_charges.get_or_insert(vec![]).extend(
RecurringChargeListDeserializer::deserialize(
"RecurringCharges",
stack,
)?,
);
}
"ReservedCacheNodesOfferingId" => {
obj.reserved_cache_nodes_offering_id = Some(
StringDeserializer::deserialize("ReservedCacheNodesOfferingId", stack)?,
);
}
"UsagePrice" => {
obj.usage_price =
Some(DoubleDeserializer::deserialize("UsagePrice", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct ReservedCacheNodesOfferingListDeserializer;
impl ReservedCacheNodesOfferingListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ReservedCacheNodesOffering>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "ReservedCacheNodesOffering" {
obj.push(ReservedCacheNodesOfferingDeserializer::deserialize(
"ReservedCacheNodesOffering",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReservedCacheNodesOfferingMessage {
pub marker: Option<String>,
pub reserved_cache_nodes_offerings: Option<Vec<ReservedCacheNodesOffering>>,
}
struct ReservedCacheNodesOfferingMessageDeserializer;
impl ReservedCacheNodesOfferingMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ReservedCacheNodesOfferingMessage, XmlParseError> {
deserialize_elements::<_, ReservedCacheNodesOfferingMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
"ReservedCacheNodesOfferings" => {
obj.reserved_cache_nodes_offerings
.get_or_insert(vec![])
.extend(ReservedCacheNodesOfferingListDeserializer::deserialize(
"ReservedCacheNodesOfferings",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ResetCacheParameterGroupMessage {
pub cache_parameter_group_name: String,
pub parameter_name_values: Option<Vec<ParameterNameValue>>,
pub reset_all_parameters: Option<bool>,
}
struct ResetCacheParameterGroupMessageSerializer;
impl ResetCacheParameterGroupMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ResetCacheParameterGroupMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheParameterGroupName"),
&obj.cache_parameter_group_name,
);
if let Some(ref field_value) = obj.parameter_name_values {
ParameterNameValueListSerializer::serialize(
params,
&format!("{}{}", prefix, "ParameterNameValue"),
field_value,
);
}
if let Some(ref field_value) = obj.reset_all_parameters {
params.put(&format!("{}{}", prefix, "ResetAllParameters"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReshardingConfiguration {
pub node_group_id: Option<String>,
pub preferred_availability_zones: Option<Vec<String>>,
}
struct ReshardingConfigurationSerializer;
impl ReshardingConfigurationSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ReshardingConfiguration) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.node_group_id {
params.put(&format!("{}{}", prefix, "NodeGroupId"), &field_value);
}
if let Some(ref field_value) = obj.preferred_availability_zones {
AvailabilityZonesListSerializer::serialize(
params,
&format!("{}{}", prefix, "AvailabilityZone"),
field_value,
);
}
}
}
struct ReshardingConfigurationListSerializer;
impl ReshardingConfigurationListSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<ReshardingConfiguration>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
ReshardingConfigurationSerializer::serialize(params, &key, obj);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ReshardingStatus {
pub slot_migration: Option<SlotMigration>,
}
struct ReshardingStatusDeserializer;
impl ReshardingStatusDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ReshardingStatus, XmlParseError> {
deserialize_elements::<_, ReshardingStatus, _>(tag_name, stack, |name, stack, obj| {
match name {
"SlotMigration" => {
obj.slot_migration = Some(SlotMigrationDeserializer::deserialize(
"SlotMigration",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct RevokeCacheSecurityGroupIngressMessage {
pub cache_security_group_name: String,
pub ec2_security_group_name: String,
pub ec2_security_group_owner_id: String,
}
struct RevokeCacheSecurityGroupIngressMessageSerializer;
impl RevokeCacheSecurityGroupIngressMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &RevokeCacheSecurityGroupIngressMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "CacheSecurityGroupName"),
&obj.cache_security_group_name,
);
params.put(
&format!("{}{}", prefix, "EC2SecurityGroupName"),
&obj.ec2_security_group_name,
);
params.put(
&format!("{}{}", prefix, "EC2SecurityGroupOwnerId"),
&obj.ec2_security_group_owner_id,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct RevokeCacheSecurityGroupIngressResult {
pub cache_security_group: Option<CacheSecurityGroup>,
}
struct RevokeCacheSecurityGroupIngressResultDeserializer;
impl RevokeCacheSecurityGroupIngressResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<RevokeCacheSecurityGroupIngressResult, XmlParseError> {
deserialize_elements::<_, RevokeCacheSecurityGroupIngressResult, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CacheSecurityGroup" => {
obj.cache_security_group =
Some(CacheSecurityGroupDeserializer::deserialize(
"CacheSecurityGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct SecurityGroupIdsListSerializer;
impl SecurityGroupIdsListSerializer {
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 SecurityGroupMembership {
pub security_group_id: Option<String>,
pub status: Option<String>,
}
struct SecurityGroupMembershipDeserializer;
impl SecurityGroupMembershipDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<SecurityGroupMembership, XmlParseError> {
deserialize_elements::<_, SecurityGroupMembership, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"SecurityGroupId" => {
obj.security_group_id =
Some(StringDeserializer::deserialize("SecurityGroupId", stack)?);
}
"Status" => {
obj.status = Some(StringDeserializer::deserialize("Status", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct SecurityGroupMembershipListDeserializer;
impl SecurityGroupMembershipListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<SecurityGroupMembership>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(SecurityGroupMembershipDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ServiceUpdate {
pub auto_update_after_recommended_apply_by_date: Option<bool>,
pub engine: Option<String>,
pub engine_version: Option<String>,
pub estimated_update_time: Option<String>,
pub service_update_description: Option<String>,
pub service_update_end_date: Option<String>,
pub service_update_name: Option<String>,
pub service_update_recommended_apply_by_date: Option<String>,
pub service_update_release_date: Option<String>,
pub service_update_severity: Option<String>,
pub service_update_status: Option<String>,
pub service_update_type: Option<String>,
}
struct ServiceUpdateDeserializer;
impl ServiceUpdateDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ServiceUpdate, XmlParseError> {
deserialize_elements::<_, ServiceUpdate, _>(tag_name, stack, |name, stack, obj| {
match name {
"AutoUpdateAfterRecommendedApplyByDate" => {
obj.auto_update_after_recommended_apply_by_date =
Some(BooleanOptionalDeserializer::deserialize(
"AutoUpdateAfterRecommendedApplyByDate",
stack,
)?);
}
"Engine" => {
obj.engine = Some(StringDeserializer::deserialize("Engine", stack)?);
}
"EngineVersion" => {
obj.engine_version =
Some(StringDeserializer::deserialize("EngineVersion", stack)?);
}
"EstimatedUpdateTime" => {
obj.estimated_update_time = Some(StringDeserializer::deserialize(
"EstimatedUpdateTime",
stack,
)?);
}
"ServiceUpdateDescription" => {
obj.service_update_description = Some(StringDeserializer::deserialize(
"ServiceUpdateDescription",
stack,
)?);
}
"ServiceUpdateEndDate" => {
obj.service_update_end_date = Some(TStampDeserializer::deserialize(
"ServiceUpdateEndDate",
stack,
)?);
}
"ServiceUpdateName" => {
obj.service_update_name =
Some(StringDeserializer::deserialize("ServiceUpdateName", stack)?);
}
"ServiceUpdateRecommendedApplyByDate" => {
obj.service_update_recommended_apply_by_date =
Some(TStampDeserializer::deserialize(
"ServiceUpdateRecommendedApplyByDate",
stack,
)?);
}
"ServiceUpdateReleaseDate" => {
obj.service_update_release_date = Some(TStampDeserializer::deserialize(
"ServiceUpdateReleaseDate",
stack,
)?);
}
"ServiceUpdateSeverity" => {
obj.service_update_severity =
Some(ServiceUpdateSeverityDeserializer::deserialize(
"ServiceUpdateSeverity",
stack,
)?);
}
"ServiceUpdateStatus" => {
obj.service_update_status = Some(ServiceUpdateStatusDeserializer::deserialize(
"ServiceUpdateStatus",
stack,
)?);
}
"ServiceUpdateType" => {
obj.service_update_type = Some(ServiceUpdateTypeDeserializer::deserialize(
"ServiceUpdateType",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ServiceUpdateListDeserializer;
impl ServiceUpdateListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ServiceUpdate>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "ServiceUpdate" {
obj.push(ServiceUpdateDeserializer::deserialize(
"ServiceUpdate",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct ServiceUpdateSeverityDeserializer;
impl ServiceUpdateSeverityDeserializer {
#[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 ServiceUpdateStatusDeserializer;
impl ServiceUpdateStatusDeserializer {
#[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 ServiceUpdateStatusListSerializer;
impl ServiceUpdateStatusListSerializer {
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 ServiceUpdateTypeDeserializer;
impl ServiceUpdateTypeDeserializer {
#[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 ServiceUpdatesMessage {
pub marker: Option<String>,
pub service_updates: Option<Vec<ServiceUpdate>>,
}
struct ServiceUpdatesMessageDeserializer;
impl ServiceUpdatesMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ServiceUpdatesMessage, XmlParseError> {
deserialize_elements::<_, ServiceUpdatesMessage, _>(tag_name, stack, |name, stack, obj| {
match name {
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
"ServiceUpdates" => {
obj.service_updates.get_or_insert(vec![]).extend(
ServiceUpdateListDeserializer::deserialize("ServiceUpdates", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct SlaMetDeserializer;
impl SlaMetDeserializer {
#[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 SlotMigration {
pub progress_percentage: Option<f64>,
}
struct SlotMigrationDeserializer;
impl SlotMigrationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<SlotMigration, XmlParseError> {
deserialize_elements::<_, SlotMigration, _>(tag_name, stack, |name, stack, obj| {
match name {
"ProgressPercentage" => {
obj.progress_percentage = Some(DoubleDeserializer::deserialize(
"ProgressPercentage",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Snapshot {
pub auto_minor_version_upgrade: Option<bool>,
pub automatic_failover: Option<String>,
pub cache_cluster_create_time: Option<String>,
pub cache_cluster_id: Option<String>,
pub cache_node_type: Option<String>,
pub cache_parameter_group_name: Option<String>,
pub cache_subnet_group_name: Option<String>,
pub engine: Option<String>,
pub engine_version: Option<String>,
pub node_snapshots: Option<Vec<NodeSnapshot>>,
pub num_cache_nodes: Option<i64>,
pub num_node_groups: Option<i64>,
pub port: Option<i64>,
pub preferred_availability_zone: Option<String>,
pub preferred_maintenance_window: Option<String>,
pub replication_group_description: Option<String>,
pub replication_group_id: Option<String>,
pub snapshot_name: Option<String>,
pub snapshot_retention_limit: Option<i64>,
pub snapshot_source: Option<String>,
pub snapshot_status: Option<String>,
pub snapshot_window: Option<String>,
pub topic_arn: Option<String>,
pub vpc_id: Option<String>,
}
struct SnapshotDeserializer;
impl SnapshotDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Snapshot, XmlParseError> {
deserialize_elements::<_, Snapshot, _>(tag_name, stack, |name, stack, obj| {
match name {
"AutoMinorVersionUpgrade" => {
obj.auto_minor_version_upgrade = Some(BooleanDeserializer::deserialize(
"AutoMinorVersionUpgrade",
stack,
)?);
}
"AutomaticFailover" => {
obj.automatic_failover =
Some(AutomaticFailoverStatusDeserializer::deserialize(
"AutomaticFailover",
stack,
)?);
}
"CacheClusterCreateTime" => {
obj.cache_cluster_create_time = Some(TStampDeserializer::deserialize(
"CacheClusterCreateTime",
stack,
)?);
}
"CacheClusterId" => {
obj.cache_cluster_id =
Some(StringDeserializer::deserialize("CacheClusterId", stack)?);
}
"CacheNodeType" => {
obj.cache_node_type =
Some(StringDeserializer::deserialize("CacheNodeType", stack)?);
}
"CacheParameterGroupName" => {
obj.cache_parameter_group_name = Some(StringDeserializer::deserialize(
"CacheParameterGroupName",
stack,
)?);
}
"CacheSubnetGroupName" => {
obj.cache_subnet_group_name = Some(StringDeserializer::deserialize(
"CacheSubnetGroupName",
stack,
)?);
}
"Engine" => {
obj.engine = Some(StringDeserializer::deserialize("Engine", stack)?);
}
"EngineVersion" => {
obj.engine_version =
Some(StringDeserializer::deserialize("EngineVersion", stack)?);
}
"NodeSnapshots" => {
obj.node_snapshots.get_or_insert(vec![]).extend(
NodeSnapshotListDeserializer::deserialize("NodeSnapshots", stack)?,
);
}
"NumCacheNodes" => {
obj.num_cache_nodes = Some(IntegerOptionalDeserializer::deserialize(
"NumCacheNodes",
stack,
)?);
}
"NumNodeGroups" => {
obj.num_node_groups = Some(IntegerOptionalDeserializer::deserialize(
"NumNodeGroups",
stack,
)?);
}
"Port" => {
obj.port = Some(IntegerOptionalDeserializer::deserialize("Port", stack)?);
}
"PreferredAvailabilityZone" => {
obj.preferred_availability_zone = Some(StringDeserializer::deserialize(
"PreferredAvailabilityZone",
stack,
)?);
}
"PreferredMaintenanceWindow" => {
obj.preferred_maintenance_window = Some(StringDeserializer::deserialize(
"PreferredMaintenanceWindow",
stack,
)?);
}
"ReplicationGroupDescription" => {
obj.replication_group_description = Some(StringDeserializer::deserialize(
"ReplicationGroupDescription",
stack,
)?);
}
"ReplicationGroupId" => {
obj.replication_group_id = Some(StringDeserializer::deserialize(
"ReplicationGroupId",
stack,
)?);
}
"SnapshotName" => {
obj.snapshot_name =
Some(StringDeserializer::deserialize("SnapshotName", stack)?);
}
"SnapshotRetentionLimit" => {
obj.snapshot_retention_limit = Some(IntegerOptionalDeserializer::deserialize(
"SnapshotRetentionLimit",
stack,
)?);
}
"SnapshotSource" => {
obj.snapshot_source =
Some(StringDeserializer::deserialize("SnapshotSource", stack)?);
}
"SnapshotStatus" => {
obj.snapshot_status =
Some(StringDeserializer::deserialize("SnapshotStatus", stack)?);
}
"SnapshotWindow" => {
obj.snapshot_window =
Some(StringDeserializer::deserialize("SnapshotWindow", stack)?);
}
"TopicArn" => {
obj.topic_arn = Some(StringDeserializer::deserialize("TopicArn", stack)?);
}
"VpcId" => {
obj.vpc_id = Some(StringDeserializer::deserialize("VpcId", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct SnapshotArnsListSerializer;
impl SnapshotArnsListSerializer {
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 SnapshotListDeserializer;
impl SnapshotListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Snapshot>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Snapshot" {
obj.push(SnapshotDeserializer::deserialize("Snapshot", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct SourceTypeDeserializer;
impl SourceTypeDeserializer {
#[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 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 Subnet {
pub subnet_availability_zone: Option<AvailabilityZone>,
pub subnet_identifier: Option<String>,
}
struct SubnetDeserializer;
impl SubnetDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Subnet, XmlParseError> {
deserialize_elements::<_, Subnet, _>(tag_name, stack, |name, stack, obj| {
match name {
"SubnetAvailabilityZone" => {
obj.subnet_availability_zone = Some(AvailabilityZoneDeserializer::deserialize(
"SubnetAvailabilityZone",
stack,
)?);
}
"SubnetIdentifier" => {
obj.subnet_identifier =
Some(StringDeserializer::deserialize("SubnetIdentifier", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct SubnetIdentifierListSerializer;
impl SubnetIdentifierListSerializer {
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 SubnetListDeserializer;
impl SubnetListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Subnet>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Subnet" {
obj.push(SubnetDeserializer::deserialize("Subnet", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct TStampDeserializer;
impl TStampDeserializer {
#[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 Tag {
pub key: Option<String>,
pub value: Option<String>,
}
struct TagDeserializer;
impl TagDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Tag, XmlParseError> {
deserialize_elements::<_, Tag, _>(tag_name, stack, |name, stack, obj| {
match name {
"Key" => {
obj.key = Some(StringDeserializer::deserialize("Key", stack)?);
}
"Value" => {
obj.value = Some(StringDeserializer::deserialize("Value", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct TagSerializer;
impl TagSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Tag) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.key {
params.put(&format!("{}{}", prefix, "Key"), &field_value);
}
if let Some(ref field_value) = obj.value {
params.put(&format!("{}{}", prefix, "Value"), &field_value);
}
}
}
struct TagListDeserializer;
impl TagListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Tag>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "Tag" {
obj.push(TagDeserializer::deserialize("Tag", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct TagListSerializer;
impl TagListSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<Tag>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
TagSerializer::serialize(params, &key, obj);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TagListMessage {
pub tag_list: Option<Vec<Tag>>,
}
struct TagListMessageDeserializer;
impl TagListMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<TagListMessage, XmlParseError> {
deserialize_elements::<_, TagListMessage, _>(tag_name, stack, |name, stack, obj| {
match name {
"TagList" => {
obj.tag_list
.get_or_insert(vec![])
.extend(TagListDeserializer::deserialize("TagList", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TestFailoverMessage {
pub node_group_id: String,
pub replication_group_id: String,
}
struct TestFailoverMessageSerializer;
impl TestFailoverMessageSerializer {
fn serialize(params: &mut Params, name: &str, obj: &TestFailoverMessage) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "NodeGroupId"), &obj.node_group_id);
params.put(
&format!("{}{}", prefix, "ReplicationGroupId"),
&obj.replication_group_id,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TestFailoverResult {
pub replication_group: Option<ReplicationGroup>,
}
struct TestFailoverResultDeserializer;
impl TestFailoverResultDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<TestFailoverResult, XmlParseError> {
deserialize_elements::<_, TestFailoverResult, _>(tag_name, stack, |name, stack, obj| {
match name {
"ReplicationGroup" => {
obj.replication_group = Some(ReplicationGroupDeserializer::deserialize(
"ReplicationGroup",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TimeRangeFilter {
pub end_time: Option<String>,
pub start_time: Option<String>,
}
struct TimeRangeFilterSerializer;
impl TimeRangeFilterSerializer {
fn serialize(params: &mut Params, name: &str, obj: &TimeRangeFilter) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.end_time {
params.put(&format!("{}{}", prefix, "EndTime"), &field_value);
}
if let Some(ref field_value) = obj.start_time {
params.put(&format!("{}{}", prefix, "StartTime"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UnprocessedUpdateAction {
pub error_message: Option<String>,
pub error_type: Option<String>,
pub replication_group_id: Option<String>,
pub service_update_name: Option<String>,
}
struct UnprocessedUpdateActionDeserializer;
impl UnprocessedUpdateActionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UnprocessedUpdateAction, XmlParseError> {
deserialize_elements::<_, UnprocessedUpdateAction, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ErrorMessage" => {
obj.error_message =
Some(StringDeserializer::deserialize("ErrorMessage", stack)?);
}
"ErrorType" => {
obj.error_type = Some(StringDeserializer::deserialize("ErrorType", stack)?);
}
"ReplicationGroupId" => {
obj.replication_group_id = Some(StringDeserializer::deserialize(
"ReplicationGroupId",
stack,
)?);
}
"ServiceUpdateName" => {
obj.service_update_name =
Some(StringDeserializer::deserialize("ServiceUpdateName", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct UnprocessedUpdateActionListDeserializer;
impl UnprocessedUpdateActionListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<UnprocessedUpdateAction>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "UnprocessedUpdateAction" {
obj.push(UnprocessedUpdateActionDeserializer::deserialize(
"UnprocessedUpdateAction",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateAction {
pub estimated_update_time: Option<String>,
pub node_group_update_status: Option<Vec<NodeGroupUpdateStatus>>,
pub nodes_updated: Option<String>,
pub replication_group_id: Option<String>,
pub service_update_name: Option<String>,
pub service_update_recommended_apply_by_date: Option<String>,
pub service_update_release_date: Option<String>,
pub service_update_severity: Option<String>,
pub service_update_status: Option<String>,
pub service_update_type: Option<String>,
pub sla_met: Option<String>,
pub update_action_available_date: Option<String>,
pub update_action_status: Option<String>,
pub update_action_status_modified_date: Option<String>,
}
struct UpdateActionDeserializer;
impl UpdateActionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateAction, XmlParseError> {
deserialize_elements::<_, UpdateAction, _>(tag_name, stack, |name, stack, obj| {
match name {
"EstimatedUpdateTime" => {
obj.estimated_update_time = Some(StringDeserializer::deserialize(
"EstimatedUpdateTime",
stack,
)?);
}
"NodeGroupUpdateStatus" => {
obj.node_group_update_status.get_or_insert(vec![]).extend(
NodeGroupUpdateStatusListDeserializer::deserialize(
"NodeGroupUpdateStatus",
stack,
)?,
);
}
"NodesUpdated" => {
obj.nodes_updated =
Some(StringDeserializer::deserialize("NodesUpdated", stack)?);
}
"ReplicationGroupId" => {
obj.replication_group_id = Some(StringDeserializer::deserialize(
"ReplicationGroupId",
stack,
)?);
}
"ServiceUpdateName" => {
obj.service_update_name =
Some(StringDeserializer::deserialize("ServiceUpdateName", stack)?);
}
"ServiceUpdateRecommendedApplyByDate" => {
obj.service_update_recommended_apply_by_date =
Some(TStampDeserializer::deserialize(
"ServiceUpdateRecommendedApplyByDate",
stack,
)?);
}
"ServiceUpdateReleaseDate" => {
obj.service_update_release_date = Some(TStampDeserializer::deserialize(
"ServiceUpdateReleaseDate",
stack,
)?);
}
"ServiceUpdateSeverity" => {
obj.service_update_severity =
Some(ServiceUpdateSeverityDeserializer::deserialize(
"ServiceUpdateSeverity",
stack,
)?);
}
"ServiceUpdateStatus" => {
obj.service_update_status = Some(ServiceUpdateStatusDeserializer::deserialize(
"ServiceUpdateStatus",
stack,
)?);
}
"ServiceUpdateType" => {
obj.service_update_type = Some(ServiceUpdateTypeDeserializer::deserialize(
"ServiceUpdateType",
stack,
)?);
}
"SlaMet" => {
obj.sla_met = Some(SlaMetDeserializer::deserialize("SlaMet", stack)?);
}
"UpdateActionAvailableDate" => {
obj.update_action_available_date = Some(TStampDeserializer::deserialize(
"UpdateActionAvailableDate",
stack,
)?);
}
"UpdateActionStatus" => {
obj.update_action_status = Some(UpdateActionStatusDeserializer::deserialize(
"UpdateActionStatus",
stack,
)?);
}
"UpdateActionStatusModifiedDate" => {
obj.update_action_status_modified_date = Some(TStampDeserializer::deserialize(
"UpdateActionStatusModifiedDate",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct UpdateActionListDeserializer;
impl UpdateActionListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<UpdateAction>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "UpdateAction" {
obj.push(UpdateActionDeserializer::deserialize(
"UpdateAction",
stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateActionResultsMessage {
pub processed_update_actions: Option<Vec<ProcessedUpdateAction>>,
pub unprocessed_update_actions: Option<Vec<UnprocessedUpdateAction>>,
}
struct UpdateActionResultsMessageDeserializer;
impl UpdateActionResultsMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateActionResultsMessage, XmlParseError> {
deserialize_elements::<_, UpdateActionResultsMessage, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ProcessedUpdateActions" => {
obj.processed_update_actions.get_or_insert(vec![]).extend(
ProcessedUpdateActionListDeserializer::deserialize(
"ProcessedUpdateActions",
stack,
)?,
);
}
"UnprocessedUpdateActions" => {
obj.unprocessed_update_actions.get_or_insert(vec![]).extend(
UnprocessedUpdateActionListDeserializer::deserialize(
"UnprocessedUpdateActions",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct UpdateActionStatusDeserializer;
impl UpdateActionStatusDeserializer {
#[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 UpdateActionStatusListSerializer;
impl UpdateActionStatusListSerializer {
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 UpdateActionsMessage {
pub marker: Option<String>,
pub update_actions: Option<Vec<UpdateAction>>,
}
struct UpdateActionsMessageDeserializer;
impl UpdateActionsMessageDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<UpdateActionsMessage, XmlParseError> {
deserialize_elements::<_, UpdateActionsMessage, _>(tag_name, stack, |name, stack, obj| {
match name {
"Marker" => {
obj.marker = Some(StringDeserializer::deserialize("Marker", stack)?);
}
"UpdateActions" => {
obj.update_actions.get_or_insert(vec![]).extend(
UpdateActionListDeserializer::deserialize("UpdateActions", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Debug, PartialEq)]
pub enum AddTagsToResourceError {
CacheClusterNotFoundFault(String),
InvalidARNFault(String),
SnapshotNotFoundFault(String),
TagQuotaPerResourceExceeded(String),
}
impl AddTagsToResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddTagsToResourceError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
AddTagsToResourceError::CacheClusterNotFoundFault(parsed_error.message),
)
}
"InvalidARN" => {
return RusotoError::Service(AddTagsToResourceError::InvalidARNFault(
parsed_error.message,
))
}
"SnapshotNotFoundFault" => {
return RusotoError::Service(AddTagsToResourceError::SnapshotNotFoundFault(
parsed_error.message,
))
}
"TagQuotaPerResourceExceeded" => {
return RusotoError::Service(
AddTagsToResourceError::TagQuotaPerResourceExceeded(
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 AddTagsToResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddTagsToResourceError {
fn description(&self) -> &str {
match *self {
AddTagsToResourceError::CacheClusterNotFoundFault(ref cause) => cause,
AddTagsToResourceError::InvalidARNFault(ref cause) => cause,
AddTagsToResourceError::SnapshotNotFoundFault(ref cause) => cause,
AddTagsToResourceError::TagQuotaPerResourceExceeded(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AuthorizeCacheSecurityGroupIngressError {
AuthorizationAlreadyExistsFault(String),
CacheSecurityGroupNotFoundFault(String),
InvalidCacheSecurityGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl AuthorizeCacheSecurityGroupIngressError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<AuthorizeCacheSecurityGroupIngressError> {
{
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[..] {
"AuthorizationAlreadyExists" => return RusotoError::Service(AuthorizeCacheSecurityGroupIngressError::AuthorizationAlreadyExistsFault(parsed_error.message)),"CacheSecurityGroupNotFound" => return RusotoError::Service(AuthorizeCacheSecurityGroupIngressError::CacheSecurityGroupNotFoundFault(parsed_error.message)),"InvalidCacheSecurityGroupState" => return RusotoError::Service(AuthorizeCacheSecurityGroupIngressError::InvalidCacheSecurityGroupStateFault(parsed_error.message)),"InvalidParameterCombination" => return RusotoError::Service(AuthorizeCacheSecurityGroupIngressError::InvalidParameterCombination(parsed_error.message)),"InvalidParameterValue" => return RusotoError::Service(AuthorizeCacheSecurityGroupIngressError::InvalidParameterValue(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 AuthorizeCacheSecurityGroupIngressError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AuthorizeCacheSecurityGroupIngressError {
fn description(&self) -> &str {
match *self {
AuthorizeCacheSecurityGroupIngressError::AuthorizationAlreadyExistsFault(ref cause) => {
cause
}
AuthorizeCacheSecurityGroupIngressError::CacheSecurityGroupNotFoundFault(ref cause) => {
cause
}
AuthorizeCacheSecurityGroupIngressError::InvalidCacheSecurityGroupStateFault(
ref cause,
) => cause,
AuthorizeCacheSecurityGroupIngressError::InvalidParameterCombination(ref cause) => {
cause
}
AuthorizeCacheSecurityGroupIngressError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum BatchApplyUpdateActionError {
InvalidParameterValue(String),
ServiceUpdateNotFoundFault(String),
}
impl BatchApplyUpdateActionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchApplyUpdateActionError> {
{
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[..] {
"InvalidParameterValue" => {
return RusotoError::Service(
BatchApplyUpdateActionError::InvalidParameterValue(
parsed_error.message,
),
)
}
"ServiceUpdateNotFoundFault" => {
return RusotoError::Service(
BatchApplyUpdateActionError::ServiceUpdateNotFoundFault(
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 BatchApplyUpdateActionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchApplyUpdateActionError {
fn description(&self) -> &str {
match *self {
BatchApplyUpdateActionError::InvalidParameterValue(ref cause) => cause,
BatchApplyUpdateActionError::ServiceUpdateNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum BatchStopUpdateActionError {
InvalidParameterValue(String),
ServiceUpdateNotFoundFault(String),
}
impl BatchStopUpdateActionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchStopUpdateActionError> {
{
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[..] {
"InvalidParameterValue" => {
return RusotoError::Service(
BatchStopUpdateActionError::InvalidParameterValue(parsed_error.message),
)
}
"ServiceUpdateNotFoundFault" => {
return RusotoError::Service(
BatchStopUpdateActionError::ServiceUpdateNotFoundFault(
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 BatchStopUpdateActionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchStopUpdateActionError {
fn description(&self) -> &str {
match *self {
BatchStopUpdateActionError::InvalidParameterValue(ref cause) => cause,
BatchStopUpdateActionError::ServiceUpdateNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CopySnapshotError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidSnapshotStateFault(String),
SnapshotAlreadyExistsFault(String),
SnapshotNotFoundFault(String),
SnapshotQuotaExceededFault(String),
}
impl CopySnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CopySnapshotError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
CopySnapshotError::InvalidParameterCombination(parsed_error.message),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(CopySnapshotError::InvalidParameterValue(
parsed_error.message,
))
}
"InvalidSnapshotState" => {
return RusotoError::Service(CopySnapshotError::InvalidSnapshotStateFault(
parsed_error.message,
))
}
"SnapshotAlreadyExistsFault" => {
return RusotoError::Service(CopySnapshotError::SnapshotAlreadyExistsFault(
parsed_error.message,
))
}
"SnapshotNotFoundFault" => {
return RusotoError::Service(CopySnapshotError::SnapshotNotFoundFault(
parsed_error.message,
))
}
"SnapshotQuotaExceededFault" => {
return RusotoError::Service(CopySnapshotError::SnapshotQuotaExceededFault(
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 CopySnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CopySnapshotError {
fn description(&self) -> &str {
match *self {
CopySnapshotError::InvalidParameterCombination(ref cause) => cause,
CopySnapshotError::InvalidParameterValue(ref cause) => cause,
CopySnapshotError::InvalidSnapshotStateFault(ref cause) => cause,
CopySnapshotError::SnapshotAlreadyExistsFault(ref cause) => cause,
CopySnapshotError::SnapshotNotFoundFault(ref cause) => cause,
CopySnapshotError::SnapshotQuotaExceededFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCacheClusterError {
CacheClusterAlreadyExistsFault(String),
CacheParameterGroupNotFoundFault(String),
CacheSecurityGroupNotFoundFault(String),
CacheSubnetGroupNotFoundFault(String),
ClusterQuotaForCustomerExceededFault(String),
InsufficientCacheClusterCapacityFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidReplicationGroupStateFault(String),
InvalidVPCNetworkStateFault(String),
NodeQuotaForClusterExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
ReplicationGroupNotFoundFault(String),
TagQuotaPerResourceExceeded(String),
}
impl CreateCacheClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateCacheClusterError> {
{
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[..] {
"CacheClusterAlreadyExists" => {
return RusotoError::Service(
CreateCacheClusterError::CacheClusterAlreadyExistsFault(
parsed_error.message,
),
)
}
"CacheParameterGroupNotFound" => {
return RusotoError::Service(
CreateCacheClusterError::CacheParameterGroupNotFoundFault(
parsed_error.message,
),
)
}
"CacheSecurityGroupNotFound" => {
return RusotoError::Service(
CreateCacheClusterError::CacheSecurityGroupNotFoundFault(
parsed_error.message,
),
)
}
"CacheSubnetGroupNotFoundFault" => {
return RusotoError::Service(
CreateCacheClusterError::CacheSubnetGroupNotFoundFault(
parsed_error.message,
),
)
}
"ClusterQuotaForCustomerExceeded" => {
return RusotoError::Service(
CreateCacheClusterError::ClusterQuotaForCustomerExceededFault(
parsed_error.message,
),
)
}
"InsufficientCacheClusterCapacity" => {
return RusotoError::Service(
CreateCacheClusterError::InsufficientCacheClusterCapacityFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
CreateCacheClusterError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
CreateCacheClusterError::InvalidParameterValue(parsed_error.message),
)
}
"InvalidReplicationGroupState" => {
return RusotoError::Service(
CreateCacheClusterError::InvalidReplicationGroupStateFault(
parsed_error.message,
),
)
}
"InvalidVPCNetworkStateFault" => {
return RusotoError::Service(
CreateCacheClusterError::InvalidVPCNetworkStateFault(
parsed_error.message,
),
)
}
"NodeQuotaForClusterExceeded" => {
return RusotoError::Service(
CreateCacheClusterError::NodeQuotaForClusterExceededFault(
parsed_error.message,
),
)
}
"NodeQuotaForCustomerExceeded" => {
return RusotoError::Service(
CreateCacheClusterError::NodeQuotaForCustomerExceededFault(
parsed_error.message,
),
)
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
CreateCacheClusterError::ReplicationGroupNotFoundFault(
parsed_error.message,
),
)
}
"TagQuotaPerResourceExceeded" => {
return RusotoError::Service(
CreateCacheClusterError::TagQuotaPerResourceExceeded(
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 CreateCacheClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCacheClusterError {
fn description(&self) -> &str {
match *self {
CreateCacheClusterError::CacheClusterAlreadyExistsFault(ref cause) => cause,
CreateCacheClusterError::CacheParameterGroupNotFoundFault(ref cause) => cause,
CreateCacheClusterError::CacheSecurityGroupNotFoundFault(ref cause) => cause,
CreateCacheClusterError::CacheSubnetGroupNotFoundFault(ref cause) => cause,
CreateCacheClusterError::ClusterQuotaForCustomerExceededFault(ref cause) => cause,
CreateCacheClusterError::InsufficientCacheClusterCapacityFault(ref cause) => cause,
CreateCacheClusterError::InvalidParameterCombination(ref cause) => cause,
CreateCacheClusterError::InvalidParameterValue(ref cause) => cause,
CreateCacheClusterError::InvalidReplicationGroupStateFault(ref cause) => cause,
CreateCacheClusterError::InvalidVPCNetworkStateFault(ref cause) => cause,
CreateCacheClusterError::NodeQuotaForClusterExceededFault(ref cause) => cause,
CreateCacheClusterError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
CreateCacheClusterError::ReplicationGroupNotFoundFault(ref cause) => cause,
CreateCacheClusterError::TagQuotaPerResourceExceeded(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCacheParameterGroupError {
CacheParameterGroupAlreadyExistsFault(String),
CacheParameterGroupQuotaExceededFault(String),
InvalidCacheParameterGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl CreateCacheParameterGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateCacheParameterGroupError> {
{
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[..] {
"CacheParameterGroupAlreadyExists" => {
return RusotoError::Service(
CreateCacheParameterGroupError::CacheParameterGroupAlreadyExistsFault(
parsed_error.message,
),
)
}
"CacheParameterGroupQuotaExceeded" => {
return RusotoError::Service(
CreateCacheParameterGroupError::CacheParameterGroupQuotaExceededFault(
parsed_error.message,
),
)
}
"InvalidCacheParameterGroupState" => {
return RusotoError::Service(
CreateCacheParameterGroupError::InvalidCacheParameterGroupStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
CreateCacheParameterGroupError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
CreateCacheParameterGroupError::InvalidParameterValue(
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 CreateCacheParameterGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCacheParameterGroupError {
fn description(&self) -> &str {
match *self {
CreateCacheParameterGroupError::CacheParameterGroupAlreadyExistsFault(ref cause) => {
cause
}
CreateCacheParameterGroupError::CacheParameterGroupQuotaExceededFault(ref cause) => {
cause
}
CreateCacheParameterGroupError::InvalidCacheParameterGroupStateFault(ref cause) => {
cause
}
CreateCacheParameterGroupError::InvalidParameterCombination(ref cause) => cause,
CreateCacheParameterGroupError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCacheSecurityGroupError {
CacheSecurityGroupAlreadyExistsFault(String),
CacheSecurityGroupQuotaExceededFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl CreateCacheSecurityGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateCacheSecurityGroupError> {
{
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[..] {
"CacheSecurityGroupAlreadyExists" => {
return RusotoError::Service(
CreateCacheSecurityGroupError::CacheSecurityGroupAlreadyExistsFault(
parsed_error.message,
),
)
}
"QuotaExceeded.CacheSecurityGroup" => {
return RusotoError::Service(
CreateCacheSecurityGroupError::CacheSecurityGroupQuotaExceededFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
CreateCacheSecurityGroupError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
CreateCacheSecurityGroupError::InvalidParameterValue(
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 CreateCacheSecurityGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCacheSecurityGroupError {
fn description(&self) -> &str {
match *self {
CreateCacheSecurityGroupError::CacheSecurityGroupAlreadyExistsFault(ref cause) => cause,
CreateCacheSecurityGroupError::CacheSecurityGroupQuotaExceededFault(ref cause) => cause,
CreateCacheSecurityGroupError::InvalidParameterCombination(ref cause) => cause,
CreateCacheSecurityGroupError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCacheSubnetGroupError {
CacheSubnetGroupAlreadyExistsFault(String),
CacheSubnetGroupQuotaExceededFault(String),
CacheSubnetQuotaExceededFault(String),
InvalidSubnet(String),
}
impl CreateCacheSubnetGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateCacheSubnetGroupError> {
{
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[..] {
"CacheSubnetGroupAlreadyExists" => {
return RusotoError::Service(
CreateCacheSubnetGroupError::CacheSubnetGroupAlreadyExistsFault(
parsed_error.message,
),
)
}
"CacheSubnetGroupQuotaExceeded" => {
return RusotoError::Service(
CreateCacheSubnetGroupError::CacheSubnetGroupQuotaExceededFault(
parsed_error.message,
),
)
}
"CacheSubnetQuotaExceededFault" => {
return RusotoError::Service(
CreateCacheSubnetGroupError::CacheSubnetQuotaExceededFault(
parsed_error.message,
),
)
}
"InvalidSubnet" => {
return RusotoError::Service(CreateCacheSubnetGroupError::InvalidSubnet(
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 CreateCacheSubnetGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCacheSubnetGroupError {
fn description(&self) -> &str {
match *self {
CreateCacheSubnetGroupError::CacheSubnetGroupAlreadyExistsFault(ref cause) => cause,
CreateCacheSubnetGroupError::CacheSubnetGroupQuotaExceededFault(ref cause) => cause,
CreateCacheSubnetGroupError::CacheSubnetQuotaExceededFault(ref cause) => cause,
CreateCacheSubnetGroupError::InvalidSubnet(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateReplicationGroupError {
CacheClusterNotFoundFault(String),
CacheParameterGroupNotFoundFault(String),
CacheSecurityGroupNotFoundFault(String),
CacheSubnetGroupNotFoundFault(String),
ClusterQuotaForCustomerExceededFault(String),
InsufficientCacheClusterCapacityFault(String),
InvalidCacheClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidVPCNetworkStateFault(String),
NodeGroupsPerReplicationGroupQuotaExceededFault(String),
NodeQuotaForClusterExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
ReplicationGroupAlreadyExistsFault(String),
TagQuotaPerResourceExceeded(String),
}
impl CreateReplicationGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateReplicationGroupError> {
{
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[..] {
"CacheClusterNotFound" => return RusotoError::Service(CreateReplicationGroupError::CacheClusterNotFoundFault(parsed_error.message)),"CacheParameterGroupNotFound" => return RusotoError::Service(CreateReplicationGroupError::CacheParameterGroupNotFoundFault(parsed_error.message)),"CacheSecurityGroupNotFound" => return RusotoError::Service(CreateReplicationGroupError::CacheSecurityGroupNotFoundFault(parsed_error.message)),"CacheSubnetGroupNotFoundFault" => return RusotoError::Service(CreateReplicationGroupError::CacheSubnetGroupNotFoundFault(parsed_error.message)),"ClusterQuotaForCustomerExceeded" => return RusotoError::Service(CreateReplicationGroupError::ClusterQuotaForCustomerExceededFault(parsed_error.message)),"InsufficientCacheClusterCapacity" => return RusotoError::Service(CreateReplicationGroupError::InsufficientCacheClusterCapacityFault(parsed_error.message)),"InvalidCacheClusterState" => return RusotoError::Service(CreateReplicationGroupError::InvalidCacheClusterStateFault(parsed_error.message)),"InvalidParameterCombination" => return RusotoError::Service(CreateReplicationGroupError::InvalidParameterCombination(parsed_error.message)),"InvalidParameterValue" => return RusotoError::Service(CreateReplicationGroupError::InvalidParameterValue(parsed_error.message)),"InvalidVPCNetworkStateFault" => return RusotoError::Service(CreateReplicationGroupError::InvalidVPCNetworkStateFault(parsed_error.message)),"NodeGroupsPerReplicationGroupQuotaExceeded" => return RusotoError::Service(CreateReplicationGroupError::NodeGroupsPerReplicationGroupQuotaExceededFault(parsed_error.message)),"NodeQuotaForClusterExceeded" => return RusotoError::Service(CreateReplicationGroupError::NodeQuotaForClusterExceededFault(parsed_error.message)),"NodeQuotaForCustomerExceeded" => return RusotoError::Service(CreateReplicationGroupError::NodeQuotaForCustomerExceededFault(parsed_error.message)),"ReplicationGroupAlreadyExists" => return RusotoError::Service(CreateReplicationGroupError::ReplicationGroupAlreadyExistsFault(parsed_error.message)),"TagQuotaPerResourceExceeded" => return RusotoError::Service(CreateReplicationGroupError::TagQuotaPerResourceExceeded(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 CreateReplicationGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateReplicationGroupError {
fn description(&self) -> &str {
match *self {
CreateReplicationGroupError::CacheClusterNotFoundFault(ref cause) => cause,
CreateReplicationGroupError::CacheParameterGroupNotFoundFault(ref cause) => cause,
CreateReplicationGroupError::CacheSecurityGroupNotFoundFault(ref cause) => cause,
CreateReplicationGroupError::CacheSubnetGroupNotFoundFault(ref cause) => cause,
CreateReplicationGroupError::ClusterQuotaForCustomerExceededFault(ref cause) => cause,
CreateReplicationGroupError::InsufficientCacheClusterCapacityFault(ref cause) => cause,
CreateReplicationGroupError::InvalidCacheClusterStateFault(ref cause) => cause,
CreateReplicationGroupError::InvalidParameterCombination(ref cause) => cause,
CreateReplicationGroupError::InvalidParameterValue(ref cause) => cause,
CreateReplicationGroupError::InvalidVPCNetworkStateFault(ref cause) => cause,
CreateReplicationGroupError::NodeGroupsPerReplicationGroupQuotaExceededFault(
ref cause,
) => cause,
CreateReplicationGroupError::NodeQuotaForClusterExceededFault(ref cause) => cause,
CreateReplicationGroupError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
CreateReplicationGroupError::ReplicationGroupAlreadyExistsFault(ref cause) => cause,
CreateReplicationGroupError::TagQuotaPerResourceExceeded(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateSnapshotError {
CacheClusterNotFoundFault(String),
InvalidCacheClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidReplicationGroupStateFault(String),
ReplicationGroupNotFoundFault(String),
SnapshotAlreadyExistsFault(String),
SnapshotFeatureNotSupportedFault(String),
SnapshotQuotaExceededFault(String),
}
impl CreateSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateSnapshotError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
CreateSnapshotError::CacheClusterNotFoundFault(parsed_error.message),
)
}
"InvalidCacheClusterState" => {
return RusotoError::Service(
CreateSnapshotError::InvalidCacheClusterStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
CreateSnapshotError::InvalidParameterCombination(parsed_error.message),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(CreateSnapshotError::InvalidParameterValue(
parsed_error.message,
))
}
"InvalidReplicationGroupState" => {
return RusotoError::Service(
CreateSnapshotError::InvalidReplicationGroupStateFault(
parsed_error.message,
),
)
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
CreateSnapshotError::ReplicationGroupNotFoundFault(
parsed_error.message,
),
)
}
"SnapshotAlreadyExistsFault" => {
return RusotoError::Service(
CreateSnapshotError::SnapshotAlreadyExistsFault(parsed_error.message),
)
}
"SnapshotFeatureNotSupportedFault" => {
return RusotoError::Service(
CreateSnapshotError::SnapshotFeatureNotSupportedFault(
parsed_error.message,
),
)
}
"SnapshotQuotaExceededFault" => {
return RusotoError::Service(
CreateSnapshotError::SnapshotQuotaExceededFault(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 CreateSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateSnapshotError {
fn description(&self) -> &str {
match *self {
CreateSnapshotError::CacheClusterNotFoundFault(ref cause) => cause,
CreateSnapshotError::InvalidCacheClusterStateFault(ref cause) => cause,
CreateSnapshotError::InvalidParameterCombination(ref cause) => cause,
CreateSnapshotError::InvalidParameterValue(ref cause) => cause,
CreateSnapshotError::InvalidReplicationGroupStateFault(ref cause) => cause,
CreateSnapshotError::ReplicationGroupNotFoundFault(ref cause) => cause,
CreateSnapshotError::SnapshotAlreadyExistsFault(ref cause) => cause,
CreateSnapshotError::SnapshotFeatureNotSupportedFault(ref cause) => cause,
CreateSnapshotError::SnapshotQuotaExceededFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DecreaseReplicaCountError {
ClusterQuotaForCustomerExceededFault(String),
InsufficientCacheClusterCapacityFault(String),
InvalidCacheClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidReplicationGroupStateFault(String),
InvalidVPCNetworkStateFault(String),
NoOperationFault(String),
NodeGroupsPerReplicationGroupQuotaExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
ReplicationGroupNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DecreaseReplicaCountError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DecreaseReplicaCountError> {
{
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[..] {
"ClusterQuotaForCustomerExceeded" => {
return RusotoError::Service(
DecreaseReplicaCountError::ClusterQuotaForCustomerExceededFault(
parsed_error.message,
),
)
}
"InsufficientCacheClusterCapacity" => {
return RusotoError::Service(
DecreaseReplicaCountError::InsufficientCacheClusterCapacityFault(
parsed_error.message,
),
)
}
"InvalidCacheClusterState" => {
return RusotoError::Service(
DecreaseReplicaCountError::InvalidCacheClusterStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DecreaseReplicaCountError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DecreaseReplicaCountError::InvalidParameterValue(parsed_error.message),
)
}
"InvalidReplicationGroupState" => {
return RusotoError::Service(
DecreaseReplicaCountError::InvalidReplicationGroupStateFault(
parsed_error.message,
),
)
}
"InvalidVPCNetworkStateFault" => {
return RusotoError::Service(
DecreaseReplicaCountError::InvalidVPCNetworkStateFault(
parsed_error.message,
),
)
}
"NoOperationFault" => {
return RusotoError::Service(DecreaseReplicaCountError::NoOperationFault(
parsed_error.message,
))
}
"NodeGroupsPerReplicationGroupQuotaExceeded" => return RusotoError::Service(
DecreaseReplicaCountError::NodeGroupsPerReplicationGroupQuotaExceededFault(
parsed_error.message,
),
),
"NodeQuotaForCustomerExceeded" => {
return RusotoError::Service(
DecreaseReplicaCountError::NodeQuotaForCustomerExceededFault(
parsed_error.message,
),
)
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
DecreaseReplicaCountError::ReplicationGroupNotFoundFault(
parsed_error.message,
),
)
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DecreaseReplicaCountError::ServiceLinkedRoleNotFoundFault(
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 DecreaseReplicaCountError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DecreaseReplicaCountError {
fn description(&self) -> &str {
match *self {
DecreaseReplicaCountError::ClusterQuotaForCustomerExceededFault(ref cause) => cause,
DecreaseReplicaCountError::InsufficientCacheClusterCapacityFault(ref cause) => cause,
DecreaseReplicaCountError::InvalidCacheClusterStateFault(ref cause) => cause,
DecreaseReplicaCountError::InvalidParameterCombination(ref cause) => cause,
DecreaseReplicaCountError::InvalidParameterValue(ref cause) => cause,
DecreaseReplicaCountError::InvalidReplicationGroupStateFault(ref cause) => cause,
DecreaseReplicaCountError::InvalidVPCNetworkStateFault(ref cause) => cause,
DecreaseReplicaCountError::NoOperationFault(ref cause) => cause,
DecreaseReplicaCountError::NodeGroupsPerReplicationGroupQuotaExceededFault(
ref cause,
) => cause,
DecreaseReplicaCountError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
DecreaseReplicaCountError::ReplicationGroupNotFoundFault(ref cause) => cause,
DecreaseReplicaCountError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteCacheClusterError {
CacheClusterNotFoundFault(String),
InvalidCacheClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
SnapshotAlreadyExistsFault(String),
SnapshotFeatureNotSupportedFault(String),
SnapshotQuotaExceededFault(String),
}
impl DeleteCacheClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteCacheClusterError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
DeleteCacheClusterError::CacheClusterNotFoundFault(
parsed_error.message,
),
)
}
"InvalidCacheClusterState" => {
return RusotoError::Service(
DeleteCacheClusterError::InvalidCacheClusterStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DeleteCacheClusterError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DeleteCacheClusterError::InvalidParameterValue(parsed_error.message),
)
}
"SnapshotAlreadyExistsFault" => {
return RusotoError::Service(
DeleteCacheClusterError::SnapshotAlreadyExistsFault(
parsed_error.message,
),
)
}
"SnapshotFeatureNotSupportedFault" => {
return RusotoError::Service(
DeleteCacheClusterError::SnapshotFeatureNotSupportedFault(
parsed_error.message,
),
)
}
"SnapshotQuotaExceededFault" => {
return RusotoError::Service(
DeleteCacheClusterError::SnapshotQuotaExceededFault(
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 DeleteCacheClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteCacheClusterError {
fn description(&self) -> &str {
match *self {
DeleteCacheClusterError::CacheClusterNotFoundFault(ref cause) => cause,
DeleteCacheClusterError::InvalidCacheClusterStateFault(ref cause) => cause,
DeleteCacheClusterError::InvalidParameterCombination(ref cause) => cause,
DeleteCacheClusterError::InvalidParameterValue(ref cause) => cause,
DeleteCacheClusterError::SnapshotAlreadyExistsFault(ref cause) => cause,
DeleteCacheClusterError::SnapshotFeatureNotSupportedFault(ref cause) => cause,
DeleteCacheClusterError::SnapshotQuotaExceededFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteCacheParameterGroupError {
CacheParameterGroupNotFoundFault(String),
InvalidCacheParameterGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DeleteCacheParameterGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteCacheParameterGroupError> {
{
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[..] {
"CacheParameterGroupNotFound" => {
return RusotoError::Service(
DeleteCacheParameterGroupError::CacheParameterGroupNotFoundFault(
parsed_error.message,
),
)
}
"InvalidCacheParameterGroupState" => {
return RusotoError::Service(
DeleteCacheParameterGroupError::InvalidCacheParameterGroupStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DeleteCacheParameterGroupError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DeleteCacheParameterGroupError::InvalidParameterValue(
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 DeleteCacheParameterGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteCacheParameterGroupError {
fn description(&self) -> &str {
match *self {
DeleteCacheParameterGroupError::CacheParameterGroupNotFoundFault(ref cause) => cause,
DeleteCacheParameterGroupError::InvalidCacheParameterGroupStateFault(ref cause) => {
cause
}
DeleteCacheParameterGroupError::InvalidParameterCombination(ref cause) => cause,
DeleteCacheParameterGroupError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteCacheSecurityGroupError {
CacheSecurityGroupNotFoundFault(String),
InvalidCacheSecurityGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DeleteCacheSecurityGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteCacheSecurityGroupError> {
{
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[..] {
"CacheSecurityGroupNotFound" => {
return RusotoError::Service(
DeleteCacheSecurityGroupError::CacheSecurityGroupNotFoundFault(
parsed_error.message,
),
)
}
"InvalidCacheSecurityGroupState" => {
return RusotoError::Service(
DeleteCacheSecurityGroupError::InvalidCacheSecurityGroupStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DeleteCacheSecurityGroupError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DeleteCacheSecurityGroupError::InvalidParameterValue(
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 DeleteCacheSecurityGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteCacheSecurityGroupError {
fn description(&self) -> &str {
match *self {
DeleteCacheSecurityGroupError::CacheSecurityGroupNotFoundFault(ref cause) => cause,
DeleteCacheSecurityGroupError::InvalidCacheSecurityGroupStateFault(ref cause) => cause,
DeleteCacheSecurityGroupError::InvalidParameterCombination(ref cause) => cause,
DeleteCacheSecurityGroupError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteCacheSubnetGroupError {
CacheSubnetGroupInUse(String),
CacheSubnetGroupNotFoundFault(String),
}
impl DeleteCacheSubnetGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteCacheSubnetGroupError> {
{
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[..] {
"CacheSubnetGroupInUse" => {
return RusotoError::Service(
DeleteCacheSubnetGroupError::CacheSubnetGroupInUse(
parsed_error.message,
),
)
}
"CacheSubnetGroupNotFoundFault" => {
return RusotoError::Service(
DeleteCacheSubnetGroupError::CacheSubnetGroupNotFoundFault(
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 DeleteCacheSubnetGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteCacheSubnetGroupError {
fn description(&self) -> &str {
match *self {
DeleteCacheSubnetGroupError::CacheSubnetGroupInUse(ref cause) => cause,
DeleteCacheSubnetGroupError::CacheSubnetGroupNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteReplicationGroupError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidReplicationGroupStateFault(String),
ReplicationGroupNotFoundFault(String),
SnapshotAlreadyExistsFault(String),
SnapshotFeatureNotSupportedFault(String),
SnapshotQuotaExceededFault(String),
}
impl DeleteReplicationGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteReplicationGroupError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
DeleteReplicationGroupError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DeleteReplicationGroupError::InvalidParameterValue(
parsed_error.message,
),
)
}
"InvalidReplicationGroupState" => {
return RusotoError::Service(
DeleteReplicationGroupError::InvalidReplicationGroupStateFault(
parsed_error.message,
),
)
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
DeleteReplicationGroupError::ReplicationGroupNotFoundFault(
parsed_error.message,
),
)
}
"SnapshotAlreadyExistsFault" => {
return RusotoError::Service(
DeleteReplicationGroupError::SnapshotAlreadyExistsFault(
parsed_error.message,
),
)
}
"SnapshotFeatureNotSupportedFault" => {
return RusotoError::Service(
DeleteReplicationGroupError::SnapshotFeatureNotSupportedFault(
parsed_error.message,
),
)
}
"SnapshotQuotaExceededFault" => {
return RusotoError::Service(
DeleteReplicationGroupError::SnapshotQuotaExceededFault(
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 DeleteReplicationGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteReplicationGroupError {
fn description(&self) -> &str {
match *self {
DeleteReplicationGroupError::InvalidParameterCombination(ref cause) => cause,
DeleteReplicationGroupError::InvalidParameterValue(ref cause) => cause,
DeleteReplicationGroupError::InvalidReplicationGroupStateFault(ref cause) => cause,
DeleteReplicationGroupError::ReplicationGroupNotFoundFault(ref cause) => cause,
DeleteReplicationGroupError::SnapshotAlreadyExistsFault(ref cause) => cause,
DeleteReplicationGroupError::SnapshotFeatureNotSupportedFault(ref cause) => cause,
DeleteReplicationGroupError::SnapshotQuotaExceededFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteSnapshotError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidSnapshotStateFault(String),
SnapshotNotFoundFault(String),
}
impl DeleteSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSnapshotError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
DeleteSnapshotError::InvalidParameterCombination(parsed_error.message),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(DeleteSnapshotError::InvalidParameterValue(
parsed_error.message,
))
}
"InvalidSnapshotState" => {
return RusotoError::Service(
DeleteSnapshotError::InvalidSnapshotStateFault(parsed_error.message),
)
}
"SnapshotNotFoundFault" => {
return RusotoError::Service(DeleteSnapshotError::SnapshotNotFoundFault(
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 DeleteSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteSnapshotError {
fn description(&self) -> &str {
match *self {
DeleteSnapshotError::InvalidParameterCombination(ref cause) => cause,
DeleteSnapshotError::InvalidParameterValue(ref cause) => cause,
DeleteSnapshotError::InvalidSnapshotStateFault(ref cause) => cause,
DeleteSnapshotError::SnapshotNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCacheClustersError {
CacheClusterNotFoundFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DescribeCacheClustersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeCacheClustersError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
DescribeCacheClustersError::CacheClusterNotFoundFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeCacheClustersError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeCacheClustersError::InvalidParameterValue(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 DescribeCacheClustersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCacheClustersError {
fn description(&self) -> &str {
match *self {
DescribeCacheClustersError::CacheClusterNotFoundFault(ref cause) => cause,
DescribeCacheClustersError::InvalidParameterCombination(ref cause) => cause,
DescribeCacheClustersError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCacheEngineVersionsError {}
impl DescribeCacheEngineVersionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeCacheEngineVersionsError> {
{
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[..] {
_ => {}
}
}
}
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 DescribeCacheEngineVersionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCacheEngineVersionsError {
fn description(&self) -> &str {
match *self {}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCacheParameterGroupsError {
CacheParameterGroupNotFoundFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DescribeCacheParameterGroupsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeCacheParameterGroupsError> {
{
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[..] {
"CacheParameterGroupNotFound" => {
return RusotoError::Service(
DescribeCacheParameterGroupsError::CacheParameterGroupNotFoundFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeCacheParameterGroupsError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeCacheParameterGroupsError::InvalidParameterValue(
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 DescribeCacheParameterGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCacheParameterGroupsError {
fn description(&self) -> &str {
match *self {
DescribeCacheParameterGroupsError::CacheParameterGroupNotFoundFault(ref cause) => cause,
DescribeCacheParameterGroupsError::InvalidParameterCombination(ref cause) => cause,
DescribeCacheParameterGroupsError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCacheParametersError {
CacheParameterGroupNotFoundFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DescribeCacheParametersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeCacheParametersError> {
{
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[..] {
"CacheParameterGroupNotFound" => {
return RusotoError::Service(
DescribeCacheParametersError::CacheParameterGroupNotFoundFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeCacheParametersError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeCacheParametersError::InvalidParameterValue(
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 DescribeCacheParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCacheParametersError {
fn description(&self) -> &str {
match *self {
DescribeCacheParametersError::CacheParameterGroupNotFoundFault(ref cause) => cause,
DescribeCacheParametersError::InvalidParameterCombination(ref cause) => cause,
DescribeCacheParametersError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCacheSecurityGroupsError {
CacheSecurityGroupNotFoundFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DescribeCacheSecurityGroupsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeCacheSecurityGroupsError> {
{
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[..] {
"CacheSecurityGroupNotFound" => {
return RusotoError::Service(
DescribeCacheSecurityGroupsError::CacheSecurityGroupNotFoundFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeCacheSecurityGroupsError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeCacheSecurityGroupsError::InvalidParameterValue(
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 DescribeCacheSecurityGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCacheSecurityGroupsError {
fn description(&self) -> &str {
match *self {
DescribeCacheSecurityGroupsError::CacheSecurityGroupNotFoundFault(ref cause) => cause,
DescribeCacheSecurityGroupsError::InvalidParameterCombination(ref cause) => cause,
DescribeCacheSecurityGroupsError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCacheSubnetGroupsError {
CacheSubnetGroupNotFoundFault(String),
}
impl DescribeCacheSubnetGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeCacheSubnetGroupsError> {
{
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[..] {
"CacheSubnetGroupNotFoundFault" => {
return RusotoError::Service(
DescribeCacheSubnetGroupsError::CacheSubnetGroupNotFoundFault(
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 DescribeCacheSubnetGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCacheSubnetGroupsError {
fn description(&self) -> &str {
match *self {
DescribeCacheSubnetGroupsError::CacheSubnetGroupNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeEngineDefaultParametersError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DescribeEngineDefaultParametersError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeEngineDefaultParametersError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeEngineDefaultParametersError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeEngineDefaultParametersError::InvalidParameterValue(
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 DescribeEngineDefaultParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeEngineDefaultParametersError {
fn description(&self) -> &str {
match *self {
DescribeEngineDefaultParametersError::InvalidParameterCombination(ref cause) => cause,
DescribeEngineDefaultParametersError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeEventsError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DescribeEventsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEventsError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeEventsError::InvalidParameterCombination(parsed_error.message),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(DescribeEventsError::InvalidParameterValue(
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 DescribeEventsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeEventsError {
fn description(&self) -> &str {
match *self {
DescribeEventsError::InvalidParameterCombination(ref cause) => cause,
DescribeEventsError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeReplicationGroupsError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ReplicationGroupNotFoundFault(String),
}
impl DescribeReplicationGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeReplicationGroupsError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeReplicationGroupsError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeReplicationGroupsError::InvalidParameterValue(
parsed_error.message,
),
)
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
DescribeReplicationGroupsError::ReplicationGroupNotFoundFault(
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 DescribeReplicationGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeReplicationGroupsError {
fn description(&self) -> &str {
match *self {
DescribeReplicationGroupsError::InvalidParameterCombination(ref cause) => cause,
DescribeReplicationGroupsError::InvalidParameterValue(ref cause) => cause,
DescribeReplicationGroupsError::ReplicationGroupNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeReservedCacheNodesError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ReservedCacheNodeNotFoundFault(String),
}
impl DescribeReservedCacheNodesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeReservedCacheNodesError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeReservedCacheNodesError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeReservedCacheNodesError::InvalidParameterValue(
parsed_error.message,
),
)
}
"ReservedCacheNodeNotFound" => {
return RusotoError::Service(
DescribeReservedCacheNodesError::ReservedCacheNodeNotFoundFault(
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 DescribeReservedCacheNodesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeReservedCacheNodesError {
fn description(&self) -> &str {
match *self {
DescribeReservedCacheNodesError::InvalidParameterCombination(ref cause) => cause,
DescribeReservedCacheNodesError::InvalidParameterValue(ref cause) => cause,
DescribeReservedCacheNodesError::ReservedCacheNodeNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeReservedCacheNodesOfferingsError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ReservedCacheNodesOfferingNotFoundFault(String),
}
impl DescribeReservedCacheNodesOfferingsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeReservedCacheNodesOfferingsError> {
{
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[..] {
"InvalidParameterCombination" => return RusotoError::Service(DescribeReservedCacheNodesOfferingsError::InvalidParameterCombination(parsed_error.message)),"InvalidParameterValue" => return RusotoError::Service(DescribeReservedCacheNodesOfferingsError::InvalidParameterValue(parsed_error.message)),"ReservedCacheNodesOfferingNotFound" => return RusotoError::Service(DescribeReservedCacheNodesOfferingsError::ReservedCacheNodesOfferingNotFoundFault(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 DescribeReservedCacheNodesOfferingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeReservedCacheNodesOfferingsError {
fn description(&self) -> &str {
match *self {
DescribeReservedCacheNodesOfferingsError::InvalidParameterCombination(ref cause) => {
cause
}
DescribeReservedCacheNodesOfferingsError::InvalidParameterValue(ref cause) => cause,
DescribeReservedCacheNodesOfferingsError::ReservedCacheNodesOfferingNotFoundFault(
ref cause,
) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeServiceUpdatesError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ServiceUpdateNotFoundFault(String),
}
impl DescribeServiceUpdatesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeServiceUpdatesError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeServiceUpdatesError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeServiceUpdatesError::InvalidParameterValue(
parsed_error.message,
),
)
}
"ServiceUpdateNotFoundFault" => {
return RusotoError::Service(
DescribeServiceUpdatesError::ServiceUpdateNotFoundFault(
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 DescribeServiceUpdatesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeServiceUpdatesError {
fn description(&self) -> &str {
match *self {
DescribeServiceUpdatesError::InvalidParameterCombination(ref cause) => cause,
DescribeServiceUpdatesError::InvalidParameterValue(ref cause) => cause,
DescribeServiceUpdatesError::ServiceUpdateNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSnapshotsError {
CacheClusterNotFoundFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
SnapshotNotFoundFault(String),
}
impl DescribeSnapshotsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeSnapshotsError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
DescribeSnapshotsError::CacheClusterNotFoundFault(parsed_error.message),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeSnapshotsError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(DescribeSnapshotsError::InvalidParameterValue(
parsed_error.message,
))
}
"SnapshotNotFoundFault" => {
return RusotoError::Service(DescribeSnapshotsError::SnapshotNotFoundFault(
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 DescribeSnapshotsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSnapshotsError {
fn description(&self) -> &str {
match *self {
DescribeSnapshotsError::CacheClusterNotFoundFault(ref cause) => cause,
DescribeSnapshotsError::InvalidParameterCombination(ref cause) => cause,
DescribeSnapshotsError::InvalidParameterValue(ref cause) => cause,
DescribeSnapshotsError::SnapshotNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUpdateActionsError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl DescribeUpdateActionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeUpdateActionsError> {
{
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[..] {
"InvalidParameterCombination" => {
return RusotoError::Service(
DescribeUpdateActionsError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
DescribeUpdateActionsError::InvalidParameterValue(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 DescribeUpdateActionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeUpdateActionsError {
fn description(&self) -> &str {
match *self {
DescribeUpdateActionsError::InvalidParameterCombination(ref cause) => cause,
DescribeUpdateActionsError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum IncreaseReplicaCountError {
ClusterQuotaForCustomerExceededFault(String),
InsufficientCacheClusterCapacityFault(String),
InvalidCacheClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidReplicationGroupStateFault(String),
InvalidVPCNetworkStateFault(String),
NoOperationFault(String),
NodeGroupsPerReplicationGroupQuotaExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
ReplicationGroupNotFoundFault(String),
}
impl IncreaseReplicaCountError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<IncreaseReplicaCountError> {
{
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[..] {
"ClusterQuotaForCustomerExceeded" => {
return RusotoError::Service(
IncreaseReplicaCountError::ClusterQuotaForCustomerExceededFault(
parsed_error.message,
),
)
}
"InsufficientCacheClusterCapacity" => {
return RusotoError::Service(
IncreaseReplicaCountError::InsufficientCacheClusterCapacityFault(
parsed_error.message,
),
)
}
"InvalidCacheClusterState" => {
return RusotoError::Service(
IncreaseReplicaCountError::InvalidCacheClusterStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
IncreaseReplicaCountError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
IncreaseReplicaCountError::InvalidParameterValue(parsed_error.message),
)
}
"InvalidReplicationGroupState" => {
return RusotoError::Service(
IncreaseReplicaCountError::InvalidReplicationGroupStateFault(
parsed_error.message,
),
)
}
"InvalidVPCNetworkStateFault" => {
return RusotoError::Service(
IncreaseReplicaCountError::InvalidVPCNetworkStateFault(
parsed_error.message,
),
)
}
"NoOperationFault" => {
return RusotoError::Service(IncreaseReplicaCountError::NoOperationFault(
parsed_error.message,
))
}
"NodeGroupsPerReplicationGroupQuotaExceeded" => return RusotoError::Service(
IncreaseReplicaCountError::NodeGroupsPerReplicationGroupQuotaExceededFault(
parsed_error.message,
),
),
"NodeQuotaForCustomerExceeded" => {
return RusotoError::Service(
IncreaseReplicaCountError::NodeQuotaForCustomerExceededFault(
parsed_error.message,
),
)
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
IncreaseReplicaCountError::ReplicationGroupNotFoundFault(
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 IncreaseReplicaCountError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for IncreaseReplicaCountError {
fn description(&self) -> &str {
match *self {
IncreaseReplicaCountError::ClusterQuotaForCustomerExceededFault(ref cause) => cause,
IncreaseReplicaCountError::InsufficientCacheClusterCapacityFault(ref cause) => cause,
IncreaseReplicaCountError::InvalidCacheClusterStateFault(ref cause) => cause,
IncreaseReplicaCountError::InvalidParameterCombination(ref cause) => cause,
IncreaseReplicaCountError::InvalidParameterValue(ref cause) => cause,
IncreaseReplicaCountError::InvalidReplicationGroupStateFault(ref cause) => cause,
IncreaseReplicaCountError::InvalidVPCNetworkStateFault(ref cause) => cause,
IncreaseReplicaCountError::NoOperationFault(ref cause) => cause,
IncreaseReplicaCountError::NodeGroupsPerReplicationGroupQuotaExceededFault(
ref cause,
) => cause,
IncreaseReplicaCountError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
IncreaseReplicaCountError::ReplicationGroupNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAllowedNodeTypeModificationsError {
CacheClusterNotFoundFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
ReplicationGroupNotFoundFault(String),
}
impl ListAllowedNodeTypeModificationsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListAllowedNodeTypeModificationsError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
ListAllowedNodeTypeModificationsError::CacheClusterNotFoundFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
ListAllowedNodeTypeModificationsError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
ListAllowedNodeTypeModificationsError::InvalidParameterValue(
parsed_error.message,
),
)
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
ListAllowedNodeTypeModificationsError::ReplicationGroupNotFoundFault(
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 ListAllowedNodeTypeModificationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAllowedNodeTypeModificationsError {
fn description(&self) -> &str {
match *self {
ListAllowedNodeTypeModificationsError::CacheClusterNotFoundFault(ref cause) => cause,
ListAllowedNodeTypeModificationsError::InvalidParameterCombination(ref cause) => cause,
ListAllowedNodeTypeModificationsError::InvalidParameterValue(ref cause) => cause,
ListAllowedNodeTypeModificationsError::ReplicationGroupNotFoundFault(ref cause) => {
cause
}
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
CacheClusterNotFoundFault(String),
InvalidARNFault(String),
SnapshotNotFoundFault(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
ListTagsForResourceError::CacheClusterNotFoundFault(
parsed_error.message,
),
)
}
"InvalidARN" => {
return RusotoError::Service(ListTagsForResourceError::InvalidARNFault(
parsed_error.message,
))
}
"SnapshotNotFoundFault" => {
return RusotoError::Service(
ListTagsForResourceError::SnapshotNotFoundFault(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 ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::CacheClusterNotFoundFault(ref cause) => cause,
ListTagsForResourceError::InvalidARNFault(ref cause) => cause,
ListTagsForResourceError::SnapshotNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ModifyCacheClusterError {
CacheClusterNotFoundFault(String),
CacheParameterGroupNotFoundFault(String),
CacheSecurityGroupNotFoundFault(String),
InsufficientCacheClusterCapacityFault(String),
InvalidCacheClusterStateFault(String),
InvalidCacheSecurityGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidVPCNetworkStateFault(String),
NodeQuotaForClusterExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
}
impl ModifyCacheClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ModifyCacheClusterError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
ModifyCacheClusterError::CacheClusterNotFoundFault(
parsed_error.message,
),
)
}
"CacheParameterGroupNotFound" => {
return RusotoError::Service(
ModifyCacheClusterError::CacheParameterGroupNotFoundFault(
parsed_error.message,
),
)
}
"CacheSecurityGroupNotFound" => {
return RusotoError::Service(
ModifyCacheClusterError::CacheSecurityGroupNotFoundFault(
parsed_error.message,
),
)
}
"InsufficientCacheClusterCapacity" => {
return RusotoError::Service(
ModifyCacheClusterError::InsufficientCacheClusterCapacityFault(
parsed_error.message,
),
)
}
"InvalidCacheClusterState" => {
return RusotoError::Service(
ModifyCacheClusterError::InvalidCacheClusterStateFault(
parsed_error.message,
),
)
}
"InvalidCacheSecurityGroupState" => {
return RusotoError::Service(
ModifyCacheClusterError::InvalidCacheSecurityGroupStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
ModifyCacheClusterError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
ModifyCacheClusterError::InvalidParameterValue(parsed_error.message),
)
}
"InvalidVPCNetworkStateFault" => {
return RusotoError::Service(
ModifyCacheClusterError::InvalidVPCNetworkStateFault(
parsed_error.message,
),
)
}
"NodeQuotaForClusterExceeded" => {
return RusotoError::Service(
ModifyCacheClusterError::NodeQuotaForClusterExceededFault(
parsed_error.message,
),
)
}
"NodeQuotaForCustomerExceeded" => {
return RusotoError::Service(
ModifyCacheClusterError::NodeQuotaForCustomerExceededFault(
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 ModifyCacheClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ModifyCacheClusterError {
fn description(&self) -> &str {
match *self {
ModifyCacheClusterError::CacheClusterNotFoundFault(ref cause) => cause,
ModifyCacheClusterError::CacheParameterGroupNotFoundFault(ref cause) => cause,
ModifyCacheClusterError::CacheSecurityGroupNotFoundFault(ref cause) => cause,
ModifyCacheClusterError::InsufficientCacheClusterCapacityFault(ref cause) => cause,
ModifyCacheClusterError::InvalidCacheClusterStateFault(ref cause) => cause,
ModifyCacheClusterError::InvalidCacheSecurityGroupStateFault(ref cause) => cause,
ModifyCacheClusterError::InvalidParameterCombination(ref cause) => cause,
ModifyCacheClusterError::InvalidParameterValue(ref cause) => cause,
ModifyCacheClusterError::InvalidVPCNetworkStateFault(ref cause) => cause,
ModifyCacheClusterError::NodeQuotaForClusterExceededFault(ref cause) => cause,
ModifyCacheClusterError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ModifyCacheParameterGroupError {
CacheParameterGroupNotFoundFault(String),
InvalidCacheParameterGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl ModifyCacheParameterGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ModifyCacheParameterGroupError> {
{
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[..] {
"CacheParameterGroupNotFound" => {
return RusotoError::Service(
ModifyCacheParameterGroupError::CacheParameterGroupNotFoundFault(
parsed_error.message,
),
)
}
"InvalidCacheParameterGroupState" => {
return RusotoError::Service(
ModifyCacheParameterGroupError::InvalidCacheParameterGroupStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
ModifyCacheParameterGroupError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
ModifyCacheParameterGroupError::InvalidParameterValue(
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 ModifyCacheParameterGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ModifyCacheParameterGroupError {
fn description(&self) -> &str {
match *self {
ModifyCacheParameterGroupError::CacheParameterGroupNotFoundFault(ref cause) => cause,
ModifyCacheParameterGroupError::InvalidCacheParameterGroupStateFault(ref cause) => {
cause
}
ModifyCacheParameterGroupError::InvalidParameterCombination(ref cause) => cause,
ModifyCacheParameterGroupError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ModifyCacheSubnetGroupError {
CacheSubnetGroupNotFoundFault(String),
CacheSubnetQuotaExceededFault(String),
InvalidSubnet(String),
SubnetInUse(String),
}
impl ModifyCacheSubnetGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ModifyCacheSubnetGroupError> {
{
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[..] {
"CacheSubnetGroupNotFoundFault" => {
return RusotoError::Service(
ModifyCacheSubnetGroupError::CacheSubnetGroupNotFoundFault(
parsed_error.message,
),
)
}
"CacheSubnetQuotaExceededFault" => {
return RusotoError::Service(
ModifyCacheSubnetGroupError::CacheSubnetQuotaExceededFault(
parsed_error.message,
),
)
}
"InvalidSubnet" => {
return RusotoError::Service(ModifyCacheSubnetGroupError::InvalidSubnet(
parsed_error.message,
))
}
"SubnetInUse" => {
return RusotoError::Service(ModifyCacheSubnetGroupError::SubnetInUse(
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 ModifyCacheSubnetGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ModifyCacheSubnetGroupError {
fn description(&self) -> &str {
match *self {
ModifyCacheSubnetGroupError::CacheSubnetGroupNotFoundFault(ref cause) => cause,
ModifyCacheSubnetGroupError::CacheSubnetQuotaExceededFault(ref cause) => cause,
ModifyCacheSubnetGroupError::InvalidSubnet(ref cause) => cause,
ModifyCacheSubnetGroupError::SubnetInUse(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ModifyReplicationGroupError {
CacheClusterNotFoundFault(String),
CacheParameterGroupNotFoundFault(String),
CacheSecurityGroupNotFoundFault(String),
InsufficientCacheClusterCapacityFault(String),
InvalidCacheClusterStateFault(String),
InvalidCacheSecurityGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidReplicationGroupStateFault(String),
InvalidVPCNetworkStateFault(String),
NodeQuotaForClusterExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
ReplicationGroupNotFoundFault(String),
}
impl ModifyReplicationGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ModifyReplicationGroupError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
ModifyReplicationGroupError::CacheClusterNotFoundFault(
parsed_error.message,
),
)
}
"CacheParameterGroupNotFound" => {
return RusotoError::Service(
ModifyReplicationGroupError::CacheParameterGroupNotFoundFault(
parsed_error.message,
),
)
}
"CacheSecurityGroupNotFound" => {
return RusotoError::Service(
ModifyReplicationGroupError::CacheSecurityGroupNotFoundFault(
parsed_error.message,
),
)
}
"InsufficientCacheClusterCapacity" => {
return RusotoError::Service(
ModifyReplicationGroupError::InsufficientCacheClusterCapacityFault(
parsed_error.message,
),
)
}
"InvalidCacheClusterState" => {
return RusotoError::Service(
ModifyReplicationGroupError::InvalidCacheClusterStateFault(
parsed_error.message,
),
)
}
"InvalidCacheSecurityGroupState" => {
return RusotoError::Service(
ModifyReplicationGroupError::InvalidCacheSecurityGroupStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
ModifyReplicationGroupError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
ModifyReplicationGroupError::InvalidParameterValue(
parsed_error.message,
),
)
}
"InvalidReplicationGroupState" => {
return RusotoError::Service(
ModifyReplicationGroupError::InvalidReplicationGroupStateFault(
parsed_error.message,
),
)
}
"InvalidVPCNetworkStateFault" => {
return RusotoError::Service(
ModifyReplicationGroupError::InvalidVPCNetworkStateFault(
parsed_error.message,
),
)
}
"NodeQuotaForClusterExceeded" => {
return RusotoError::Service(
ModifyReplicationGroupError::NodeQuotaForClusterExceededFault(
parsed_error.message,
),
)
}
"NodeQuotaForCustomerExceeded" => {
return RusotoError::Service(
ModifyReplicationGroupError::NodeQuotaForCustomerExceededFault(
parsed_error.message,
),
)
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
ModifyReplicationGroupError::ReplicationGroupNotFoundFault(
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 ModifyReplicationGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ModifyReplicationGroupError {
fn description(&self) -> &str {
match *self {
ModifyReplicationGroupError::CacheClusterNotFoundFault(ref cause) => cause,
ModifyReplicationGroupError::CacheParameterGroupNotFoundFault(ref cause) => cause,
ModifyReplicationGroupError::CacheSecurityGroupNotFoundFault(ref cause) => cause,
ModifyReplicationGroupError::InsufficientCacheClusterCapacityFault(ref cause) => cause,
ModifyReplicationGroupError::InvalidCacheClusterStateFault(ref cause) => cause,
ModifyReplicationGroupError::InvalidCacheSecurityGroupStateFault(ref cause) => cause,
ModifyReplicationGroupError::InvalidParameterCombination(ref cause) => cause,
ModifyReplicationGroupError::InvalidParameterValue(ref cause) => cause,
ModifyReplicationGroupError::InvalidReplicationGroupStateFault(ref cause) => cause,
ModifyReplicationGroupError::InvalidVPCNetworkStateFault(ref cause) => cause,
ModifyReplicationGroupError::NodeQuotaForClusterExceededFault(ref cause) => cause,
ModifyReplicationGroupError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
ModifyReplicationGroupError::ReplicationGroupNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ModifyReplicationGroupShardConfigurationError {
InsufficientCacheClusterCapacityFault(String),
InvalidCacheClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidReplicationGroupStateFault(String),
InvalidVPCNetworkStateFault(String),
NodeGroupsPerReplicationGroupQuotaExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
ReplicationGroupNotFoundFault(String),
}
impl ModifyReplicationGroupShardConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ModifyReplicationGroupShardConfigurationError> {
{
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[..] {
"InsufficientCacheClusterCapacity" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::InsufficientCacheClusterCapacityFault(parsed_error.message)),"InvalidCacheClusterState" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::InvalidCacheClusterStateFault(parsed_error.message)),"InvalidParameterCombination" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::InvalidParameterCombination(parsed_error.message)),"InvalidParameterValue" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::InvalidParameterValue(parsed_error.message)),"InvalidReplicationGroupState" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::InvalidReplicationGroupStateFault(parsed_error.message)),"InvalidVPCNetworkStateFault" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::InvalidVPCNetworkStateFault(parsed_error.message)),"NodeGroupsPerReplicationGroupQuotaExceeded" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::NodeGroupsPerReplicationGroupQuotaExceededFault(parsed_error.message)),"NodeQuotaForCustomerExceeded" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::NodeQuotaForCustomerExceededFault(parsed_error.message)),"ReplicationGroupNotFoundFault" => return RusotoError::Service(ModifyReplicationGroupShardConfigurationError::ReplicationGroupNotFoundFault(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 ModifyReplicationGroupShardConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ModifyReplicationGroupShardConfigurationError {
fn description(&self) -> &str {
match *self {
ModifyReplicationGroupShardConfigurationError::InsufficientCacheClusterCapacityFault(ref cause) => cause,
ModifyReplicationGroupShardConfigurationError::InvalidCacheClusterStateFault(ref cause) => cause,
ModifyReplicationGroupShardConfigurationError::InvalidParameterCombination(ref cause) => cause,
ModifyReplicationGroupShardConfigurationError::InvalidParameterValue(ref cause) => cause,
ModifyReplicationGroupShardConfigurationError::InvalidReplicationGroupStateFault(ref cause) => cause,
ModifyReplicationGroupShardConfigurationError::InvalidVPCNetworkStateFault(ref cause) => cause,
ModifyReplicationGroupShardConfigurationError::NodeGroupsPerReplicationGroupQuotaExceededFault(ref cause) => cause,
ModifyReplicationGroupShardConfigurationError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
ModifyReplicationGroupShardConfigurationError::ReplicationGroupNotFoundFault(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum PurchaseReservedCacheNodesOfferingError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ReservedCacheNodeAlreadyExistsFault(String),
ReservedCacheNodeQuotaExceededFault(String),
ReservedCacheNodesOfferingNotFoundFault(String),
}
impl PurchaseReservedCacheNodesOfferingError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<PurchaseReservedCacheNodesOfferingError> {
{
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[..] {
"InvalidParameterCombination" => return RusotoError::Service(PurchaseReservedCacheNodesOfferingError::InvalidParameterCombination(parsed_error.message)),"InvalidParameterValue" => return RusotoError::Service(PurchaseReservedCacheNodesOfferingError::InvalidParameterValue(parsed_error.message)),"ReservedCacheNodeAlreadyExists" => return RusotoError::Service(PurchaseReservedCacheNodesOfferingError::ReservedCacheNodeAlreadyExistsFault(parsed_error.message)),"ReservedCacheNodeQuotaExceeded" => return RusotoError::Service(PurchaseReservedCacheNodesOfferingError::ReservedCacheNodeQuotaExceededFault(parsed_error.message)),"ReservedCacheNodesOfferingNotFound" => return RusotoError::Service(PurchaseReservedCacheNodesOfferingError::ReservedCacheNodesOfferingNotFoundFault(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 PurchaseReservedCacheNodesOfferingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PurchaseReservedCacheNodesOfferingError {
fn description(&self) -> &str {
match *self {
PurchaseReservedCacheNodesOfferingError::InvalidParameterCombination(ref cause) => {
cause
}
PurchaseReservedCacheNodesOfferingError::InvalidParameterValue(ref cause) => cause,
PurchaseReservedCacheNodesOfferingError::ReservedCacheNodeAlreadyExistsFault(
ref cause,
) => cause,
PurchaseReservedCacheNodesOfferingError::ReservedCacheNodeQuotaExceededFault(
ref cause,
) => cause,
PurchaseReservedCacheNodesOfferingError::ReservedCacheNodesOfferingNotFoundFault(
ref cause,
) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RebootCacheClusterError {
CacheClusterNotFoundFault(String),
InvalidCacheClusterStateFault(String),
}
impl RebootCacheClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RebootCacheClusterError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
RebootCacheClusterError::CacheClusterNotFoundFault(
parsed_error.message,
),
)
}
"InvalidCacheClusterState" => {
return RusotoError::Service(
RebootCacheClusterError::InvalidCacheClusterStateFault(
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 RebootCacheClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RebootCacheClusterError {
fn description(&self) -> &str {
match *self {
RebootCacheClusterError::CacheClusterNotFoundFault(ref cause) => cause,
RebootCacheClusterError::InvalidCacheClusterStateFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveTagsFromResourceError {
CacheClusterNotFoundFault(String),
InvalidARNFault(String),
SnapshotNotFoundFault(String),
TagNotFoundFault(String),
}
impl RemoveTagsFromResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RemoveTagsFromResourceError> {
{
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[..] {
"CacheClusterNotFound" => {
return RusotoError::Service(
RemoveTagsFromResourceError::CacheClusterNotFoundFault(
parsed_error.message,
),
)
}
"InvalidARN" => {
return RusotoError::Service(RemoveTagsFromResourceError::InvalidARNFault(
parsed_error.message,
))
}
"SnapshotNotFoundFault" => {
return RusotoError::Service(
RemoveTagsFromResourceError::SnapshotNotFoundFault(
parsed_error.message,
),
)
}
"TagNotFound" => {
return RusotoError::Service(RemoveTagsFromResourceError::TagNotFoundFault(
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 RemoveTagsFromResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveTagsFromResourceError {
fn description(&self) -> &str {
match *self {
RemoveTagsFromResourceError::CacheClusterNotFoundFault(ref cause) => cause,
RemoveTagsFromResourceError::InvalidARNFault(ref cause) => cause,
RemoveTagsFromResourceError::SnapshotNotFoundFault(ref cause) => cause,
RemoveTagsFromResourceError::TagNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ResetCacheParameterGroupError {
CacheParameterGroupNotFoundFault(String),
InvalidCacheParameterGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl ResetCacheParameterGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ResetCacheParameterGroupError> {
{
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[..] {
"CacheParameterGroupNotFound" => {
return RusotoError::Service(
ResetCacheParameterGroupError::CacheParameterGroupNotFoundFault(
parsed_error.message,
),
)
}
"InvalidCacheParameterGroupState" => {
return RusotoError::Service(
ResetCacheParameterGroupError::InvalidCacheParameterGroupStateFault(
parsed_error.message,
),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
ResetCacheParameterGroupError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
ResetCacheParameterGroupError::InvalidParameterValue(
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 ResetCacheParameterGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ResetCacheParameterGroupError {
fn description(&self) -> &str {
match *self {
ResetCacheParameterGroupError::CacheParameterGroupNotFoundFault(ref cause) => cause,
ResetCacheParameterGroupError::InvalidCacheParameterGroupStateFault(ref cause) => cause,
ResetCacheParameterGroupError::InvalidParameterCombination(ref cause) => cause,
ResetCacheParameterGroupError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RevokeCacheSecurityGroupIngressError {
AuthorizationNotFoundFault(String),
CacheSecurityGroupNotFoundFault(String),
InvalidCacheSecurityGroupStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
}
impl RevokeCacheSecurityGroupIngressError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RevokeCacheSecurityGroupIngressError> {
{
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[..] {
"AuthorizationNotFound" => {
return RusotoError::Service(
RevokeCacheSecurityGroupIngressError::AuthorizationNotFoundFault(
parsed_error.message,
),
)
}
"CacheSecurityGroupNotFound" => {
return RusotoError::Service(
RevokeCacheSecurityGroupIngressError::CacheSecurityGroupNotFoundFault(
parsed_error.message,
),
)
}
"InvalidCacheSecurityGroupState" => return RusotoError::Service(
RevokeCacheSecurityGroupIngressError::InvalidCacheSecurityGroupStateFault(
parsed_error.message,
),
),
"InvalidParameterCombination" => {
return RusotoError::Service(
RevokeCacheSecurityGroupIngressError::InvalidParameterCombination(
parsed_error.message,
),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(
RevokeCacheSecurityGroupIngressError::InvalidParameterValue(
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 RevokeCacheSecurityGroupIngressError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RevokeCacheSecurityGroupIngressError {
fn description(&self) -> &str {
match *self {
RevokeCacheSecurityGroupIngressError::AuthorizationNotFoundFault(ref cause) => cause,
RevokeCacheSecurityGroupIngressError::CacheSecurityGroupNotFoundFault(ref cause) => {
cause
}
RevokeCacheSecurityGroupIngressError::InvalidCacheSecurityGroupStateFault(
ref cause,
) => cause,
RevokeCacheSecurityGroupIngressError::InvalidParameterCombination(ref cause) => cause,
RevokeCacheSecurityGroupIngressError::InvalidParameterValue(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TestFailoverError {
APICallRateForCustomerExceededFault(String),
InvalidCacheClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidReplicationGroupStateFault(String),
NodeGroupNotFoundFault(String),
ReplicationGroupNotFoundFault(String),
TestFailoverNotAvailableFault(String),
}
impl TestFailoverError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TestFailoverError> {
{
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[..] {
"APICallRateForCustomerExceeded" => {
return RusotoError::Service(
TestFailoverError::APICallRateForCustomerExceededFault(
parsed_error.message,
),
)
}
"InvalidCacheClusterState" => {
return RusotoError::Service(
TestFailoverError::InvalidCacheClusterStateFault(parsed_error.message),
)
}
"InvalidParameterCombination" => {
return RusotoError::Service(
TestFailoverError::InvalidParameterCombination(parsed_error.message),
)
}
"InvalidParameterValue" => {
return RusotoError::Service(TestFailoverError::InvalidParameterValue(
parsed_error.message,
))
}
"InvalidReplicationGroupState" => {
return RusotoError::Service(
TestFailoverError::InvalidReplicationGroupStateFault(
parsed_error.message,
),
)
}
"NodeGroupNotFoundFault" => {
return RusotoError::Service(TestFailoverError::NodeGroupNotFoundFault(
parsed_error.message,
))
}
"ReplicationGroupNotFoundFault" => {
return RusotoError::Service(
TestFailoverError::ReplicationGroupNotFoundFault(parsed_error.message),
)
}
"TestFailoverNotAvailableFault" => {
return RusotoError::Service(
TestFailoverError::TestFailoverNotAvailableFault(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 TestFailoverError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TestFailoverError {
fn description(&self) -> &str {
match *self {
TestFailoverError::APICallRateForCustomerExceededFault(ref cause) => cause,
TestFailoverError::InvalidCacheClusterStateFault(ref cause) => cause,
TestFailoverError::InvalidParameterCombination(ref cause) => cause,
TestFailoverError::InvalidParameterValue(ref cause) => cause,
TestFailoverError::InvalidReplicationGroupStateFault(ref cause) => cause,
TestFailoverError::NodeGroupNotFoundFault(ref cause) => cause,
TestFailoverError::ReplicationGroupNotFoundFault(ref cause) => cause,
TestFailoverError::TestFailoverNotAvailableFault(ref cause) => cause,
}
}
}
pub trait ElastiCache {
fn add_tags_to_resource(
&self,
input: AddTagsToResourceMessage,
) -> RusotoFuture<TagListMessage, AddTagsToResourceError>;
fn authorize_cache_security_group_ingress(
&self,
input: AuthorizeCacheSecurityGroupIngressMessage,
) -> RusotoFuture<
AuthorizeCacheSecurityGroupIngressResult,
AuthorizeCacheSecurityGroupIngressError,
>;
fn batch_apply_update_action(
&self,
input: BatchApplyUpdateActionMessage,
) -> RusotoFuture<UpdateActionResultsMessage, BatchApplyUpdateActionError>;
fn batch_stop_update_action(
&self,
input: BatchStopUpdateActionMessage,
) -> RusotoFuture<UpdateActionResultsMessage, BatchStopUpdateActionError>;
fn copy_snapshot(
&self,
input: CopySnapshotMessage,
) -> RusotoFuture<CopySnapshotResult, CopySnapshotError>;
fn create_cache_cluster(
&self,
input: CreateCacheClusterMessage,
) -> RusotoFuture<CreateCacheClusterResult, CreateCacheClusterError>;
fn create_cache_parameter_group(
&self,
input: CreateCacheParameterGroupMessage,
) -> RusotoFuture<CreateCacheParameterGroupResult, CreateCacheParameterGroupError>;
fn create_cache_security_group(
&self,
input: CreateCacheSecurityGroupMessage,
) -> RusotoFuture<CreateCacheSecurityGroupResult, CreateCacheSecurityGroupError>;
fn create_cache_subnet_group(
&self,
input: CreateCacheSubnetGroupMessage,
) -> RusotoFuture<CreateCacheSubnetGroupResult, CreateCacheSubnetGroupError>;
fn create_replication_group(
&self,
input: CreateReplicationGroupMessage,
) -> RusotoFuture<CreateReplicationGroupResult, CreateReplicationGroupError>;
fn create_snapshot(
&self,
input: CreateSnapshotMessage,
) -> RusotoFuture<CreateSnapshotResult, CreateSnapshotError>;
fn decrease_replica_count(
&self,
input: DecreaseReplicaCountMessage,
) -> RusotoFuture<DecreaseReplicaCountResult, DecreaseReplicaCountError>;
fn delete_cache_cluster(
&self,
input: DeleteCacheClusterMessage,
) -> RusotoFuture<DeleteCacheClusterResult, DeleteCacheClusterError>;
fn delete_cache_parameter_group(
&self,
input: DeleteCacheParameterGroupMessage,
) -> RusotoFuture<(), DeleteCacheParameterGroupError>;
fn delete_cache_security_group(
&self,
input: DeleteCacheSecurityGroupMessage,
) -> RusotoFuture<(), DeleteCacheSecurityGroupError>;
fn delete_cache_subnet_group(
&self,
input: DeleteCacheSubnetGroupMessage,
) -> RusotoFuture<(), DeleteCacheSubnetGroupError>;
fn delete_replication_group(
&self,
input: DeleteReplicationGroupMessage,
) -> RusotoFuture<DeleteReplicationGroupResult, DeleteReplicationGroupError>;
fn delete_snapshot(
&self,
input: DeleteSnapshotMessage,
) -> RusotoFuture<DeleteSnapshotResult, DeleteSnapshotError>;
fn describe_cache_clusters(
&self,
input: DescribeCacheClustersMessage,
) -> RusotoFuture<CacheClusterMessage, DescribeCacheClustersError>;
fn describe_cache_engine_versions(
&self,
input: DescribeCacheEngineVersionsMessage,
) -> RusotoFuture<CacheEngineVersionMessage, DescribeCacheEngineVersionsError>;
fn describe_cache_parameter_groups(
&self,
input: DescribeCacheParameterGroupsMessage,
) -> RusotoFuture<CacheParameterGroupsMessage, DescribeCacheParameterGroupsError>;
fn describe_cache_parameters(
&self,
input: DescribeCacheParametersMessage,
) -> RusotoFuture<CacheParameterGroupDetails, DescribeCacheParametersError>;
fn describe_cache_security_groups(
&self,
input: DescribeCacheSecurityGroupsMessage,
) -> RusotoFuture<CacheSecurityGroupMessage, DescribeCacheSecurityGroupsError>;
fn describe_cache_subnet_groups(
&self,
input: DescribeCacheSubnetGroupsMessage,
) -> RusotoFuture<CacheSubnetGroupMessage, DescribeCacheSubnetGroupsError>;
fn describe_engine_default_parameters(
&self,
input: DescribeEngineDefaultParametersMessage,
) -> RusotoFuture<DescribeEngineDefaultParametersResult, DescribeEngineDefaultParametersError>;
fn describe_events(
&self,
input: DescribeEventsMessage,
) -> RusotoFuture<EventsMessage, DescribeEventsError>;
fn describe_replication_groups(
&self,
input: DescribeReplicationGroupsMessage,
) -> RusotoFuture<ReplicationGroupMessage, DescribeReplicationGroupsError>;
fn describe_reserved_cache_nodes(
&self,
input: DescribeReservedCacheNodesMessage,
) -> RusotoFuture<ReservedCacheNodeMessage, DescribeReservedCacheNodesError>;
fn describe_reserved_cache_nodes_offerings(
&self,
input: DescribeReservedCacheNodesOfferingsMessage,
) -> RusotoFuture<ReservedCacheNodesOfferingMessage, DescribeReservedCacheNodesOfferingsError>;
fn describe_service_updates(
&self,
input: DescribeServiceUpdatesMessage,
) -> RusotoFuture<ServiceUpdatesMessage, DescribeServiceUpdatesError>;
fn describe_snapshots(
&self,
input: DescribeSnapshotsMessage,
) -> RusotoFuture<DescribeSnapshotsListMessage, DescribeSnapshotsError>;
fn describe_update_actions(
&self,
input: DescribeUpdateActionsMessage,
) -> RusotoFuture<UpdateActionsMessage, DescribeUpdateActionsError>;
fn increase_replica_count(
&self,
input: IncreaseReplicaCountMessage,
) -> RusotoFuture<IncreaseReplicaCountResult, IncreaseReplicaCountError>;
fn list_allowed_node_type_modifications(
&self,
input: ListAllowedNodeTypeModificationsMessage,
) -> RusotoFuture<AllowedNodeTypeModificationsMessage, ListAllowedNodeTypeModificationsError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceMessage,
) -> RusotoFuture<TagListMessage, ListTagsForResourceError>;
fn modify_cache_cluster(
&self,
input: ModifyCacheClusterMessage,
) -> RusotoFuture<ModifyCacheClusterResult, ModifyCacheClusterError>;
fn modify_cache_parameter_group(
&self,
input: ModifyCacheParameterGroupMessage,
) -> RusotoFuture<CacheParameterGroupNameMessage, ModifyCacheParameterGroupError>;
fn modify_cache_subnet_group(
&self,
input: ModifyCacheSubnetGroupMessage,
) -> RusotoFuture<ModifyCacheSubnetGroupResult, ModifyCacheSubnetGroupError>;
fn modify_replication_group(
&self,
input: ModifyReplicationGroupMessage,
) -> RusotoFuture<ModifyReplicationGroupResult, ModifyReplicationGroupError>;
fn modify_replication_group_shard_configuration(
&self,
input: ModifyReplicationGroupShardConfigurationMessage,
) -> RusotoFuture<
ModifyReplicationGroupShardConfigurationResult,
ModifyReplicationGroupShardConfigurationError,
>;
fn purchase_reserved_cache_nodes_offering(
&self,
input: PurchaseReservedCacheNodesOfferingMessage,
) -> RusotoFuture<
PurchaseReservedCacheNodesOfferingResult,
PurchaseReservedCacheNodesOfferingError,
>;
fn reboot_cache_cluster(
&self,
input: RebootCacheClusterMessage,
) -> RusotoFuture<RebootCacheClusterResult, RebootCacheClusterError>;
fn remove_tags_from_resource(
&self,
input: RemoveTagsFromResourceMessage,
) -> RusotoFuture<TagListMessage, RemoveTagsFromResourceError>;
fn reset_cache_parameter_group(
&self,
input: ResetCacheParameterGroupMessage,
) -> RusotoFuture<CacheParameterGroupNameMessage, ResetCacheParameterGroupError>;
fn revoke_cache_security_group_ingress(
&self,
input: RevokeCacheSecurityGroupIngressMessage,
) -> RusotoFuture<RevokeCacheSecurityGroupIngressResult, RevokeCacheSecurityGroupIngressError>;
fn test_failover(
&self,
input: TestFailoverMessage,
) -> RusotoFuture<TestFailoverResult, TestFailoverError>;
}
#[derive(Clone)]
pub struct ElastiCacheClient {
client: Client,
region: region::Region,
}
impl ElastiCacheClient {
pub fn new(region: region::Region) -> ElastiCacheClient {
ElastiCacheClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> ElastiCacheClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
ElastiCacheClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl ElastiCache for ElastiCacheClient {
fn add_tags_to_resource(
&self,
input: AddTagsToResourceMessage,
) -> RusotoFuture<TagListMessage, AddTagsToResourceError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "AddTagsToResource");
params.put("Version", "2015-02-02");
AddTagsToResourceMessageSerializer::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(AddTagsToResourceError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = TagListMessage::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 = TagListMessageDeserializer::deserialize(
"AddTagsToResourceResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn authorize_cache_security_group_ingress(
&self,
input: AuthorizeCacheSecurityGroupIngressMessage,
) -> RusotoFuture<
AuthorizeCacheSecurityGroupIngressResult,
AuthorizeCacheSecurityGroupIngressError,
> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "AuthorizeCacheSecurityGroupIngress");
params.put("Version", "2015-02-02");
AuthorizeCacheSecurityGroupIngressMessageSerializer::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(AuthorizeCacheSecurityGroupIngressError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = AuthorizeCacheSecurityGroupIngressResult::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 = AuthorizeCacheSecurityGroupIngressResultDeserializer::deserialize(
"AuthorizeCacheSecurityGroupIngressResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn batch_apply_update_action(
&self,
input: BatchApplyUpdateActionMessage,
) -> RusotoFuture<UpdateActionResultsMessage, BatchApplyUpdateActionError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "BatchApplyUpdateAction");
params.put("Version", "2015-02-02");
BatchApplyUpdateActionMessageSerializer::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(BatchApplyUpdateActionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = UpdateActionResultsMessage::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 = UpdateActionResultsMessageDeserializer::deserialize(
"BatchApplyUpdateActionResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn batch_stop_update_action(
&self,
input: BatchStopUpdateActionMessage,
) -> RusotoFuture<UpdateActionResultsMessage, BatchStopUpdateActionError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "BatchStopUpdateAction");
params.put("Version", "2015-02-02");
BatchStopUpdateActionMessageSerializer::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(BatchStopUpdateActionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = UpdateActionResultsMessage::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 = UpdateActionResultsMessageDeserializer::deserialize(
"BatchStopUpdateActionResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn copy_snapshot(
&self,
input: CopySnapshotMessage,
) -> RusotoFuture<CopySnapshotResult, CopySnapshotError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CopySnapshot");
params.put("Version", "2015-02-02");
CopySnapshotMessageSerializer::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(CopySnapshotError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CopySnapshotResult::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 = CopySnapshotResultDeserializer::deserialize(
"CopySnapshotResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn create_cache_cluster(
&self,
input: CreateCacheClusterMessage,
) -> RusotoFuture<CreateCacheClusterResult, CreateCacheClusterError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateCacheCluster");
params.put("Version", "2015-02-02");
CreateCacheClusterMessageSerializer::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(CreateCacheClusterError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CreateCacheClusterResult::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 = CreateCacheClusterResultDeserializer::deserialize(
"CreateCacheClusterResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn create_cache_parameter_group(
&self,
input: CreateCacheParameterGroupMessage,
) -> RusotoFuture<CreateCacheParameterGroupResult, CreateCacheParameterGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateCacheParameterGroup");
params.put("Version", "2015-02-02");
CreateCacheParameterGroupMessageSerializer::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(CreateCacheParameterGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CreateCacheParameterGroupResult::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 = CreateCacheParameterGroupResultDeserializer::deserialize(
"CreateCacheParameterGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn create_cache_security_group(
&self,
input: CreateCacheSecurityGroupMessage,
) -> RusotoFuture<CreateCacheSecurityGroupResult, CreateCacheSecurityGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateCacheSecurityGroup");
params.put("Version", "2015-02-02");
CreateCacheSecurityGroupMessageSerializer::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(CreateCacheSecurityGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CreateCacheSecurityGroupResult::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 = CreateCacheSecurityGroupResultDeserializer::deserialize(
"CreateCacheSecurityGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn create_cache_subnet_group(
&self,
input: CreateCacheSubnetGroupMessage,
) -> RusotoFuture<CreateCacheSubnetGroupResult, CreateCacheSubnetGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateCacheSubnetGroup");
params.put("Version", "2015-02-02");
CreateCacheSubnetGroupMessageSerializer::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(CreateCacheSubnetGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CreateCacheSubnetGroupResult::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 = CreateCacheSubnetGroupResultDeserializer::deserialize(
"CreateCacheSubnetGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn create_replication_group(
&self,
input: CreateReplicationGroupMessage,
) -> RusotoFuture<CreateReplicationGroupResult, CreateReplicationGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateReplicationGroup");
params.put("Version", "2015-02-02");
CreateReplicationGroupMessageSerializer::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(CreateReplicationGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CreateReplicationGroupResult::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 = CreateReplicationGroupResultDeserializer::deserialize(
"CreateReplicationGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn create_snapshot(
&self,
input: CreateSnapshotMessage,
) -> RusotoFuture<CreateSnapshotResult, CreateSnapshotError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateSnapshot");
params.put("Version", "2015-02-02");
CreateSnapshotMessageSerializer::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(CreateSnapshotError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CreateSnapshotResult::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 = CreateSnapshotResultDeserializer::deserialize(
"CreateSnapshotResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn decrease_replica_count(
&self,
input: DecreaseReplicaCountMessage,
) -> RusotoFuture<DecreaseReplicaCountResult, DecreaseReplicaCountError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DecreaseReplicaCount");
params.put("Version", "2015-02-02");
DecreaseReplicaCountMessageSerializer::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(DecreaseReplicaCountError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DecreaseReplicaCountResult::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 = DecreaseReplicaCountResultDeserializer::deserialize(
"DecreaseReplicaCountResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_cache_cluster(
&self,
input: DeleteCacheClusterMessage,
) -> RusotoFuture<DeleteCacheClusterResult, DeleteCacheClusterError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteCacheCluster");
params.put("Version", "2015-02-02");
DeleteCacheClusterMessageSerializer::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(DeleteCacheClusterError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteCacheClusterResult::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 = DeleteCacheClusterResultDeserializer::deserialize(
"DeleteCacheClusterResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_cache_parameter_group(
&self,
input: DeleteCacheParameterGroupMessage,
) -> RusotoFuture<(), DeleteCacheParameterGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteCacheParameterGroup");
params.put("Version", "2015-02-02");
DeleteCacheParameterGroupMessageSerializer::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(DeleteCacheParameterGroupError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_cache_security_group(
&self,
input: DeleteCacheSecurityGroupMessage,
) -> RusotoFuture<(), DeleteCacheSecurityGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteCacheSecurityGroup");
params.put("Version", "2015-02-02");
DeleteCacheSecurityGroupMessageSerializer::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(DeleteCacheSecurityGroupError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_cache_subnet_group(
&self,
input: DeleteCacheSubnetGroupMessage,
) -> RusotoFuture<(), DeleteCacheSubnetGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteCacheSubnetGroup");
params.put("Version", "2015-02-02");
DeleteCacheSubnetGroupMessageSerializer::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(DeleteCacheSubnetGroupError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_replication_group(
&self,
input: DeleteReplicationGroupMessage,
) -> RusotoFuture<DeleteReplicationGroupResult, DeleteReplicationGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteReplicationGroup");
params.put("Version", "2015-02-02");
DeleteReplicationGroupMessageSerializer::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(DeleteReplicationGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteReplicationGroupResult::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 = DeleteReplicationGroupResultDeserializer::deserialize(
"DeleteReplicationGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_snapshot(
&self,
input: DeleteSnapshotMessage,
) -> RusotoFuture<DeleteSnapshotResult, DeleteSnapshotError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteSnapshot");
params.put("Version", "2015-02-02");
DeleteSnapshotMessageSerializer::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(DeleteSnapshotError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteSnapshotResult::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 = DeleteSnapshotResultDeserializer::deserialize(
"DeleteSnapshotResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_cache_clusters(
&self,
input: DescribeCacheClustersMessage,
) -> RusotoFuture<CacheClusterMessage, DescribeCacheClustersError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeCacheClusters");
params.put("Version", "2015-02-02");
DescribeCacheClustersMessageSerializer::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(DescribeCacheClustersError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CacheClusterMessage::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 = CacheClusterMessageDeserializer::deserialize(
"DescribeCacheClustersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_cache_engine_versions(
&self,
input: DescribeCacheEngineVersionsMessage,
) -> RusotoFuture<CacheEngineVersionMessage, DescribeCacheEngineVersionsError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeCacheEngineVersions");
params.put("Version", "2015-02-02");
DescribeCacheEngineVersionsMessageSerializer::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(DescribeCacheEngineVersionsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CacheEngineVersionMessage::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 = CacheEngineVersionMessageDeserializer::deserialize(
"DescribeCacheEngineVersionsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_cache_parameter_groups(
&self,
input: DescribeCacheParameterGroupsMessage,
) -> RusotoFuture<CacheParameterGroupsMessage, DescribeCacheParameterGroupsError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeCacheParameterGroups");
params.put("Version", "2015-02-02");
DescribeCacheParameterGroupsMessageSerializer::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(DescribeCacheParameterGroupsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CacheParameterGroupsMessage::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 = CacheParameterGroupsMessageDeserializer::deserialize(
"DescribeCacheParameterGroupsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_cache_parameters(
&self,
input: DescribeCacheParametersMessage,
) -> RusotoFuture<CacheParameterGroupDetails, DescribeCacheParametersError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeCacheParameters");
params.put("Version", "2015-02-02");
DescribeCacheParametersMessageSerializer::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(DescribeCacheParametersError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CacheParameterGroupDetails::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 = CacheParameterGroupDetailsDeserializer::deserialize(
"DescribeCacheParametersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_cache_security_groups(
&self,
input: DescribeCacheSecurityGroupsMessage,
) -> RusotoFuture<CacheSecurityGroupMessage, DescribeCacheSecurityGroupsError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeCacheSecurityGroups");
params.put("Version", "2015-02-02");
DescribeCacheSecurityGroupsMessageSerializer::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(DescribeCacheSecurityGroupsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CacheSecurityGroupMessage::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 = CacheSecurityGroupMessageDeserializer::deserialize(
"DescribeCacheSecurityGroupsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_cache_subnet_groups(
&self,
input: DescribeCacheSubnetGroupsMessage,
) -> RusotoFuture<CacheSubnetGroupMessage, DescribeCacheSubnetGroupsError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeCacheSubnetGroups");
params.put("Version", "2015-02-02");
DescribeCacheSubnetGroupsMessageSerializer::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(DescribeCacheSubnetGroupsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CacheSubnetGroupMessage::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 = CacheSubnetGroupMessageDeserializer::deserialize(
"DescribeCacheSubnetGroupsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_engine_default_parameters(
&self,
input: DescribeEngineDefaultParametersMessage,
) -> RusotoFuture<DescribeEngineDefaultParametersResult, DescribeEngineDefaultParametersError>
{
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeEngineDefaultParameters");
params.put("Version", "2015-02-02");
DescribeEngineDefaultParametersMessageSerializer::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(DescribeEngineDefaultParametersError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeEngineDefaultParametersResult::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 = DescribeEngineDefaultParametersResultDeserializer::deserialize(
"DescribeEngineDefaultParametersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_events(
&self,
input: DescribeEventsMessage,
) -> RusotoFuture<EventsMessage, DescribeEventsError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeEvents");
params.put("Version", "2015-02-02");
DescribeEventsMessageSerializer::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(DescribeEventsError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = EventsMessage::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 =
EventsMessageDeserializer::deserialize("DescribeEventsResult", &mut stack)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_replication_groups(
&self,
input: DescribeReplicationGroupsMessage,
) -> RusotoFuture<ReplicationGroupMessage, DescribeReplicationGroupsError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeReplicationGroups");
params.put("Version", "2015-02-02");
DescribeReplicationGroupsMessageSerializer::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(DescribeReplicationGroupsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ReplicationGroupMessage::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 = ReplicationGroupMessageDeserializer::deserialize(
"DescribeReplicationGroupsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_reserved_cache_nodes(
&self,
input: DescribeReservedCacheNodesMessage,
) -> RusotoFuture<ReservedCacheNodeMessage, DescribeReservedCacheNodesError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeReservedCacheNodes");
params.put("Version", "2015-02-02");
DescribeReservedCacheNodesMessageSerializer::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(DescribeReservedCacheNodesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ReservedCacheNodeMessage::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 = ReservedCacheNodeMessageDeserializer::deserialize(
"DescribeReservedCacheNodesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_reserved_cache_nodes_offerings(
&self,
input: DescribeReservedCacheNodesOfferingsMessage,
) -> RusotoFuture<ReservedCacheNodesOfferingMessage, DescribeReservedCacheNodesOfferingsError>
{
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeReservedCacheNodesOfferings");
params.put("Version", "2015-02-02");
DescribeReservedCacheNodesOfferingsMessageSerializer::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(DescribeReservedCacheNodesOfferingsError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ReservedCacheNodesOfferingMessage::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 = ReservedCacheNodesOfferingMessageDeserializer::deserialize(
"DescribeReservedCacheNodesOfferingsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_service_updates(
&self,
input: DescribeServiceUpdatesMessage,
) -> RusotoFuture<ServiceUpdatesMessage, DescribeServiceUpdatesError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeServiceUpdates");
params.put("Version", "2015-02-02");
DescribeServiceUpdatesMessageSerializer::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(DescribeServiceUpdatesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ServiceUpdatesMessage::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 = ServiceUpdatesMessageDeserializer::deserialize(
"DescribeServiceUpdatesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_snapshots(
&self,
input: DescribeSnapshotsMessage,
) -> RusotoFuture<DescribeSnapshotsListMessage, DescribeSnapshotsError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeSnapshots");
params.put("Version", "2015-02-02");
DescribeSnapshotsMessageSerializer::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(DescribeSnapshotsError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeSnapshotsListMessage::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 = DescribeSnapshotsListMessageDeserializer::deserialize(
"DescribeSnapshotsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_update_actions(
&self,
input: DescribeUpdateActionsMessage,
) -> RusotoFuture<UpdateActionsMessage, DescribeUpdateActionsError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeUpdateActions");
params.put("Version", "2015-02-02");
DescribeUpdateActionsMessageSerializer::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(DescribeUpdateActionsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = UpdateActionsMessage::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 = UpdateActionsMessageDeserializer::deserialize(
"DescribeUpdateActionsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn increase_replica_count(
&self,
input: IncreaseReplicaCountMessage,
) -> RusotoFuture<IncreaseReplicaCountResult, IncreaseReplicaCountError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "IncreaseReplicaCount");
params.put("Version", "2015-02-02");
IncreaseReplicaCountMessageSerializer::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(IncreaseReplicaCountError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = IncreaseReplicaCountResult::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 = IncreaseReplicaCountResultDeserializer::deserialize(
"IncreaseReplicaCountResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn list_allowed_node_type_modifications(
&self,
input: ListAllowedNodeTypeModificationsMessage,
) -> RusotoFuture<AllowedNodeTypeModificationsMessage, ListAllowedNodeTypeModificationsError>
{
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ListAllowedNodeTypeModifications");
params.put("Version", "2015-02-02");
ListAllowedNodeTypeModificationsMessageSerializer::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(ListAllowedNodeTypeModificationsError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = AllowedNodeTypeModificationsMessage::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 = AllowedNodeTypeModificationsMessageDeserializer::deserialize(
"ListAllowedNodeTypeModificationsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceMessage,
) -> RusotoFuture<TagListMessage, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ListTagsForResource");
params.put("Version", "2015-02-02");
ListTagsForResourceMessageSerializer::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(ListTagsForResourceError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = TagListMessage::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 = TagListMessageDeserializer::deserialize(
"ListTagsForResourceResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn modify_cache_cluster(
&self,
input: ModifyCacheClusterMessage,
) -> RusotoFuture<ModifyCacheClusterResult, ModifyCacheClusterError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ModifyCacheCluster");
params.put("Version", "2015-02-02");
ModifyCacheClusterMessageSerializer::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(ModifyCacheClusterError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ModifyCacheClusterResult::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 = ModifyCacheClusterResultDeserializer::deserialize(
"ModifyCacheClusterResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn modify_cache_parameter_group(
&self,
input: ModifyCacheParameterGroupMessage,
) -> RusotoFuture<CacheParameterGroupNameMessage, ModifyCacheParameterGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ModifyCacheParameterGroup");
params.put("Version", "2015-02-02");
ModifyCacheParameterGroupMessageSerializer::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(ModifyCacheParameterGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CacheParameterGroupNameMessage::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 = CacheParameterGroupNameMessageDeserializer::deserialize(
"ModifyCacheParameterGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn modify_cache_subnet_group(
&self,
input: ModifyCacheSubnetGroupMessage,
) -> RusotoFuture<ModifyCacheSubnetGroupResult, ModifyCacheSubnetGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ModifyCacheSubnetGroup");
params.put("Version", "2015-02-02");
ModifyCacheSubnetGroupMessageSerializer::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(ModifyCacheSubnetGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ModifyCacheSubnetGroupResult::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 = ModifyCacheSubnetGroupResultDeserializer::deserialize(
"ModifyCacheSubnetGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn modify_replication_group(
&self,
input: ModifyReplicationGroupMessage,
) -> RusotoFuture<ModifyReplicationGroupResult, ModifyReplicationGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ModifyReplicationGroup");
params.put("Version", "2015-02-02");
ModifyReplicationGroupMessageSerializer::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(ModifyReplicationGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ModifyReplicationGroupResult::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 = ModifyReplicationGroupResultDeserializer::deserialize(
"ModifyReplicationGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn modify_replication_group_shard_configuration(
&self,
input: ModifyReplicationGroupShardConfigurationMessage,
) -> RusotoFuture<
ModifyReplicationGroupShardConfigurationResult,
ModifyReplicationGroupShardConfigurationError,
> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ModifyReplicationGroupShardConfiguration");
params.put("Version", "2015-02-02");
ModifyReplicationGroupShardConfigurationMessageSerializer::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(ModifyReplicationGroupShardConfigurationError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ModifyReplicationGroupShardConfigurationResult::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 =
ModifyReplicationGroupShardConfigurationResultDeserializer::deserialize(
"ModifyReplicationGroupShardConfigurationResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn purchase_reserved_cache_nodes_offering(
&self,
input: PurchaseReservedCacheNodesOfferingMessage,
) -> RusotoFuture<
PurchaseReservedCacheNodesOfferingResult,
PurchaseReservedCacheNodesOfferingError,
> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "PurchaseReservedCacheNodesOffering");
params.put("Version", "2015-02-02");
PurchaseReservedCacheNodesOfferingMessageSerializer::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(PurchaseReservedCacheNodesOfferingError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = PurchaseReservedCacheNodesOfferingResult::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 = PurchaseReservedCacheNodesOfferingResultDeserializer::deserialize(
"PurchaseReservedCacheNodesOfferingResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn reboot_cache_cluster(
&self,
input: RebootCacheClusterMessage,
) -> RusotoFuture<RebootCacheClusterResult, RebootCacheClusterError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "RebootCacheCluster");
params.put("Version", "2015-02-02");
RebootCacheClusterMessageSerializer::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(RebootCacheClusterError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = RebootCacheClusterResult::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 = RebootCacheClusterResultDeserializer::deserialize(
"RebootCacheClusterResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn remove_tags_from_resource(
&self,
input: RemoveTagsFromResourceMessage,
) -> RusotoFuture<TagListMessage, RemoveTagsFromResourceError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "RemoveTagsFromResource");
params.put("Version", "2015-02-02");
RemoveTagsFromResourceMessageSerializer::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(RemoveTagsFromResourceError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = TagListMessage::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 = TagListMessageDeserializer::deserialize(
"RemoveTagsFromResourceResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn reset_cache_parameter_group(
&self,
input: ResetCacheParameterGroupMessage,
) -> RusotoFuture<CacheParameterGroupNameMessage, ResetCacheParameterGroupError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ResetCacheParameterGroup");
params.put("Version", "2015-02-02");
ResetCacheParameterGroupMessageSerializer::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(ResetCacheParameterGroupError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CacheParameterGroupNameMessage::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 = CacheParameterGroupNameMessageDeserializer::deserialize(
"ResetCacheParameterGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn revoke_cache_security_group_ingress(
&self,
input: RevokeCacheSecurityGroupIngressMessage,
) -> RusotoFuture<RevokeCacheSecurityGroupIngressResult, RevokeCacheSecurityGroupIngressError>
{
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "RevokeCacheSecurityGroupIngress");
params.put("Version", "2015-02-02");
RevokeCacheSecurityGroupIngressMessageSerializer::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(RevokeCacheSecurityGroupIngressError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = RevokeCacheSecurityGroupIngressResult::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 = RevokeCacheSecurityGroupIngressResultDeserializer::deserialize(
"RevokeCacheSecurityGroupIngressResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn test_failover(
&self,
input: TestFailoverMessage,
) -> RusotoFuture<TestFailoverResult, TestFailoverError> {
let mut request = SignedRequest::new("POST", "elasticache", &self.region, "/");
let mut params = Params::new();
params.put("Action", "TestFailover");
params.put("Version", "2015-02-02");
TestFailoverMessageSerializer::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(TestFailoverError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = TestFailoverResult::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 = TestFailoverResultDeserializer::deserialize(
"TestFailoverResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
}