use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto::xml::error::*;
use rusoto_core::proto::xml::util::{
characters, deserialize_elements, end_element, find_start_element, peek_at_name, skip_tree,
start_element,
};
use rusoto_core::proto::xml::util::{Next, Peek, XmlParseError, XmlResponse};
use rusoto_core::signature::SignedRequest;
use serde_urlencoded;
use std::str::FromStr;
use xml::reader::ParserConfig;
use xml::EventReader;
struct ActivitiesDeserializer;
impl ActivitiesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Activity>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(ActivityDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ActivitiesType {
pub activities: Vec<Activity>,
pub next_token: Option<String>,
}
struct ActivitiesTypeDeserializer;
impl ActivitiesTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ActivitiesType, XmlParseError> {
deserialize_elements::<_, ActivitiesType, _>(tag_name, stack, |name, stack, obj| {
match name {
"Activities" => {
obj.activities
.extend(ActivitiesDeserializer::deserialize("Activities", stack)?);
}
"NextToken" => {
obj.next_token = Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Activity {
pub activity_id: String,
pub auto_scaling_group_name: String,
pub cause: String,
pub description: Option<String>,
pub details: Option<String>,
pub end_time: Option<String>,
pub progress: Option<i64>,
pub start_time: String,
pub status_code: String,
pub status_message: Option<String>,
}
struct ActivityDeserializer;
impl ActivityDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Activity, XmlParseError> {
deserialize_elements::<_, Activity, _>(tag_name, stack, |name, stack, obj| {
match name {
"ActivityId" => {
obj.activity_id = XmlStringDeserializer::deserialize("ActivityId", stack)?;
}
"AutoScalingGroupName" => {
obj.auto_scaling_group_name =
XmlStringMaxLen255Deserializer::deserialize("AutoScalingGroupName", stack)?;
}
"Cause" => {
obj.cause = XmlStringMaxLen1023Deserializer::deserialize("Cause", stack)?;
}
"Description" => {
obj.description =
Some(XmlStringDeserializer::deserialize("Description", stack)?);
}
"Details" => {
obj.details = Some(XmlStringDeserializer::deserialize("Details", stack)?);
}
"EndTime" => {
obj.end_time = Some(TimestampTypeDeserializer::deserialize("EndTime", stack)?);
}
"Progress" => {
obj.progress = Some(ProgressDeserializer::deserialize("Progress", stack)?);
}
"StartTime" => {
obj.start_time = TimestampTypeDeserializer::deserialize("StartTime", stack)?;
}
"StatusCode" => {
obj.status_code =
ScalingActivityStatusCodeDeserializer::deserialize("StatusCode", stack)?;
}
"StatusMessage" => {
obj.status_message = Some(XmlStringMaxLen255Deserializer::deserialize(
"StatusMessage",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ActivityIdsSerializer;
impl ActivityIdsSerializer {
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 ActivityType {
pub activity: Option<Activity>,
}
struct ActivityTypeDeserializer;
impl ActivityTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ActivityType, XmlParseError> {
deserialize_elements::<_, ActivityType, _>(tag_name, stack, |name, stack, obj| {
match name {
"Activity" => {
obj.activity = Some(ActivityDeserializer::deserialize("Activity", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AdjustmentType {
pub adjustment_type: Option<String>,
}
struct AdjustmentTypeDeserializer;
impl AdjustmentTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AdjustmentType, XmlParseError> {
deserialize_elements::<_, AdjustmentType, _>(tag_name, stack, |name, stack, obj| {
match name {
"AdjustmentType" => {
obj.adjustment_type = Some(XmlStringMaxLen255Deserializer::deserialize(
"AdjustmentType",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AdjustmentTypesDeserializer;
impl AdjustmentTypesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<AdjustmentType>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(AdjustmentTypeDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Alarm {
pub alarm_arn: Option<String>,
pub alarm_name: Option<String>,
}
struct AlarmDeserializer;
impl AlarmDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Alarm, XmlParseError> {
deserialize_elements::<_, Alarm, _>(tag_name, stack, |name, stack, obj| {
match name {
"AlarmARN" => {
obj.alarm_arn = Some(ResourceNameDeserializer::deserialize("AlarmARN", stack)?);
}
"AlarmName" => {
obj.alarm_name = Some(XmlStringMaxLen255Deserializer::deserialize(
"AlarmName",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AlarmsDeserializer;
impl AlarmsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Alarm>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(AlarmDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct AsciiStringMaxLen255Deserializer;
impl AsciiStringMaxLen255Deserializer {
#[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 AssociatePublicIpAddressDeserializer;
impl AssociatePublicIpAddressDeserializer {
#[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 AttachInstancesQuery {
pub auto_scaling_group_name: String,
pub instance_ids: Option<Vec<String>>,
}
struct AttachInstancesQuerySerializer;
impl AttachInstancesQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &AttachInstancesQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.instance_ids {
InstanceIdsSerializer::serialize(
params,
&format!("{}{}", prefix, "InstanceIds"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AttachLoadBalancerTargetGroupsResultType {}
struct AttachLoadBalancerTargetGroupsResultTypeDeserializer;
impl AttachLoadBalancerTargetGroupsResultTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AttachLoadBalancerTargetGroupsResultType, XmlParseError> {
start_element(tag_name, stack)?;
let obj = AttachLoadBalancerTargetGroupsResultType::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AttachLoadBalancerTargetGroupsType {
pub auto_scaling_group_name: String,
pub target_group_ar_ns: Vec<String>,
}
struct AttachLoadBalancerTargetGroupsTypeSerializer;
impl AttachLoadBalancerTargetGroupsTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &AttachLoadBalancerTargetGroupsType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
TargetGroupARNsSerializer::serialize(
params,
&format!("{}{}", prefix, "TargetGroupARNs"),
&obj.target_group_ar_ns,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AttachLoadBalancersResultType {}
struct AttachLoadBalancersResultTypeDeserializer;
impl AttachLoadBalancersResultTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AttachLoadBalancersResultType, XmlParseError> {
start_element(tag_name, stack)?;
let obj = AttachLoadBalancersResultType::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AttachLoadBalancersType {
pub auto_scaling_group_name: String,
pub load_balancer_names: Vec<String>,
}
struct AttachLoadBalancersTypeSerializer;
impl AttachLoadBalancersTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &AttachLoadBalancersType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
LoadBalancerNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "LoadBalancerNames"),
&obj.load_balancer_names,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AutoScalingGroup {
pub auto_scaling_group_arn: Option<String>,
pub auto_scaling_group_name: String,
pub availability_zones: Vec<String>,
pub created_time: String,
pub default_cooldown: i64,
pub desired_capacity: i64,
pub enabled_metrics: Option<Vec<EnabledMetric>>,
pub health_check_grace_period: Option<i64>,
pub health_check_type: String,
pub instances: Option<Vec<Instance>>,
pub launch_configuration_name: Option<String>,
pub launch_template: Option<LaunchTemplateSpecification>,
pub load_balancer_names: Option<Vec<String>>,
pub max_size: i64,
pub min_size: i64,
pub mixed_instances_policy: Option<MixedInstancesPolicy>,
pub new_instances_protected_from_scale_in: Option<bool>,
pub placement_group: Option<String>,
pub service_linked_role_arn: Option<String>,
pub status: Option<String>,
pub suspended_processes: Option<Vec<SuspendedProcess>>,
pub tags: Option<Vec<TagDescription>>,
pub target_group_ar_ns: Option<Vec<String>>,
pub termination_policies: Option<Vec<String>>,
pub vpc_zone_identifier: Option<String>,
}
struct AutoScalingGroupDeserializer;
impl AutoScalingGroupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AutoScalingGroup, XmlParseError> {
deserialize_elements::<_, AutoScalingGroup, _>(tag_name, stack, |name, stack, obj| {
match name {
"AutoScalingGroupARN" => {
obj.auto_scaling_group_arn = Some(ResourceNameDeserializer::deserialize(
"AutoScalingGroupARN",
stack,
)?);
}
"AutoScalingGroupName" => {
obj.auto_scaling_group_name =
XmlStringMaxLen255Deserializer::deserialize("AutoScalingGroupName", stack)?;
}
"AvailabilityZones" => {
obj.availability_zones
.extend(AvailabilityZonesDeserializer::deserialize(
"AvailabilityZones",
stack,
)?);
}
"CreatedTime" => {
obj.created_time =
TimestampTypeDeserializer::deserialize("CreatedTime", stack)?;
}
"DefaultCooldown" => {
obj.default_cooldown =
CooldownDeserializer::deserialize("DefaultCooldown", stack)?;
}
"DesiredCapacity" => {
obj.desired_capacity =
AutoScalingGroupDesiredCapacityDeserializer::deserialize(
"DesiredCapacity",
stack,
)?;
}
"EnabledMetrics" => {
obj.enabled_metrics.get_or_insert(vec![]).extend(
EnabledMetricsDeserializer::deserialize("EnabledMetrics", stack)?,
);
}
"HealthCheckGracePeriod" => {
obj.health_check_grace_period =
Some(HealthCheckGracePeriodDeserializer::deserialize(
"HealthCheckGracePeriod",
stack,
)?);
}
"HealthCheckType" => {
obj.health_check_type =
XmlStringMaxLen32Deserializer::deserialize("HealthCheckType", stack)?;
}
"Instances" => {
obj.instances
.get_or_insert(vec![])
.extend(InstancesDeserializer::deserialize("Instances", stack)?);
}
"LaunchConfigurationName" => {
obj.launch_configuration_name =
Some(XmlStringMaxLen255Deserializer::deserialize(
"LaunchConfigurationName",
stack,
)?);
}
"LaunchTemplate" => {
obj.launch_template =
Some(LaunchTemplateSpecificationDeserializer::deserialize(
"LaunchTemplate",
stack,
)?);
}
"LoadBalancerNames" => {
obj.load_balancer_names.get_or_insert(vec![]).extend(
LoadBalancerNamesDeserializer::deserialize("LoadBalancerNames", stack)?,
);
}
"MaxSize" => {
obj.max_size =
AutoScalingGroupMaxSizeDeserializer::deserialize("MaxSize", stack)?;
}
"MinSize" => {
obj.min_size =
AutoScalingGroupMinSizeDeserializer::deserialize("MinSize", stack)?;
}
"MixedInstancesPolicy" => {
obj.mixed_instances_policy =
Some(MixedInstancesPolicyDeserializer::deserialize(
"MixedInstancesPolicy",
stack,
)?);
}
"NewInstancesProtectedFromScaleIn" => {
obj.new_instances_protected_from_scale_in =
Some(InstanceProtectedDeserializer::deserialize(
"NewInstancesProtectedFromScaleIn",
stack,
)?);
}
"PlacementGroup" => {
obj.placement_group = Some(XmlStringMaxLen255Deserializer::deserialize(
"PlacementGroup",
stack,
)?);
}
"ServiceLinkedRoleARN" => {
obj.service_linked_role_arn = Some(ResourceNameDeserializer::deserialize(
"ServiceLinkedRoleARN",
stack,
)?);
}
"Status" => {
obj.status = Some(XmlStringMaxLen255Deserializer::deserialize(
"Status", stack,
)?);
}
"SuspendedProcesses" => {
obj.suspended_processes.get_or_insert(vec![]).extend(
SuspendedProcessesDeserializer::deserialize("SuspendedProcesses", stack)?,
);
}
"Tags" => {
obj.tags
.get_or_insert(vec![])
.extend(TagDescriptionListDeserializer::deserialize("Tags", stack)?);
}
"TargetGroupARNs" => {
obj.target_group_ar_ns.get_or_insert(vec![]).extend(
TargetGroupARNsDeserializer::deserialize("TargetGroupARNs", stack)?,
);
}
"TerminationPolicies" => {
obj.termination_policies.get_or_insert(vec![]).extend(
TerminationPoliciesDeserializer::deserialize("TerminationPolicies", stack)?,
);
}
"VPCZoneIdentifier" => {
obj.vpc_zone_identifier = Some(XmlStringMaxLen2047Deserializer::deserialize(
"VPCZoneIdentifier",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct AutoScalingGroupDesiredCapacityDeserializer;
impl AutoScalingGroupDesiredCapacityDeserializer {
#[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 AutoScalingGroupMaxSizeDeserializer;
impl AutoScalingGroupMaxSizeDeserializer {
#[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 AutoScalingGroupMinSizeDeserializer;
impl AutoScalingGroupMinSizeDeserializer {
#[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 AutoScalingGroupNamesSerializer;
impl AutoScalingGroupNamesSerializer {
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 AutoScalingGroupNamesType {
pub auto_scaling_group_names: Option<Vec<String>>,
pub max_records: Option<i64>,
pub next_token: Option<String>,
}
struct AutoScalingGroupNamesTypeSerializer;
impl AutoScalingGroupNamesTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &AutoScalingGroupNamesType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.auto_scaling_group_names {
AutoScalingGroupNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "AutoScalingGroupNames"),
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.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
}
}
struct AutoScalingGroupsDeserializer;
impl AutoScalingGroupsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<AutoScalingGroup>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(AutoScalingGroupDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AutoScalingGroupsType {
pub auto_scaling_groups: Vec<AutoScalingGroup>,
pub next_token: Option<String>,
}
struct AutoScalingGroupsTypeDeserializer;
impl AutoScalingGroupsTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AutoScalingGroupsType, XmlParseError> {
deserialize_elements::<_, AutoScalingGroupsType, _>(tag_name, stack, |name, stack, obj| {
match name {
"AutoScalingGroups" => {
obj.auto_scaling_groups
.extend(AutoScalingGroupsDeserializer::deserialize(
"AutoScalingGroups",
stack,
)?);
}
"NextToken" => {
obj.next_token = Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AutoScalingInstanceDetails {
pub auto_scaling_group_name: String,
pub availability_zone: String,
pub health_status: String,
pub instance_id: String,
pub launch_configuration_name: Option<String>,
pub launch_template: Option<LaunchTemplateSpecification>,
pub lifecycle_state: String,
pub protected_from_scale_in: bool,
}
struct AutoScalingInstanceDetailsDeserializer;
impl AutoScalingInstanceDetailsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AutoScalingInstanceDetails, XmlParseError> {
deserialize_elements::<_, AutoScalingInstanceDetails, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AutoScalingGroupName" => {
obj.auto_scaling_group_name = XmlStringMaxLen255Deserializer::deserialize(
"AutoScalingGroupName",
stack,
)?;
}
"AvailabilityZone" => {
obj.availability_zone =
XmlStringMaxLen255Deserializer::deserialize("AvailabilityZone", stack)?;
}
"HealthStatus" => {
obj.health_status =
XmlStringMaxLen32Deserializer::deserialize("HealthStatus", stack)?;
}
"InstanceId" => {
obj.instance_id =
XmlStringMaxLen19Deserializer::deserialize("InstanceId", stack)?;
}
"LaunchConfigurationName" => {
obj.launch_configuration_name =
Some(XmlStringMaxLen255Deserializer::deserialize(
"LaunchConfigurationName",
stack,
)?);
}
"LaunchTemplate" => {
obj.launch_template =
Some(LaunchTemplateSpecificationDeserializer::deserialize(
"LaunchTemplate",
stack,
)?);
}
"LifecycleState" => {
obj.lifecycle_state =
XmlStringMaxLen32Deserializer::deserialize("LifecycleState", stack)?;
}
"ProtectedFromScaleIn" => {
obj.protected_from_scale_in = InstanceProtectedDeserializer::deserialize(
"ProtectedFromScaleIn",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct AutoScalingInstancesDeserializer;
impl AutoScalingInstancesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<AutoScalingInstanceDetails>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(AutoScalingInstanceDetailsDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AutoScalingInstancesType {
pub auto_scaling_instances: Option<Vec<AutoScalingInstanceDetails>>,
pub next_token: Option<String>,
}
struct AutoScalingInstancesTypeDeserializer;
impl AutoScalingInstancesTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<AutoScalingInstancesType, XmlParseError> {
deserialize_elements::<_, AutoScalingInstancesType, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AutoScalingInstances" => {
obj.auto_scaling_instances.get_or_insert(vec![]).extend(
AutoScalingInstancesDeserializer::deserialize(
"AutoScalingInstances",
stack,
)?,
);
}
"NextToken" => {
obj.next_token =
Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct AutoScalingNotificationTypesDeserializer;
impl AutoScalingNotificationTypesDeserializer {
#[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(XmlStringMaxLen255Deserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct AutoScalingNotificationTypesSerializer;
impl AutoScalingNotificationTypesSerializer {
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 AvailabilityZonesDeserializer;
impl AvailabilityZonesDeserializer {
#[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(XmlStringMaxLen255Deserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct AvailabilityZonesSerializer;
impl AvailabilityZonesSerializer {
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 BatchDeleteScheduledActionAnswer {
pub failed_scheduled_actions: Option<Vec<FailedScheduledUpdateGroupActionRequest>>,
}
struct BatchDeleteScheduledActionAnswerDeserializer;
impl BatchDeleteScheduledActionAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<BatchDeleteScheduledActionAnswer, XmlParseError> {
deserialize_elements::<_, BatchDeleteScheduledActionAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"FailedScheduledActions" => {
obj.failed_scheduled_actions.get_or_insert(vec![]).extend(
FailedScheduledUpdateGroupActionRequestsDeserializer::deserialize(
"FailedScheduledActions",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct BatchDeleteScheduledActionType {
pub auto_scaling_group_name: String,
pub scheduled_action_names: Vec<String>,
}
struct BatchDeleteScheduledActionTypeSerializer;
impl BatchDeleteScheduledActionTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &BatchDeleteScheduledActionType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
ScheduledActionNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "ScheduledActionNames"),
&obj.scheduled_action_names,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct BatchPutScheduledUpdateGroupActionAnswer {
pub failed_scheduled_update_group_actions: Option<Vec<FailedScheduledUpdateGroupActionRequest>>,
}
struct BatchPutScheduledUpdateGroupActionAnswerDeserializer;
impl BatchPutScheduledUpdateGroupActionAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<BatchPutScheduledUpdateGroupActionAnswer, XmlParseError> {
deserialize_elements::<_, BatchPutScheduledUpdateGroupActionAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"FailedScheduledUpdateGroupActions" => {
obj.failed_scheduled_update_group_actions
.get_or_insert(vec![])
.extend(
FailedScheduledUpdateGroupActionRequestsDeserializer::deserialize(
"FailedScheduledUpdateGroupActions",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct BatchPutScheduledUpdateGroupActionType {
pub auto_scaling_group_name: String,
pub scheduled_update_group_actions: Vec<ScheduledUpdateGroupActionRequest>,
}
struct BatchPutScheduledUpdateGroupActionTypeSerializer;
impl BatchPutScheduledUpdateGroupActionTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &BatchPutScheduledUpdateGroupActionType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
ScheduledUpdateGroupActionRequestsSerializer::serialize(
params,
&format!("{}{}", prefix, "ScheduledUpdateGroupActions"),
&obj.scheduled_update_group_actions,
);
}
}
struct BlockDeviceEbsDeleteOnTerminationDeserializer;
impl BlockDeviceEbsDeleteOnTerminationDeserializer {
#[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 BlockDeviceEbsEncryptedDeserializer;
impl BlockDeviceEbsEncryptedDeserializer {
#[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 BlockDeviceEbsIopsDeserializer;
impl BlockDeviceEbsIopsDeserializer {
#[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 BlockDeviceEbsVolumeSizeDeserializer;
impl BlockDeviceEbsVolumeSizeDeserializer {
#[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 BlockDeviceEbsVolumeTypeDeserializer;
impl BlockDeviceEbsVolumeTypeDeserializer {
#[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 BlockDeviceMapping {
pub device_name: String,
pub ebs: Option<Ebs>,
pub no_device: Option<bool>,
pub virtual_name: Option<String>,
}
struct BlockDeviceMappingDeserializer;
impl BlockDeviceMappingDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<BlockDeviceMapping, XmlParseError> {
deserialize_elements::<_, BlockDeviceMapping, _>(tag_name, stack, |name, stack, obj| {
match name {
"DeviceName" => {
obj.device_name =
XmlStringMaxLen255Deserializer::deserialize("DeviceName", stack)?;
}
"Ebs" => {
obj.ebs = Some(EbsDeserializer::deserialize("Ebs", stack)?);
}
"NoDevice" => {
obj.no_device = Some(NoDeviceDeserializer::deserialize("NoDevice", stack)?);
}
"VirtualName" => {
obj.virtual_name = Some(XmlStringMaxLen255Deserializer::deserialize(
"VirtualName",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct BlockDeviceMappingSerializer;
impl BlockDeviceMappingSerializer {
fn serialize(params: &mut Params, name: &str, obj: &BlockDeviceMapping) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "DeviceName"), &obj.device_name);
if let Some(ref field_value) = obj.ebs {
EbsSerializer::serialize(params, &format!("{}{}", prefix, "Ebs"), field_value);
}
if let Some(ref field_value) = obj.no_device {
params.put(&format!("{}{}", prefix, "NoDevice"), &field_value);
}
if let Some(ref field_value) = obj.virtual_name {
params.put(&format!("{}{}", prefix, "VirtualName"), &field_value);
}
}
}
struct BlockDeviceMappingsDeserializer;
impl BlockDeviceMappingsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<BlockDeviceMapping>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(BlockDeviceMappingDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct BlockDeviceMappingsSerializer;
impl BlockDeviceMappingsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<BlockDeviceMapping>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
BlockDeviceMappingSerializer::serialize(params, &key, obj);
}
}
}
struct ClassicLinkVPCSecurityGroupsDeserializer;
impl ClassicLinkVPCSecurityGroupsDeserializer {
#[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(XmlStringMaxLen255Deserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct ClassicLinkVPCSecurityGroupsSerializer;
impl ClassicLinkVPCSecurityGroupsSerializer {
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 CompleteLifecycleActionAnswer {}
struct CompleteLifecycleActionAnswerDeserializer;
impl CompleteLifecycleActionAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CompleteLifecycleActionAnswer, XmlParseError> {
start_element(tag_name, stack)?;
let obj = CompleteLifecycleActionAnswer::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CompleteLifecycleActionType {
pub auto_scaling_group_name: String,
pub instance_id: Option<String>,
pub lifecycle_action_result: String,
pub lifecycle_action_token: Option<String>,
pub lifecycle_hook_name: String,
}
struct CompleteLifecycleActionTypeSerializer;
impl CompleteLifecycleActionTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CompleteLifecycleActionType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.instance_id {
params.put(&format!("{}{}", prefix, "InstanceId"), &field_value);
}
params.put(
&format!("{}{}", prefix, "LifecycleActionResult"),
&obj.lifecycle_action_result,
);
if let Some(ref field_value) = obj.lifecycle_action_token {
params.put(
&format!("{}{}", prefix, "LifecycleActionToken"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "LifecycleHookName"),
&obj.lifecycle_hook_name,
);
}
}
struct CooldownDeserializer;
impl CooldownDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateAutoScalingGroupType {
pub auto_scaling_group_name: String,
pub availability_zones: Option<Vec<String>>,
pub default_cooldown: Option<i64>,
pub desired_capacity: Option<i64>,
pub health_check_grace_period: Option<i64>,
pub health_check_type: Option<String>,
pub instance_id: Option<String>,
pub launch_configuration_name: Option<String>,
pub launch_template: Option<LaunchTemplateSpecification>,
pub lifecycle_hook_specification_list: Option<Vec<LifecycleHookSpecification>>,
pub load_balancer_names: Option<Vec<String>>,
pub max_size: i64,
pub min_size: i64,
pub mixed_instances_policy: Option<MixedInstancesPolicy>,
pub new_instances_protected_from_scale_in: Option<bool>,
pub placement_group: Option<String>,
pub service_linked_role_arn: Option<String>,
pub tags: Option<Vec<Tag>>,
pub target_group_ar_ns: Option<Vec<String>>,
pub termination_policies: Option<Vec<String>>,
pub vpc_zone_identifier: Option<String>,
}
struct CreateAutoScalingGroupTypeSerializer;
impl CreateAutoScalingGroupTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateAutoScalingGroupType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.availability_zones {
AvailabilityZonesSerializer::serialize(
params,
&format!("{}{}", prefix, "AvailabilityZones"),
field_value,
);
}
if let Some(ref field_value) = obj.default_cooldown {
params.put(&format!("{}{}", prefix, "DefaultCooldown"), &field_value);
}
if let Some(ref field_value) = obj.desired_capacity {
params.put(&format!("{}{}", prefix, "DesiredCapacity"), &field_value);
}
if let Some(ref field_value) = obj.health_check_grace_period {
params.put(
&format!("{}{}", prefix, "HealthCheckGracePeriod"),
&field_value,
);
}
if let Some(ref field_value) = obj.health_check_type {
params.put(&format!("{}{}", prefix, "HealthCheckType"), &field_value);
}
if let Some(ref field_value) = obj.instance_id {
params.put(&format!("{}{}", prefix, "InstanceId"), &field_value);
}
if let Some(ref field_value) = obj.launch_configuration_name {
params.put(
&format!("{}{}", prefix, "LaunchConfigurationName"),
&field_value,
);
}
if let Some(ref field_value) = obj.launch_template {
LaunchTemplateSpecificationSerializer::serialize(
params,
&format!("{}{}", prefix, "LaunchTemplate"),
field_value,
);
}
if let Some(ref field_value) = obj.lifecycle_hook_specification_list {
LifecycleHookSpecificationsSerializer::serialize(
params,
&format!("{}{}", prefix, "LifecycleHookSpecificationList"),
field_value,
);
}
if let Some(ref field_value) = obj.load_balancer_names {
LoadBalancerNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "LoadBalancerNames"),
field_value,
);
}
params.put(&format!("{}{}", prefix, "MaxSize"), &obj.max_size);
params.put(&format!("{}{}", prefix, "MinSize"), &obj.min_size);
if let Some(ref field_value) = obj.mixed_instances_policy {
MixedInstancesPolicySerializer::serialize(
params,
&format!("{}{}", prefix, "MixedInstancesPolicy"),
field_value,
);
}
if let Some(ref field_value) = obj.new_instances_protected_from_scale_in {
params.put(
&format!("{}{}", prefix, "NewInstancesProtectedFromScaleIn"),
&field_value,
);
}
if let Some(ref field_value) = obj.placement_group {
params.put(&format!("{}{}", prefix, "PlacementGroup"), &field_value);
}
if let Some(ref field_value) = obj.service_linked_role_arn {
params.put(
&format!("{}{}", prefix, "ServiceLinkedRoleARN"),
&field_value,
);
}
if let Some(ref field_value) = obj.tags {
TagsSerializer::serialize(params, &format!("{}{}", prefix, "Tags"), field_value);
}
if let Some(ref field_value) = obj.target_group_ar_ns {
TargetGroupARNsSerializer::serialize(
params,
&format!("{}{}", prefix, "TargetGroupARNs"),
field_value,
);
}
if let Some(ref field_value) = obj.termination_policies {
TerminationPoliciesSerializer::serialize(
params,
&format!("{}{}", prefix, "TerminationPolicies"),
field_value,
);
}
if let Some(ref field_value) = obj.vpc_zone_identifier {
params.put(&format!("{}{}", prefix, "VPCZoneIdentifier"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateLaunchConfigurationType {
pub associate_public_ip_address: Option<bool>,
pub block_device_mappings: Option<Vec<BlockDeviceMapping>>,
pub classic_link_vpc_id: Option<String>,
pub classic_link_vpc_security_groups: Option<Vec<String>>,
pub ebs_optimized: Option<bool>,
pub iam_instance_profile: Option<String>,
pub image_id: Option<String>,
pub instance_id: Option<String>,
pub instance_monitoring: Option<InstanceMonitoring>,
pub instance_type: Option<String>,
pub kernel_id: Option<String>,
pub key_name: Option<String>,
pub launch_configuration_name: String,
pub placement_tenancy: Option<String>,
pub ramdisk_id: Option<String>,
pub security_groups: Option<Vec<String>>,
pub spot_price: Option<String>,
pub user_data: Option<String>,
}
struct CreateLaunchConfigurationTypeSerializer;
impl CreateLaunchConfigurationTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateLaunchConfigurationType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.associate_public_ip_address {
params.put(
&format!("{}{}", prefix, "AssociatePublicIpAddress"),
&field_value,
);
}
if let Some(ref field_value) = obj.block_device_mappings {
BlockDeviceMappingsSerializer::serialize(
params,
&format!("{}{}", prefix, "BlockDeviceMappings"),
field_value,
);
}
if let Some(ref field_value) = obj.classic_link_vpc_id {
params.put(&format!("{}{}", prefix, "ClassicLinkVPCId"), &field_value);
}
if let Some(ref field_value) = obj.classic_link_vpc_security_groups {
ClassicLinkVPCSecurityGroupsSerializer::serialize(
params,
&format!("{}{}", prefix, "ClassicLinkVPCSecurityGroups"),
field_value,
);
}
if let Some(ref field_value) = obj.ebs_optimized {
params.put(&format!("{}{}", prefix, "EbsOptimized"), &field_value);
}
if let Some(ref field_value) = obj.iam_instance_profile {
params.put(&format!("{}{}", prefix, "IamInstanceProfile"), &field_value);
}
if let Some(ref field_value) = obj.image_id {
params.put(&format!("{}{}", prefix, "ImageId"), &field_value);
}
if let Some(ref field_value) = obj.instance_id {
params.put(&format!("{}{}", prefix, "InstanceId"), &field_value);
}
if let Some(ref field_value) = obj.instance_monitoring {
InstanceMonitoringSerializer::serialize(
params,
&format!("{}{}", prefix, "InstanceMonitoring"),
field_value,
);
}
if let Some(ref field_value) = obj.instance_type {
params.put(&format!("{}{}", prefix, "InstanceType"), &field_value);
}
if let Some(ref field_value) = obj.kernel_id {
params.put(&format!("{}{}", prefix, "KernelId"), &field_value);
}
if let Some(ref field_value) = obj.key_name {
params.put(&format!("{}{}", prefix, "KeyName"), &field_value);
}
params.put(
&format!("{}{}", prefix, "LaunchConfigurationName"),
&obj.launch_configuration_name,
);
if let Some(ref field_value) = obj.placement_tenancy {
params.put(&format!("{}{}", prefix, "PlacementTenancy"), &field_value);
}
if let Some(ref field_value) = obj.ramdisk_id {
params.put(&format!("{}{}", prefix, "RamdiskId"), &field_value);
}
if let Some(ref field_value) = obj.security_groups {
SecurityGroupsSerializer::serialize(
params,
&format!("{}{}", prefix, "SecurityGroups"),
field_value,
);
}
if let Some(ref field_value) = obj.spot_price {
params.put(&format!("{}{}", prefix, "SpotPrice"), &field_value);
}
if let Some(ref field_value) = obj.user_data {
params.put(&format!("{}{}", prefix, "UserData"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateOrUpdateTagsType {
pub tags: Vec<Tag>,
}
struct CreateOrUpdateTagsTypeSerializer;
impl CreateOrUpdateTagsTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CreateOrUpdateTagsType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
TagsSerializer::serialize(params, &format!("{}{}", prefix, "Tags"), &obj.tags);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CustomizedMetricSpecification {
pub dimensions: Option<Vec<MetricDimension>>,
pub metric_name: String,
pub namespace: String,
pub statistic: String,
pub unit: Option<String>,
}
struct CustomizedMetricSpecificationDeserializer;
impl CustomizedMetricSpecificationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<CustomizedMetricSpecification, XmlParseError> {
deserialize_elements::<_, CustomizedMetricSpecification, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Dimensions" => {
obj.dimensions.get_or_insert(vec![]).extend(
MetricDimensionsDeserializer::deserialize("Dimensions", stack)?,
);
}
"MetricName" => {
obj.metric_name = MetricNameDeserializer::deserialize("MetricName", stack)?;
}
"Namespace" => {
obj.namespace =
MetricNamespaceDeserializer::deserialize("Namespace", stack)?;
}
"Statistic" => {
obj.statistic =
MetricStatisticDeserializer::deserialize("Statistic", stack)?;
}
"Unit" => {
obj.unit = Some(MetricUnitDeserializer::deserialize("Unit", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct CustomizedMetricSpecificationSerializer;
impl CustomizedMetricSpecificationSerializer {
fn serialize(params: &mut Params, name: &str, obj: &CustomizedMetricSpecification) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.dimensions {
MetricDimensionsSerializer::serialize(
params,
&format!("{}{}", prefix, "Dimensions"),
field_value,
);
}
params.put(&format!("{}{}", prefix, "MetricName"), &obj.metric_name);
params.put(&format!("{}{}", prefix, "Namespace"), &obj.namespace);
params.put(&format!("{}{}", prefix, "Statistic"), &obj.statistic);
if let Some(ref field_value) = obj.unit {
params.put(&format!("{}{}", prefix, "Unit"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteAutoScalingGroupType {
pub auto_scaling_group_name: String,
pub force_delete: Option<bool>,
}
struct DeleteAutoScalingGroupTypeSerializer;
impl DeleteAutoScalingGroupTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteAutoScalingGroupType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.force_delete {
params.put(&format!("{}{}", prefix, "ForceDelete"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteLifecycleHookAnswer {}
struct DeleteLifecycleHookAnswerDeserializer;
impl DeleteLifecycleHookAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DeleteLifecycleHookAnswer, XmlParseError> {
start_element(tag_name, stack)?;
let obj = DeleteLifecycleHookAnswer::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteLifecycleHookType {
pub auto_scaling_group_name: String,
pub lifecycle_hook_name: String,
}
struct DeleteLifecycleHookTypeSerializer;
impl DeleteLifecycleHookTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteLifecycleHookType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
params.put(
&format!("{}{}", prefix, "LifecycleHookName"),
&obj.lifecycle_hook_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteNotificationConfigurationType {
pub auto_scaling_group_name: String,
pub topic_arn: String,
}
struct DeleteNotificationConfigurationTypeSerializer;
impl DeleteNotificationConfigurationTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteNotificationConfigurationType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
params.put(&format!("{}{}", prefix, "TopicARN"), &obj.topic_arn);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeletePolicyType {
pub auto_scaling_group_name: Option<String>,
pub policy_name: String,
}
struct DeletePolicyTypeSerializer;
impl DeletePolicyTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeletePolicyType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.auto_scaling_group_name {
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&field_value,
);
}
params.put(&format!("{}{}", prefix, "PolicyName"), &obj.policy_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteScheduledActionType {
pub auto_scaling_group_name: String,
pub scheduled_action_name: String,
}
struct DeleteScheduledActionTypeSerializer;
impl DeleteScheduledActionTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteScheduledActionType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
params.put(
&format!("{}{}", prefix, "ScheduledActionName"),
&obj.scheduled_action_name,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteTagsType {
pub tags: Vec<Tag>,
}
struct DeleteTagsTypeSerializer;
impl DeleteTagsTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DeleteTagsType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
TagsSerializer::serialize(params, &format!("{}{}", prefix, "Tags"), &obj.tags);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeAccountLimitsAnswer {
pub max_number_of_auto_scaling_groups: Option<i64>,
pub max_number_of_launch_configurations: Option<i64>,
pub number_of_auto_scaling_groups: Option<i64>,
pub number_of_launch_configurations: Option<i64>,
}
struct DescribeAccountLimitsAnswerDeserializer;
impl DescribeAccountLimitsAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeAccountLimitsAnswer, XmlParseError> {
deserialize_elements::<_, DescribeAccountLimitsAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"MaxNumberOfAutoScalingGroups" => {
obj.max_number_of_auto_scaling_groups =
Some(MaxNumberOfAutoScalingGroupsDeserializer::deserialize(
"MaxNumberOfAutoScalingGroups",
stack,
)?);
}
"MaxNumberOfLaunchConfigurations" => {
obj.max_number_of_launch_configurations =
Some(MaxNumberOfLaunchConfigurationsDeserializer::deserialize(
"MaxNumberOfLaunchConfigurations",
stack,
)?);
}
"NumberOfAutoScalingGroups" => {
obj.number_of_auto_scaling_groups =
Some(NumberOfAutoScalingGroupsDeserializer::deserialize(
"NumberOfAutoScalingGroups",
stack,
)?);
}
"NumberOfLaunchConfigurations" => {
obj.number_of_launch_configurations =
Some(NumberOfLaunchConfigurationsDeserializer::deserialize(
"NumberOfLaunchConfigurations",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeAdjustmentTypesAnswer {
pub adjustment_types: Option<Vec<AdjustmentType>>,
}
struct DescribeAdjustmentTypesAnswerDeserializer;
impl DescribeAdjustmentTypesAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeAdjustmentTypesAnswer, XmlParseError> {
deserialize_elements::<_, DescribeAdjustmentTypesAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AdjustmentTypes" => {
obj.adjustment_types.get_or_insert(vec![]).extend(
AdjustmentTypesDeserializer::deserialize("AdjustmentTypes", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeAutoScalingInstancesType {
pub instance_ids: Option<Vec<String>>,
pub max_records: Option<i64>,
pub next_token: Option<String>,
}
struct DescribeAutoScalingInstancesTypeSerializer;
impl DescribeAutoScalingInstancesTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeAutoScalingInstancesType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.instance_ids {
InstanceIdsSerializer::serialize(
params,
&format!("{}{}", prefix, "InstanceIds"),
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.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeAutoScalingNotificationTypesAnswer {
pub auto_scaling_notification_types: Option<Vec<String>>,
}
struct DescribeAutoScalingNotificationTypesAnswerDeserializer;
impl DescribeAutoScalingNotificationTypesAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeAutoScalingNotificationTypesAnswer, XmlParseError> {
deserialize_elements::<_, DescribeAutoScalingNotificationTypesAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AutoScalingNotificationTypes" => {
obj.auto_scaling_notification_types
.get_or_insert(vec![])
.extend(AutoScalingNotificationTypesDeserializer::deserialize(
"AutoScalingNotificationTypes",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeLifecycleHookTypesAnswer {
pub lifecycle_hook_types: Option<Vec<String>>,
}
struct DescribeLifecycleHookTypesAnswerDeserializer;
impl DescribeLifecycleHookTypesAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeLifecycleHookTypesAnswer, XmlParseError> {
deserialize_elements::<_, DescribeLifecycleHookTypesAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"LifecycleHookTypes" => {
obj.lifecycle_hook_types.get_or_insert(vec![]).extend(
AutoScalingNotificationTypesDeserializer::deserialize(
"LifecycleHookTypes",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeLifecycleHooksAnswer {
pub lifecycle_hooks: Option<Vec<LifecycleHook>>,
}
struct DescribeLifecycleHooksAnswerDeserializer;
impl DescribeLifecycleHooksAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeLifecycleHooksAnswer, XmlParseError> {
deserialize_elements::<_, DescribeLifecycleHooksAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"LifecycleHooks" => {
obj.lifecycle_hooks.get_or_insert(vec![]).extend(
LifecycleHooksDeserializer::deserialize("LifecycleHooks", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeLifecycleHooksType {
pub auto_scaling_group_name: String,
pub lifecycle_hook_names: Option<Vec<String>>,
}
struct DescribeLifecycleHooksTypeSerializer;
impl DescribeLifecycleHooksTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeLifecycleHooksType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.lifecycle_hook_names {
LifecycleHookNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "LifecycleHookNames"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeLoadBalancerTargetGroupsRequest {
pub auto_scaling_group_name: String,
pub max_records: Option<i64>,
pub next_token: Option<String>,
}
struct DescribeLoadBalancerTargetGroupsRequestSerializer;
impl DescribeLoadBalancerTargetGroupsRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeLoadBalancerTargetGroupsRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeLoadBalancerTargetGroupsResponse {
pub load_balancer_target_groups: Option<Vec<LoadBalancerTargetGroupState>>,
pub next_token: Option<String>,
}
struct DescribeLoadBalancerTargetGroupsResponseDeserializer;
impl DescribeLoadBalancerTargetGroupsResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeLoadBalancerTargetGroupsResponse, XmlParseError> {
deserialize_elements::<_, DescribeLoadBalancerTargetGroupsResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"LoadBalancerTargetGroups" => {
obj.load_balancer_target_groups
.get_or_insert(vec![])
.extend(LoadBalancerTargetGroupStatesDeserializer::deserialize(
"LoadBalancerTargetGroups",
stack,
)?);
}
"NextToken" => {
obj.next_token =
Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeLoadBalancersRequest {
pub auto_scaling_group_name: String,
pub max_records: Option<i64>,
pub next_token: Option<String>,
}
struct DescribeLoadBalancersRequestSerializer;
impl DescribeLoadBalancersRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeLoadBalancersRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeLoadBalancersResponse {
pub load_balancers: Option<Vec<LoadBalancerState>>,
pub next_token: Option<String>,
}
struct DescribeLoadBalancersResponseDeserializer;
impl DescribeLoadBalancersResponseDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeLoadBalancersResponse, XmlParseError> {
deserialize_elements::<_, DescribeLoadBalancersResponse, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"LoadBalancers" => {
obj.load_balancers.get_or_insert(vec![]).extend(
LoadBalancerStatesDeserializer::deserialize("LoadBalancers", stack)?,
);
}
"NextToken" => {
obj.next_token =
Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeMetricCollectionTypesAnswer {
pub granularities: Option<Vec<MetricGranularityType>>,
pub metrics: Option<Vec<MetricCollectionType>>,
}
struct DescribeMetricCollectionTypesAnswerDeserializer;
impl DescribeMetricCollectionTypesAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeMetricCollectionTypesAnswer, XmlParseError> {
deserialize_elements::<_, DescribeMetricCollectionTypesAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"Granularities" => {
obj.granularities.get_or_insert(vec![]).extend(
MetricGranularityTypesDeserializer::deserialize(
"Granularities",
stack,
)?,
);
}
"Metrics" => {
obj.metrics.get_or_insert(vec![]).extend(
MetricCollectionTypesDeserializer::deserialize("Metrics", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeNotificationConfigurationsAnswer {
pub next_token: Option<String>,
pub notification_configurations: Vec<NotificationConfiguration>,
}
struct DescribeNotificationConfigurationsAnswerDeserializer;
impl DescribeNotificationConfigurationsAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeNotificationConfigurationsAnswer, XmlParseError> {
deserialize_elements::<_, DescribeNotificationConfigurationsAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"NextToken" => {
obj.next_token =
Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
"NotificationConfigurations" => {
obj.notification_configurations.extend(
NotificationConfigurationsDeserializer::deserialize(
"NotificationConfigurations",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeNotificationConfigurationsType {
pub auto_scaling_group_names: Option<Vec<String>>,
pub max_records: Option<i64>,
pub next_token: Option<String>,
}
struct DescribeNotificationConfigurationsTypeSerializer;
impl DescribeNotificationConfigurationsTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeNotificationConfigurationsType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.auto_scaling_group_names {
AutoScalingGroupNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "AutoScalingGroupNames"),
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.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribePoliciesType {
pub auto_scaling_group_name: Option<String>,
pub max_records: Option<i64>,
pub next_token: Option<String>,
pub policy_names: Option<Vec<String>>,
pub policy_types: Option<Vec<String>>,
}
struct DescribePoliciesTypeSerializer;
impl DescribePoliciesTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribePoliciesType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.auto_scaling_group_name {
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&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.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
if let Some(ref field_value) = obj.policy_names {
PolicyNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "PolicyNames"),
field_value,
);
}
if let Some(ref field_value) = obj.policy_types {
PolicyTypesSerializer::serialize(
params,
&format!("{}{}", prefix, "PolicyTypes"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeScalingActivitiesType {
pub activity_ids: Option<Vec<String>>,
pub auto_scaling_group_name: Option<String>,
pub max_records: Option<i64>,
pub next_token: Option<String>,
}
struct DescribeScalingActivitiesTypeSerializer;
impl DescribeScalingActivitiesTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeScalingActivitiesType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.activity_ids {
ActivityIdsSerializer::serialize(
params,
&format!("{}{}", prefix, "ActivityIds"),
field_value,
);
}
if let Some(ref field_value) = obj.auto_scaling_group_name {
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&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.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeScheduledActionsType {
pub auto_scaling_group_name: Option<String>,
pub end_time: Option<String>,
pub max_records: Option<i64>,
pub next_token: Option<String>,
pub scheduled_action_names: Option<Vec<String>>,
pub start_time: Option<String>,
}
struct DescribeScheduledActionsTypeSerializer;
impl DescribeScheduledActionsTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeScheduledActionsType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.auto_scaling_group_name {
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&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.max_records {
params.put(&format!("{}{}", prefix, "MaxRecords"), &field_value);
}
if let Some(ref field_value) = obj.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
if let Some(ref field_value) = obj.scheduled_action_names {
ScheduledActionNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "ScheduledActionNames"),
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 DescribeTagsType {
pub filters: Option<Vec<Filter>>,
pub max_records: Option<i64>,
pub next_token: Option<String>,
}
struct DescribeTagsTypeSerializer;
impl DescribeTagsTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DescribeTagsType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.filters {
FiltersSerializer::serialize(params, &format!("{}{}", prefix, "Filters"), 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.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeTerminationPolicyTypesAnswer {
pub termination_policy_types: Option<Vec<String>>,
}
struct DescribeTerminationPolicyTypesAnswerDeserializer;
impl DescribeTerminationPolicyTypesAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DescribeTerminationPolicyTypesAnswer, XmlParseError> {
deserialize_elements::<_, DescribeTerminationPolicyTypesAnswer, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"TerminationPolicyTypes" => {
obj.termination_policy_types.get_or_insert(vec![]).extend(
TerminationPoliciesDeserializer::deserialize(
"TerminationPolicyTypes",
stack,
)?,
);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DetachInstancesAnswer {
pub activities: Option<Vec<Activity>>,
}
struct DetachInstancesAnswerDeserializer;
impl DetachInstancesAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DetachInstancesAnswer, XmlParseError> {
deserialize_elements::<_, DetachInstancesAnswer, _>(tag_name, stack, |name, stack, obj| {
match name {
"Activities" => {
obj.activities
.get_or_insert(vec![])
.extend(ActivitiesDeserializer::deserialize("Activities", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DetachInstancesQuery {
pub auto_scaling_group_name: String,
pub instance_ids: Option<Vec<String>>,
pub should_decrement_desired_capacity: bool,
}
struct DetachInstancesQuerySerializer;
impl DetachInstancesQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &DetachInstancesQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.instance_ids {
InstanceIdsSerializer::serialize(
params,
&format!("{}{}", prefix, "InstanceIds"),
field_value,
);
}
params.put(
&format!("{}{}", prefix, "ShouldDecrementDesiredCapacity"),
&obj.should_decrement_desired_capacity,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DetachLoadBalancerTargetGroupsResultType {}
struct DetachLoadBalancerTargetGroupsResultTypeDeserializer;
impl DetachLoadBalancerTargetGroupsResultTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DetachLoadBalancerTargetGroupsResultType, XmlParseError> {
start_element(tag_name, stack)?;
let obj = DetachLoadBalancerTargetGroupsResultType::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DetachLoadBalancerTargetGroupsType {
pub auto_scaling_group_name: String,
pub target_group_ar_ns: Vec<String>,
}
struct DetachLoadBalancerTargetGroupsTypeSerializer;
impl DetachLoadBalancerTargetGroupsTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DetachLoadBalancerTargetGroupsType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
TargetGroupARNsSerializer::serialize(
params,
&format!("{}{}", prefix, "TargetGroupARNs"),
&obj.target_group_ar_ns,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DetachLoadBalancersResultType {}
struct DetachLoadBalancersResultTypeDeserializer;
impl DetachLoadBalancersResultTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<DetachLoadBalancersResultType, XmlParseError> {
start_element(tag_name, stack)?;
let obj = DetachLoadBalancersResultType::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DetachLoadBalancersType {
pub auto_scaling_group_name: String,
pub load_balancer_names: Vec<String>,
}
struct DetachLoadBalancersTypeSerializer;
impl DetachLoadBalancersTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &DetachLoadBalancersType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
LoadBalancerNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "LoadBalancerNames"),
&obj.load_balancer_names,
);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DisableMetricsCollectionQuery {
pub auto_scaling_group_name: String,
pub metrics: Option<Vec<String>>,
}
struct DisableMetricsCollectionQuerySerializer;
impl DisableMetricsCollectionQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &DisableMetricsCollectionQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.metrics {
MetricsSerializer::serialize(params, &format!("{}{}", prefix, "Metrics"), field_value);
}
}
}
struct DisableScaleInDeserializer;
impl DisableScaleInDeserializer {
#[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 Ebs {
pub delete_on_termination: Option<bool>,
pub encrypted: Option<bool>,
pub iops: Option<i64>,
pub snapshot_id: Option<String>,
pub volume_size: Option<i64>,
pub volume_type: Option<String>,
}
struct EbsDeserializer;
impl EbsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<Ebs, XmlParseError> {
deserialize_elements::<_, Ebs, _>(tag_name, stack, |name, stack, obj| {
match name {
"DeleteOnTermination" => {
obj.delete_on_termination =
Some(BlockDeviceEbsDeleteOnTerminationDeserializer::deserialize(
"DeleteOnTermination",
stack,
)?);
}
"Encrypted" => {
obj.encrypted = Some(BlockDeviceEbsEncryptedDeserializer::deserialize(
"Encrypted",
stack,
)?);
}
"Iops" => {
obj.iops = Some(BlockDeviceEbsIopsDeserializer::deserialize("Iops", stack)?);
}
"SnapshotId" => {
obj.snapshot_id = Some(XmlStringMaxLen255Deserializer::deserialize(
"SnapshotId",
stack,
)?);
}
"VolumeSize" => {
obj.volume_size = Some(BlockDeviceEbsVolumeSizeDeserializer::deserialize(
"VolumeSize",
stack,
)?);
}
"VolumeType" => {
obj.volume_type = Some(BlockDeviceEbsVolumeTypeDeserializer::deserialize(
"VolumeType",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct EbsSerializer;
impl EbsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Ebs) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.delete_on_termination {
params.put(
&format!("{}{}", prefix, "DeleteOnTermination"),
&field_value,
);
}
if let Some(ref field_value) = obj.encrypted {
params.put(&format!("{}{}", prefix, "Encrypted"), &field_value);
}
if let Some(ref field_value) = obj.iops {
params.put(&format!("{}{}", prefix, "Iops"), &field_value);
}
if let Some(ref field_value) = obj.snapshot_id {
params.put(&format!("{}{}", prefix, "SnapshotId"), &field_value);
}
if let Some(ref field_value) = obj.volume_size {
params.put(&format!("{}{}", prefix, "VolumeSize"), &field_value);
}
if let Some(ref field_value) = obj.volume_type {
params.put(&format!("{}{}", prefix, "VolumeType"), &field_value);
}
}
}
struct EbsOptimizedDeserializer;
impl EbsOptimizedDeserializer {
#[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 EnableMetricsCollectionQuery {
pub auto_scaling_group_name: String,
pub granularity: String,
pub metrics: Option<Vec<String>>,
}
struct EnableMetricsCollectionQuerySerializer;
impl EnableMetricsCollectionQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &EnableMetricsCollectionQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
params.put(&format!("{}{}", prefix, "Granularity"), &obj.granularity);
if let Some(ref field_value) = obj.metrics {
MetricsSerializer::serialize(params, &format!("{}{}", prefix, "Metrics"), field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct EnabledMetric {
pub granularity: Option<String>,
pub metric: Option<String>,
}
struct EnabledMetricDeserializer;
impl EnabledMetricDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<EnabledMetric, XmlParseError> {
deserialize_elements::<_, EnabledMetric, _>(tag_name, stack, |name, stack, obj| {
match name {
"Granularity" => {
obj.granularity = Some(XmlStringMaxLen255Deserializer::deserialize(
"Granularity",
stack,
)?);
}
"Metric" => {
obj.metric = Some(XmlStringMaxLen255Deserializer::deserialize(
"Metric", stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct EnabledMetricsDeserializer;
impl EnabledMetricsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<EnabledMetric>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(EnabledMetricDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct EnterStandbyAnswer {
pub activities: Option<Vec<Activity>>,
}
struct EnterStandbyAnswerDeserializer;
impl EnterStandbyAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<EnterStandbyAnswer, XmlParseError> {
deserialize_elements::<_, EnterStandbyAnswer, _>(tag_name, stack, |name, stack, obj| {
match name {
"Activities" => {
obj.activities
.get_or_insert(vec![])
.extend(ActivitiesDeserializer::deserialize("Activities", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct EnterStandbyQuery {
pub auto_scaling_group_name: String,
pub instance_ids: Option<Vec<String>>,
pub should_decrement_desired_capacity: bool,
}
struct EnterStandbyQuerySerializer;
impl EnterStandbyQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &EnterStandbyQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.instance_ids {
InstanceIdsSerializer::serialize(
params,
&format!("{}{}", prefix, "InstanceIds"),
field_value,
);
}
params.put(
&format!("{}{}", prefix, "ShouldDecrementDesiredCapacity"),
&obj.should_decrement_desired_capacity,
);
}
}
struct EstimatedInstanceWarmupDeserializer;
impl EstimatedInstanceWarmupDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ExecutePolicyType {
pub auto_scaling_group_name: Option<String>,
pub breach_threshold: Option<f64>,
pub honor_cooldown: Option<bool>,
pub metric_value: Option<f64>,
pub policy_name: String,
}
struct ExecutePolicyTypeSerializer;
impl ExecutePolicyTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ExecutePolicyType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.auto_scaling_group_name {
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&field_value,
);
}
if let Some(ref field_value) = obj.breach_threshold {
params.put(&format!("{}{}", prefix, "BreachThreshold"), &field_value);
}
if let Some(ref field_value) = obj.honor_cooldown {
params.put(&format!("{}{}", prefix, "HonorCooldown"), &field_value);
}
if let Some(ref field_value) = obj.metric_value {
params.put(&format!("{}{}", prefix, "MetricValue"), &field_value);
}
params.put(&format!("{}{}", prefix, "PolicyName"), &obj.policy_name);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ExitStandbyAnswer {
pub activities: Option<Vec<Activity>>,
}
struct ExitStandbyAnswerDeserializer;
impl ExitStandbyAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ExitStandbyAnswer, XmlParseError> {
deserialize_elements::<_, ExitStandbyAnswer, _>(tag_name, stack, |name, stack, obj| {
match name {
"Activities" => {
obj.activities
.get_or_insert(vec![])
.extend(ActivitiesDeserializer::deserialize("Activities", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ExitStandbyQuery {
pub auto_scaling_group_name: String,
pub instance_ids: Option<Vec<String>>,
}
struct ExitStandbyQuerySerializer;
impl ExitStandbyQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &ExitStandbyQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.instance_ids {
InstanceIdsSerializer::serialize(
params,
&format!("{}{}", prefix, "InstanceIds"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct FailedScheduledUpdateGroupActionRequest {
pub error_code: Option<String>,
pub error_message: Option<String>,
pub scheduled_action_name: String,
}
struct FailedScheduledUpdateGroupActionRequestDeserializer;
impl FailedScheduledUpdateGroupActionRequestDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<FailedScheduledUpdateGroupActionRequest, XmlParseError> {
deserialize_elements::<_, FailedScheduledUpdateGroupActionRequest, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"ErrorCode" => {
obj.error_code = Some(XmlStringMaxLen64Deserializer::deserialize(
"ErrorCode",
stack,
)?);
}
"ErrorMessage" => {
obj.error_message =
Some(XmlStringDeserializer::deserialize("ErrorMessage", stack)?);
}
"ScheduledActionName" => {
obj.scheduled_action_name = XmlStringMaxLen255Deserializer::deserialize(
"ScheduledActionName",
stack,
)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct FailedScheduledUpdateGroupActionRequestsDeserializer;
impl FailedScheduledUpdateGroupActionRequestsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<FailedScheduledUpdateGroupActionRequest>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(
FailedScheduledUpdateGroupActionRequestDeserializer::deserialize(
"member", stack,
)?,
);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Filter {
pub name: Option<String>,
pub values: Option<Vec<String>>,
}
struct FilterSerializer;
impl FilterSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Filter) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.name {
params.put(&format!("{}{}", prefix, "Name"), &field_value);
}
if let Some(ref field_value) = obj.values {
ValuesSerializer::serialize(params, &format!("{}{}", prefix, "Values"), field_value);
}
}
}
struct FiltersSerializer;
impl FiltersSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<Filter>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
FilterSerializer::serialize(params, &key, obj);
}
}
}
struct GlobalTimeoutDeserializer;
impl GlobalTimeoutDeserializer {
#[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 HealthCheckGracePeriodDeserializer;
impl HealthCheckGracePeriodDeserializer {
#[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 HeartbeatTimeoutDeserializer;
impl HeartbeatTimeoutDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Instance {
pub availability_zone: String,
pub health_status: String,
pub instance_id: String,
pub launch_configuration_name: Option<String>,
pub launch_template: Option<LaunchTemplateSpecification>,
pub lifecycle_state: String,
pub protected_from_scale_in: bool,
}
struct InstanceDeserializer;
impl InstanceDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Instance, XmlParseError> {
deserialize_elements::<_, Instance, _>(tag_name, stack, |name, stack, obj| {
match name {
"AvailabilityZone" => {
obj.availability_zone =
XmlStringMaxLen255Deserializer::deserialize("AvailabilityZone", stack)?;
}
"HealthStatus" => {
obj.health_status =
XmlStringMaxLen32Deserializer::deserialize("HealthStatus", stack)?;
}
"InstanceId" => {
obj.instance_id =
XmlStringMaxLen19Deserializer::deserialize("InstanceId", stack)?;
}
"LaunchConfigurationName" => {
obj.launch_configuration_name =
Some(XmlStringMaxLen255Deserializer::deserialize(
"LaunchConfigurationName",
stack,
)?);
}
"LaunchTemplate" => {
obj.launch_template =
Some(LaunchTemplateSpecificationDeserializer::deserialize(
"LaunchTemplate",
stack,
)?);
}
"LifecycleState" => {
obj.lifecycle_state =
LifecycleStateDeserializer::deserialize("LifecycleState", stack)?;
}
"ProtectedFromScaleIn" => {
obj.protected_from_scale_in =
InstanceProtectedDeserializer::deserialize("ProtectedFromScaleIn", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct InstanceIdsSerializer;
impl InstanceIdsSerializer {
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 InstanceMonitoring {
pub enabled: Option<bool>,
}
struct InstanceMonitoringDeserializer;
impl InstanceMonitoringDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<InstanceMonitoring, XmlParseError> {
deserialize_elements::<_, InstanceMonitoring, _>(tag_name, stack, |name, stack, obj| {
match name {
"Enabled" => {
obj.enabled = Some(MonitoringEnabledDeserializer::deserialize(
"Enabled", stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct InstanceMonitoringSerializer;
impl InstanceMonitoringSerializer {
fn serialize(params: &mut Params, name: &str, obj: &InstanceMonitoring) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.enabled {
params.put(&format!("{}{}", prefix, "Enabled"), &field_value);
}
}
}
struct InstanceProtectedDeserializer;
impl InstanceProtectedDeserializer {
#[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 InstancesDeserializer;
impl InstancesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<Instance>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(InstanceDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct InstancesDistribution {
pub on_demand_allocation_strategy: Option<String>,
pub on_demand_base_capacity: Option<i64>,
pub on_demand_percentage_above_base_capacity: Option<i64>,
pub spot_allocation_strategy: Option<String>,
pub spot_instance_pools: Option<i64>,
pub spot_max_price: Option<String>,
}
struct InstancesDistributionDeserializer;
impl InstancesDistributionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<InstancesDistribution, XmlParseError> {
deserialize_elements::<_, InstancesDistribution, _>(tag_name, stack, |name, stack, obj| {
match name {
"OnDemandAllocationStrategy" => {
obj.on_demand_allocation_strategy = Some(XmlStringDeserializer::deserialize(
"OnDemandAllocationStrategy",
stack,
)?);
}
"OnDemandBaseCapacity" => {
obj.on_demand_base_capacity =
Some(OnDemandBaseCapacityDeserializer::deserialize(
"OnDemandBaseCapacity",
stack,
)?);
}
"OnDemandPercentageAboveBaseCapacity" => {
obj.on_demand_percentage_above_base_capacity = Some(
OnDemandPercentageAboveBaseCapacityDeserializer::deserialize(
"OnDemandPercentageAboveBaseCapacity",
stack,
)?,
);
}
"SpotAllocationStrategy" => {
obj.spot_allocation_strategy = Some(XmlStringDeserializer::deserialize(
"SpotAllocationStrategy",
stack,
)?);
}
"SpotInstancePools" => {
obj.spot_instance_pools = Some(SpotInstancePoolsDeserializer::deserialize(
"SpotInstancePools",
stack,
)?);
}
"SpotMaxPrice" => {
obj.spot_max_price = Some(MixedInstanceSpotPriceDeserializer::deserialize(
"SpotMaxPrice",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct InstancesDistributionSerializer;
impl InstancesDistributionSerializer {
fn serialize(params: &mut Params, name: &str, obj: &InstancesDistribution) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.on_demand_allocation_strategy {
params.put(
&format!("{}{}", prefix, "OnDemandAllocationStrategy"),
&field_value,
);
}
if let Some(ref field_value) = obj.on_demand_base_capacity {
params.put(
&format!("{}{}", prefix, "OnDemandBaseCapacity"),
&field_value,
);
}
if let Some(ref field_value) = obj.on_demand_percentage_above_base_capacity {
params.put(
&format!("{}{}", prefix, "OnDemandPercentageAboveBaseCapacity"),
&field_value,
);
}
if let Some(ref field_value) = obj.spot_allocation_strategy {
params.put(
&format!("{}{}", prefix, "SpotAllocationStrategy"),
&field_value,
);
}
if let Some(ref field_value) = obj.spot_instance_pools {
params.put(&format!("{}{}", prefix, "SpotInstancePools"), &field_value);
}
if let Some(ref field_value) = obj.spot_max_price {
params.put(&format!("{}{}", prefix, "SpotMaxPrice"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LaunchConfiguration {
pub associate_public_ip_address: Option<bool>,
pub block_device_mappings: Option<Vec<BlockDeviceMapping>>,
pub classic_link_vpc_id: Option<String>,
pub classic_link_vpc_security_groups: Option<Vec<String>>,
pub created_time: String,
pub ebs_optimized: Option<bool>,
pub iam_instance_profile: Option<String>,
pub image_id: String,
pub instance_monitoring: Option<InstanceMonitoring>,
pub instance_type: String,
pub kernel_id: Option<String>,
pub key_name: Option<String>,
pub launch_configuration_arn: Option<String>,
pub launch_configuration_name: String,
pub placement_tenancy: Option<String>,
pub ramdisk_id: Option<String>,
pub security_groups: Option<Vec<String>>,
pub spot_price: Option<String>,
pub user_data: Option<String>,
}
struct LaunchConfigurationDeserializer;
impl LaunchConfigurationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LaunchConfiguration, XmlParseError> {
deserialize_elements::<_, LaunchConfiguration, _>(tag_name, stack, |name, stack, obj| {
match name {
"AssociatePublicIpAddress" => {
obj.associate_public_ip_address =
Some(AssociatePublicIpAddressDeserializer::deserialize(
"AssociatePublicIpAddress",
stack,
)?);
}
"BlockDeviceMappings" => {
obj.block_device_mappings.get_or_insert(vec![]).extend(
BlockDeviceMappingsDeserializer::deserialize("BlockDeviceMappings", stack)?,
);
}
"ClassicLinkVPCId" => {
obj.classic_link_vpc_id = Some(XmlStringMaxLen255Deserializer::deserialize(
"ClassicLinkVPCId",
stack,
)?);
}
"ClassicLinkVPCSecurityGroups" => {
obj.classic_link_vpc_security_groups
.get_or_insert(vec![])
.extend(ClassicLinkVPCSecurityGroupsDeserializer::deserialize(
"ClassicLinkVPCSecurityGroups",
stack,
)?);
}
"CreatedTime" => {
obj.created_time =
TimestampTypeDeserializer::deserialize("CreatedTime", stack)?;
}
"EbsOptimized" => {
obj.ebs_optimized = Some(EbsOptimizedDeserializer::deserialize(
"EbsOptimized",
stack,
)?);
}
"IamInstanceProfile" => {
obj.iam_instance_profile = Some(XmlStringMaxLen1600Deserializer::deserialize(
"IamInstanceProfile",
stack,
)?);
}
"ImageId" => {
obj.image_id = XmlStringMaxLen255Deserializer::deserialize("ImageId", stack)?;
}
"InstanceMonitoring" => {
obj.instance_monitoring = Some(InstanceMonitoringDeserializer::deserialize(
"InstanceMonitoring",
stack,
)?);
}
"InstanceType" => {
obj.instance_type =
XmlStringMaxLen255Deserializer::deserialize("InstanceType", stack)?;
}
"KernelId" => {
obj.kernel_id = Some(XmlStringMaxLen255Deserializer::deserialize(
"KernelId", stack,
)?);
}
"KeyName" => {
obj.key_name = Some(XmlStringMaxLen255Deserializer::deserialize(
"KeyName", stack,
)?);
}
"LaunchConfigurationARN" => {
obj.launch_configuration_arn = Some(ResourceNameDeserializer::deserialize(
"LaunchConfigurationARN",
stack,
)?);
}
"LaunchConfigurationName" => {
obj.launch_configuration_name = XmlStringMaxLen255Deserializer::deserialize(
"LaunchConfigurationName",
stack,
)?;
}
"PlacementTenancy" => {
obj.placement_tenancy = Some(XmlStringMaxLen64Deserializer::deserialize(
"PlacementTenancy",
stack,
)?);
}
"RamdiskId" => {
obj.ramdisk_id = Some(XmlStringMaxLen255Deserializer::deserialize(
"RamdiskId",
stack,
)?);
}
"SecurityGroups" => {
obj.security_groups.get_or_insert(vec![]).extend(
SecurityGroupsDeserializer::deserialize("SecurityGroups", stack)?,
);
}
"SpotPrice" => {
obj.spot_price = Some(SpotPriceDeserializer::deserialize("SpotPrice", stack)?);
}
"UserData" => {
obj.user_data = Some(XmlStringUserDataDeserializer::deserialize(
"UserData", stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LaunchConfigurationNameType {
pub launch_configuration_name: String,
}
struct LaunchConfigurationNameTypeSerializer;
impl LaunchConfigurationNameTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LaunchConfigurationNameType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "LaunchConfigurationName"),
&obj.launch_configuration_name,
);
}
}
struct LaunchConfigurationNamesSerializer;
impl LaunchConfigurationNamesSerializer {
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 LaunchConfigurationNamesType {
pub launch_configuration_names: Option<Vec<String>>,
pub max_records: Option<i64>,
pub next_token: Option<String>,
}
struct LaunchConfigurationNamesTypeSerializer;
impl LaunchConfigurationNamesTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LaunchConfigurationNamesType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.launch_configuration_names {
LaunchConfigurationNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "LaunchConfigurationNames"),
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.next_token {
params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
}
}
}
struct LaunchConfigurationsDeserializer;
impl LaunchConfigurationsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<LaunchConfiguration>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(LaunchConfigurationDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LaunchConfigurationsType {
pub launch_configurations: Vec<LaunchConfiguration>,
pub next_token: Option<String>,
}
struct LaunchConfigurationsTypeDeserializer;
impl LaunchConfigurationsTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LaunchConfigurationsType, XmlParseError> {
deserialize_elements::<_, LaunchConfigurationsType, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"LaunchConfigurations" => {
obj.launch_configurations.extend(
LaunchConfigurationsDeserializer::deserialize(
"LaunchConfigurations",
stack,
)?,
);
}
"NextToken" => {
obj.next_token =
Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LaunchTemplate {
pub launch_template_specification: Option<LaunchTemplateSpecification>,
pub overrides: Option<Vec<LaunchTemplateOverrides>>,
}
struct LaunchTemplateDeserializer;
impl LaunchTemplateDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LaunchTemplate, XmlParseError> {
deserialize_elements::<_, LaunchTemplate, _>(tag_name, stack, |name, stack, obj| {
match name {
"LaunchTemplateSpecification" => {
obj.launch_template_specification =
Some(LaunchTemplateSpecificationDeserializer::deserialize(
"LaunchTemplateSpecification",
stack,
)?);
}
"Overrides" => {
obj.overrides
.get_or_insert(vec![])
.extend(OverridesDeserializer::deserialize("Overrides", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct LaunchTemplateSerializer;
impl LaunchTemplateSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LaunchTemplate) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.launch_template_specification {
LaunchTemplateSpecificationSerializer::serialize(
params,
&format!("{}{}", prefix, "LaunchTemplateSpecification"),
field_value,
);
}
if let Some(ref field_value) = obj.overrides {
OverridesSerializer::serialize(
params,
&format!("{}{}", prefix, "Overrides"),
field_value,
);
}
}
}
struct LaunchTemplateNameDeserializer;
impl LaunchTemplateNameDeserializer {
#[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 LaunchTemplateOverrides {
pub instance_type: Option<String>,
}
struct LaunchTemplateOverridesDeserializer;
impl LaunchTemplateOverridesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LaunchTemplateOverrides, XmlParseError> {
deserialize_elements::<_, LaunchTemplateOverrides, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"InstanceType" => {
obj.instance_type = Some(XmlStringMaxLen255Deserializer::deserialize(
"InstanceType",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct LaunchTemplateOverridesSerializer;
impl LaunchTemplateOverridesSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LaunchTemplateOverrides) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.instance_type {
params.put(&format!("{}{}", prefix, "InstanceType"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LaunchTemplateSpecification {
pub launch_template_id: Option<String>,
pub launch_template_name: Option<String>,
pub version: Option<String>,
}
struct LaunchTemplateSpecificationDeserializer;
impl LaunchTemplateSpecificationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LaunchTemplateSpecification, XmlParseError> {
deserialize_elements::<_, LaunchTemplateSpecification, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"LaunchTemplateId" => {
obj.launch_template_id = Some(XmlStringMaxLen255Deserializer::deserialize(
"LaunchTemplateId",
stack,
)?);
}
"LaunchTemplateName" => {
obj.launch_template_name =
Some(LaunchTemplateNameDeserializer::deserialize(
"LaunchTemplateName",
stack,
)?);
}
"Version" => {
obj.version = Some(XmlStringMaxLen255Deserializer::deserialize(
"Version", stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct LaunchTemplateSpecificationSerializer;
impl LaunchTemplateSpecificationSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LaunchTemplateSpecification) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.launch_template_id {
params.put(&format!("{}{}", prefix, "LaunchTemplateId"), &field_value);
}
if let Some(ref field_value) = obj.launch_template_name {
params.put(&format!("{}{}", prefix, "LaunchTemplateName"), &field_value);
}
if let Some(ref field_value) = obj.version {
params.put(&format!("{}{}", prefix, "Version"), &field_value);
}
}
}
struct LifecycleActionResultDeserializer;
impl LifecycleActionResultDeserializer {
#[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 LifecycleHook {
pub auto_scaling_group_name: Option<String>,
pub default_result: Option<String>,
pub global_timeout: Option<i64>,
pub heartbeat_timeout: Option<i64>,
pub lifecycle_hook_name: Option<String>,
pub lifecycle_transition: Option<String>,
pub notification_metadata: Option<String>,
pub notification_target_arn: Option<String>,
pub role_arn: Option<String>,
}
struct LifecycleHookDeserializer;
impl LifecycleHookDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LifecycleHook, XmlParseError> {
deserialize_elements::<_, LifecycleHook, _>(tag_name, stack, |name, stack, obj| {
match name {
"AutoScalingGroupName" => {
obj.auto_scaling_group_name = Some(ResourceNameDeserializer::deserialize(
"AutoScalingGroupName",
stack,
)?);
}
"DefaultResult" => {
obj.default_result = Some(LifecycleActionResultDeserializer::deserialize(
"DefaultResult",
stack,
)?);
}
"GlobalTimeout" => {
obj.global_timeout = Some(GlobalTimeoutDeserializer::deserialize(
"GlobalTimeout",
stack,
)?);
}
"HeartbeatTimeout" => {
obj.heartbeat_timeout = Some(HeartbeatTimeoutDeserializer::deserialize(
"HeartbeatTimeout",
stack,
)?);
}
"LifecycleHookName" => {
obj.lifecycle_hook_name = Some(AsciiStringMaxLen255Deserializer::deserialize(
"LifecycleHookName",
stack,
)?);
}
"LifecycleTransition" => {
obj.lifecycle_transition = Some(LifecycleTransitionDeserializer::deserialize(
"LifecycleTransition",
stack,
)?);
}
"NotificationMetadata" => {
obj.notification_metadata = Some(XmlStringMaxLen1023Deserializer::deserialize(
"NotificationMetadata",
stack,
)?);
}
"NotificationTargetARN" => {
obj.notification_target_arn = Some(ResourceNameDeserializer::deserialize(
"NotificationTargetARN",
stack,
)?);
}
"RoleARN" => {
obj.role_arn = Some(ResourceNameDeserializer::deserialize("RoleARN", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct LifecycleHookNamesSerializer;
impl LifecycleHookNamesSerializer {
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 LifecycleHookSpecification {
pub default_result: Option<String>,
pub heartbeat_timeout: Option<i64>,
pub lifecycle_hook_name: String,
pub lifecycle_transition: String,
pub notification_metadata: Option<String>,
pub notification_target_arn: Option<String>,
pub role_arn: Option<String>,
}
struct LifecycleHookSpecificationSerializer;
impl LifecycleHookSpecificationSerializer {
fn serialize(params: &mut Params, name: &str, obj: &LifecycleHookSpecification) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.default_result {
params.put(&format!("{}{}", prefix, "DefaultResult"), &field_value);
}
if let Some(ref field_value) = obj.heartbeat_timeout {
params.put(&format!("{}{}", prefix, "HeartbeatTimeout"), &field_value);
}
params.put(
&format!("{}{}", prefix, "LifecycleHookName"),
&obj.lifecycle_hook_name,
);
params.put(
&format!("{}{}", prefix, "LifecycleTransition"),
&obj.lifecycle_transition,
);
if let Some(ref field_value) = obj.notification_metadata {
params.put(
&format!("{}{}", prefix, "NotificationMetadata"),
&field_value,
);
}
if let Some(ref field_value) = obj.notification_target_arn {
params.put(
&format!("{}{}", prefix, "NotificationTargetARN"),
&field_value,
);
}
if let Some(ref field_value) = obj.role_arn {
params.put(&format!("{}{}", prefix, "RoleARN"), &field_value);
}
}
}
struct LifecycleHookSpecificationsSerializer;
impl LifecycleHookSpecificationsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<LifecycleHookSpecification>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
LifecycleHookSpecificationSerializer::serialize(params, &key, obj);
}
}
}
struct LifecycleHooksDeserializer;
impl LifecycleHooksDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<LifecycleHook>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(LifecycleHookDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct LifecycleStateDeserializer;
impl LifecycleStateDeserializer {
#[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 LifecycleTransitionDeserializer;
impl LifecycleTransitionDeserializer {
#[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 LoadBalancerNamesDeserializer;
impl LoadBalancerNamesDeserializer {
#[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(XmlStringMaxLen255Deserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct LoadBalancerNamesSerializer;
impl LoadBalancerNamesSerializer {
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 LoadBalancerState {
pub load_balancer_name: Option<String>,
pub state: Option<String>,
}
struct LoadBalancerStateDeserializer;
impl LoadBalancerStateDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LoadBalancerState, XmlParseError> {
deserialize_elements::<_, LoadBalancerState, _>(tag_name, stack, |name, stack, obj| {
match name {
"LoadBalancerName" => {
obj.load_balancer_name = Some(XmlStringMaxLen255Deserializer::deserialize(
"LoadBalancerName",
stack,
)?);
}
"State" => {
obj.state = Some(XmlStringMaxLen255Deserializer::deserialize("State", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct LoadBalancerStatesDeserializer;
impl LoadBalancerStatesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<LoadBalancerState>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(LoadBalancerStateDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct LoadBalancerTargetGroupState {
pub load_balancer_target_group_arn: Option<String>,
pub state: Option<String>,
}
struct LoadBalancerTargetGroupStateDeserializer;
impl LoadBalancerTargetGroupStateDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<LoadBalancerTargetGroupState, XmlParseError> {
deserialize_elements::<_, LoadBalancerTargetGroupState, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"LoadBalancerTargetGroupARN" => {
obj.load_balancer_target_group_arn =
Some(XmlStringMaxLen511Deserializer::deserialize(
"LoadBalancerTargetGroupARN",
stack,
)?);
}
"State" => {
obj.state =
Some(XmlStringMaxLen255Deserializer::deserialize("State", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct LoadBalancerTargetGroupStatesDeserializer;
impl LoadBalancerTargetGroupStatesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<LoadBalancerTargetGroupState>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(LoadBalancerTargetGroupStateDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct MaxNumberOfAutoScalingGroupsDeserializer;
impl MaxNumberOfAutoScalingGroupsDeserializer {
#[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 MaxNumberOfLaunchConfigurationsDeserializer;
impl MaxNumberOfLaunchConfigurationsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<i64, XmlParseError> {
start_element(tag_name, stack)?;
let obj = i64::from_str(characters(stack)?.as_ref()).unwrap();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct MetricCollectionType {
pub metric: Option<String>,
}
struct MetricCollectionTypeDeserializer;
impl MetricCollectionTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<MetricCollectionType, XmlParseError> {
deserialize_elements::<_, MetricCollectionType, _>(tag_name, stack, |name, stack, obj| {
match name {
"Metric" => {
obj.metric = Some(XmlStringMaxLen255Deserializer::deserialize(
"Metric", stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct MetricCollectionTypesDeserializer;
impl MetricCollectionTypesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<MetricCollectionType>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(MetricCollectionTypeDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct MetricDimension {
pub name: String,
pub value: String,
}
struct MetricDimensionDeserializer;
impl MetricDimensionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<MetricDimension, XmlParseError> {
deserialize_elements::<_, MetricDimension, _>(tag_name, stack, |name, stack, obj| {
match name {
"Name" => {
obj.name = MetricDimensionNameDeserializer::deserialize("Name", stack)?;
}
"Value" => {
obj.value = MetricDimensionValueDeserializer::deserialize("Value", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct MetricDimensionSerializer;
impl MetricDimensionSerializer {
fn serialize(params: &mut Params, name: &str, obj: &MetricDimension) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "Name"), &obj.name);
params.put(&format!("{}{}", prefix, "Value"), &obj.value);
}
}
struct MetricDimensionNameDeserializer;
impl MetricDimensionNameDeserializer {
#[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 MetricDimensionValueDeserializer;
impl MetricDimensionValueDeserializer {
#[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 MetricDimensionsDeserializer;
impl MetricDimensionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<MetricDimension>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(MetricDimensionDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct MetricDimensionsSerializer;
impl MetricDimensionsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<MetricDimension>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
MetricDimensionSerializer::serialize(params, &key, obj);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct MetricGranularityType {
pub granularity: Option<String>,
}
struct MetricGranularityTypeDeserializer;
impl MetricGranularityTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<MetricGranularityType, XmlParseError> {
deserialize_elements::<_, MetricGranularityType, _>(tag_name, stack, |name, stack, obj| {
match name {
"Granularity" => {
obj.granularity = Some(XmlStringMaxLen255Deserializer::deserialize(
"Granularity",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct MetricGranularityTypesDeserializer;
impl MetricGranularityTypesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<MetricGranularityType>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(MetricGranularityTypeDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct MetricNameDeserializer;
impl MetricNameDeserializer {
#[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 MetricNamespaceDeserializer;
impl MetricNamespaceDeserializer {
#[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 MetricScaleDeserializer;
impl MetricScaleDeserializer {
#[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)
}
}
struct MetricStatisticDeserializer;
impl MetricStatisticDeserializer {
#[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 MetricTypeDeserializer;
impl MetricTypeDeserializer {
#[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 MetricUnitDeserializer;
impl MetricUnitDeserializer {
#[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 MetricsSerializer;
impl MetricsSerializer {
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 MinAdjustmentMagnitudeDeserializer;
impl MinAdjustmentMagnitudeDeserializer {
#[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 MinAdjustmentStepDeserializer;
impl MinAdjustmentStepDeserializer {
#[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 MixedInstanceSpotPriceDeserializer;
impl MixedInstanceSpotPriceDeserializer {
#[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 MixedInstancesPolicy {
pub instances_distribution: Option<InstancesDistribution>,
pub launch_template: Option<LaunchTemplate>,
}
struct MixedInstancesPolicyDeserializer;
impl MixedInstancesPolicyDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<MixedInstancesPolicy, XmlParseError> {
deserialize_elements::<_, MixedInstancesPolicy, _>(tag_name, stack, |name, stack, obj| {
match name {
"InstancesDistribution" => {
obj.instances_distribution =
Some(InstancesDistributionDeserializer::deserialize(
"InstancesDistribution",
stack,
)?);
}
"LaunchTemplate" => {
obj.launch_template = Some(LaunchTemplateDeserializer::deserialize(
"LaunchTemplate",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct MixedInstancesPolicySerializer;
impl MixedInstancesPolicySerializer {
fn serialize(params: &mut Params, name: &str, obj: &MixedInstancesPolicy) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.instances_distribution {
InstancesDistributionSerializer::serialize(
params,
&format!("{}{}", prefix, "InstancesDistribution"),
field_value,
);
}
if let Some(ref field_value) = obj.launch_template {
LaunchTemplateSerializer::serialize(
params,
&format!("{}{}", prefix, "LaunchTemplate"),
field_value,
);
}
}
}
struct MonitoringEnabledDeserializer;
impl MonitoringEnabledDeserializer {
#[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 NoDeviceDeserializer;
impl NoDeviceDeserializer {
#[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 NotificationConfiguration {
pub auto_scaling_group_name: Option<String>,
pub notification_type: Option<String>,
pub topic_arn: 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 {
"AutoScalingGroupName" => {
obj.auto_scaling_group_name = Some(ResourceNameDeserializer::deserialize(
"AutoScalingGroupName",
stack,
)?);
}
"NotificationType" => {
obj.notification_type = Some(XmlStringMaxLen255Deserializer::deserialize(
"NotificationType",
stack,
)?);
}
"TopicARN" => {
obj.topic_arn =
Some(ResourceNameDeserializer::deserialize("TopicARN", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct NotificationConfigurationsDeserializer;
impl NotificationConfigurationsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<NotificationConfiguration>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(NotificationConfigurationDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct NumberOfAutoScalingGroupsDeserializer;
impl NumberOfAutoScalingGroupsDeserializer {
#[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 NumberOfLaunchConfigurationsDeserializer;
impl NumberOfLaunchConfigurationsDeserializer {
#[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 OnDemandBaseCapacityDeserializer;
impl OnDemandBaseCapacityDeserializer {
#[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 OnDemandPercentageAboveBaseCapacityDeserializer;
impl OnDemandPercentageAboveBaseCapacityDeserializer {
#[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 OverridesDeserializer;
impl OverridesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<LaunchTemplateOverrides>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(LaunchTemplateOverridesDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct OverridesSerializer;
impl OverridesSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<LaunchTemplateOverrides>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
LaunchTemplateOverridesSerializer::serialize(params, &key, obj);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PoliciesType {
pub next_token: Option<String>,
pub scaling_policies: Option<Vec<ScalingPolicy>>,
}
struct PoliciesTypeDeserializer;
impl PoliciesTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PoliciesType, XmlParseError> {
deserialize_elements::<_, PoliciesType, _>(tag_name, stack, |name, stack, obj| {
match name {
"NextToken" => {
obj.next_token = Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
"ScalingPolicies" => {
obj.scaling_policies.get_or_insert(vec![]).extend(
ScalingPoliciesDeserializer::deserialize("ScalingPolicies", stack)?,
);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PolicyARNType {
pub alarms: Option<Vec<Alarm>>,
pub policy_arn: Option<String>,
}
struct PolicyARNTypeDeserializer;
impl PolicyARNTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PolicyARNType, XmlParseError> {
deserialize_elements::<_, PolicyARNType, _>(tag_name, stack, |name, stack, obj| {
match name {
"Alarms" => {
obj.alarms
.get_or_insert(vec![])
.extend(AlarmsDeserializer::deserialize("Alarms", stack)?);
}
"PolicyARN" => {
obj.policy_arn =
Some(ResourceNameDeserializer::deserialize("PolicyARN", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct PolicyIncrementDeserializer;
impl PolicyIncrementDeserializer {
#[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 PolicyNamesSerializer;
impl PolicyNamesSerializer {
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 PolicyTypesSerializer;
impl PolicyTypesSerializer {
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 PredefinedMetricSpecification {
pub predefined_metric_type: String,
pub resource_label: Option<String>,
}
struct PredefinedMetricSpecificationDeserializer;
impl PredefinedMetricSpecificationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PredefinedMetricSpecification, XmlParseError> {
deserialize_elements::<_, PredefinedMetricSpecification, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"PredefinedMetricType" => {
obj.predefined_metric_type =
MetricTypeDeserializer::deserialize("PredefinedMetricType", stack)?;
}
"ResourceLabel" => {
obj.resource_label = Some(XmlStringMaxLen1023Deserializer::deserialize(
"ResourceLabel",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct PredefinedMetricSpecificationSerializer;
impl PredefinedMetricSpecificationSerializer {
fn serialize(params: &mut Params, name: &str, obj: &PredefinedMetricSpecification) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "PredefinedMetricType"),
&obj.predefined_metric_type,
);
if let Some(ref field_value) = obj.resource_label {
params.put(&format!("{}{}", prefix, "ResourceLabel"), &field_value);
}
}
}
struct ProcessNamesSerializer;
impl ProcessNamesSerializer {
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 ProcessType {
pub process_name: String,
}
struct ProcessTypeDeserializer;
impl ProcessTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ProcessType, XmlParseError> {
deserialize_elements::<_, ProcessType, _>(tag_name, stack, |name, stack, obj| {
match name {
"ProcessName" => {
obj.process_name =
XmlStringMaxLen255Deserializer::deserialize("ProcessName", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ProcessesDeserializer;
impl ProcessesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ProcessType>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(ProcessTypeDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ProcessesType {
pub processes: Option<Vec<ProcessType>>,
}
struct ProcessesTypeDeserializer;
impl ProcessesTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ProcessesType, XmlParseError> {
deserialize_elements::<_, ProcessesType, _>(tag_name, stack, |name, stack, obj| {
match name {
"Processes" => {
obj.processes
.get_or_insert(vec![])
.extend(ProcessesDeserializer::deserialize("Processes", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct ProgressDeserializer;
impl ProgressDeserializer {
#[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 PropagateAtLaunchDeserializer;
impl PropagateAtLaunchDeserializer {
#[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 PutLifecycleHookAnswer {}
struct PutLifecycleHookAnswerDeserializer;
impl PutLifecycleHookAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<PutLifecycleHookAnswer, XmlParseError> {
start_element(tag_name, stack)?;
let obj = PutLifecycleHookAnswer::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PutLifecycleHookType {
pub auto_scaling_group_name: String,
pub default_result: Option<String>,
pub heartbeat_timeout: Option<i64>,
pub lifecycle_hook_name: String,
pub lifecycle_transition: Option<String>,
pub notification_metadata: Option<String>,
pub notification_target_arn: Option<String>,
pub role_arn: Option<String>,
}
struct PutLifecycleHookTypeSerializer;
impl PutLifecycleHookTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &PutLifecycleHookType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.default_result {
params.put(&format!("{}{}", prefix, "DefaultResult"), &field_value);
}
if let Some(ref field_value) = obj.heartbeat_timeout {
params.put(&format!("{}{}", prefix, "HeartbeatTimeout"), &field_value);
}
params.put(
&format!("{}{}", prefix, "LifecycleHookName"),
&obj.lifecycle_hook_name,
);
if let Some(ref field_value) = obj.lifecycle_transition {
params.put(
&format!("{}{}", prefix, "LifecycleTransition"),
&field_value,
);
}
if let Some(ref field_value) = obj.notification_metadata {
params.put(
&format!("{}{}", prefix, "NotificationMetadata"),
&field_value,
);
}
if let Some(ref field_value) = obj.notification_target_arn {
params.put(
&format!("{}{}", prefix, "NotificationTargetARN"),
&field_value,
);
}
if let Some(ref field_value) = obj.role_arn {
params.put(&format!("{}{}", prefix, "RoleARN"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PutNotificationConfigurationType {
pub auto_scaling_group_name: String,
pub notification_types: Vec<String>,
pub topic_arn: String,
}
struct PutNotificationConfigurationTypeSerializer;
impl PutNotificationConfigurationTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &PutNotificationConfigurationType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
AutoScalingNotificationTypesSerializer::serialize(
params,
&format!("{}{}", prefix, "NotificationTypes"),
&obj.notification_types,
);
params.put(&format!("{}{}", prefix, "TopicARN"), &obj.topic_arn);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PutScalingPolicyType {
pub adjustment_type: Option<String>,
pub auto_scaling_group_name: String,
pub cooldown: Option<i64>,
pub estimated_instance_warmup: Option<i64>,
pub metric_aggregation_type: Option<String>,
pub min_adjustment_magnitude: Option<i64>,
pub min_adjustment_step: Option<i64>,
pub policy_name: String,
pub policy_type: Option<String>,
pub scaling_adjustment: Option<i64>,
pub step_adjustments: Option<Vec<StepAdjustment>>,
pub target_tracking_configuration: Option<TargetTrackingConfiguration>,
}
struct PutScalingPolicyTypeSerializer;
impl PutScalingPolicyTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &PutScalingPolicyType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.adjustment_type {
params.put(&format!("{}{}", prefix, "AdjustmentType"), &field_value);
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.cooldown {
params.put(&format!("{}{}", prefix, "Cooldown"), &field_value);
}
if let Some(ref field_value) = obj.estimated_instance_warmup {
params.put(
&format!("{}{}", prefix, "EstimatedInstanceWarmup"),
&field_value,
);
}
if let Some(ref field_value) = obj.metric_aggregation_type {
params.put(
&format!("{}{}", prefix, "MetricAggregationType"),
&field_value,
);
}
if let Some(ref field_value) = obj.min_adjustment_magnitude {
params.put(
&format!("{}{}", prefix, "MinAdjustmentMagnitude"),
&field_value,
);
}
if let Some(ref field_value) = obj.min_adjustment_step {
params.put(&format!("{}{}", prefix, "MinAdjustmentStep"), &field_value);
}
params.put(&format!("{}{}", prefix, "PolicyName"), &obj.policy_name);
if let Some(ref field_value) = obj.policy_type {
params.put(&format!("{}{}", prefix, "PolicyType"), &field_value);
}
if let Some(ref field_value) = obj.scaling_adjustment {
params.put(&format!("{}{}", prefix, "ScalingAdjustment"), &field_value);
}
if let Some(ref field_value) = obj.step_adjustments {
StepAdjustmentsSerializer::serialize(
params,
&format!("{}{}", prefix, "StepAdjustments"),
field_value,
);
}
if let Some(ref field_value) = obj.target_tracking_configuration {
TargetTrackingConfigurationSerializer::serialize(
params,
&format!("{}{}", prefix, "TargetTrackingConfiguration"),
field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct PutScheduledUpdateGroupActionType {
pub auto_scaling_group_name: String,
pub desired_capacity: Option<i64>,
pub end_time: Option<String>,
pub max_size: Option<i64>,
pub min_size: Option<i64>,
pub recurrence: Option<String>,
pub scheduled_action_name: String,
pub start_time: Option<String>,
pub time: Option<String>,
}
struct PutScheduledUpdateGroupActionTypeSerializer;
impl PutScheduledUpdateGroupActionTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &PutScheduledUpdateGroupActionType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.desired_capacity {
params.put(&format!("{}{}", prefix, "DesiredCapacity"), &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.max_size {
params.put(&format!("{}{}", prefix, "MaxSize"), &field_value);
}
if let Some(ref field_value) = obj.min_size {
params.put(&format!("{}{}", prefix, "MinSize"), &field_value);
}
if let Some(ref field_value) = obj.recurrence {
params.put(&format!("{}{}", prefix, "Recurrence"), &field_value);
}
params.put(
&format!("{}{}", prefix, "ScheduledActionName"),
&obj.scheduled_action_name,
);
if let Some(ref field_value) = obj.start_time {
params.put(&format!("{}{}", prefix, "StartTime"), &field_value);
}
if let Some(ref field_value) = obj.time {
params.put(&format!("{}{}", prefix, "Time"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct RecordLifecycleActionHeartbeatAnswer {}
struct RecordLifecycleActionHeartbeatAnswerDeserializer;
impl RecordLifecycleActionHeartbeatAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<RecordLifecycleActionHeartbeatAnswer, XmlParseError> {
start_element(tag_name, stack)?;
let obj = RecordLifecycleActionHeartbeatAnswer::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct RecordLifecycleActionHeartbeatType {
pub auto_scaling_group_name: String,
pub instance_id: Option<String>,
pub lifecycle_action_token: Option<String>,
pub lifecycle_hook_name: String,
}
struct RecordLifecycleActionHeartbeatTypeSerializer;
impl RecordLifecycleActionHeartbeatTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &RecordLifecycleActionHeartbeatType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.instance_id {
params.put(&format!("{}{}", prefix, "InstanceId"), &field_value);
}
if let Some(ref field_value) = obj.lifecycle_action_token {
params.put(
&format!("{}{}", prefix, "LifecycleActionToken"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "LifecycleHookName"),
&obj.lifecycle_hook_name,
);
}
}
struct ResourceNameDeserializer;
impl ResourceNameDeserializer {
#[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 ScalingActivityStatusCodeDeserializer;
impl ScalingActivityStatusCodeDeserializer {
#[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 ScalingPoliciesDeserializer;
impl ScalingPoliciesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ScalingPolicy>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(ScalingPolicyDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ScalingPolicy {
pub adjustment_type: Option<String>,
pub alarms: Option<Vec<Alarm>>,
pub auto_scaling_group_name: Option<String>,
pub cooldown: Option<i64>,
pub estimated_instance_warmup: Option<i64>,
pub metric_aggregation_type: Option<String>,
pub min_adjustment_magnitude: Option<i64>,
pub min_adjustment_step: Option<i64>,
pub policy_arn: Option<String>,
pub policy_name: Option<String>,
pub policy_type: Option<String>,
pub scaling_adjustment: Option<i64>,
pub step_adjustments: Option<Vec<StepAdjustment>>,
pub target_tracking_configuration: Option<TargetTrackingConfiguration>,
}
struct ScalingPolicyDeserializer;
impl ScalingPolicyDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ScalingPolicy, XmlParseError> {
deserialize_elements::<_, ScalingPolicy, _>(tag_name, stack, |name, stack, obj| {
match name {
"AdjustmentType" => {
obj.adjustment_type = Some(XmlStringMaxLen255Deserializer::deserialize(
"AdjustmentType",
stack,
)?);
}
"Alarms" => {
obj.alarms
.get_or_insert(vec![])
.extend(AlarmsDeserializer::deserialize("Alarms", stack)?);
}
"AutoScalingGroupName" => {
obj.auto_scaling_group_name = Some(
XmlStringMaxLen255Deserializer::deserialize("AutoScalingGroupName", stack)?,
);
}
"Cooldown" => {
obj.cooldown = Some(CooldownDeserializer::deserialize("Cooldown", stack)?);
}
"EstimatedInstanceWarmup" => {
obj.estimated_instance_warmup =
Some(EstimatedInstanceWarmupDeserializer::deserialize(
"EstimatedInstanceWarmup",
stack,
)?);
}
"MetricAggregationType" => {
obj.metric_aggregation_type = Some(XmlStringMaxLen32Deserializer::deserialize(
"MetricAggregationType",
stack,
)?);
}
"MinAdjustmentMagnitude" => {
obj.min_adjustment_magnitude =
Some(MinAdjustmentMagnitudeDeserializer::deserialize(
"MinAdjustmentMagnitude",
stack,
)?);
}
"MinAdjustmentStep" => {
obj.min_adjustment_step = Some(MinAdjustmentStepDeserializer::deserialize(
"MinAdjustmentStep",
stack,
)?);
}
"PolicyARN" => {
obj.policy_arn =
Some(ResourceNameDeserializer::deserialize("PolicyARN", stack)?);
}
"PolicyName" => {
obj.policy_name = Some(XmlStringMaxLen255Deserializer::deserialize(
"PolicyName",
stack,
)?);
}
"PolicyType" => {
obj.policy_type = Some(XmlStringMaxLen64Deserializer::deserialize(
"PolicyType",
stack,
)?);
}
"ScalingAdjustment" => {
obj.scaling_adjustment = Some(PolicyIncrementDeserializer::deserialize(
"ScalingAdjustment",
stack,
)?);
}
"StepAdjustments" => {
obj.step_adjustments.get_or_insert(vec![]).extend(
StepAdjustmentsDeserializer::deserialize("StepAdjustments", stack)?,
);
}
"TargetTrackingConfiguration" => {
obj.target_tracking_configuration =
Some(TargetTrackingConfigurationDeserializer::deserialize(
"TargetTrackingConfiguration",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ScalingProcessQuery {
pub auto_scaling_group_name: String,
pub scaling_processes: Option<Vec<String>>,
}
struct ScalingProcessQuerySerializer;
impl ScalingProcessQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &ScalingProcessQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.scaling_processes {
ProcessNamesSerializer::serialize(
params,
&format!("{}{}", prefix, "ScalingProcesses"),
field_value,
);
}
}
}
struct ScheduledActionNamesSerializer;
impl ScheduledActionNamesSerializer {
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 ScheduledActionsType {
pub next_token: Option<String>,
pub scheduled_update_group_actions: Option<Vec<ScheduledUpdateGroupAction>>,
}
struct ScheduledActionsTypeDeserializer;
impl ScheduledActionsTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ScheduledActionsType, XmlParseError> {
deserialize_elements::<_, ScheduledActionsType, _>(tag_name, stack, |name, stack, obj| {
match name {
"NextToken" => {
obj.next_token = Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
"ScheduledUpdateGroupActions" => {
obj.scheduled_update_group_actions
.get_or_insert(vec![])
.extend(ScheduledUpdateGroupActionsDeserializer::deserialize(
"ScheduledUpdateGroupActions",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ScheduledUpdateGroupAction {
pub auto_scaling_group_name: Option<String>,
pub desired_capacity: Option<i64>,
pub end_time: Option<String>,
pub max_size: Option<i64>,
pub min_size: Option<i64>,
pub recurrence: Option<String>,
pub scheduled_action_arn: Option<String>,
pub scheduled_action_name: Option<String>,
pub start_time: Option<String>,
pub time: Option<String>,
}
struct ScheduledUpdateGroupActionDeserializer;
impl ScheduledUpdateGroupActionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<ScheduledUpdateGroupAction, XmlParseError> {
deserialize_elements::<_, ScheduledUpdateGroupAction, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"AutoScalingGroupName" => {
obj.auto_scaling_group_name =
Some(XmlStringMaxLen255Deserializer::deserialize(
"AutoScalingGroupName",
stack,
)?);
}
"DesiredCapacity" => {
obj.desired_capacity =
Some(AutoScalingGroupDesiredCapacityDeserializer::deserialize(
"DesiredCapacity",
stack,
)?);
}
"EndTime" => {
obj.end_time =
Some(TimestampTypeDeserializer::deserialize("EndTime", stack)?);
}
"MaxSize" => {
obj.max_size = Some(AutoScalingGroupMaxSizeDeserializer::deserialize(
"MaxSize", stack,
)?);
}
"MinSize" => {
obj.min_size = Some(AutoScalingGroupMinSizeDeserializer::deserialize(
"MinSize", stack,
)?);
}
"Recurrence" => {
obj.recurrence = Some(XmlStringMaxLen255Deserializer::deserialize(
"Recurrence",
stack,
)?);
}
"ScheduledActionARN" => {
obj.scheduled_action_arn = Some(ResourceNameDeserializer::deserialize(
"ScheduledActionARN",
stack,
)?);
}
"ScheduledActionName" => {
obj.scheduled_action_name =
Some(XmlStringMaxLen255Deserializer::deserialize(
"ScheduledActionName",
stack,
)?);
}
"StartTime" => {
obj.start_time =
Some(TimestampTypeDeserializer::deserialize("StartTime", stack)?);
}
"Time" => {
obj.time = Some(TimestampTypeDeserializer::deserialize("Time", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ScheduledUpdateGroupActionRequest {
pub desired_capacity: Option<i64>,
pub end_time: Option<String>,
pub max_size: Option<i64>,
pub min_size: Option<i64>,
pub recurrence: Option<String>,
pub scheduled_action_name: String,
pub start_time: Option<String>,
}
struct ScheduledUpdateGroupActionRequestSerializer;
impl ScheduledUpdateGroupActionRequestSerializer {
fn serialize(params: &mut Params, name: &str, obj: &ScheduledUpdateGroupActionRequest) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.desired_capacity {
params.put(&format!("{}{}", prefix, "DesiredCapacity"), &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.max_size {
params.put(&format!("{}{}", prefix, "MaxSize"), &field_value);
}
if let Some(ref field_value) = obj.min_size {
params.put(&format!("{}{}", prefix, "MinSize"), &field_value);
}
if let Some(ref field_value) = obj.recurrence {
params.put(&format!("{}{}", prefix, "Recurrence"), &field_value);
}
params.put(
&format!("{}{}", prefix, "ScheduledActionName"),
&obj.scheduled_action_name,
);
if let Some(ref field_value) = obj.start_time {
params.put(&format!("{}{}", prefix, "StartTime"), &field_value);
}
}
}
struct ScheduledUpdateGroupActionRequestsSerializer;
impl ScheduledUpdateGroupActionRequestsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<ScheduledUpdateGroupActionRequest>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
ScheduledUpdateGroupActionRequestSerializer::serialize(params, &key, obj);
}
}
}
struct ScheduledUpdateGroupActionsDeserializer;
impl ScheduledUpdateGroupActionsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<ScheduledUpdateGroupAction>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(ScheduledUpdateGroupActionDeserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct SecurityGroupsDeserializer;
impl SecurityGroupsDeserializer {
#[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(XmlStringDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct SecurityGroupsSerializer;
impl SecurityGroupsSerializer {
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 SetDesiredCapacityType {
pub auto_scaling_group_name: String,
pub desired_capacity: i64,
pub honor_cooldown: Option<bool>,
}
struct SetDesiredCapacityTypeSerializer;
impl SetDesiredCapacityTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &SetDesiredCapacityType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
params.put(
&format!("{}{}", prefix, "DesiredCapacity"),
&obj.desired_capacity,
);
if let Some(ref field_value) = obj.honor_cooldown {
params.put(&format!("{}{}", prefix, "HonorCooldown"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct SetInstanceHealthQuery {
pub health_status: String,
pub instance_id: String,
pub should_respect_grace_period: Option<bool>,
}
struct SetInstanceHealthQuerySerializer;
impl SetInstanceHealthQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &SetInstanceHealthQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "HealthStatus"), &obj.health_status);
params.put(&format!("{}{}", prefix, "InstanceId"), &obj.instance_id);
if let Some(ref field_value) = obj.should_respect_grace_period {
params.put(
&format!("{}{}", prefix, "ShouldRespectGracePeriod"),
&field_value,
);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct SetInstanceProtectionAnswer {}
struct SetInstanceProtectionAnswerDeserializer;
impl SetInstanceProtectionAnswerDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<SetInstanceProtectionAnswer, XmlParseError> {
start_element(tag_name, stack)?;
let obj = SetInstanceProtectionAnswer::default();
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct SetInstanceProtectionQuery {
pub auto_scaling_group_name: String,
pub instance_ids: Vec<String>,
pub protected_from_scale_in: bool,
}
struct SetInstanceProtectionQuerySerializer;
impl SetInstanceProtectionQuerySerializer {
fn serialize(params: &mut Params, name: &str, obj: &SetInstanceProtectionQuery) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
InstanceIdsSerializer::serialize(
params,
&format!("{}{}", prefix, "InstanceIds"),
&obj.instance_ids,
);
params.put(
&format!("{}{}", prefix, "ProtectedFromScaleIn"),
&obj.protected_from_scale_in,
);
}
}
struct SpotInstancePoolsDeserializer;
impl SpotInstancePoolsDeserializer {
#[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 SpotPriceDeserializer;
impl SpotPriceDeserializer {
#[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 StepAdjustment {
pub metric_interval_lower_bound: Option<f64>,
pub metric_interval_upper_bound: Option<f64>,
pub scaling_adjustment: i64,
}
struct StepAdjustmentDeserializer;
impl StepAdjustmentDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<StepAdjustment, XmlParseError> {
deserialize_elements::<_, StepAdjustment, _>(tag_name, stack, |name, stack, obj| {
match name {
"MetricIntervalLowerBound" => {
obj.metric_interval_lower_bound = Some(MetricScaleDeserializer::deserialize(
"MetricIntervalLowerBound",
stack,
)?);
}
"MetricIntervalUpperBound" => {
obj.metric_interval_upper_bound = Some(MetricScaleDeserializer::deserialize(
"MetricIntervalUpperBound",
stack,
)?);
}
"ScalingAdjustment" => {
obj.scaling_adjustment =
PolicyIncrementDeserializer::deserialize("ScalingAdjustment", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct StepAdjustmentSerializer;
impl StepAdjustmentSerializer {
fn serialize(params: &mut Params, name: &str, obj: &StepAdjustment) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.metric_interval_lower_bound {
params.put(
&format!("{}{}", prefix, "MetricIntervalLowerBound"),
&field_value,
);
}
if let Some(ref field_value) = obj.metric_interval_upper_bound {
params.put(
&format!("{}{}", prefix, "MetricIntervalUpperBound"),
&field_value,
);
}
params.put(
&format!("{}{}", prefix, "ScalingAdjustment"),
&obj.scaling_adjustment,
);
}
}
struct StepAdjustmentsDeserializer;
impl StepAdjustmentsDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<StepAdjustment>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(StepAdjustmentDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct StepAdjustmentsSerializer;
impl StepAdjustmentsSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Vec<StepAdjustment>) {
for (index, obj) in obj.iter().enumerate() {
let key = format!("{}.member.{}", name, index + 1);
StepAdjustmentSerializer::serialize(params, &key, obj);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct SuspendedProcess {
pub process_name: Option<String>,
pub suspension_reason: Option<String>,
}
struct SuspendedProcessDeserializer;
impl SuspendedProcessDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<SuspendedProcess, XmlParseError> {
deserialize_elements::<_, SuspendedProcess, _>(tag_name, stack, |name, stack, obj| {
match name {
"ProcessName" => {
obj.process_name = Some(XmlStringMaxLen255Deserializer::deserialize(
"ProcessName",
stack,
)?);
}
"SuspensionReason" => {
obj.suspension_reason = Some(XmlStringMaxLen255Deserializer::deserialize(
"SuspensionReason",
stack,
)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct SuspendedProcessesDeserializer;
impl SuspendedProcessesDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<SuspendedProcess>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(SuspendedProcessDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Tag {
pub key: String,
pub propagate_at_launch: Option<bool>,
pub resource_id: Option<String>,
pub resource_type: Option<String>,
pub value: Option<String>,
}
struct TagSerializer;
impl TagSerializer {
fn serialize(params: &mut Params, name: &str, obj: &Tag) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "Key"), &obj.key);
if let Some(ref field_value) = obj.propagate_at_launch {
params.put(&format!("{}{}", prefix, "PropagateAtLaunch"), &field_value);
}
if let Some(ref field_value) = obj.resource_id {
params.put(&format!("{}{}", prefix, "ResourceId"), &field_value);
}
if let Some(ref field_value) = obj.resource_type {
params.put(&format!("{}{}", prefix, "ResourceType"), &field_value);
}
if let Some(ref field_value) = obj.value {
params.put(&format!("{}{}", prefix, "Value"), &field_value);
}
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TagDescription {
pub key: Option<String>,
pub propagate_at_launch: Option<bool>,
pub resource_id: Option<String>,
pub resource_type: Option<String>,
pub value: Option<String>,
}
struct TagDescriptionDeserializer;
impl TagDescriptionDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<TagDescription, XmlParseError> {
deserialize_elements::<_, TagDescription, _>(tag_name, stack, |name, stack, obj| {
match name {
"Key" => {
obj.key = Some(TagKeyDeserializer::deserialize("Key", stack)?);
}
"PropagateAtLaunch" => {
obj.propagate_at_launch = Some(PropagateAtLaunchDeserializer::deserialize(
"PropagateAtLaunch",
stack,
)?);
}
"ResourceId" => {
obj.resource_id =
Some(XmlStringDeserializer::deserialize("ResourceId", stack)?);
}
"ResourceType" => {
obj.resource_type =
Some(XmlStringDeserializer::deserialize("ResourceType", stack)?);
}
"Value" => {
obj.value = Some(TagValueDeserializer::deserialize("Value", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct TagDescriptionListDeserializer;
impl TagDescriptionListDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<Vec<TagDescription>, XmlParseError> {
deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
if name == "member" {
obj.push(TagDescriptionDeserializer::deserialize("member", stack)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct TagKeyDeserializer;
impl TagKeyDeserializer {
#[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 TagValueDeserializer;
impl TagValueDeserializer {
#[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 TagsSerializer;
impl TagsSerializer {
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 TagsType {
pub next_token: Option<String>,
pub tags: Option<Vec<TagDescription>>,
}
struct TagsTypeDeserializer;
impl TagsTypeDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<TagsType, XmlParseError> {
deserialize_elements::<_, TagsType, _>(tag_name, stack, |name, stack, obj| {
match name {
"NextToken" => {
obj.next_token = Some(XmlStringDeserializer::deserialize("NextToken", stack)?);
}
"Tags" => {
obj.tags
.get_or_insert(vec![])
.extend(TagDescriptionListDeserializer::deserialize("Tags", stack)?);
}
_ => skip_tree(stack),
}
Ok(())
})
}
}
struct TargetGroupARNsDeserializer;
impl TargetGroupARNsDeserializer {
#[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(XmlStringMaxLen511Deserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct TargetGroupARNsSerializer;
impl TargetGroupARNsSerializer {
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 TargetTrackingConfiguration {
pub customized_metric_specification: Option<CustomizedMetricSpecification>,
pub disable_scale_in: Option<bool>,
pub predefined_metric_specification: Option<PredefinedMetricSpecification>,
pub target_value: f64,
}
struct TargetTrackingConfigurationDeserializer;
impl TargetTrackingConfigurationDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(
tag_name: &str,
stack: &mut T,
) -> Result<TargetTrackingConfiguration, XmlParseError> {
deserialize_elements::<_, TargetTrackingConfiguration, _>(
tag_name,
stack,
|name, stack, obj| {
match name {
"CustomizedMetricSpecification" => {
obj.customized_metric_specification =
Some(CustomizedMetricSpecificationDeserializer::deserialize(
"CustomizedMetricSpecification",
stack,
)?);
}
"DisableScaleIn" => {
obj.disable_scale_in = Some(DisableScaleInDeserializer::deserialize(
"DisableScaleIn",
stack,
)?);
}
"PredefinedMetricSpecification" => {
obj.predefined_metric_specification =
Some(PredefinedMetricSpecificationDeserializer::deserialize(
"PredefinedMetricSpecification",
stack,
)?);
}
"TargetValue" => {
obj.target_value =
MetricScaleDeserializer::deserialize("TargetValue", stack)?;
}
_ => skip_tree(stack),
}
Ok(())
},
)
}
}
struct TargetTrackingConfigurationSerializer;
impl TargetTrackingConfigurationSerializer {
fn serialize(params: &mut Params, name: &str, obj: &TargetTrackingConfiguration) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
if let Some(ref field_value) = obj.customized_metric_specification {
CustomizedMetricSpecificationSerializer::serialize(
params,
&format!("{}{}", prefix, "CustomizedMetricSpecification"),
field_value,
);
}
if let Some(ref field_value) = obj.disable_scale_in {
params.put(&format!("{}{}", prefix, "DisableScaleIn"), &field_value);
}
if let Some(ref field_value) = obj.predefined_metric_specification {
PredefinedMetricSpecificationSerializer::serialize(
params,
&format!("{}{}", prefix, "PredefinedMetricSpecification"),
field_value,
);
}
params.put(&format!("{}{}", prefix, "TargetValue"), &obj.target_value);
}
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct TerminateInstanceInAutoScalingGroupType {
pub instance_id: String,
pub should_decrement_desired_capacity: bool,
}
struct TerminateInstanceInAutoScalingGroupTypeSerializer;
impl TerminateInstanceInAutoScalingGroupTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &TerminateInstanceInAutoScalingGroupType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(&format!("{}{}", prefix, "InstanceId"), &obj.instance_id);
params.put(
&format!("{}{}", prefix, "ShouldDecrementDesiredCapacity"),
&obj.should_decrement_desired_capacity,
);
}
}
struct TerminationPoliciesDeserializer;
impl TerminationPoliciesDeserializer {
#[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(XmlStringMaxLen1600Deserializer::deserialize(
"member", stack,
)?);
} else {
skip_tree(stack);
}
Ok(())
})
}
}
struct TerminationPoliciesSerializer;
impl TerminationPoliciesSerializer {
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 TimestampTypeDeserializer;
impl TimestampTypeDeserializer {
#[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 UpdateAutoScalingGroupType {
pub auto_scaling_group_name: String,
pub availability_zones: Option<Vec<String>>,
pub default_cooldown: Option<i64>,
pub desired_capacity: Option<i64>,
pub health_check_grace_period: Option<i64>,
pub health_check_type: Option<String>,
pub launch_configuration_name: Option<String>,
pub launch_template: Option<LaunchTemplateSpecification>,
pub max_size: Option<i64>,
pub min_size: Option<i64>,
pub mixed_instances_policy: Option<MixedInstancesPolicy>,
pub new_instances_protected_from_scale_in: Option<bool>,
pub placement_group: Option<String>,
pub service_linked_role_arn: Option<String>,
pub termination_policies: Option<Vec<String>>,
pub vpc_zone_identifier: Option<String>,
}
struct UpdateAutoScalingGroupTypeSerializer;
impl UpdateAutoScalingGroupTypeSerializer {
fn serialize(params: &mut Params, name: &str, obj: &UpdateAutoScalingGroupType) {
let mut prefix = name.to_string();
if prefix != "" {
prefix.push_str(".");
}
params.put(
&format!("{}{}", prefix, "AutoScalingGroupName"),
&obj.auto_scaling_group_name,
);
if let Some(ref field_value) = obj.availability_zones {
AvailabilityZonesSerializer::serialize(
params,
&format!("{}{}", prefix, "AvailabilityZones"),
field_value,
);
}
if let Some(ref field_value) = obj.default_cooldown {
params.put(&format!("{}{}", prefix, "DefaultCooldown"), &field_value);
}
if let Some(ref field_value) = obj.desired_capacity {
params.put(&format!("{}{}", prefix, "DesiredCapacity"), &field_value);
}
if let Some(ref field_value) = obj.health_check_grace_period {
params.put(
&format!("{}{}", prefix, "HealthCheckGracePeriod"),
&field_value,
);
}
if let Some(ref field_value) = obj.health_check_type {
params.put(&format!("{}{}", prefix, "HealthCheckType"), &field_value);
}
if let Some(ref field_value) = obj.launch_configuration_name {
params.put(
&format!("{}{}", prefix, "LaunchConfigurationName"),
&field_value,
);
}
if let Some(ref field_value) = obj.launch_template {
LaunchTemplateSpecificationSerializer::serialize(
params,
&format!("{}{}", prefix, "LaunchTemplate"),
field_value,
);
}
if let Some(ref field_value) = obj.max_size {
params.put(&format!("{}{}", prefix, "MaxSize"), &field_value);
}
if let Some(ref field_value) = obj.min_size {
params.put(&format!("{}{}", prefix, "MinSize"), &field_value);
}
if let Some(ref field_value) = obj.mixed_instances_policy {
MixedInstancesPolicySerializer::serialize(
params,
&format!("{}{}", prefix, "MixedInstancesPolicy"),
field_value,
);
}
if let Some(ref field_value) = obj.new_instances_protected_from_scale_in {
params.put(
&format!("{}{}", prefix, "NewInstancesProtectedFromScaleIn"),
&field_value,
);
}
if let Some(ref field_value) = obj.placement_group {
params.put(&format!("{}{}", prefix, "PlacementGroup"), &field_value);
}
if let Some(ref field_value) = obj.service_linked_role_arn {
params.put(
&format!("{}{}", prefix, "ServiceLinkedRoleARN"),
&field_value,
);
}
if let Some(ref field_value) = obj.termination_policies {
TerminationPoliciesSerializer::serialize(
params,
&format!("{}{}", prefix, "TerminationPolicies"),
field_value,
);
}
if let Some(ref field_value) = obj.vpc_zone_identifier {
params.put(&format!("{}{}", prefix, "VPCZoneIdentifier"), &field_value);
}
}
}
struct ValuesSerializer;
impl ValuesSerializer {
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 XmlStringDeserializer;
impl XmlStringDeserializer {
#[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 XmlStringMaxLen1023Deserializer;
impl XmlStringMaxLen1023Deserializer {
#[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 XmlStringMaxLen1600Deserializer;
impl XmlStringMaxLen1600Deserializer {
#[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 XmlStringMaxLen19Deserializer;
impl XmlStringMaxLen19Deserializer {
#[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 XmlStringMaxLen2047Deserializer;
impl XmlStringMaxLen2047Deserializer {
#[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 XmlStringMaxLen255Deserializer;
impl XmlStringMaxLen255Deserializer {
#[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 XmlStringMaxLen32Deserializer;
impl XmlStringMaxLen32Deserializer {
#[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 XmlStringMaxLen511Deserializer;
impl XmlStringMaxLen511Deserializer {
#[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 XmlStringMaxLen64Deserializer;
impl XmlStringMaxLen64Deserializer {
#[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 XmlStringUserDataDeserializer;
impl XmlStringUserDataDeserializer {
#[allow(unused_variables)]
fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
start_element(tag_name, stack)?;
let obj = characters(stack)?;
end_element(tag_name, stack)?;
Ok(obj)
}
}
#[derive(Debug, PartialEq)]
pub enum AttachInstancesError {
ResourceContentionFault(String),
ServiceLinkedRoleFailure(String),
}
impl AttachInstancesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AttachInstancesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(AttachInstancesError::ResourceContentionFault(
parsed_error.message,
))
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(
AttachInstancesError::ServiceLinkedRoleFailure(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 AttachInstancesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AttachInstancesError {
fn description(&self) -> &str {
match *self {
AttachInstancesError::ResourceContentionFault(ref cause) => cause,
AttachInstancesError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AttachLoadBalancerTargetGroupsError {
ResourceContentionFault(String),
ServiceLinkedRoleFailure(String),
}
impl AttachLoadBalancerTargetGroupsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<AttachLoadBalancerTargetGroupsError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
AttachLoadBalancerTargetGroupsError::ResourceContentionFault(
parsed_error.message,
),
)
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(
AttachLoadBalancerTargetGroupsError::ServiceLinkedRoleFailure(
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 AttachLoadBalancerTargetGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AttachLoadBalancerTargetGroupsError {
fn description(&self) -> &str {
match *self {
AttachLoadBalancerTargetGroupsError::ResourceContentionFault(ref cause) => cause,
AttachLoadBalancerTargetGroupsError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AttachLoadBalancersError {
ResourceContentionFault(String),
ServiceLinkedRoleFailure(String),
}
impl AttachLoadBalancersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AttachLoadBalancersError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
AttachLoadBalancersError::ResourceContentionFault(parsed_error.message),
)
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(
AttachLoadBalancersError::ServiceLinkedRoleFailure(
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 AttachLoadBalancersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AttachLoadBalancersError {
fn description(&self) -> &str {
match *self {
AttachLoadBalancersError::ResourceContentionFault(ref cause) => cause,
AttachLoadBalancersError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum BatchDeleteScheduledActionError {
ResourceContentionFault(String),
}
impl BatchDeleteScheduledActionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<BatchDeleteScheduledActionError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
BatchDeleteScheduledActionError::ResourceContentionFault(
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 BatchDeleteScheduledActionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchDeleteScheduledActionError {
fn description(&self) -> &str {
match *self {
BatchDeleteScheduledActionError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum BatchPutScheduledUpdateGroupActionError {
AlreadyExistsFault(String),
LimitExceededFault(String),
ResourceContentionFault(String),
}
impl BatchPutScheduledUpdateGroupActionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<BatchPutScheduledUpdateGroupActionError> {
{
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[..] {
"AlreadyExists" => {
return RusotoError::Service(
BatchPutScheduledUpdateGroupActionError::AlreadyExistsFault(
parsed_error.message,
),
)
}
"LimitExceeded" => {
return RusotoError::Service(
BatchPutScheduledUpdateGroupActionError::LimitExceededFault(
parsed_error.message,
),
)
}
"ResourceContention" => {
return RusotoError::Service(
BatchPutScheduledUpdateGroupActionError::ResourceContentionFault(
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 BatchPutScheduledUpdateGroupActionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchPutScheduledUpdateGroupActionError {
fn description(&self) -> &str {
match *self {
BatchPutScheduledUpdateGroupActionError::AlreadyExistsFault(ref cause) => cause,
BatchPutScheduledUpdateGroupActionError::LimitExceededFault(ref cause) => cause,
BatchPutScheduledUpdateGroupActionError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CompleteLifecycleActionError {
ResourceContentionFault(String),
}
impl CompleteLifecycleActionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CompleteLifecycleActionError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
CompleteLifecycleActionError::ResourceContentionFault(
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 CompleteLifecycleActionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CompleteLifecycleActionError {
fn description(&self) -> &str {
match *self {
CompleteLifecycleActionError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateAutoScalingGroupError {
AlreadyExistsFault(String),
LimitExceededFault(String),
ResourceContentionFault(String),
ServiceLinkedRoleFailure(String),
}
impl CreateAutoScalingGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAutoScalingGroupError> {
{
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[..] {
"AlreadyExists" => {
return RusotoError::Service(
CreateAutoScalingGroupError::AlreadyExistsFault(parsed_error.message),
)
}
"LimitExceeded" => {
return RusotoError::Service(
CreateAutoScalingGroupError::LimitExceededFault(parsed_error.message),
)
}
"ResourceContention" => {
return RusotoError::Service(
CreateAutoScalingGroupError::ResourceContentionFault(
parsed_error.message,
),
)
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(
CreateAutoScalingGroupError::ServiceLinkedRoleFailure(
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 CreateAutoScalingGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAutoScalingGroupError {
fn description(&self) -> &str {
match *self {
CreateAutoScalingGroupError::AlreadyExistsFault(ref cause) => cause,
CreateAutoScalingGroupError::LimitExceededFault(ref cause) => cause,
CreateAutoScalingGroupError::ResourceContentionFault(ref cause) => cause,
CreateAutoScalingGroupError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateLaunchConfigurationError {
AlreadyExistsFault(String),
LimitExceededFault(String),
ResourceContentionFault(String),
}
impl CreateLaunchConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateLaunchConfigurationError> {
{
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[..] {
"AlreadyExists" => {
return RusotoError::Service(
CreateLaunchConfigurationError::AlreadyExistsFault(
parsed_error.message,
),
)
}
"LimitExceeded" => {
return RusotoError::Service(
CreateLaunchConfigurationError::LimitExceededFault(
parsed_error.message,
),
)
}
"ResourceContention" => {
return RusotoError::Service(
CreateLaunchConfigurationError::ResourceContentionFault(
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 CreateLaunchConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateLaunchConfigurationError {
fn description(&self) -> &str {
match *self {
CreateLaunchConfigurationError::AlreadyExistsFault(ref cause) => cause,
CreateLaunchConfigurationError::LimitExceededFault(ref cause) => cause,
CreateLaunchConfigurationError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateOrUpdateTagsError {
AlreadyExistsFault(String),
LimitExceededFault(String),
ResourceContentionFault(String),
ResourceInUseFault(String),
}
impl CreateOrUpdateTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateOrUpdateTagsError> {
{
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[..] {
"AlreadyExists" => {
return RusotoError::Service(CreateOrUpdateTagsError::AlreadyExistsFault(
parsed_error.message,
))
}
"LimitExceeded" => {
return RusotoError::Service(CreateOrUpdateTagsError::LimitExceededFault(
parsed_error.message,
))
}
"ResourceContention" => {
return RusotoError::Service(
CreateOrUpdateTagsError::ResourceContentionFault(parsed_error.message),
)
}
"ResourceInUse" => {
return RusotoError::Service(CreateOrUpdateTagsError::ResourceInUseFault(
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 CreateOrUpdateTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateOrUpdateTagsError {
fn description(&self) -> &str {
match *self {
CreateOrUpdateTagsError::AlreadyExistsFault(ref cause) => cause,
CreateOrUpdateTagsError::LimitExceededFault(ref cause) => cause,
CreateOrUpdateTagsError::ResourceContentionFault(ref cause) => cause,
CreateOrUpdateTagsError::ResourceInUseFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAutoScalingGroupError {
ResourceContentionFault(String),
ResourceInUseFault(String),
ScalingActivityInProgressFault(String),
}
impl DeleteAutoScalingGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAutoScalingGroupError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DeleteAutoScalingGroupError::ResourceContentionFault(
parsed_error.message,
),
)
}
"ResourceInUse" => {
return RusotoError::Service(
DeleteAutoScalingGroupError::ResourceInUseFault(parsed_error.message),
)
}
"ScalingActivityInProgress" => {
return RusotoError::Service(
DeleteAutoScalingGroupError::ScalingActivityInProgressFault(
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 DeleteAutoScalingGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAutoScalingGroupError {
fn description(&self) -> &str {
match *self {
DeleteAutoScalingGroupError::ResourceContentionFault(ref cause) => cause,
DeleteAutoScalingGroupError::ResourceInUseFault(ref cause) => cause,
DeleteAutoScalingGroupError::ScalingActivityInProgressFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLaunchConfigurationError {
ResourceContentionFault(String),
ResourceInUseFault(String),
}
impl DeleteLaunchConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLaunchConfigurationError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DeleteLaunchConfigurationError::ResourceContentionFault(
parsed_error.message,
),
)
}
"ResourceInUse" => {
return RusotoError::Service(
DeleteLaunchConfigurationError::ResourceInUseFault(
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 DeleteLaunchConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLaunchConfigurationError {
fn description(&self) -> &str {
match *self {
DeleteLaunchConfigurationError::ResourceContentionFault(ref cause) => cause,
DeleteLaunchConfigurationError::ResourceInUseFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLifecycleHookError {
ResourceContentionFault(String),
}
impl DeleteLifecycleHookError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLifecycleHookError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DeleteLifecycleHookError::ResourceContentionFault(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 DeleteLifecycleHookError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLifecycleHookError {
fn description(&self) -> &str {
match *self {
DeleteLifecycleHookError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteNotificationConfigurationError {
ResourceContentionFault(String),
}
impl DeleteNotificationConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteNotificationConfigurationError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DeleteNotificationConfigurationError::ResourceContentionFault(
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 DeleteNotificationConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteNotificationConfigurationError {
fn description(&self) -> &str {
match *self {
DeleteNotificationConfigurationError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeletePolicyError {
ResourceContentionFault(String),
ServiceLinkedRoleFailure(String),
}
impl DeletePolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeletePolicyError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(DeletePolicyError::ResourceContentionFault(
parsed_error.message,
))
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(DeletePolicyError::ServiceLinkedRoleFailure(
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 DeletePolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeletePolicyError {
fn description(&self) -> &str {
match *self {
DeletePolicyError::ResourceContentionFault(ref cause) => cause,
DeletePolicyError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteScheduledActionError {
ResourceContentionFault(String),
}
impl DeleteScheduledActionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteScheduledActionError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DeleteScheduledActionError::ResourceContentionFault(
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 DeleteScheduledActionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteScheduledActionError {
fn description(&self) -> &str {
match *self {
DeleteScheduledActionError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteTagsError {
ResourceContentionFault(String),
ResourceInUseFault(String),
}
impl DeleteTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteTagsError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(DeleteTagsError::ResourceContentionFault(
parsed_error.message,
))
}
"ResourceInUse" => {
return RusotoError::Service(DeleteTagsError::ResourceInUseFault(
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 DeleteTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteTagsError {
fn description(&self) -> &str {
match *self {
DeleteTagsError::ResourceContentionFault(ref cause) => cause,
DeleteTagsError::ResourceInUseFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAccountLimitsError {
ResourceContentionFault(String),
}
impl DescribeAccountLimitsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAccountLimitsError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeAccountLimitsError::ResourceContentionFault(
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 DescribeAccountLimitsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAccountLimitsError {
fn description(&self) -> &str {
match *self {
DescribeAccountLimitsError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAdjustmentTypesError {
ResourceContentionFault(String),
}
impl DescribeAdjustmentTypesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAdjustmentTypesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeAdjustmentTypesError::ResourceContentionFault(
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 DescribeAdjustmentTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAdjustmentTypesError {
fn description(&self) -> &str {
match *self {
DescribeAdjustmentTypesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAutoScalingGroupsError {
InvalidNextToken(String),
ResourceContentionFault(String),
}
impl DescribeAutoScalingGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAutoScalingGroupsError> {
{
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[..] {
"InvalidNextToken" => {
return RusotoError::Service(
DescribeAutoScalingGroupsError::InvalidNextToken(parsed_error.message),
)
}
"ResourceContention" => {
return RusotoError::Service(
DescribeAutoScalingGroupsError::ResourceContentionFault(
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 DescribeAutoScalingGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAutoScalingGroupsError {
fn description(&self) -> &str {
match *self {
DescribeAutoScalingGroupsError::InvalidNextToken(ref cause) => cause,
DescribeAutoScalingGroupsError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAutoScalingInstancesError {
InvalidNextToken(String),
ResourceContentionFault(String),
}
impl DescribeAutoScalingInstancesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeAutoScalingInstancesError> {
{
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[..] {
"InvalidNextToken" => {
return RusotoError::Service(
DescribeAutoScalingInstancesError::InvalidNextToken(
parsed_error.message,
),
)
}
"ResourceContention" => {
return RusotoError::Service(
DescribeAutoScalingInstancesError::ResourceContentionFault(
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 DescribeAutoScalingInstancesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAutoScalingInstancesError {
fn description(&self) -> &str {
match *self {
DescribeAutoScalingInstancesError::InvalidNextToken(ref cause) => cause,
DescribeAutoScalingInstancesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAutoScalingNotificationTypesError {
ResourceContentionFault(String),
}
impl DescribeAutoScalingNotificationTypesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeAutoScalingNotificationTypesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeAutoScalingNotificationTypesError::ResourceContentionFault(
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 DescribeAutoScalingNotificationTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAutoScalingNotificationTypesError {
fn description(&self) -> &str {
match *self {
DescribeAutoScalingNotificationTypesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLaunchConfigurationsError {
InvalidNextToken(String),
ResourceContentionFault(String),
}
impl DescribeLaunchConfigurationsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeLaunchConfigurationsError> {
{
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[..] {
"InvalidNextToken" => {
return RusotoError::Service(
DescribeLaunchConfigurationsError::InvalidNextToken(
parsed_error.message,
),
)
}
"ResourceContention" => {
return RusotoError::Service(
DescribeLaunchConfigurationsError::ResourceContentionFault(
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 DescribeLaunchConfigurationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLaunchConfigurationsError {
fn description(&self) -> &str {
match *self {
DescribeLaunchConfigurationsError::InvalidNextToken(ref cause) => cause,
DescribeLaunchConfigurationsError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLifecycleHookTypesError {
ResourceContentionFault(String),
}
impl DescribeLifecycleHookTypesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeLifecycleHookTypesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeLifecycleHookTypesError::ResourceContentionFault(
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 DescribeLifecycleHookTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLifecycleHookTypesError {
fn description(&self) -> &str {
match *self {
DescribeLifecycleHookTypesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLifecycleHooksError {
ResourceContentionFault(String),
}
impl DescribeLifecycleHooksError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeLifecycleHooksError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeLifecycleHooksError::ResourceContentionFault(
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 DescribeLifecycleHooksError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLifecycleHooksError {
fn description(&self) -> &str {
match *self {
DescribeLifecycleHooksError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLoadBalancerTargetGroupsError {
ResourceContentionFault(String),
}
impl DescribeLoadBalancerTargetGroupsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeLoadBalancerTargetGroupsError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeLoadBalancerTargetGroupsError::ResourceContentionFault(
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 DescribeLoadBalancerTargetGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLoadBalancerTargetGroupsError {
fn description(&self) -> &str {
match *self {
DescribeLoadBalancerTargetGroupsError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLoadBalancersError {
ResourceContentionFault(String),
}
impl DescribeLoadBalancersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeLoadBalancersError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeLoadBalancersError::ResourceContentionFault(
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 DescribeLoadBalancersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLoadBalancersError {
fn description(&self) -> &str {
match *self {
DescribeLoadBalancersError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeMetricCollectionTypesError {
ResourceContentionFault(String),
}
impl DescribeMetricCollectionTypesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeMetricCollectionTypesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeMetricCollectionTypesError::ResourceContentionFault(
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 DescribeMetricCollectionTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeMetricCollectionTypesError {
fn description(&self) -> &str {
match *self {
DescribeMetricCollectionTypesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeNotificationConfigurationsError {
InvalidNextToken(String),
ResourceContentionFault(String),
}
impl DescribeNotificationConfigurationsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeNotificationConfigurationsError> {
{
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[..] {
"InvalidNextToken" => {
return RusotoError::Service(
DescribeNotificationConfigurationsError::InvalidNextToken(
parsed_error.message,
),
)
}
"ResourceContention" => {
return RusotoError::Service(
DescribeNotificationConfigurationsError::ResourceContentionFault(
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 DescribeNotificationConfigurationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeNotificationConfigurationsError {
fn description(&self) -> &str {
match *self {
DescribeNotificationConfigurationsError::InvalidNextToken(ref cause) => cause,
DescribeNotificationConfigurationsError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribePoliciesError {
InvalidNextToken(String),
ResourceContentionFault(String),
ServiceLinkedRoleFailure(String),
}
impl DescribePoliciesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribePoliciesError> {
{
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[..] {
"InvalidNextToken" => {
return RusotoError::Service(DescribePoliciesError::InvalidNextToken(
parsed_error.message,
))
}
"ResourceContention" => {
return RusotoError::Service(
DescribePoliciesError::ResourceContentionFault(parsed_error.message),
)
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(
DescribePoliciesError::ServiceLinkedRoleFailure(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 DescribePoliciesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribePoliciesError {
fn description(&self) -> &str {
match *self {
DescribePoliciesError::InvalidNextToken(ref cause) => cause,
DescribePoliciesError::ResourceContentionFault(ref cause) => cause,
DescribePoliciesError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeScalingActivitiesError {
InvalidNextToken(String),
ResourceContentionFault(String),
}
impl DescribeScalingActivitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeScalingActivitiesError> {
{
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[..] {
"InvalidNextToken" => {
return RusotoError::Service(
DescribeScalingActivitiesError::InvalidNextToken(parsed_error.message),
)
}
"ResourceContention" => {
return RusotoError::Service(
DescribeScalingActivitiesError::ResourceContentionFault(
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 DescribeScalingActivitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeScalingActivitiesError {
fn description(&self) -> &str {
match *self {
DescribeScalingActivitiesError::InvalidNextToken(ref cause) => cause,
DescribeScalingActivitiesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeScalingProcessTypesError {
ResourceContentionFault(String),
}
impl DescribeScalingProcessTypesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeScalingProcessTypesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeScalingProcessTypesError::ResourceContentionFault(
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 DescribeScalingProcessTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeScalingProcessTypesError {
fn description(&self) -> &str {
match *self {
DescribeScalingProcessTypesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeScheduledActionsError {
InvalidNextToken(String),
ResourceContentionFault(String),
}
impl DescribeScheduledActionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeScheduledActionsError> {
{
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[..] {
"InvalidNextToken" => {
return RusotoError::Service(
DescribeScheduledActionsError::InvalidNextToken(parsed_error.message),
)
}
"ResourceContention" => {
return RusotoError::Service(
DescribeScheduledActionsError::ResourceContentionFault(
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 DescribeScheduledActionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeScheduledActionsError {
fn description(&self) -> &str {
match *self {
DescribeScheduledActionsError::InvalidNextToken(ref cause) => cause,
DescribeScheduledActionsError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTagsError {
InvalidNextToken(String),
ResourceContentionFault(String),
}
impl DescribeTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeTagsError> {
{
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[..] {
"InvalidNextToken" => {
return RusotoError::Service(DescribeTagsError::InvalidNextToken(
parsed_error.message,
))
}
"ResourceContention" => {
return RusotoError::Service(DescribeTagsError::ResourceContentionFault(
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 DescribeTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTagsError {
fn description(&self) -> &str {
match *self {
DescribeTagsError::InvalidNextToken(ref cause) => cause,
DescribeTagsError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTerminationPolicyTypesError {
ResourceContentionFault(String),
}
impl DescribeTerminationPolicyTypesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeTerminationPolicyTypesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DescribeTerminationPolicyTypesError::ResourceContentionFault(
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 DescribeTerminationPolicyTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTerminationPolicyTypesError {
fn description(&self) -> &str {
match *self {
DescribeTerminationPolicyTypesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DetachInstancesError {
ResourceContentionFault(String),
}
impl DetachInstancesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DetachInstancesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(DetachInstancesError::ResourceContentionFault(
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 DetachInstancesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetachInstancesError {
fn description(&self) -> &str {
match *self {
DetachInstancesError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DetachLoadBalancerTargetGroupsError {
ResourceContentionFault(String),
}
impl DetachLoadBalancerTargetGroupsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DetachLoadBalancerTargetGroupsError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DetachLoadBalancerTargetGroupsError::ResourceContentionFault(
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 DetachLoadBalancerTargetGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetachLoadBalancerTargetGroupsError {
fn description(&self) -> &str {
match *self {
DetachLoadBalancerTargetGroupsError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DetachLoadBalancersError {
ResourceContentionFault(String),
}
impl DetachLoadBalancersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DetachLoadBalancersError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DetachLoadBalancersError::ResourceContentionFault(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 DetachLoadBalancersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetachLoadBalancersError {
fn description(&self) -> &str {
match *self {
DetachLoadBalancersError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisableMetricsCollectionError {
ResourceContentionFault(String),
}
impl DisableMetricsCollectionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisableMetricsCollectionError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
DisableMetricsCollectionError::ResourceContentionFault(
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 DisableMetricsCollectionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisableMetricsCollectionError {
fn description(&self) -> &str {
match *self {
DisableMetricsCollectionError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum EnableMetricsCollectionError {
ResourceContentionFault(String),
}
impl EnableMetricsCollectionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<EnableMetricsCollectionError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
EnableMetricsCollectionError::ResourceContentionFault(
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 EnableMetricsCollectionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for EnableMetricsCollectionError {
fn description(&self) -> &str {
match *self {
EnableMetricsCollectionError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum EnterStandbyError {
ResourceContentionFault(String),
}
impl EnterStandbyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<EnterStandbyError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(EnterStandbyError::ResourceContentionFault(
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 EnterStandbyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for EnterStandbyError {
fn description(&self) -> &str {
match *self {
EnterStandbyError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ExecutePolicyError {
ResourceContentionFault(String),
ScalingActivityInProgressFault(String),
}
impl ExecutePolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ExecutePolicyError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(ExecutePolicyError::ResourceContentionFault(
parsed_error.message,
))
}
"ScalingActivityInProgress" => {
return RusotoError::Service(
ExecutePolicyError::ScalingActivityInProgressFault(
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 ExecutePolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ExecutePolicyError {
fn description(&self) -> &str {
match *self {
ExecutePolicyError::ResourceContentionFault(ref cause) => cause,
ExecutePolicyError::ScalingActivityInProgressFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ExitStandbyError {
ResourceContentionFault(String),
}
impl ExitStandbyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ExitStandbyError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(ExitStandbyError::ResourceContentionFault(
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 ExitStandbyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ExitStandbyError {
fn description(&self) -> &str {
match *self {
ExitStandbyError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutLifecycleHookError {
LimitExceededFault(String),
ResourceContentionFault(String),
}
impl PutLifecycleHookError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutLifecycleHookError> {
{
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[..] {
"LimitExceeded" => {
return RusotoError::Service(PutLifecycleHookError::LimitExceededFault(
parsed_error.message,
))
}
"ResourceContention" => {
return RusotoError::Service(
PutLifecycleHookError::ResourceContentionFault(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 PutLifecycleHookError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutLifecycleHookError {
fn description(&self) -> &str {
match *self {
PutLifecycleHookError::LimitExceededFault(ref cause) => cause,
PutLifecycleHookError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutNotificationConfigurationError {
LimitExceededFault(String),
ResourceContentionFault(String),
ServiceLinkedRoleFailure(String),
}
impl PutNotificationConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<PutNotificationConfigurationError> {
{
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[..] {
"LimitExceeded" => {
return RusotoError::Service(
PutNotificationConfigurationError::LimitExceededFault(
parsed_error.message,
),
)
}
"ResourceContention" => {
return RusotoError::Service(
PutNotificationConfigurationError::ResourceContentionFault(
parsed_error.message,
),
)
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(
PutNotificationConfigurationError::ServiceLinkedRoleFailure(
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 PutNotificationConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutNotificationConfigurationError {
fn description(&self) -> &str {
match *self {
PutNotificationConfigurationError::LimitExceededFault(ref cause) => cause,
PutNotificationConfigurationError::ResourceContentionFault(ref cause) => cause,
PutNotificationConfigurationError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutScalingPolicyError {
LimitExceededFault(String),
ResourceContentionFault(String),
ServiceLinkedRoleFailure(String),
}
impl PutScalingPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutScalingPolicyError> {
{
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[..] {
"LimitExceeded" => {
return RusotoError::Service(PutScalingPolicyError::LimitExceededFault(
parsed_error.message,
))
}
"ResourceContention" => {
return RusotoError::Service(
PutScalingPolicyError::ResourceContentionFault(parsed_error.message),
)
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(
PutScalingPolicyError::ServiceLinkedRoleFailure(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 PutScalingPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutScalingPolicyError {
fn description(&self) -> &str {
match *self {
PutScalingPolicyError::LimitExceededFault(ref cause) => cause,
PutScalingPolicyError::ResourceContentionFault(ref cause) => cause,
PutScalingPolicyError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutScheduledUpdateGroupActionError {
AlreadyExistsFault(String),
LimitExceededFault(String),
ResourceContentionFault(String),
}
impl PutScheduledUpdateGroupActionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<PutScheduledUpdateGroupActionError> {
{
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[..] {
"AlreadyExists" => {
return RusotoError::Service(
PutScheduledUpdateGroupActionError::AlreadyExistsFault(
parsed_error.message,
),
)
}
"LimitExceeded" => {
return RusotoError::Service(
PutScheduledUpdateGroupActionError::LimitExceededFault(
parsed_error.message,
),
)
}
"ResourceContention" => {
return RusotoError::Service(
PutScheduledUpdateGroupActionError::ResourceContentionFault(
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 PutScheduledUpdateGroupActionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutScheduledUpdateGroupActionError {
fn description(&self) -> &str {
match *self {
PutScheduledUpdateGroupActionError::AlreadyExistsFault(ref cause) => cause,
PutScheduledUpdateGroupActionError::LimitExceededFault(ref cause) => cause,
PutScheduledUpdateGroupActionError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RecordLifecycleActionHeartbeatError {
ResourceContentionFault(String),
}
impl RecordLifecycleActionHeartbeatError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RecordLifecycleActionHeartbeatError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
RecordLifecycleActionHeartbeatError::ResourceContentionFault(
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 RecordLifecycleActionHeartbeatError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RecordLifecycleActionHeartbeatError {
fn description(&self) -> &str {
match *self {
RecordLifecycleActionHeartbeatError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ResumeProcessesError {
ResourceContentionFault(String),
ResourceInUseFault(String),
}
impl ResumeProcessesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ResumeProcessesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(ResumeProcessesError::ResourceContentionFault(
parsed_error.message,
))
}
"ResourceInUse" => {
return RusotoError::Service(ResumeProcessesError::ResourceInUseFault(
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 ResumeProcessesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ResumeProcessesError {
fn description(&self) -> &str {
match *self {
ResumeProcessesError::ResourceContentionFault(ref cause) => cause,
ResumeProcessesError::ResourceInUseFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetDesiredCapacityError {
ResourceContentionFault(String),
ScalingActivityInProgressFault(String),
}
impl SetDesiredCapacityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetDesiredCapacityError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
SetDesiredCapacityError::ResourceContentionFault(parsed_error.message),
)
}
"ScalingActivityInProgress" => {
return RusotoError::Service(
SetDesiredCapacityError::ScalingActivityInProgressFault(
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 SetDesiredCapacityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetDesiredCapacityError {
fn description(&self) -> &str {
match *self {
SetDesiredCapacityError::ResourceContentionFault(ref cause) => cause,
SetDesiredCapacityError::ScalingActivityInProgressFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetInstanceHealthError {
ResourceContentionFault(String),
}
impl SetInstanceHealthError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetInstanceHealthError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
SetInstanceHealthError::ResourceContentionFault(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 SetInstanceHealthError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetInstanceHealthError {
fn description(&self) -> &str {
match *self {
SetInstanceHealthError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetInstanceProtectionError {
LimitExceededFault(String),
ResourceContentionFault(String),
}
impl SetInstanceProtectionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetInstanceProtectionError> {
{
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[..] {
"LimitExceeded" => {
return RusotoError::Service(
SetInstanceProtectionError::LimitExceededFault(parsed_error.message),
)
}
"ResourceContention" => {
return RusotoError::Service(
SetInstanceProtectionError::ResourceContentionFault(
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 SetInstanceProtectionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetInstanceProtectionError {
fn description(&self) -> &str {
match *self {
SetInstanceProtectionError::LimitExceededFault(ref cause) => cause,
SetInstanceProtectionError::ResourceContentionFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SuspendProcessesError {
ResourceContentionFault(String),
ResourceInUseFault(String),
}
impl SuspendProcessesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SuspendProcessesError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
SuspendProcessesError::ResourceContentionFault(parsed_error.message),
)
}
"ResourceInUse" => {
return RusotoError::Service(SuspendProcessesError::ResourceInUseFault(
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 SuspendProcessesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SuspendProcessesError {
fn description(&self) -> &str {
match *self {
SuspendProcessesError::ResourceContentionFault(ref cause) => cause,
SuspendProcessesError::ResourceInUseFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TerminateInstanceInAutoScalingGroupError {
ResourceContentionFault(String),
ScalingActivityInProgressFault(String),
}
impl TerminateInstanceInAutoScalingGroupError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<TerminateInstanceInAutoScalingGroupError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
TerminateInstanceInAutoScalingGroupError::ResourceContentionFault(
parsed_error.message,
),
)
}
"ScalingActivityInProgress" => return RusotoError::Service(
TerminateInstanceInAutoScalingGroupError::ScalingActivityInProgressFault(
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 TerminateInstanceInAutoScalingGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TerminateInstanceInAutoScalingGroupError {
fn description(&self) -> &str {
match *self {
TerminateInstanceInAutoScalingGroupError::ResourceContentionFault(ref cause) => cause,
TerminateInstanceInAutoScalingGroupError::ScalingActivityInProgressFault(ref cause) => {
cause
}
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateAutoScalingGroupError {
ResourceContentionFault(String),
ScalingActivityInProgressFault(String),
ServiceLinkedRoleFailure(String),
}
impl UpdateAutoScalingGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAutoScalingGroupError> {
{
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[..] {
"ResourceContention" => {
return RusotoError::Service(
UpdateAutoScalingGroupError::ResourceContentionFault(
parsed_error.message,
),
)
}
"ScalingActivityInProgress" => {
return RusotoError::Service(
UpdateAutoScalingGroupError::ScalingActivityInProgressFault(
parsed_error.message,
),
)
}
"ServiceLinkedRoleFailure" => {
return RusotoError::Service(
UpdateAutoScalingGroupError::ServiceLinkedRoleFailure(
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 UpdateAutoScalingGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateAutoScalingGroupError {
fn description(&self) -> &str {
match *self {
UpdateAutoScalingGroupError::ResourceContentionFault(ref cause) => cause,
UpdateAutoScalingGroupError::ScalingActivityInProgressFault(ref cause) => cause,
UpdateAutoScalingGroupError::ServiceLinkedRoleFailure(ref cause) => cause,
}
}
}
pub trait Autoscaling {
fn attach_instances(
&self,
input: AttachInstancesQuery,
) -> RusotoFuture<(), AttachInstancesError>;
fn attach_load_balancer_target_groups(
&self,
input: AttachLoadBalancerTargetGroupsType,
) -> RusotoFuture<AttachLoadBalancerTargetGroupsResultType, AttachLoadBalancerTargetGroupsError>;
fn attach_load_balancers(
&self,
input: AttachLoadBalancersType,
) -> RusotoFuture<AttachLoadBalancersResultType, AttachLoadBalancersError>;
fn batch_delete_scheduled_action(
&self,
input: BatchDeleteScheduledActionType,
) -> RusotoFuture<BatchDeleteScheduledActionAnswer, BatchDeleteScheduledActionError>;
fn batch_put_scheduled_update_group_action(
&self,
input: BatchPutScheduledUpdateGroupActionType,
) -> RusotoFuture<
BatchPutScheduledUpdateGroupActionAnswer,
BatchPutScheduledUpdateGroupActionError,
>;
fn complete_lifecycle_action(
&self,
input: CompleteLifecycleActionType,
) -> RusotoFuture<CompleteLifecycleActionAnswer, CompleteLifecycleActionError>;
fn create_auto_scaling_group(
&self,
input: CreateAutoScalingGroupType,
) -> RusotoFuture<(), CreateAutoScalingGroupError>;
fn create_launch_configuration(
&self,
input: CreateLaunchConfigurationType,
) -> RusotoFuture<(), CreateLaunchConfigurationError>;
fn create_or_update_tags(
&self,
input: CreateOrUpdateTagsType,
) -> RusotoFuture<(), CreateOrUpdateTagsError>;
fn delete_auto_scaling_group(
&self,
input: DeleteAutoScalingGroupType,
) -> RusotoFuture<(), DeleteAutoScalingGroupError>;
fn delete_launch_configuration(
&self,
input: LaunchConfigurationNameType,
) -> RusotoFuture<(), DeleteLaunchConfigurationError>;
fn delete_lifecycle_hook(
&self,
input: DeleteLifecycleHookType,
) -> RusotoFuture<DeleteLifecycleHookAnswer, DeleteLifecycleHookError>;
fn delete_notification_configuration(
&self,
input: DeleteNotificationConfigurationType,
) -> RusotoFuture<(), DeleteNotificationConfigurationError>;
fn delete_policy(&self, input: DeletePolicyType) -> RusotoFuture<(), DeletePolicyError>;
fn delete_scheduled_action(
&self,
input: DeleteScheduledActionType,
) -> RusotoFuture<(), DeleteScheduledActionError>;
fn delete_tags(&self, input: DeleteTagsType) -> RusotoFuture<(), DeleteTagsError>;
fn describe_account_limits(
&self,
) -> RusotoFuture<DescribeAccountLimitsAnswer, DescribeAccountLimitsError>;
fn describe_adjustment_types(
&self,
) -> RusotoFuture<DescribeAdjustmentTypesAnswer, DescribeAdjustmentTypesError>;
fn describe_auto_scaling_groups(
&self,
input: AutoScalingGroupNamesType,
) -> RusotoFuture<AutoScalingGroupsType, DescribeAutoScalingGroupsError>;
fn describe_auto_scaling_instances(
&self,
input: DescribeAutoScalingInstancesType,
) -> RusotoFuture<AutoScalingInstancesType, DescribeAutoScalingInstancesError>;
fn describe_auto_scaling_notification_types(
&self,
) -> RusotoFuture<
DescribeAutoScalingNotificationTypesAnswer,
DescribeAutoScalingNotificationTypesError,
>;
fn describe_launch_configurations(
&self,
input: LaunchConfigurationNamesType,
) -> RusotoFuture<LaunchConfigurationsType, DescribeLaunchConfigurationsError>;
fn describe_lifecycle_hook_types(
&self,
) -> RusotoFuture<DescribeLifecycleHookTypesAnswer, DescribeLifecycleHookTypesError>;
fn describe_lifecycle_hooks(
&self,
input: DescribeLifecycleHooksType,
) -> RusotoFuture<DescribeLifecycleHooksAnswer, DescribeLifecycleHooksError>;
fn describe_load_balancer_target_groups(
&self,
input: DescribeLoadBalancerTargetGroupsRequest,
) -> RusotoFuture<DescribeLoadBalancerTargetGroupsResponse, DescribeLoadBalancerTargetGroupsError>;
fn describe_load_balancers(
&self,
input: DescribeLoadBalancersRequest,
) -> RusotoFuture<DescribeLoadBalancersResponse, DescribeLoadBalancersError>;
fn describe_metric_collection_types(
&self,
) -> RusotoFuture<DescribeMetricCollectionTypesAnswer, DescribeMetricCollectionTypesError>;
fn describe_notification_configurations(
&self,
input: DescribeNotificationConfigurationsType,
) -> RusotoFuture<
DescribeNotificationConfigurationsAnswer,
DescribeNotificationConfigurationsError,
>;
fn describe_policies(
&self,
input: DescribePoliciesType,
) -> RusotoFuture<PoliciesType, DescribePoliciesError>;
fn describe_scaling_activities(
&self,
input: DescribeScalingActivitiesType,
) -> RusotoFuture<ActivitiesType, DescribeScalingActivitiesError>;
fn describe_scaling_process_types(
&self,
) -> RusotoFuture<ProcessesType, DescribeScalingProcessTypesError>;
fn describe_scheduled_actions(
&self,
input: DescribeScheduledActionsType,
) -> RusotoFuture<ScheduledActionsType, DescribeScheduledActionsError>;
fn describe_tags(&self, input: DescribeTagsType) -> RusotoFuture<TagsType, DescribeTagsError>;
fn describe_termination_policy_types(
&self,
) -> RusotoFuture<DescribeTerminationPolicyTypesAnswer, DescribeTerminationPolicyTypesError>;
fn detach_instances(
&self,
input: DetachInstancesQuery,
) -> RusotoFuture<DetachInstancesAnswer, DetachInstancesError>;
fn detach_load_balancer_target_groups(
&self,
input: DetachLoadBalancerTargetGroupsType,
) -> RusotoFuture<DetachLoadBalancerTargetGroupsResultType, DetachLoadBalancerTargetGroupsError>;
fn detach_load_balancers(
&self,
input: DetachLoadBalancersType,
) -> RusotoFuture<DetachLoadBalancersResultType, DetachLoadBalancersError>;
fn disable_metrics_collection(
&self,
input: DisableMetricsCollectionQuery,
) -> RusotoFuture<(), DisableMetricsCollectionError>;
fn enable_metrics_collection(
&self,
input: EnableMetricsCollectionQuery,
) -> RusotoFuture<(), EnableMetricsCollectionError>;
fn enter_standby(
&self,
input: EnterStandbyQuery,
) -> RusotoFuture<EnterStandbyAnswer, EnterStandbyError>;
fn execute_policy(&self, input: ExecutePolicyType) -> RusotoFuture<(), ExecutePolicyError>;
fn exit_standby(
&self,
input: ExitStandbyQuery,
) -> RusotoFuture<ExitStandbyAnswer, ExitStandbyError>;
fn put_lifecycle_hook(
&self,
input: PutLifecycleHookType,
) -> RusotoFuture<PutLifecycleHookAnswer, PutLifecycleHookError>;
fn put_notification_configuration(
&self,
input: PutNotificationConfigurationType,
) -> RusotoFuture<(), PutNotificationConfigurationError>;
fn put_scaling_policy(
&self,
input: PutScalingPolicyType,
) -> RusotoFuture<PolicyARNType, PutScalingPolicyError>;
fn put_scheduled_update_group_action(
&self,
input: PutScheduledUpdateGroupActionType,
) -> RusotoFuture<(), PutScheduledUpdateGroupActionError>;
fn record_lifecycle_action_heartbeat(
&self,
input: RecordLifecycleActionHeartbeatType,
) -> RusotoFuture<RecordLifecycleActionHeartbeatAnswer, RecordLifecycleActionHeartbeatError>;
fn resume_processes(
&self,
input: ScalingProcessQuery,
) -> RusotoFuture<(), ResumeProcessesError>;
fn set_desired_capacity(
&self,
input: SetDesiredCapacityType,
) -> RusotoFuture<(), SetDesiredCapacityError>;
fn set_instance_health(
&self,
input: SetInstanceHealthQuery,
) -> RusotoFuture<(), SetInstanceHealthError>;
fn set_instance_protection(
&self,
input: SetInstanceProtectionQuery,
) -> RusotoFuture<SetInstanceProtectionAnswer, SetInstanceProtectionError>;
fn suspend_processes(
&self,
input: ScalingProcessQuery,
) -> RusotoFuture<(), SuspendProcessesError>;
fn terminate_instance_in_auto_scaling_group(
&self,
input: TerminateInstanceInAutoScalingGroupType,
) -> RusotoFuture<ActivityType, TerminateInstanceInAutoScalingGroupError>;
fn update_auto_scaling_group(
&self,
input: UpdateAutoScalingGroupType,
) -> RusotoFuture<(), UpdateAutoScalingGroupError>;
}
#[derive(Clone)]
pub struct AutoscalingClient {
client: Client,
region: region::Region,
}
impl AutoscalingClient {
pub fn new(region: region::Region) -> AutoscalingClient {
AutoscalingClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> AutoscalingClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
AutoscalingClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Autoscaling for AutoscalingClient {
fn attach_instances(
&self,
input: AttachInstancesQuery,
) -> RusotoFuture<(), AttachInstancesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "AttachInstances");
params.put("Version", "2011-01-01");
AttachInstancesQuerySerializer::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(AttachInstancesError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn attach_load_balancer_target_groups(
&self,
input: AttachLoadBalancerTargetGroupsType,
) -> RusotoFuture<AttachLoadBalancerTargetGroupsResultType, AttachLoadBalancerTargetGroupsError>
{
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "AttachLoadBalancerTargetGroups");
params.put("Version", "2011-01-01");
AttachLoadBalancerTargetGroupsTypeSerializer::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(AttachLoadBalancerTargetGroupsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = AttachLoadBalancerTargetGroupsResultType::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 = AttachLoadBalancerTargetGroupsResultTypeDeserializer::deserialize(
"AttachLoadBalancerTargetGroupsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn attach_load_balancers(
&self,
input: AttachLoadBalancersType,
) -> RusotoFuture<AttachLoadBalancersResultType, AttachLoadBalancersError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "AttachLoadBalancers");
params.put("Version", "2011-01-01");
AttachLoadBalancersTypeSerializer::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(AttachLoadBalancersError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = AttachLoadBalancersResultType::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 = AttachLoadBalancersResultTypeDeserializer::deserialize(
"AttachLoadBalancersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn batch_delete_scheduled_action(
&self,
input: BatchDeleteScheduledActionType,
) -> RusotoFuture<BatchDeleteScheduledActionAnswer, BatchDeleteScheduledActionError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "BatchDeleteScheduledAction");
params.put("Version", "2011-01-01");
BatchDeleteScheduledActionTypeSerializer::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(BatchDeleteScheduledActionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = BatchDeleteScheduledActionAnswer::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 = BatchDeleteScheduledActionAnswerDeserializer::deserialize(
"BatchDeleteScheduledActionResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn batch_put_scheduled_update_group_action(
&self,
input: BatchPutScheduledUpdateGroupActionType,
) -> RusotoFuture<
BatchPutScheduledUpdateGroupActionAnswer,
BatchPutScheduledUpdateGroupActionError,
> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "BatchPutScheduledUpdateGroupAction");
params.put("Version", "2011-01-01");
BatchPutScheduledUpdateGroupActionTypeSerializer::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(BatchPutScheduledUpdateGroupActionError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = BatchPutScheduledUpdateGroupActionAnswer::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 = BatchPutScheduledUpdateGroupActionAnswerDeserializer::deserialize(
"BatchPutScheduledUpdateGroupActionResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn complete_lifecycle_action(
&self,
input: CompleteLifecycleActionType,
) -> RusotoFuture<CompleteLifecycleActionAnswer, CompleteLifecycleActionError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CompleteLifecycleAction");
params.put("Version", "2011-01-01");
CompleteLifecycleActionTypeSerializer::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(CompleteLifecycleActionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = CompleteLifecycleActionAnswer::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 = CompleteLifecycleActionAnswerDeserializer::deserialize(
"CompleteLifecycleActionResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn create_auto_scaling_group(
&self,
input: CreateAutoScalingGroupType,
) -> RusotoFuture<(), CreateAutoScalingGroupError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateAutoScalingGroup");
params.put("Version", "2011-01-01");
CreateAutoScalingGroupTypeSerializer::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(CreateAutoScalingGroupError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn create_launch_configuration(
&self,
input: CreateLaunchConfigurationType,
) -> RusotoFuture<(), CreateLaunchConfigurationError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateLaunchConfiguration");
params.put("Version", "2011-01-01");
CreateLaunchConfigurationTypeSerializer::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(CreateLaunchConfigurationError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn create_or_update_tags(
&self,
input: CreateOrUpdateTagsType,
) -> RusotoFuture<(), CreateOrUpdateTagsError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "CreateOrUpdateTags");
params.put("Version", "2011-01-01");
CreateOrUpdateTagsTypeSerializer::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(CreateOrUpdateTagsError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_auto_scaling_group(
&self,
input: DeleteAutoScalingGroupType,
) -> RusotoFuture<(), DeleteAutoScalingGroupError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteAutoScalingGroup");
params.put("Version", "2011-01-01");
DeleteAutoScalingGroupTypeSerializer::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(DeleteAutoScalingGroupError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_launch_configuration(
&self,
input: LaunchConfigurationNameType,
) -> RusotoFuture<(), DeleteLaunchConfigurationError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteLaunchConfiguration");
params.put("Version", "2011-01-01");
LaunchConfigurationNameTypeSerializer::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(DeleteLaunchConfigurationError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_lifecycle_hook(
&self,
input: DeleteLifecycleHookType,
) -> RusotoFuture<DeleteLifecycleHookAnswer, DeleteLifecycleHookError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteLifecycleHook");
params.put("Version", "2011-01-01");
DeleteLifecycleHookTypeSerializer::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(DeleteLifecycleHookError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DeleteLifecycleHookAnswer::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 = DeleteLifecycleHookAnswerDeserializer::deserialize(
"DeleteLifecycleHookResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn delete_notification_configuration(
&self,
input: DeleteNotificationConfigurationType,
) -> RusotoFuture<(), DeleteNotificationConfigurationError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteNotificationConfiguration");
params.put("Version", "2011-01-01");
DeleteNotificationConfigurationTypeSerializer::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(DeleteNotificationConfigurationError::from_response(
response,
))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_policy(&self, input: DeletePolicyType) -> RusotoFuture<(), DeletePolicyError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeletePolicy");
params.put("Version", "2011-01-01");
DeletePolicyTypeSerializer::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(DeletePolicyError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_scheduled_action(
&self,
input: DeleteScheduledActionType,
) -> RusotoFuture<(), DeleteScheduledActionError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteScheduledAction");
params.put("Version", "2011-01-01");
DeleteScheduledActionTypeSerializer::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(DeleteScheduledActionError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn delete_tags(&self, input: DeleteTagsType) -> RusotoFuture<(), DeleteTagsError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DeleteTags");
params.put("Version", "2011-01-01");
DeleteTagsTypeSerializer::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(DeleteTagsError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn describe_account_limits(
&self,
) -> RusotoFuture<DescribeAccountLimitsAnswer, DescribeAccountLimitsError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeAccountLimits");
params.put("Version", "2011-01-01");
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAccountLimitsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeAccountLimitsAnswer::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 = DescribeAccountLimitsAnswerDeserializer::deserialize(
"DescribeAccountLimitsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_adjustment_types(
&self,
) -> RusotoFuture<DescribeAdjustmentTypesAnswer, DescribeAdjustmentTypesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeAdjustmentTypes");
params.put("Version", "2011-01-01");
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAdjustmentTypesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeAdjustmentTypesAnswer::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 = DescribeAdjustmentTypesAnswerDeserializer::deserialize(
"DescribeAdjustmentTypesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_auto_scaling_groups(
&self,
input: AutoScalingGroupNamesType,
) -> RusotoFuture<AutoScalingGroupsType, DescribeAutoScalingGroupsError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeAutoScalingGroups");
params.put("Version", "2011-01-01");
AutoScalingGroupNamesTypeSerializer::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(DescribeAutoScalingGroupsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = AutoScalingGroupsType::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 = AutoScalingGroupsTypeDeserializer::deserialize(
"DescribeAutoScalingGroupsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_auto_scaling_instances(
&self,
input: DescribeAutoScalingInstancesType,
) -> RusotoFuture<AutoScalingInstancesType, DescribeAutoScalingInstancesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeAutoScalingInstances");
params.put("Version", "2011-01-01");
DescribeAutoScalingInstancesTypeSerializer::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(DescribeAutoScalingInstancesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = AutoScalingInstancesType::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 = AutoScalingInstancesTypeDeserializer::deserialize(
"DescribeAutoScalingInstancesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_auto_scaling_notification_types(
&self,
) -> RusotoFuture<
DescribeAutoScalingNotificationTypesAnswer,
DescribeAutoScalingNotificationTypesError,
> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeAutoScalingNotificationTypes");
params.put("Version", "2011-01-01");
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAutoScalingNotificationTypesError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeAutoScalingNotificationTypesAnswer::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 = DescribeAutoScalingNotificationTypesAnswerDeserializer::deserialize(
"DescribeAutoScalingNotificationTypesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_launch_configurations(
&self,
input: LaunchConfigurationNamesType,
) -> RusotoFuture<LaunchConfigurationsType, DescribeLaunchConfigurationsError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeLaunchConfigurations");
params.put("Version", "2011-01-01");
LaunchConfigurationNamesTypeSerializer::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(DescribeLaunchConfigurationsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = LaunchConfigurationsType::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 = LaunchConfigurationsTypeDeserializer::deserialize(
"DescribeLaunchConfigurationsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_lifecycle_hook_types(
&self,
) -> RusotoFuture<DescribeLifecycleHookTypesAnswer, DescribeLifecycleHookTypesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeLifecycleHookTypes");
params.put("Version", "2011-01-01");
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeLifecycleHookTypesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeLifecycleHookTypesAnswer::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 = DescribeLifecycleHookTypesAnswerDeserializer::deserialize(
"DescribeLifecycleHookTypesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_lifecycle_hooks(
&self,
input: DescribeLifecycleHooksType,
) -> RusotoFuture<DescribeLifecycleHooksAnswer, DescribeLifecycleHooksError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeLifecycleHooks");
params.put("Version", "2011-01-01");
DescribeLifecycleHooksTypeSerializer::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(DescribeLifecycleHooksError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeLifecycleHooksAnswer::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 = DescribeLifecycleHooksAnswerDeserializer::deserialize(
"DescribeLifecycleHooksResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_load_balancer_target_groups(
&self,
input: DescribeLoadBalancerTargetGroupsRequest,
) -> RusotoFuture<DescribeLoadBalancerTargetGroupsResponse, DescribeLoadBalancerTargetGroupsError>
{
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeLoadBalancerTargetGroups");
params.put("Version", "2011-01-01");
DescribeLoadBalancerTargetGroupsRequestSerializer::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(DescribeLoadBalancerTargetGroupsError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeLoadBalancerTargetGroupsResponse::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 = DescribeLoadBalancerTargetGroupsResponseDeserializer::deserialize(
"DescribeLoadBalancerTargetGroupsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_load_balancers(
&self,
input: DescribeLoadBalancersRequest,
) -> RusotoFuture<DescribeLoadBalancersResponse, DescribeLoadBalancersError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeLoadBalancers");
params.put("Version", "2011-01-01");
DescribeLoadBalancersRequestSerializer::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(DescribeLoadBalancersError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeLoadBalancersResponse::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 = DescribeLoadBalancersResponseDeserializer::deserialize(
"DescribeLoadBalancersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_metric_collection_types(
&self,
) -> RusotoFuture<DescribeMetricCollectionTypesAnswer, DescribeMetricCollectionTypesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeMetricCollectionTypes");
params.put("Version", "2011-01-01");
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeMetricCollectionTypesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeMetricCollectionTypesAnswer::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 = DescribeMetricCollectionTypesAnswerDeserializer::deserialize(
"DescribeMetricCollectionTypesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_notification_configurations(
&self,
input: DescribeNotificationConfigurationsType,
) -> RusotoFuture<
DescribeNotificationConfigurationsAnswer,
DescribeNotificationConfigurationsError,
> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeNotificationConfigurations");
params.put("Version", "2011-01-01");
DescribeNotificationConfigurationsTypeSerializer::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(DescribeNotificationConfigurationsError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeNotificationConfigurationsAnswer::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 = DescribeNotificationConfigurationsAnswerDeserializer::deserialize(
"DescribeNotificationConfigurationsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_policies(
&self,
input: DescribePoliciesType,
) -> RusotoFuture<PoliciesType, DescribePoliciesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribePolicies");
params.put("Version", "2011-01-01");
DescribePoliciesTypeSerializer::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(DescribePoliciesError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = PoliciesType::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 = PoliciesTypeDeserializer::deserialize(
"DescribePoliciesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_scaling_activities(
&self,
input: DescribeScalingActivitiesType,
) -> RusotoFuture<ActivitiesType, DescribeScalingActivitiesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeScalingActivities");
params.put("Version", "2011-01-01");
DescribeScalingActivitiesTypeSerializer::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(DescribeScalingActivitiesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ActivitiesType::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 = ActivitiesTypeDeserializer::deserialize(
"DescribeScalingActivitiesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_scaling_process_types(
&self,
) -> RusotoFuture<ProcessesType, DescribeScalingProcessTypesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeScalingProcessTypes");
params.put("Version", "2011-01-01");
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeScalingProcessTypesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ProcessesType::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 = ProcessesTypeDeserializer::deserialize(
"DescribeScalingProcessTypesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_scheduled_actions(
&self,
input: DescribeScheduledActionsType,
) -> RusotoFuture<ScheduledActionsType, DescribeScheduledActionsError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeScheduledActions");
params.put("Version", "2011-01-01");
DescribeScheduledActionsTypeSerializer::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(DescribeScheduledActionsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ScheduledActionsType::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 = ScheduledActionsTypeDeserializer::deserialize(
"DescribeScheduledActionsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_tags(&self, input: DescribeTagsType) -> RusotoFuture<TagsType, DescribeTagsError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeTags");
params.put("Version", "2011-01-01");
DescribeTagsTypeSerializer::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(DescribeTagsError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = TagsType::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 = TagsTypeDeserializer::deserialize("DescribeTagsResult", &mut stack)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn describe_termination_policy_types(
&self,
) -> RusotoFuture<DescribeTerminationPolicyTypesAnswer, DescribeTerminationPolicyTypesError>
{
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DescribeTerminationPolicyTypes");
params.put("Version", "2011-01-01");
request.set_payload(Some(serde_urlencoded::to_string(¶ms).unwrap()));
request.set_content_type("application/x-www-form-urlencoded".to_owned());
self.client.sign_and_dispatch(request, |response| {
if !response.status.is_success() {
return Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeTerminationPolicyTypesError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DescribeTerminationPolicyTypesAnswer::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 = DescribeTerminationPolicyTypesAnswerDeserializer::deserialize(
"DescribeTerminationPolicyTypesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn detach_instances(
&self,
input: DetachInstancesQuery,
) -> RusotoFuture<DetachInstancesAnswer, DetachInstancesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DetachInstances");
params.put("Version", "2011-01-01");
DetachInstancesQuerySerializer::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(DetachInstancesError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DetachInstancesAnswer::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 = DetachInstancesAnswerDeserializer::deserialize(
"DetachInstancesResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn detach_load_balancer_target_groups(
&self,
input: DetachLoadBalancerTargetGroupsType,
) -> RusotoFuture<DetachLoadBalancerTargetGroupsResultType, DetachLoadBalancerTargetGroupsError>
{
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DetachLoadBalancerTargetGroups");
params.put("Version", "2011-01-01");
DetachLoadBalancerTargetGroupsTypeSerializer::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(DetachLoadBalancerTargetGroupsError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DetachLoadBalancerTargetGroupsResultType::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 = DetachLoadBalancerTargetGroupsResultTypeDeserializer::deserialize(
"DetachLoadBalancerTargetGroupsResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn detach_load_balancers(
&self,
input: DetachLoadBalancersType,
) -> RusotoFuture<DetachLoadBalancersResultType, DetachLoadBalancersError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DetachLoadBalancers");
params.put("Version", "2011-01-01");
DetachLoadBalancersTypeSerializer::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(DetachLoadBalancersError::from_response(response))
}),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = DetachLoadBalancersResultType::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 = DetachLoadBalancersResultTypeDeserializer::deserialize(
"DetachLoadBalancersResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn disable_metrics_collection(
&self,
input: DisableMetricsCollectionQuery,
) -> RusotoFuture<(), DisableMetricsCollectionError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "DisableMetricsCollection");
params.put("Version", "2011-01-01");
DisableMetricsCollectionQuerySerializer::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(DisableMetricsCollectionError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn enable_metrics_collection(
&self,
input: EnableMetricsCollectionQuery,
) -> RusotoFuture<(), EnableMetricsCollectionError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "EnableMetricsCollection");
params.put("Version", "2011-01-01");
EnableMetricsCollectionQuerySerializer::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(EnableMetricsCollectionError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn enter_standby(
&self,
input: EnterStandbyQuery,
) -> RusotoFuture<EnterStandbyAnswer, EnterStandbyError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "EnterStandby");
params.put("Version", "2011-01-01");
EnterStandbyQuerySerializer::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(EnterStandbyError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = EnterStandbyAnswer::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 = EnterStandbyAnswerDeserializer::deserialize(
"EnterStandbyResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn execute_policy(&self, input: ExecutePolicyType) -> RusotoFuture<(), ExecutePolicyError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ExecutePolicy");
params.put("Version", "2011-01-01");
ExecutePolicyTypeSerializer::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(ExecutePolicyError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn exit_standby(
&self,
input: ExitStandbyQuery,
) -> RusotoFuture<ExitStandbyAnswer, ExitStandbyError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ExitStandby");
params.put("Version", "2011-01-01");
ExitStandbyQuerySerializer::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(ExitStandbyError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ExitStandbyAnswer::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 = ExitStandbyAnswerDeserializer::deserialize(
"ExitStandbyResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn put_lifecycle_hook(
&self,
input: PutLifecycleHookType,
) -> RusotoFuture<PutLifecycleHookAnswer, PutLifecycleHookError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "PutLifecycleHook");
params.put("Version", "2011-01-01");
PutLifecycleHookTypeSerializer::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(PutLifecycleHookError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = PutLifecycleHookAnswer::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 = PutLifecycleHookAnswerDeserializer::deserialize(
"PutLifecycleHookResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn put_notification_configuration(
&self,
input: PutNotificationConfigurationType,
) -> RusotoFuture<(), PutNotificationConfigurationError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "PutNotificationConfiguration");
params.put("Version", "2011-01-01");
PutNotificationConfigurationTypeSerializer::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(PutNotificationConfigurationError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn put_scaling_policy(
&self,
input: PutScalingPolicyType,
) -> RusotoFuture<PolicyARNType, PutScalingPolicyError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "PutScalingPolicy");
params.put("Version", "2011-01-01");
PutScalingPolicyTypeSerializer::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(PutScalingPolicyError::from_response(response))),
);
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = PolicyARNType::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 = PolicyARNTypeDeserializer::deserialize(
"PutScalingPolicyResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn put_scheduled_update_group_action(
&self,
input: PutScheduledUpdateGroupActionType,
) -> RusotoFuture<(), PutScheduledUpdateGroupActionError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "PutScheduledUpdateGroupAction");
params.put("Version", "2011-01-01");
PutScheduledUpdateGroupActionTypeSerializer::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(PutScheduledUpdateGroupActionError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn record_lifecycle_action_heartbeat(
&self,
input: RecordLifecycleActionHeartbeatType,
) -> RusotoFuture<RecordLifecycleActionHeartbeatAnswer, RecordLifecycleActionHeartbeatError>
{
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "RecordLifecycleActionHeartbeat");
params.put("Version", "2011-01-01");
RecordLifecycleActionHeartbeatTypeSerializer::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(RecordLifecycleActionHeartbeatError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = RecordLifecycleActionHeartbeatAnswer::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 = RecordLifecycleActionHeartbeatAnswerDeserializer::deserialize(
"RecordLifecycleActionHeartbeatResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn resume_processes(
&self,
input: ScalingProcessQuery,
) -> RusotoFuture<(), ResumeProcessesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "ResumeProcesses");
params.put("Version", "2011-01-01");
ScalingProcessQuerySerializer::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(ResumeProcessesError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn set_desired_capacity(
&self,
input: SetDesiredCapacityType,
) -> RusotoFuture<(), SetDesiredCapacityError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "SetDesiredCapacity");
params.put("Version", "2011-01-01");
SetDesiredCapacityTypeSerializer::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(SetDesiredCapacityError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn set_instance_health(
&self,
input: SetInstanceHealthQuery,
) -> RusotoFuture<(), SetInstanceHealthError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "SetInstanceHealth");
params.put("Version", "2011-01-01");
SetInstanceHealthQuerySerializer::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(SetInstanceHealthError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn set_instance_protection(
&self,
input: SetInstanceProtectionQuery,
) -> RusotoFuture<SetInstanceProtectionAnswer, SetInstanceProtectionError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "SetInstanceProtection");
params.put("Version", "2011-01-01");
SetInstanceProtectionQuerySerializer::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(SetInstanceProtectionError::from_response(response))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = SetInstanceProtectionAnswer::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 = SetInstanceProtectionAnswerDeserializer::deserialize(
"SetInstanceProtectionResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn suspend_processes(
&self,
input: ScalingProcessQuery,
) -> RusotoFuture<(), SuspendProcessesError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "SuspendProcesses");
params.put("Version", "2011-01-01");
ScalingProcessQuerySerializer::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(SuspendProcessesError::from_response(response))),
);
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
fn terminate_instance_in_auto_scaling_group(
&self,
input: TerminateInstanceInAutoScalingGroupType,
) -> RusotoFuture<ActivityType, TerminateInstanceInAutoScalingGroupError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "TerminateInstanceInAutoScalingGroup");
params.put("Version", "2011-01-01");
TerminateInstanceInAutoScalingGroupTypeSerializer::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(TerminateInstanceInAutoScalingGroupError::from_response(
response,
))
}));
}
Box::new(response.buffer().from_err().and_then(move |response| {
let result;
if response.body.is_empty() {
result = ActivityType::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 = ActivityTypeDeserializer::deserialize(
"TerminateInstanceInAutoScalingGroupResult",
&mut stack,
)?;
skip_tree(&mut stack);
end_element(&actual_tag_name, &mut stack)?;
}
Ok(result)
}))
})
}
fn update_auto_scaling_group(
&self,
input: UpdateAutoScalingGroupType,
) -> RusotoFuture<(), UpdateAutoScalingGroupError> {
let mut request = SignedRequest::new("POST", "autoscaling", &self.region, "/");
let mut params = Params::new();
params.put("Action", "UpdateAutoScalingGroup");
params.put("Version", "2011-01-01");
UpdateAutoScalingGroupTypeSerializer::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(UpdateAutoScalingGroupError::from_response(response))
}));
}
Box::new(future::ok(::std::mem::drop(response)))
})
}
}
#[cfg(test)]
mod protocol_tests {
extern crate rusoto_mock;
use self::rusoto_mock::*;
use super::*;
use rusoto_core::Region as rusoto_region;
#[test]
fn test_parse_error_autoscaling_delete_policy() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/error",
"autoscaling-delete-policy.xml",
);
let mock = MockRequestDispatcher::with_status(400).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = DeletePolicyType::default();
let result = client.delete_policy(request).sync();
assert!(!result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_adjustment_types() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-adjustment-types.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let result = client.describe_adjustment_types().sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_auto_scaling_groups() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-auto-scaling-groups.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = AutoScalingGroupNamesType::default();
let result = client.describe_auto_scaling_groups(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_auto_scaling_instances() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-auto-scaling-instances.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = DescribeAutoScalingInstancesType::default();
let result = client.describe_auto_scaling_instances(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_auto_scaling_notification_types() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-auto-scaling-notification-types.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let result = client.describe_auto_scaling_notification_types().sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_launch_configurations() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-launch-configurations.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = LaunchConfigurationNamesType::default();
let result = client.describe_launch_configurations(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_metric_collection_types() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-metric-collection-types.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let result = client.describe_metric_collection_types().sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_notification_configurations() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-notification-configurations.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = DescribeNotificationConfigurationsType::default();
let result = client.describe_notification_configurations(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_policies() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-policies.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = DescribePoliciesType::default();
let result = client.describe_policies(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_scaling_activities() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-scaling-activities.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = DescribeScalingActivitiesType::default();
let result = client.describe_scaling_activities(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_scaling_process_types() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-scaling-process-types.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let result = client.describe_scaling_process_types().sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_scheduled_actions() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-scheduled-actions.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = DescribeScheduledActionsType::default();
let result = client.describe_scheduled_actions(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_tags() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-tags.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let request = DescribeTagsType::default();
let result = client.describe_tags(request).sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
#[test]
fn test_parse_valid_autoscaling_describe_termination_policy_types() {
let mock_response = MockResponseReader::read_response(
"test_resources/generated/valid",
"autoscaling-describe-termination-policy-types.xml",
);
let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
let client =
AutoscalingClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
let result = client.describe_termination_policy_types().sync();
assert!(result.is_ok(), "parse error: {:?}", result);
}
}