use std::error::Error;
use std::fmt;
use std::io;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoFuture};
use rusoto_core::credential::{CredentialsError, ProvideAwsCredentials};
use rusoto_core::request::HttpDispatchError;
use rusoto_core::signature::SignedRequest;
use serde_json;
use serde_json::from_slice;
use serde_json::Value as SerdeJsonValue;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddInstanceFleetInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "InstanceFleet")]
pub instance_fleet: InstanceFleetConfig,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddInstanceFleetOutput {
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
#[serde(rename = "InstanceFleetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_fleet_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddInstanceGroupsInput {
#[serde(rename = "InstanceGroups")]
pub instance_groups: Vec<InstanceGroupConfig>,
#[serde(rename = "JobFlowId")]
pub job_flow_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddInstanceGroupsOutput {
#[serde(rename = "InstanceGroupIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_group_ids: Option<Vec<String>>,
#[serde(rename = "JobFlowId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_flow_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddJobFlowStepsInput {
#[serde(rename = "JobFlowId")]
pub job_flow_id: String,
#[serde(rename = "Steps")]
pub steps: Vec<StepConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddJobFlowStepsOutput {
#[serde(rename = "StepIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub step_ids: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddTagsInput {
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddTagsOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Application {
#[serde(rename = "AdditionalInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_info: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Args")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<String>>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AutoScalingPolicy {
#[serde(rename = "Constraints")]
pub constraints: ScalingConstraints,
#[serde(rename = "Rules")]
pub rules: Vec<ScalingRule>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AutoScalingPolicyDescription {
#[serde(rename = "Constraints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraints: Option<ScalingConstraints>,
#[serde(rename = "Rules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules: Option<Vec<ScalingRule>>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<AutoScalingPolicyStatus>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AutoScalingPolicyStateChangeReason {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AutoScalingPolicyStatus {
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "StateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_change_reason: Option<AutoScalingPolicyStateChangeReason>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct BootstrapActionConfig {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "ScriptBootstrapAction")]
pub script_bootstrap_action: ScriptBootstrapActionConfig,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BootstrapActionDetail {
#[serde(rename = "BootstrapActionConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bootstrap_action_config: Option<BootstrapActionConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CancelStepsInfo {
#[serde(rename = "Reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "StepId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub step_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CancelStepsInput {
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
#[serde(rename = "StepIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub step_ids: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CancelStepsOutput {
#[serde(rename = "CancelStepsInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cancel_steps_info_list: Option<Vec<CancelStepsInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CloudWatchAlarmDefinition {
#[serde(rename = "ComparisonOperator")]
pub comparison_operator: String,
#[serde(rename = "Dimensions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dimensions: Option<Vec<MetricDimension>>,
#[serde(rename = "EvaluationPeriods")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_periods: Option<i64>,
#[serde(rename = "MetricName")]
pub metric_name: String,
#[serde(rename = "Namespace")]
#[serde(skip_serializing_if = "Option::is_none")]
pub namespace: Option<String>,
#[serde(rename = "Period")]
pub period: i64,
#[serde(rename = "Statistic")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statistic: Option<String>,
#[serde(rename = "Threshold")]
pub threshold: f64,
#[serde(rename = "Unit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Cluster {
#[serde(rename = "Applications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub applications: Option<Vec<Application>>,
#[serde(rename = "AutoScalingRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_role: Option<String>,
#[serde(rename = "AutoTerminate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_terminate: Option<bool>,
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Vec<Configuration>>,
#[serde(rename = "CustomAmiId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_ami_id: Option<String>,
#[serde(rename = "EbsRootVolumeSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_root_volume_size: Option<i64>,
#[serde(rename = "Ec2InstanceAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_instance_attributes: Option<Ec2InstanceAttributes>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "InstanceCollectionType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_collection_type: Option<String>,
#[serde(rename = "KerberosAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kerberos_attributes: Option<KerberosAttributes>,
#[serde(rename = "LogUri")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_uri: Option<String>,
#[serde(rename = "MasterPublicDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_public_dns_name: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "NormalizedInstanceHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub normalized_instance_hours: Option<i64>,
#[serde(rename = "ReleaseLabel")]
#[serde(skip_serializing_if = "Option::is_none")]
pub release_label: Option<String>,
#[serde(rename = "RepoUpgradeOnBoot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repo_upgrade_on_boot: Option<String>,
#[serde(rename = "RequestedAmiVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requested_ami_version: Option<String>,
#[serde(rename = "RunningAmiVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub running_ami_version: Option<String>,
#[serde(rename = "ScaleDownBehavior")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scale_down_behavior: Option<String>,
#[serde(rename = "SecurityConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_configuration: Option<String>,
#[serde(rename = "ServiceRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_role: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<ClusterStatus>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "TerminationProtected")]
#[serde(skip_serializing_if = "Option::is_none")]
pub termination_protected: Option<bool>,
#[serde(rename = "VisibleToAllUsers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub visible_to_all_users: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ClusterStateChangeReason {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ClusterStatus {
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "StateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_change_reason: Option<ClusterStateChangeReason>,
#[serde(rename = "Timeline")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeline: Option<ClusterTimeline>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ClusterSummary {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "NormalizedInstanceHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub normalized_instance_hours: Option<i64>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<ClusterStatus>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ClusterTimeline {
#[serde(rename = "CreationDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date_time: Option<f64>,
#[serde(rename = "EndDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date_time: Option<f64>,
#[serde(rename = "ReadyDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ready_date_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Command {
#[serde(rename = "Args")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<String>>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ScriptPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub script_path: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Configuration {
#[serde(rename = "Classification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub classification: Option<String>,
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Vec<Configuration>>,
#[serde(rename = "Properties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub properties: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateSecurityConfigurationInput {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "SecurityConfiguration")]
pub security_configuration: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateSecurityConfigurationOutput {
#[serde(rename = "CreationDateTime")]
pub creation_date_time: f64,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteSecurityConfigurationInput {
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteSecurityConfigurationOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeClusterInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeClusterOutput {
#[serde(rename = "Cluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster: Option<Cluster>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeJobFlowsInput {
#[serde(rename = "CreatedAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_after: Option<f64>,
#[serde(rename = "CreatedBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_before: Option<f64>,
#[serde(rename = "JobFlowIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_flow_ids: Option<Vec<String>>,
#[serde(rename = "JobFlowStates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_flow_states: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeJobFlowsOutput {
#[serde(rename = "JobFlows")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_flows: Option<Vec<JobFlowDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeSecurityConfigurationInput {
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeSecurityConfigurationOutput {
#[serde(rename = "CreationDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date_time: Option<f64>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "SecurityConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_configuration: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeStepInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "StepId")]
pub step_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeStepOutput {
#[serde(rename = "Step")]
#[serde(skip_serializing_if = "Option::is_none")]
pub step: Option<Step>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EbsBlockDevice {
#[serde(rename = "Device")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device: Option<String>,
#[serde(rename = "VolumeSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_specification: Option<VolumeSpecification>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct EbsBlockDeviceConfig {
#[serde(rename = "VolumeSpecification")]
pub volume_specification: VolumeSpecification,
#[serde(rename = "VolumesPerInstance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volumes_per_instance: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct EbsConfiguration {
#[serde(rename = "EbsBlockDeviceConfigs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_block_device_configs: Option<Vec<EbsBlockDeviceConfig>>,
#[serde(rename = "EbsOptimized")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_optimized: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EbsVolume {
#[serde(rename = "Device")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device: Option<String>,
#[serde(rename = "VolumeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Ec2InstanceAttributes {
#[serde(rename = "AdditionalMasterSecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_master_security_groups: Option<Vec<String>>,
#[serde(rename = "AdditionalSlaveSecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_slave_security_groups: Option<Vec<String>>,
#[serde(rename = "Ec2AvailabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_availability_zone: Option<String>,
#[serde(rename = "Ec2KeyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_key_name: Option<String>,
#[serde(rename = "Ec2SubnetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_subnet_id: Option<String>,
#[serde(rename = "EmrManagedMasterSecurityGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub emr_managed_master_security_group: Option<String>,
#[serde(rename = "EmrManagedSlaveSecurityGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub emr_managed_slave_security_group: Option<String>,
#[serde(rename = "IamInstanceProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iam_instance_profile: Option<String>,
#[serde(rename = "RequestedEc2AvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requested_ec_2_availability_zones: Option<Vec<String>>,
#[serde(rename = "RequestedEc2SubnetIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requested_ec_2_subnet_ids: Option<Vec<String>>,
#[serde(rename = "ServiceAccessSecurityGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_access_security_group: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FailureDetails {
#[serde(rename = "LogFile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_file: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "Reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HadoopJarStepConfig {
#[serde(rename = "Args")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<String>>,
#[serde(rename = "Jar")]
pub jar: String,
#[serde(rename = "MainClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub main_class: Option<String>,
#[serde(rename = "Properties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub properties: Option<Vec<KeyValue>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HadoopStepConfig {
#[serde(rename = "Args")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<String>>,
#[serde(rename = "Jar")]
#[serde(skip_serializing_if = "Option::is_none")]
pub jar: Option<String>,
#[serde(rename = "MainClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub main_class: Option<String>,
#[serde(rename = "Properties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub properties: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Instance {
#[serde(rename = "EbsVolumes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_volumes: Option<Vec<EbsVolume>>,
#[serde(rename = "Ec2InstanceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_instance_id: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "InstanceFleetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_fleet_id: Option<String>,
#[serde(rename = "InstanceGroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_group_id: Option<String>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "Market")]
#[serde(skip_serializing_if = "Option::is_none")]
pub market: Option<String>,
#[serde(rename = "PrivateDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_dns_name: Option<String>,
#[serde(rename = "PrivateIpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_ip_address: Option<String>,
#[serde(rename = "PublicDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_dns_name: Option<String>,
#[serde(rename = "PublicIpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_ip_address: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<InstanceStatus>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceFleet {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "InstanceFleetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_fleet_type: Option<String>,
#[serde(rename = "InstanceTypeSpecifications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type_specifications: Option<Vec<InstanceTypeSpecification>>,
#[serde(rename = "LaunchSpecifications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub launch_specifications: Option<InstanceFleetProvisioningSpecifications>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ProvisionedOnDemandCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_on_demand_capacity: Option<i64>,
#[serde(rename = "ProvisionedSpotCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_spot_capacity: Option<i64>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<InstanceFleetStatus>,
#[serde(rename = "TargetOnDemandCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_on_demand_capacity: Option<i64>,
#[serde(rename = "TargetSpotCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_spot_capacity: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InstanceFleetConfig {
#[serde(rename = "InstanceFleetType")]
pub instance_fleet_type: String,
#[serde(rename = "InstanceTypeConfigs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type_configs: Option<Vec<InstanceTypeConfig>>,
#[serde(rename = "LaunchSpecifications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub launch_specifications: Option<InstanceFleetProvisioningSpecifications>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "TargetOnDemandCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_on_demand_capacity: Option<i64>,
#[serde(rename = "TargetSpotCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_spot_capacity: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InstanceFleetModifyConfig {
#[serde(rename = "InstanceFleetId")]
pub instance_fleet_id: String,
#[serde(rename = "TargetOnDemandCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_on_demand_capacity: Option<i64>,
#[serde(rename = "TargetSpotCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_spot_capacity: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct InstanceFleetProvisioningSpecifications {
#[serde(rename = "SpotSpecification")]
pub spot_specification: SpotProvisioningSpecification,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceFleetStateChangeReason {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceFleetStatus {
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "StateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_change_reason: Option<InstanceFleetStateChangeReason>,
#[serde(rename = "Timeline")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeline: Option<InstanceFleetTimeline>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceFleetTimeline {
#[serde(rename = "CreationDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date_time: Option<f64>,
#[serde(rename = "EndDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date_time: Option<f64>,
#[serde(rename = "ReadyDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ready_date_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceGroup {
#[serde(rename = "AutoScalingPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_policy: Option<AutoScalingPolicyDescription>,
#[serde(rename = "BidPrice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bid_price: Option<String>,
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Vec<Configuration>>,
#[serde(rename = "EbsBlockDevices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_block_devices: Option<Vec<EbsBlockDevice>>,
#[serde(rename = "EbsOptimized")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_optimized: Option<bool>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "InstanceGroupType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_group_type: Option<String>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "Market")]
#[serde(skip_serializing_if = "Option::is_none")]
pub market: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "RequestedInstanceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requested_instance_count: Option<i64>,
#[serde(rename = "RunningInstanceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub running_instance_count: Option<i64>,
#[serde(rename = "ShrinkPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shrink_policy: Option<ShrinkPolicy>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<InstanceGroupStatus>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InstanceGroupConfig {
#[serde(rename = "AutoScalingPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_policy: Option<AutoScalingPolicy>,
#[serde(rename = "BidPrice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bid_price: Option<String>,
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Vec<Configuration>>,
#[serde(rename = "EbsConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_configuration: Option<EbsConfiguration>,
#[serde(rename = "InstanceCount")]
pub instance_count: i64,
#[serde(rename = "InstanceRole")]
pub instance_role: String,
#[serde(rename = "InstanceType")]
pub instance_type: String,
#[serde(rename = "Market")]
#[serde(skip_serializing_if = "Option::is_none")]
pub market: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceGroupDetail {
#[serde(rename = "BidPrice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bid_price: Option<String>,
#[serde(rename = "CreationDateTime")]
pub creation_date_time: f64,
#[serde(rename = "EndDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date_time: Option<f64>,
#[serde(rename = "InstanceGroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_group_id: Option<String>,
#[serde(rename = "InstanceRequestCount")]
pub instance_request_count: i64,
#[serde(rename = "InstanceRole")]
pub instance_role: String,
#[serde(rename = "InstanceRunningCount")]
pub instance_running_count: i64,
#[serde(rename = "InstanceType")]
pub instance_type: String,
#[serde(rename = "LastStateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_state_change_reason: Option<String>,
#[serde(rename = "Market")]
pub market: String,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ReadyDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ready_date_time: Option<f64>,
#[serde(rename = "StartDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_date_time: Option<f64>,
#[serde(rename = "State")]
pub state: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InstanceGroupModifyConfig {
#[serde(rename = "EC2InstanceIdsToTerminate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec2_instance_ids_to_terminate: Option<Vec<String>>,
#[serde(rename = "InstanceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_count: Option<i64>,
#[serde(rename = "InstanceGroupId")]
pub instance_group_id: String,
#[serde(rename = "ShrinkPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shrink_policy: Option<ShrinkPolicy>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceGroupStateChangeReason {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceGroupStatus {
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "StateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_change_reason: Option<InstanceGroupStateChangeReason>,
#[serde(rename = "Timeline")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeline: Option<InstanceGroupTimeline>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceGroupTimeline {
#[serde(rename = "CreationDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date_time: Option<f64>,
#[serde(rename = "EndDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date_time: Option<f64>,
#[serde(rename = "ReadyDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ready_date_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct InstanceResizePolicy {
#[serde(rename = "InstanceTerminationTimeout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_termination_timeout: Option<i64>,
#[serde(rename = "InstancesToProtect")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instances_to_protect: Option<Vec<String>>,
#[serde(rename = "InstancesToTerminate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instances_to_terminate: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceStateChangeReason {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceStatus {
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "StateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_change_reason: Option<InstanceStateChangeReason>,
#[serde(rename = "Timeline")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeline: Option<InstanceTimeline>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceTimeline {
#[serde(rename = "CreationDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date_time: Option<f64>,
#[serde(rename = "EndDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date_time: Option<f64>,
#[serde(rename = "ReadyDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ready_date_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InstanceTypeConfig {
#[serde(rename = "BidPrice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bid_price: Option<String>,
#[serde(rename = "BidPriceAsPercentageOfOnDemandPrice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bid_price_as_percentage_of_on_demand_price: Option<f64>,
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Vec<Configuration>>,
#[serde(rename = "EbsConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_configuration: Option<EbsConfiguration>,
#[serde(rename = "InstanceType")]
pub instance_type: String,
#[serde(rename = "WeightedCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub weighted_capacity: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceTypeSpecification {
#[serde(rename = "BidPrice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bid_price: Option<String>,
#[serde(rename = "BidPriceAsPercentageOfOnDemandPrice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bid_price_as_percentage_of_on_demand_price: Option<f64>,
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Vec<Configuration>>,
#[serde(rename = "EbsBlockDevices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_block_devices: Option<Vec<EbsBlockDevice>>,
#[serde(rename = "EbsOptimized")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_optimized: Option<bool>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "WeightedCapacity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub weighted_capacity: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct JobFlowDetail {
#[serde(rename = "AmiVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ami_version: Option<String>,
#[serde(rename = "AutoScalingRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_role: Option<String>,
#[serde(rename = "BootstrapActions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bootstrap_actions: Option<Vec<BootstrapActionDetail>>,
#[serde(rename = "ExecutionStatusDetail")]
pub execution_status_detail: JobFlowExecutionStatusDetail,
#[serde(rename = "Instances")]
pub instances: JobFlowInstancesDetail,
#[serde(rename = "JobFlowId")]
pub job_flow_id: String,
#[serde(rename = "JobFlowRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_flow_role: Option<String>,
#[serde(rename = "LogUri")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_uri: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "ScaleDownBehavior")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scale_down_behavior: Option<String>,
#[serde(rename = "ServiceRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_role: Option<String>,
#[serde(rename = "Steps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub steps: Option<Vec<StepDetail>>,
#[serde(rename = "SupportedProducts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_products: Option<Vec<String>>,
#[serde(rename = "VisibleToAllUsers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub visible_to_all_users: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct JobFlowExecutionStatusDetail {
#[serde(rename = "CreationDateTime")]
pub creation_date_time: f64,
#[serde(rename = "EndDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date_time: Option<f64>,
#[serde(rename = "LastStateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_state_change_reason: Option<String>,
#[serde(rename = "ReadyDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ready_date_time: Option<f64>,
#[serde(rename = "StartDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_date_time: Option<f64>,
#[serde(rename = "State")]
pub state: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct JobFlowInstancesConfig {
#[serde(rename = "AdditionalMasterSecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_master_security_groups: Option<Vec<String>>,
#[serde(rename = "AdditionalSlaveSecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_slave_security_groups: Option<Vec<String>>,
#[serde(rename = "Ec2KeyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_key_name: Option<String>,
#[serde(rename = "Ec2SubnetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_subnet_id: Option<String>,
#[serde(rename = "Ec2SubnetIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_subnet_ids: Option<Vec<String>>,
#[serde(rename = "EmrManagedMasterSecurityGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub emr_managed_master_security_group: Option<String>,
#[serde(rename = "EmrManagedSlaveSecurityGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub emr_managed_slave_security_group: Option<String>,
#[serde(rename = "HadoopVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hadoop_version: Option<String>,
#[serde(rename = "InstanceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_count: Option<i64>,
#[serde(rename = "InstanceFleets")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_fleets: Option<Vec<InstanceFleetConfig>>,
#[serde(rename = "InstanceGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_groups: Option<Vec<InstanceGroupConfig>>,
#[serde(rename = "KeepJobFlowAliveWhenNoSteps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keep_job_flow_alive_when_no_steps: Option<bool>,
#[serde(rename = "MasterInstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_instance_type: Option<String>,
#[serde(rename = "Placement")]
#[serde(skip_serializing_if = "Option::is_none")]
pub placement: Option<PlacementType>,
#[serde(rename = "ServiceAccessSecurityGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_access_security_group: Option<String>,
#[serde(rename = "SlaveInstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub slave_instance_type: Option<String>,
#[serde(rename = "TerminationProtected")]
#[serde(skip_serializing_if = "Option::is_none")]
pub termination_protected: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct JobFlowInstancesDetail {
#[serde(rename = "Ec2KeyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_key_name: Option<String>,
#[serde(rename = "Ec2SubnetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_subnet_id: Option<String>,
#[serde(rename = "HadoopVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hadoop_version: Option<String>,
#[serde(rename = "InstanceCount")]
pub instance_count: i64,
#[serde(rename = "InstanceGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_groups: Option<Vec<InstanceGroupDetail>>,
#[serde(rename = "KeepJobFlowAliveWhenNoSteps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keep_job_flow_alive_when_no_steps: Option<bool>,
#[serde(rename = "MasterInstanceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_instance_id: Option<String>,
#[serde(rename = "MasterInstanceType")]
pub master_instance_type: String,
#[serde(rename = "MasterPublicDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_public_dns_name: Option<String>,
#[serde(rename = "NormalizedInstanceHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub normalized_instance_hours: Option<i64>,
#[serde(rename = "Placement")]
#[serde(skip_serializing_if = "Option::is_none")]
pub placement: Option<PlacementType>,
#[serde(rename = "SlaveInstanceType")]
pub slave_instance_type: String,
#[serde(rename = "TerminationProtected")]
#[serde(skip_serializing_if = "Option::is_none")]
pub termination_protected: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct KerberosAttributes {
#[serde(rename = "ADDomainJoinPassword")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ad_domain_join_password: Option<String>,
#[serde(rename = "ADDomainJoinUser")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ad_domain_join_user: Option<String>,
#[serde(rename = "CrossRealmTrustPrincipalPassword")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cross_realm_trust_principal_password: Option<String>,
#[serde(rename = "KdcAdminPassword")]
pub kdc_admin_password: String,
#[serde(rename = "Realm")]
pub realm: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct KeyValue {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListBootstrapActionsInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListBootstrapActionsOutput {
#[serde(rename = "BootstrapActions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bootstrap_actions: Option<Vec<Command>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListClustersInput {
#[serde(rename = "ClusterStates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_states: Option<Vec<String>>,
#[serde(rename = "CreatedAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_after: Option<f64>,
#[serde(rename = "CreatedBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_before: Option<f64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListClustersOutput {
#[serde(rename = "Clusters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub clusters: Option<Vec<ClusterSummary>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListInstanceFleetsInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListInstanceFleetsOutput {
#[serde(rename = "InstanceFleets")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_fleets: Option<Vec<InstanceFleet>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListInstanceGroupsInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListInstanceGroupsOutput {
#[serde(rename = "InstanceGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_groups: Option<Vec<InstanceGroup>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListInstancesInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "InstanceFleetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_fleet_id: Option<String>,
#[serde(rename = "InstanceFleetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_fleet_type: Option<String>,
#[serde(rename = "InstanceGroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_group_id: Option<String>,
#[serde(rename = "InstanceGroupTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_group_types: Option<Vec<String>>,
#[serde(rename = "InstanceStates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_states: Option<Vec<String>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListInstancesOutput {
#[serde(rename = "Instances")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instances: Option<Vec<Instance>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListSecurityConfigurationsInput {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListSecurityConfigurationsOutput {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "SecurityConfigurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_configurations: Option<Vec<SecurityConfigurationSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListStepsInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "StepIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub step_ids: Option<Vec<String>>,
#[serde(rename = "StepStates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub step_states: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListStepsOutput {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "Steps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub steps: Option<Vec<StepSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MetricDimension {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ModifyInstanceFleetInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "InstanceFleet")]
pub instance_fleet: InstanceFleetModifyConfig,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ModifyInstanceGroupsInput {
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
#[serde(rename = "InstanceGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_groups: Option<Vec<InstanceGroupModifyConfig>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PlacementType {
#[serde(rename = "AvailabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "AvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zones: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutAutoScalingPolicyInput {
#[serde(rename = "AutoScalingPolicy")]
pub auto_scaling_policy: AutoScalingPolicy,
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "InstanceGroupId")]
pub instance_group_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutAutoScalingPolicyOutput {
#[serde(rename = "AutoScalingPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_policy: Option<AutoScalingPolicyDescription>,
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
#[serde(rename = "InstanceGroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_group_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemoveAutoScalingPolicyInput {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "InstanceGroupId")]
pub instance_group_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RemoveAutoScalingPolicyOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemoveTagsInput {
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RemoveTagsOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RunJobFlowInput {
#[serde(rename = "AdditionalInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_info: Option<String>,
#[serde(rename = "AmiVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ami_version: Option<String>,
#[serde(rename = "Applications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub applications: Option<Vec<Application>>,
#[serde(rename = "AutoScalingRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_role: Option<String>,
#[serde(rename = "BootstrapActions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bootstrap_actions: Option<Vec<BootstrapActionConfig>>,
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Vec<Configuration>>,
#[serde(rename = "CustomAmiId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_ami_id: Option<String>,
#[serde(rename = "EbsRootVolumeSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_root_volume_size: Option<i64>,
#[serde(rename = "Instances")]
pub instances: JobFlowInstancesConfig,
#[serde(rename = "JobFlowRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_flow_role: Option<String>,
#[serde(rename = "KerberosAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kerberos_attributes: Option<KerberosAttributes>,
#[serde(rename = "LogUri")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_uri: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "NewSupportedProducts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub new_supported_products: Option<Vec<SupportedProductConfig>>,
#[serde(rename = "ReleaseLabel")]
#[serde(skip_serializing_if = "Option::is_none")]
pub release_label: Option<String>,
#[serde(rename = "RepoUpgradeOnBoot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repo_upgrade_on_boot: Option<String>,
#[serde(rename = "ScaleDownBehavior")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scale_down_behavior: Option<String>,
#[serde(rename = "SecurityConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_configuration: Option<String>,
#[serde(rename = "ServiceRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_role: Option<String>,
#[serde(rename = "Steps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub steps: Option<Vec<StepConfig>>,
#[serde(rename = "SupportedProducts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_products: Option<Vec<String>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "VisibleToAllUsers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub visible_to_all_users: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RunJobFlowOutput {
#[serde(rename = "JobFlowId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_flow_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ScalingAction {
#[serde(rename = "Market")]
#[serde(skip_serializing_if = "Option::is_none")]
pub market: Option<String>,
#[serde(rename = "SimpleScalingPolicyConfiguration")]
pub simple_scaling_policy_configuration: SimpleScalingPolicyConfiguration,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ScalingConstraints {
#[serde(rename = "MaxCapacity")]
pub max_capacity: i64,
#[serde(rename = "MinCapacity")]
pub min_capacity: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ScalingRule {
#[serde(rename = "Action")]
pub action: ScalingAction,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Trigger")]
pub trigger: ScalingTrigger,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ScalingTrigger {
#[serde(rename = "CloudWatchAlarmDefinition")]
pub cloud_watch_alarm_definition: CloudWatchAlarmDefinition,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ScriptBootstrapActionConfig {
#[serde(rename = "Args")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<String>>,
#[serde(rename = "Path")]
pub path: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SecurityConfigurationSummary {
#[serde(rename = "CreationDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date_time: Option<f64>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SetTerminationProtectionInput {
#[serde(rename = "JobFlowIds")]
pub job_flow_ids: Vec<String>,
#[serde(rename = "TerminationProtected")]
pub termination_protected: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SetVisibleToAllUsersInput {
#[serde(rename = "JobFlowIds")]
pub job_flow_ids: Vec<String>,
#[serde(rename = "VisibleToAllUsers")]
pub visible_to_all_users: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ShrinkPolicy {
#[serde(rename = "DecommissionTimeout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub decommission_timeout: Option<i64>,
#[serde(rename = "InstanceResizePolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_resize_policy: Option<InstanceResizePolicy>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimpleScalingPolicyConfiguration {
#[serde(rename = "AdjustmentType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub adjustment_type: Option<String>,
#[serde(rename = "CoolDown")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cool_down: Option<i64>,
#[serde(rename = "ScalingAdjustment")]
pub scaling_adjustment: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SpotProvisioningSpecification {
#[serde(rename = "BlockDurationMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub block_duration_minutes: Option<i64>,
#[serde(rename = "TimeoutAction")]
pub timeout_action: String,
#[serde(rename = "TimeoutDurationMinutes")]
pub timeout_duration_minutes: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Step {
#[serde(rename = "ActionOnFailure")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action_on_failure: Option<String>,
#[serde(rename = "Config")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config: Option<HadoopStepConfig>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<StepStatus>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct StepConfig {
#[serde(rename = "ActionOnFailure")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action_on_failure: Option<String>,
#[serde(rename = "HadoopJarStep")]
pub hadoop_jar_step: HadoopJarStepConfig,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StepDetail {
#[serde(rename = "ExecutionStatusDetail")]
pub execution_status_detail: StepExecutionStatusDetail,
#[serde(rename = "StepConfig")]
pub step_config: StepConfig,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StepExecutionStatusDetail {
#[serde(rename = "CreationDateTime")]
pub creation_date_time: f64,
#[serde(rename = "EndDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date_time: Option<f64>,
#[serde(rename = "LastStateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_state_change_reason: Option<String>,
#[serde(rename = "StartDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_date_time: Option<f64>,
#[serde(rename = "State")]
pub state: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StepStateChangeReason {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StepStatus {
#[serde(rename = "FailureDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_details: Option<FailureDetails>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "StateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_change_reason: Option<StepStateChangeReason>,
#[serde(rename = "Timeline")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeline: Option<StepTimeline>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StepSummary {
#[serde(rename = "ActionOnFailure")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action_on_failure: Option<String>,
#[serde(rename = "Config")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config: Option<HadoopStepConfig>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<StepStatus>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StepTimeline {
#[serde(rename = "CreationDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date_time: Option<f64>,
#[serde(rename = "EndDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date_time: Option<f64>,
#[serde(rename = "StartDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_date_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SupportedProductConfig {
#[serde(rename = "Args")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<String>>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TerminateJobFlowsInput {
#[serde(rename = "JobFlowIds")]
pub job_flow_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct VolumeSpecification {
#[serde(rename = "Iops")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iops: Option<i64>,
#[serde(rename = "SizeInGB")]
pub size_in_gb: i64,
#[serde(rename = "VolumeType")]
pub volume_type: String,
}
#[derive(Debug, PartialEq)]
pub enum AddInstanceFleetError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddInstanceFleetError {
pub fn from_response(res: BufferedHttpResponse) -> AddInstanceFleetError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return AddInstanceFleetError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return AddInstanceFleetError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return AddInstanceFleetError::Validation(error_message.to_string());
}
_ => {}
}
}
return AddInstanceFleetError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddInstanceFleetError {
fn from(err: serde_json::error::Error) -> AddInstanceFleetError {
AddInstanceFleetError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddInstanceFleetError {
fn from(err: CredentialsError) -> AddInstanceFleetError {
AddInstanceFleetError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddInstanceFleetError {
fn from(err: HttpDispatchError) -> AddInstanceFleetError {
AddInstanceFleetError::HttpDispatch(err)
}
}
impl From<io::Error> for AddInstanceFleetError {
fn from(err: io::Error) -> AddInstanceFleetError {
AddInstanceFleetError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddInstanceFleetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddInstanceFleetError {
fn description(&self) -> &str {
match *self {
AddInstanceFleetError::InternalServer(ref cause) => cause,
AddInstanceFleetError::InvalidRequest(ref cause) => cause,
AddInstanceFleetError::Validation(ref cause) => cause,
AddInstanceFleetError::Credentials(ref err) => err.description(),
AddInstanceFleetError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AddInstanceFleetError::ParseError(ref cause) => cause,
AddInstanceFleetError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddInstanceGroupsError {
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddInstanceGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> AddInstanceGroupsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return AddInstanceGroupsError::InternalServerError(String::from(error_message));
}
"ValidationException" => {
return AddInstanceGroupsError::Validation(error_message.to_string());
}
_ => {}
}
}
return AddInstanceGroupsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddInstanceGroupsError {
fn from(err: serde_json::error::Error) -> AddInstanceGroupsError {
AddInstanceGroupsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddInstanceGroupsError {
fn from(err: CredentialsError) -> AddInstanceGroupsError {
AddInstanceGroupsError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddInstanceGroupsError {
fn from(err: HttpDispatchError) -> AddInstanceGroupsError {
AddInstanceGroupsError::HttpDispatch(err)
}
}
impl From<io::Error> for AddInstanceGroupsError {
fn from(err: io::Error) -> AddInstanceGroupsError {
AddInstanceGroupsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddInstanceGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddInstanceGroupsError {
fn description(&self) -> &str {
match *self {
AddInstanceGroupsError::InternalServerError(ref cause) => cause,
AddInstanceGroupsError::Validation(ref cause) => cause,
AddInstanceGroupsError::Credentials(ref err) => err.description(),
AddInstanceGroupsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AddInstanceGroupsError::ParseError(ref cause) => cause,
AddInstanceGroupsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddJobFlowStepsError {
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddJobFlowStepsError {
pub fn from_response(res: BufferedHttpResponse) -> AddJobFlowStepsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return AddJobFlowStepsError::InternalServerError(String::from(error_message));
}
"ValidationException" => {
return AddJobFlowStepsError::Validation(error_message.to_string());
}
_ => {}
}
}
return AddJobFlowStepsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddJobFlowStepsError {
fn from(err: serde_json::error::Error) -> AddJobFlowStepsError {
AddJobFlowStepsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddJobFlowStepsError {
fn from(err: CredentialsError) -> AddJobFlowStepsError {
AddJobFlowStepsError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddJobFlowStepsError {
fn from(err: HttpDispatchError) -> AddJobFlowStepsError {
AddJobFlowStepsError::HttpDispatch(err)
}
}
impl From<io::Error> for AddJobFlowStepsError {
fn from(err: io::Error) -> AddJobFlowStepsError {
AddJobFlowStepsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddJobFlowStepsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddJobFlowStepsError {
fn description(&self) -> &str {
match *self {
AddJobFlowStepsError::InternalServerError(ref cause) => cause,
AddJobFlowStepsError::Validation(ref cause) => cause,
AddJobFlowStepsError::Credentials(ref err) => err.description(),
AddJobFlowStepsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AddJobFlowStepsError::ParseError(ref cause) => cause,
AddJobFlowStepsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddTagsError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddTagsError {
pub fn from_response(res: BufferedHttpResponse) -> AddTagsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return AddTagsError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return AddTagsError::InvalidRequest(String::from(error_message));
}
"ValidationException" => return AddTagsError::Validation(error_message.to_string()),
_ => {}
}
}
return AddTagsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddTagsError {
fn from(err: serde_json::error::Error) -> AddTagsError {
AddTagsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddTagsError {
fn from(err: CredentialsError) -> AddTagsError {
AddTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddTagsError {
fn from(err: HttpDispatchError) -> AddTagsError {
AddTagsError::HttpDispatch(err)
}
}
impl From<io::Error> for AddTagsError {
fn from(err: io::Error) -> AddTagsError {
AddTagsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddTagsError {
fn description(&self) -> &str {
match *self {
AddTagsError::InternalServer(ref cause) => cause,
AddTagsError::InvalidRequest(ref cause) => cause,
AddTagsError::Validation(ref cause) => cause,
AddTagsError::Credentials(ref err) => err.description(),
AddTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AddTagsError::ParseError(ref cause) => cause,
AddTagsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CancelStepsError {
InternalServerError(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CancelStepsError {
pub fn from_response(res: BufferedHttpResponse) -> CancelStepsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return CancelStepsError::InternalServerError(String::from(error_message));
}
"InvalidRequestException" => {
return CancelStepsError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return CancelStepsError::Validation(error_message.to_string());
}
_ => {}
}
}
return CancelStepsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CancelStepsError {
fn from(err: serde_json::error::Error) -> CancelStepsError {
CancelStepsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CancelStepsError {
fn from(err: CredentialsError) -> CancelStepsError {
CancelStepsError::Credentials(err)
}
}
impl From<HttpDispatchError> for CancelStepsError {
fn from(err: HttpDispatchError) -> CancelStepsError {
CancelStepsError::HttpDispatch(err)
}
}
impl From<io::Error> for CancelStepsError {
fn from(err: io::Error) -> CancelStepsError {
CancelStepsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CancelStepsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CancelStepsError {
fn description(&self) -> &str {
match *self {
CancelStepsError::InternalServerError(ref cause) => cause,
CancelStepsError::InvalidRequest(ref cause) => cause,
CancelStepsError::Validation(ref cause) => cause,
CancelStepsError::Credentials(ref err) => err.description(),
CancelStepsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CancelStepsError::ParseError(ref cause) => cause,
CancelStepsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateSecurityConfigurationError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateSecurityConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> CreateSecurityConfigurationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return CreateSecurityConfigurationError::InternalServer(String::from(
error_message,
));
}
"InvalidRequestException" => {
return CreateSecurityConfigurationError::InvalidRequest(String::from(
error_message,
));
}
"ValidationException" => {
return CreateSecurityConfigurationError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateSecurityConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateSecurityConfigurationError {
fn from(err: serde_json::error::Error) -> CreateSecurityConfigurationError {
CreateSecurityConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateSecurityConfigurationError {
fn from(err: CredentialsError) -> CreateSecurityConfigurationError {
CreateSecurityConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateSecurityConfigurationError {
fn from(err: HttpDispatchError) -> CreateSecurityConfigurationError {
CreateSecurityConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateSecurityConfigurationError {
fn from(err: io::Error) -> CreateSecurityConfigurationError {
CreateSecurityConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateSecurityConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateSecurityConfigurationError {
fn description(&self) -> &str {
match *self {
CreateSecurityConfigurationError::InternalServer(ref cause) => cause,
CreateSecurityConfigurationError::InvalidRequest(ref cause) => cause,
CreateSecurityConfigurationError::Validation(ref cause) => cause,
CreateSecurityConfigurationError::Credentials(ref err) => err.description(),
CreateSecurityConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateSecurityConfigurationError::ParseError(ref cause) => cause,
CreateSecurityConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteSecurityConfigurationError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteSecurityConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteSecurityConfigurationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return DeleteSecurityConfigurationError::InternalServer(String::from(
error_message,
));
}
"InvalidRequestException" => {
return DeleteSecurityConfigurationError::InvalidRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteSecurityConfigurationError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteSecurityConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteSecurityConfigurationError {
fn from(err: serde_json::error::Error) -> DeleteSecurityConfigurationError {
DeleteSecurityConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteSecurityConfigurationError {
fn from(err: CredentialsError) -> DeleteSecurityConfigurationError {
DeleteSecurityConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteSecurityConfigurationError {
fn from(err: HttpDispatchError) -> DeleteSecurityConfigurationError {
DeleteSecurityConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteSecurityConfigurationError {
fn from(err: io::Error) -> DeleteSecurityConfigurationError {
DeleteSecurityConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteSecurityConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteSecurityConfigurationError {
fn description(&self) -> &str {
match *self {
DeleteSecurityConfigurationError::InternalServer(ref cause) => cause,
DeleteSecurityConfigurationError::InvalidRequest(ref cause) => cause,
DeleteSecurityConfigurationError::Validation(ref cause) => cause,
DeleteSecurityConfigurationError::Credentials(ref err) => err.description(),
DeleteSecurityConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteSecurityConfigurationError::ParseError(ref cause) => cause,
DeleteSecurityConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeClusterError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeClusterError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeClusterError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return DescribeClusterError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return DescribeClusterError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return DescribeClusterError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeClusterError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeClusterError {
fn from(err: serde_json::error::Error) -> DescribeClusterError {
DescribeClusterError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeClusterError {
fn from(err: CredentialsError) -> DescribeClusterError {
DescribeClusterError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeClusterError {
fn from(err: HttpDispatchError) -> DescribeClusterError {
DescribeClusterError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeClusterError {
fn from(err: io::Error) -> DescribeClusterError {
DescribeClusterError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeClusterError {
fn description(&self) -> &str {
match *self {
DescribeClusterError::InternalServer(ref cause) => cause,
DescribeClusterError::InvalidRequest(ref cause) => cause,
DescribeClusterError::Validation(ref cause) => cause,
DescribeClusterError::Credentials(ref err) => err.description(),
DescribeClusterError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeClusterError::ParseError(ref cause) => cause,
DescribeClusterError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeJobFlowsError {
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeJobFlowsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeJobFlowsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return DescribeJobFlowsError::InternalServerError(String::from(error_message));
}
"ValidationException" => {
return DescribeJobFlowsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeJobFlowsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeJobFlowsError {
fn from(err: serde_json::error::Error) -> DescribeJobFlowsError {
DescribeJobFlowsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeJobFlowsError {
fn from(err: CredentialsError) -> DescribeJobFlowsError {
DescribeJobFlowsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeJobFlowsError {
fn from(err: HttpDispatchError) -> DescribeJobFlowsError {
DescribeJobFlowsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeJobFlowsError {
fn from(err: io::Error) -> DescribeJobFlowsError {
DescribeJobFlowsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeJobFlowsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeJobFlowsError {
fn description(&self) -> &str {
match *self {
DescribeJobFlowsError::InternalServerError(ref cause) => cause,
DescribeJobFlowsError::Validation(ref cause) => cause,
DescribeJobFlowsError::Credentials(ref err) => err.description(),
DescribeJobFlowsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeJobFlowsError::ParseError(ref cause) => cause,
DescribeJobFlowsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSecurityConfigurationError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeSecurityConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeSecurityConfigurationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return DescribeSecurityConfigurationError::InternalServer(String::from(
error_message,
));
}
"InvalidRequestException" => {
return DescribeSecurityConfigurationError::InvalidRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeSecurityConfigurationError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeSecurityConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeSecurityConfigurationError {
fn from(err: serde_json::error::Error) -> DescribeSecurityConfigurationError {
DescribeSecurityConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeSecurityConfigurationError {
fn from(err: CredentialsError) -> DescribeSecurityConfigurationError {
DescribeSecurityConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeSecurityConfigurationError {
fn from(err: HttpDispatchError) -> DescribeSecurityConfigurationError {
DescribeSecurityConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeSecurityConfigurationError {
fn from(err: io::Error) -> DescribeSecurityConfigurationError {
DescribeSecurityConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeSecurityConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSecurityConfigurationError {
fn description(&self) -> &str {
match *self {
DescribeSecurityConfigurationError::InternalServer(ref cause) => cause,
DescribeSecurityConfigurationError::InvalidRequest(ref cause) => cause,
DescribeSecurityConfigurationError::Validation(ref cause) => cause,
DescribeSecurityConfigurationError::Credentials(ref err) => err.description(),
DescribeSecurityConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeSecurityConfigurationError::ParseError(ref cause) => cause,
DescribeSecurityConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeStepError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeStepError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeStepError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return DescribeStepError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return DescribeStepError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return DescribeStepError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeStepError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeStepError {
fn from(err: serde_json::error::Error) -> DescribeStepError {
DescribeStepError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeStepError {
fn from(err: CredentialsError) -> DescribeStepError {
DescribeStepError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeStepError {
fn from(err: HttpDispatchError) -> DescribeStepError {
DescribeStepError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeStepError {
fn from(err: io::Error) -> DescribeStepError {
DescribeStepError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeStepError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeStepError {
fn description(&self) -> &str {
match *self {
DescribeStepError::InternalServer(ref cause) => cause,
DescribeStepError::InvalidRequest(ref cause) => cause,
DescribeStepError::Validation(ref cause) => cause,
DescribeStepError::Credentials(ref err) => err.description(),
DescribeStepError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeStepError::ParseError(ref cause) => cause,
DescribeStepError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListBootstrapActionsError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListBootstrapActionsError {
pub fn from_response(res: BufferedHttpResponse) -> ListBootstrapActionsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return ListBootstrapActionsError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return ListBootstrapActionsError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return ListBootstrapActionsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListBootstrapActionsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListBootstrapActionsError {
fn from(err: serde_json::error::Error) -> ListBootstrapActionsError {
ListBootstrapActionsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListBootstrapActionsError {
fn from(err: CredentialsError) -> ListBootstrapActionsError {
ListBootstrapActionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListBootstrapActionsError {
fn from(err: HttpDispatchError) -> ListBootstrapActionsError {
ListBootstrapActionsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListBootstrapActionsError {
fn from(err: io::Error) -> ListBootstrapActionsError {
ListBootstrapActionsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListBootstrapActionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListBootstrapActionsError {
fn description(&self) -> &str {
match *self {
ListBootstrapActionsError::InternalServer(ref cause) => cause,
ListBootstrapActionsError::InvalidRequest(ref cause) => cause,
ListBootstrapActionsError::Validation(ref cause) => cause,
ListBootstrapActionsError::Credentials(ref err) => err.description(),
ListBootstrapActionsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListBootstrapActionsError::ParseError(ref cause) => cause,
ListBootstrapActionsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListClustersError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListClustersError {
pub fn from_response(res: BufferedHttpResponse) -> ListClustersError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return ListClustersError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return ListClustersError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return ListClustersError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListClustersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListClustersError {
fn from(err: serde_json::error::Error) -> ListClustersError {
ListClustersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListClustersError {
fn from(err: CredentialsError) -> ListClustersError {
ListClustersError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListClustersError {
fn from(err: HttpDispatchError) -> ListClustersError {
ListClustersError::HttpDispatch(err)
}
}
impl From<io::Error> for ListClustersError {
fn from(err: io::Error) -> ListClustersError {
ListClustersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListClustersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListClustersError {
fn description(&self) -> &str {
match *self {
ListClustersError::InternalServer(ref cause) => cause,
ListClustersError::InvalidRequest(ref cause) => cause,
ListClustersError::Validation(ref cause) => cause,
ListClustersError::Credentials(ref err) => err.description(),
ListClustersError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListClustersError::ParseError(ref cause) => cause,
ListClustersError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListInstanceFleetsError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListInstanceFleetsError {
pub fn from_response(res: BufferedHttpResponse) -> ListInstanceFleetsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return ListInstanceFleetsError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return ListInstanceFleetsError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return ListInstanceFleetsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListInstanceFleetsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListInstanceFleetsError {
fn from(err: serde_json::error::Error) -> ListInstanceFleetsError {
ListInstanceFleetsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListInstanceFleetsError {
fn from(err: CredentialsError) -> ListInstanceFleetsError {
ListInstanceFleetsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListInstanceFleetsError {
fn from(err: HttpDispatchError) -> ListInstanceFleetsError {
ListInstanceFleetsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListInstanceFleetsError {
fn from(err: io::Error) -> ListInstanceFleetsError {
ListInstanceFleetsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListInstanceFleetsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListInstanceFleetsError {
fn description(&self) -> &str {
match *self {
ListInstanceFleetsError::InternalServer(ref cause) => cause,
ListInstanceFleetsError::InvalidRequest(ref cause) => cause,
ListInstanceFleetsError::Validation(ref cause) => cause,
ListInstanceFleetsError::Credentials(ref err) => err.description(),
ListInstanceFleetsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListInstanceFleetsError::ParseError(ref cause) => cause,
ListInstanceFleetsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListInstanceGroupsError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListInstanceGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> ListInstanceGroupsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return ListInstanceGroupsError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return ListInstanceGroupsError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return ListInstanceGroupsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListInstanceGroupsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListInstanceGroupsError {
fn from(err: serde_json::error::Error) -> ListInstanceGroupsError {
ListInstanceGroupsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListInstanceGroupsError {
fn from(err: CredentialsError) -> ListInstanceGroupsError {
ListInstanceGroupsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListInstanceGroupsError {
fn from(err: HttpDispatchError) -> ListInstanceGroupsError {
ListInstanceGroupsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListInstanceGroupsError {
fn from(err: io::Error) -> ListInstanceGroupsError {
ListInstanceGroupsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListInstanceGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListInstanceGroupsError {
fn description(&self) -> &str {
match *self {
ListInstanceGroupsError::InternalServer(ref cause) => cause,
ListInstanceGroupsError::InvalidRequest(ref cause) => cause,
ListInstanceGroupsError::Validation(ref cause) => cause,
ListInstanceGroupsError::Credentials(ref err) => err.description(),
ListInstanceGroupsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListInstanceGroupsError::ParseError(ref cause) => cause,
ListInstanceGroupsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListInstancesError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListInstancesError {
pub fn from_response(res: BufferedHttpResponse) -> ListInstancesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return ListInstancesError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return ListInstancesError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return ListInstancesError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListInstancesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListInstancesError {
fn from(err: serde_json::error::Error) -> ListInstancesError {
ListInstancesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListInstancesError {
fn from(err: CredentialsError) -> ListInstancesError {
ListInstancesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListInstancesError {
fn from(err: HttpDispatchError) -> ListInstancesError {
ListInstancesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListInstancesError {
fn from(err: io::Error) -> ListInstancesError {
ListInstancesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListInstancesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListInstancesError {
fn description(&self) -> &str {
match *self {
ListInstancesError::InternalServer(ref cause) => cause,
ListInstancesError::InvalidRequest(ref cause) => cause,
ListInstancesError::Validation(ref cause) => cause,
ListInstancesError::Credentials(ref err) => err.description(),
ListInstancesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListInstancesError::ParseError(ref cause) => cause,
ListInstancesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListSecurityConfigurationsError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListSecurityConfigurationsError {
pub fn from_response(res: BufferedHttpResponse) -> ListSecurityConfigurationsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return ListSecurityConfigurationsError::InternalServer(String::from(
error_message,
));
}
"InvalidRequestException" => {
return ListSecurityConfigurationsError::InvalidRequest(String::from(
error_message,
));
}
"ValidationException" => {
return ListSecurityConfigurationsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListSecurityConfigurationsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListSecurityConfigurationsError {
fn from(err: serde_json::error::Error) -> ListSecurityConfigurationsError {
ListSecurityConfigurationsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListSecurityConfigurationsError {
fn from(err: CredentialsError) -> ListSecurityConfigurationsError {
ListSecurityConfigurationsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListSecurityConfigurationsError {
fn from(err: HttpDispatchError) -> ListSecurityConfigurationsError {
ListSecurityConfigurationsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListSecurityConfigurationsError {
fn from(err: io::Error) -> ListSecurityConfigurationsError {
ListSecurityConfigurationsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListSecurityConfigurationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListSecurityConfigurationsError {
fn description(&self) -> &str {
match *self {
ListSecurityConfigurationsError::InternalServer(ref cause) => cause,
ListSecurityConfigurationsError::InvalidRequest(ref cause) => cause,
ListSecurityConfigurationsError::Validation(ref cause) => cause,
ListSecurityConfigurationsError::Credentials(ref err) => err.description(),
ListSecurityConfigurationsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListSecurityConfigurationsError::ParseError(ref cause) => cause,
ListSecurityConfigurationsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListStepsError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListStepsError {
pub fn from_response(res: BufferedHttpResponse) -> ListStepsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return ListStepsError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return ListStepsError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return ListStepsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListStepsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListStepsError {
fn from(err: serde_json::error::Error) -> ListStepsError {
ListStepsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListStepsError {
fn from(err: CredentialsError) -> ListStepsError {
ListStepsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListStepsError {
fn from(err: HttpDispatchError) -> ListStepsError {
ListStepsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListStepsError {
fn from(err: io::Error) -> ListStepsError {
ListStepsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListStepsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListStepsError {
fn description(&self) -> &str {
match *self {
ListStepsError::InternalServer(ref cause) => cause,
ListStepsError::InvalidRequest(ref cause) => cause,
ListStepsError::Validation(ref cause) => cause,
ListStepsError::Credentials(ref err) => err.description(),
ListStepsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListStepsError::ParseError(ref cause) => cause,
ListStepsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ModifyInstanceFleetError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ModifyInstanceFleetError {
pub fn from_response(res: BufferedHttpResponse) -> ModifyInstanceFleetError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return ModifyInstanceFleetError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return ModifyInstanceFleetError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return ModifyInstanceFleetError::Validation(error_message.to_string());
}
_ => {}
}
}
return ModifyInstanceFleetError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ModifyInstanceFleetError {
fn from(err: serde_json::error::Error) -> ModifyInstanceFleetError {
ModifyInstanceFleetError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ModifyInstanceFleetError {
fn from(err: CredentialsError) -> ModifyInstanceFleetError {
ModifyInstanceFleetError::Credentials(err)
}
}
impl From<HttpDispatchError> for ModifyInstanceFleetError {
fn from(err: HttpDispatchError) -> ModifyInstanceFleetError {
ModifyInstanceFleetError::HttpDispatch(err)
}
}
impl From<io::Error> for ModifyInstanceFleetError {
fn from(err: io::Error) -> ModifyInstanceFleetError {
ModifyInstanceFleetError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ModifyInstanceFleetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ModifyInstanceFleetError {
fn description(&self) -> &str {
match *self {
ModifyInstanceFleetError::InternalServer(ref cause) => cause,
ModifyInstanceFleetError::InvalidRequest(ref cause) => cause,
ModifyInstanceFleetError::Validation(ref cause) => cause,
ModifyInstanceFleetError::Credentials(ref err) => err.description(),
ModifyInstanceFleetError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ModifyInstanceFleetError::ParseError(ref cause) => cause,
ModifyInstanceFleetError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ModifyInstanceGroupsError {
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ModifyInstanceGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> ModifyInstanceGroupsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return ModifyInstanceGroupsError::InternalServerError(String::from(
error_message,
));
}
"ValidationException" => {
return ModifyInstanceGroupsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ModifyInstanceGroupsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ModifyInstanceGroupsError {
fn from(err: serde_json::error::Error) -> ModifyInstanceGroupsError {
ModifyInstanceGroupsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ModifyInstanceGroupsError {
fn from(err: CredentialsError) -> ModifyInstanceGroupsError {
ModifyInstanceGroupsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ModifyInstanceGroupsError {
fn from(err: HttpDispatchError) -> ModifyInstanceGroupsError {
ModifyInstanceGroupsError::HttpDispatch(err)
}
}
impl From<io::Error> for ModifyInstanceGroupsError {
fn from(err: io::Error) -> ModifyInstanceGroupsError {
ModifyInstanceGroupsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ModifyInstanceGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ModifyInstanceGroupsError {
fn description(&self) -> &str {
match *self {
ModifyInstanceGroupsError::InternalServerError(ref cause) => cause,
ModifyInstanceGroupsError::Validation(ref cause) => cause,
ModifyInstanceGroupsError::Credentials(ref err) => err.description(),
ModifyInstanceGroupsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ModifyInstanceGroupsError::ParseError(ref cause) => cause,
ModifyInstanceGroupsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutAutoScalingPolicyError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutAutoScalingPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> PutAutoScalingPolicyError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return PutAutoScalingPolicyError::Validation(error_message.to_string());
}
_ => {}
}
}
return PutAutoScalingPolicyError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutAutoScalingPolicyError {
fn from(err: serde_json::error::Error) -> PutAutoScalingPolicyError {
PutAutoScalingPolicyError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutAutoScalingPolicyError {
fn from(err: CredentialsError) -> PutAutoScalingPolicyError {
PutAutoScalingPolicyError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutAutoScalingPolicyError {
fn from(err: HttpDispatchError) -> PutAutoScalingPolicyError {
PutAutoScalingPolicyError::HttpDispatch(err)
}
}
impl From<io::Error> for PutAutoScalingPolicyError {
fn from(err: io::Error) -> PutAutoScalingPolicyError {
PutAutoScalingPolicyError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutAutoScalingPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutAutoScalingPolicyError {
fn description(&self) -> &str {
match *self {
PutAutoScalingPolicyError::Validation(ref cause) => cause,
PutAutoScalingPolicyError::Credentials(ref err) => err.description(),
PutAutoScalingPolicyError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
PutAutoScalingPolicyError::ParseError(ref cause) => cause,
PutAutoScalingPolicyError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveAutoScalingPolicyError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RemoveAutoScalingPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RemoveAutoScalingPolicyError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return RemoveAutoScalingPolicyError::Validation(error_message.to_string());
}
_ => {}
}
}
return RemoveAutoScalingPolicyError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RemoveAutoScalingPolicyError {
fn from(err: serde_json::error::Error) -> RemoveAutoScalingPolicyError {
RemoveAutoScalingPolicyError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RemoveAutoScalingPolicyError {
fn from(err: CredentialsError) -> RemoveAutoScalingPolicyError {
RemoveAutoScalingPolicyError::Credentials(err)
}
}
impl From<HttpDispatchError> for RemoveAutoScalingPolicyError {
fn from(err: HttpDispatchError) -> RemoveAutoScalingPolicyError {
RemoveAutoScalingPolicyError::HttpDispatch(err)
}
}
impl From<io::Error> for RemoveAutoScalingPolicyError {
fn from(err: io::Error) -> RemoveAutoScalingPolicyError {
RemoveAutoScalingPolicyError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RemoveAutoScalingPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveAutoScalingPolicyError {
fn description(&self) -> &str {
match *self {
RemoveAutoScalingPolicyError::Validation(ref cause) => cause,
RemoveAutoScalingPolicyError::Credentials(ref err) => err.description(),
RemoveAutoScalingPolicyError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
RemoveAutoScalingPolicyError::ParseError(ref cause) => cause,
RemoveAutoScalingPolicyError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveTagsError {
InternalServer(String),
InvalidRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RemoveTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RemoveTagsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerException" => {
return RemoveTagsError::InternalServer(String::from(error_message));
}
"InvalidRequestException" => {
return RemoveTagsError::InvalidRequest(String::from(error_message));
}
"ValidationException" => {
return RemoveTagsError::Validation(error_message.to_string());
}
_ => {}
}
}
return RemoveTagsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RemoveTagsError {
fn from(err: serde_json::error::Error) -> RemoveTagsError {
RemoveTagsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RemoveTagsError {
fn from(err: CredentialsError) -> RemoveTagsError {
RemoveTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for RemoveTagsError {
fn from(err: HttpDispatchError) -> RemoveTagsError {
RemoveTagsError::HttpDispatch(err)
}
}
impl From<io::Error> for RemoveTagsError {
fn from(err: io::Error) -> RemoveTagsError {
RemoveTagsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RemoveTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveTagsError {
fn description(&self) -> &str {
match *self {
RemoveTagsError::InternalServer(ref cause) => cause,
RemoveTagsError::InvalidRequest(ref cause) => cause,
RemoveTagsError::Validation(ref cause) => cause,
RemoveTagsError::Credentials(ref err) => err.description(),
RemoveTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
RemoveTagsError::ParseError(ref cause) => cause,
RemoveTagsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RunJobFlowError {
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RunJobFlowError {
pub fn from_response(res: BufferedHttpResponse) -> RunJobFlowError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return RunJobFlowError::InternalServerError(String::from(error_message));
}
"ValidationException" => {
return RunJobFlowError::Validation(error_message.to_string());
}
_ => {}
}
}
return RunJobFlowError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RunJobFlowError {
fn from(err: serde_json::error::Error) -> RunJobFlowError {
RunJobFlowError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RunJobFlowError {
fn from(err: CredentialsError) -> RunJobFlowError {
RunJobFlowError::Credentials(err)
}
}
impl From<HttpDispatchError> for RunJobFlowError {
fn from(err: HttpDispatchError) -> RunJobFlowError {
RunJobFlowError::HttpDispatch(err)
}
}
impl From<io::Error> for RunJobFlowError {
fn from(err: io::Error) -> RunJobFlowError {
RunJobFlowError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RunJobFlowError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RunJobFlowError {
fn description(&self) -> &str {
match *self {
RunJobFlowError::InternalServerError(ref cause) => cause,
RunJobFlowError::Validation(ref cause) => cause,
RunJobFlowError::Credentials(ref err) => err.description(),
RunJobFlowError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
RunJobFlowError::ParseError(ref cause) => cause,
RunJobFlowError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetTerminationProtectionError {
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl SetTerminationProtectionError {
pub fn from_response(res: BufferedHttpResponse) -> SetTerminationProtectionError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return SetTerminationProtectionError::InternalServerError(String::from(
error_message,
));
}
"ValidationException" => {
return SetTerminationProtectionError::Validation(error_message.to_string());
}
_ => {}
}
}
return SetTerminationProtectionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for SetTerminationProtectionError {
fn from(err: serde_json::error::Error) -> SetTerminationProtectionError {
SetTerminationProtectionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for SetTerminationProtectionError {
fn from(err: CredentialsError) -> SetTerminationProtectionError {
SetTerminationProtectionError::Credentials(err)
}
}
impl From<HttpDispatchError> for SetTerminationProtectionError {
fn from(err: HttpDispatchError) -> SetTerminationProtectionError {
SetTerminationProtectionError::HttpDispatch(err)
}
}
impl From<io::Error> for SetTerminationProtectionError {
fn from(err: io::Error) -> SetTerminationProtectionError {
SetTerminationProtectionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for SetTerminationProtectionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetTerminationProtectionError {
fn description(&self) -> &str {
match *self {
SetTerminationProtectionError::InternalServerError(ref cause) => cause,
SetTerminationProtectionError::Validation(ref cause) => cause,
SetTerminationProtectionError::Credentials(ref err) => err.description(),
SetTerminationProtectionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
SetTerminationProtectionError::ParseError(ref cause) => cause,
SetTerminationProtectionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetVisibleToAllUsersError {
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl SetVisibleToAllUsersError {
pub fn from_response(res: BufferedHttpResponse) -> SetVisibleToAllUsersError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return SetVisibleToAllUsersError::InternalServerError(String::from(
error_message,
));
}
"ValidationException" => {
return SetVisibleToAllUsersError::Validation(error_message.to_string());
}
_ => {}
}
}
return SetVisibleToAllUsersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for SetVisibleToAllUsersError {
fn from(err: serde_json::error::Error) -> SetVisibleToAllUsersError {
SetVisibleToAllUsersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for SetVisibleToAllUsersError {
fn from(err: CredentialsError) -> SetVisibleToAllUsersError {
SetVisibleToAllUsersError::Credentials(err)
}
}
impl From<HttpDispatchError> for SetVisibleToAllUsersError {
fn from(err: HttpDispatchError) -> SetVisibleToAllUsersError {
SetVisibleToAllUsersError::HttpDispatch(err)
}
}
impl From<io::Error> for SetVisibleToAllUsersError {
fn from(err: io::Error) -> SetVisibleToAllUsersError {
SetVisibleToAllUsersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for SetVisibleToAllUsersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetVisibleToAllUsersError {
fn description(&self) -> &str {
match *self {
SetVisibleToAllUsersError::InternalServerError(ref cause) => cause,
SetVisibleToAllUsersError::Validation(ref cause) => cause,
SetVisibleToAllUsersError::Credentials(ref err) => err.description(),
SetVisibleToAllUsersError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
SetVisibleToAllUsersError::ParseError(ref cause) => cause,
SetVisibleToAllUsersError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum TerminateJobFlowsError {
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl TerminateJobFlowsError {
pub fn from_response(res: BufferedHttpResponse) -> TerminateJobFlowsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InternalServerError" => {
return TerminateJobFlowsError::InternalServerError(String::from(error_message));
}
"ValidationException" => {
return TerminateJobFlowsError::Validation(error_message.to_string());
}
_ => {}
}
}
return TerminateJobFlowsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for TerminateJobFlowsError {
fn from(err: serde_json::error::Error) -> TerminateJobFlowsError {
TerminateJobFlowsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for TerminateJobFlowsError {
fn from(err: CredentialsError) -> TerminateJobFlowsError {
TerminateJobFlowsError::Credentials(err)
}
}
impl From<HttpDispatchError> for TerminateJobFlowsError {
fn from(err: HttpDispatchError) -> TerminateJobFlowsError {
TerminateJobFlowsError::HttpDispatch(err)
}
}
impl From<io::Error> for TerminateJobFlowsError {
fn from(err: io::Error) -> TerminateJobFlowsError {
TerminateJobFlowsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for TerminateJobFlowsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TerminateJobFlowsError {
fn description(&self) -> &str {
match *self {
TerminateJobFlowsError::InternalServerError(ref cause) => cause,
TerminateJobFlowsError::Validation(ref cause) => cause,
TerminateJobFlowsError::Credentials(ref err) => err.description(),
TerminateJobFlowsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
TerminateJobFlowsError::ParseError(ref cause) => cause,
TerminateJobFlowsError::Unknown(_) => "unknown error",
}
}
}
pub trait Emr {
fn add_instance_fleet(
&self,
input: AddInstanceFleetInput,
) -> RusotoFuture<AddInstanceFleetOutput, AddInstanceFleetError>;
fn add_instance_groups(
&self,
input: AddInstanceGroupsInput,
) -> RusotoFuture<AddInstanceGroupsOutput, AddInstanceGroupsError>;
fn add_job_flow_steps(
&self,
input: AddJobFlowStepsInput,
) -> RusotoFuture<AddJobFlowStepsOutput, AddJobFlowStepsError>;
fn add_tags(&self, input: AddTagsInput) -> RusotoFuture<AddTagsOutput, AddTagsError>;
fn cancel_steps(
&self,
input: CancelStepsInput,
) -> RusotoFuture<CancelStepsOutput, CancelStepsError>;
fn create_security_configuration(
&self,
input: CreateSecurityConfigurationInput,
) -> RusotoFuture<CreateSecurityConfigurationOutput, CreateSecurityConfigurationError>;
fn delete_security_configuration(
&self,
input: DeleteSecurityConfigurationInput,
) -> RusotoFuture<DeleteSecurityConfigurationOutput, DeleteSecurityConfigurationError>;
fn describe_cluster(
&self,
input: DescribeClusterInput,
) -> RusotoFuture<DescribeClusterOutput, DescribeClusterError>;
fn describe_job_flows(
&self,
input: DescribeJobFlowsInput,
) -> RusotoFuture<DescribeJobFlowsOutput, DescribeJobFlowsError>;
fn describe_security_configuration(
&self,
input: DescribeSecurityConfigurationInput,
) -> RusotoFuture<DescribeSecurityConfigurationOutput, DescribeSecurityConfigurationError>;
fn describe_step(
&self,
input: DescribeStepInput,
) -> RusotoFuture<DescribeStepOutput, DescribeStepError>;
fn list_bootstrap_actions(
&self,
input: ListBootstrapActionsInput,
) -> RusotoFuture<ListBootstrapActionsOutput, ListBootstrapActionsError>;
fn list_clusters(
&self,
input: ListClustersInput,
) -> RusotoFuture<ListClustersOutput, ListClustersError>;
fn list_instance_fleets(
&self,
input: ListInstanceFleetsInput,
) -> RusotoFuture<ListInstanceFleetsOutput, ListInstanceFleetsError>;
fn list_instance_groups(
&self,
input: ListInstanceGroupsInput,
) -> RusotoFuture<ListInstanceGroupsOutput, ListInstanceGroupsError>;
fn list_instances(
&self,
input: ListInstancesInput,
) -> RusotoFuture<ListInstancesOutput, ListInstancesError>;
fn list_security_configurations(
&self,
input: ListSecurityConfigurationsInput,
) -> RusotoFuture<ListSecurityConfigurationsOutput, ListSecurityConfigurationsError>;
fn list_steps(&self, input: ListStepsInput) -> RusotoFuture<ListStepsOutput, ListStepsError>;
fn modify_instance_fleet(
&self,
input: ModifyInstanceFleetInput,
) -> RusotoFuture<(), ModifyInstanceFleetError>;
fn modify_instance_groups(
&self,
input: ModifyInstanceGroupsInput,
) -> RusotoFuture<(), ModifyInstanceGroupsError>;
fn put_auto_scaling_policy(
&self,
input: PutAutoScalingPolicyInput,
) -> RusotoFuture<PutAutoScalingPolicyOutput, PutAutoScalingPolicyError>;
fn remove_auto_scaling_policy(
&self,
input: RemoveAutoScalingPolicyInput,
) -> RusotoFuture<RemoveAutoScalingPolicyOutput, RemoveAutoScalingPolicyError>;
fn remove_tags(
&self,
input: RemoveTagsInput,
) -> RusotoFuture<RemoveTagsOutput, RemoveTagsError>;
fn run_job_flow(
&self,
input: RunJobFlowInput,
) -> RusotoFuture<RunJobFlowOutput, RunJobFlowError>;
fn set_termination_protection(
&self,
input: SetTerminationProtectionInput,
) -> RusotoFuture<(), SetTerminationProtectionError>;
fn set_visible_to_all_users(
&self,
input: SetVisibleToAllUsersInput,
) -> RusotoFuture<(), SetVisibleToAllUsersError>;
fn terminate_job_flows(
&self,
input: TerminateJobFlowsInput,
) -> RusotoFuture<(), TerminateJobFlowsError>;
}
#[derive(Clone)]
pub struct EmrClient {
client: Client,
region: region::Region,
}
impl EmrClient {
pub fn new(region: region::Region) -> EmrClient {
EmrClient {
client: Client::shared(),
region: region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> EmrClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
EmrClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region: region,
}
}
}
impl Emr for EmrClient {
fn add_instance_fleet(
&self,
input: AddInstanceFleetInput,
) -> RusotoFuture<AddInstanceFleetOutput, AddInstanceFleetError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.AddInstanceFleet");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<AddInstanceFleetOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddInstanceFleetError::from_response(response))),
)
}
})
}
fn add_instance_groups(
&self,
input: AddInstanceGroupsInput,
) -> RusotoFuture<AddInstanceGroupsOutput, AddInstanceGroupsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.AddInstanceGroups");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<AddInstanceGroupsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddInstanceGroupsError::from_response(response))),
)
}
})
}
fn add_job_flow_steps(
&self,
input: AddJobFlowStepsInput,
) -> RusotoFuture<AddJobFlowStepsOutput, AddJobFlowStepsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.AddJobFlowSteps");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<AddJobFlowStepsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddJobFlowStepsError::from_response(response))),
)
}
})
}
fn add_tags(&self, input: AddTagsInput) -> RusotoFuture<AddTagsOutput, AddTagsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.AddTags");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<AddTagsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddTagsError::from_response(response))),
)
}
})
}
fn cancel_steps(
&self,
input: CancelStepsInput,
) -> RusotoFuture<CancelStepsOutput, CancelStepsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.CancelSteps");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CancelStepsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CancelStepsError::from_response(response))),
)
}
})
}
fn create_security_configuration(
&self,
input: CreateSecurityConfigurationInput,
) -> RusotoFuture<CreateSecurityConfigurationOutput, CreateSecurityConfigurationError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"ElasticMapReduce.CreateSecurityConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateSecurityConfigurationOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateSecurityConfigurationError::from_response(response))
}))
}
})
}
fn delete_security_configuration(
&self,
input: DeleteSecurityConfigurationInput,
) -> RusotoFuture<DeleteSecurityConfigurationOutput, DeleteSecurityConfigurationError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"ElasticMapReduce.DeleteSecurityConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DeleteSecurityConfigurationOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteSecurityConfigurationError::from_response(response))
}))
}
})
}
fn describe_cluster(
&self,
input: DescribeClusterInput,
) -> RusotoFuture<DescribeClusterOutput, DescribeClusterError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.DescribeCluster");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeClusterOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeClusterError::from_response(response))),
)
}
})
}
fn describe_job_flows(
&self,
input: DescribeJobFlowsInput,
) -> RusotoFuture<DescribeJobFlowsOutput, DescribeJobFlowsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.DescribeJobFlows");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeJobFlowsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeJobFlowsError::from_response(response))),
)
}
})
}
fn describe_security_configuration(
&self,
input: DescribeSecurityConfigurationInput,
) -> RusotoFuture<DescribeSecurityConfigurationOutput, DescribeSecurityConfigurationError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"ElasticMapReduce.DescribeSecurityConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeSecurityConfigurationOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeSecurityConfigurationError::from_response(response))
}))
}
})
}
fn describe_step(
&self,
input: DescribeStepInput,
) -> RusotoFuture<DescribeStepOutput, DescribeStepError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.DescribeStep");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeStepOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeStepError::from_response(response))),
)
}
})
}
fn list_bootstrap_actions(
&self,
input: ListBootstrapActionsInput,
) -> RusotoFuture<ListBootstrapActionsOutput, ListBootstrapActionsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.ListBootstrapActions");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListBootstrapActionsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListBootstrapActionsError::from_response(response))
}),
)
}
})
}
fn list_clusters(
&self,
input: ListClustersInput,
) -> RusotoFuture<ListClustersOutput, ListClustersError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.ListClusters");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListClustersOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListClustersError::from_response(response))),
)
}
})
}
fn list_instance_fleets(
&self,
input: ListInstanceFleetsInput,
) -> RusotoFuture<ListInstanceFleetsOutput, ListInstanceFleetsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.ListInstanceFleets");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListInstanceFleetsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListInstanceFleetsError::from_response(response))),
)
}
})
}
fn list_instance_groups(
&self,
input: ListInstanceGroupsInput,
) -> RusotoFuture<ListInstanceGroupsOutput, ListInstanceGroupsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.ListInstanceGroups");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListInstanceGroupsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListInstanceGroupsError::from_response(response))),
)
}
})
}
fn list_instances(
&self,
input: ListInstancesInput,
) -> RusotoFuture<ListInstancesOutput, ListInstancesError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.ListInstances");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListInstancesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListInstancesError::from_response(response))),
)
}
})
}
fn list_security_configurations(
&self,
input: ListSecurityConfigurationsInput,
) -> RusotoFuture<ListSecurityConfigurationsOutput, ListSecurityConfigurationsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"ElasticMapReduce.ListSecurityConfigurations",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListSecurityConfigurationsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListSecurityConfigurationsError::from_response(response))
}))
}
})
}
fn list_steps(&self, input: ListStepsInput) -> RusotoFuture<ListStepsOutput, ListStepsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.ListSteps");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListStepsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListStepsError::from_response(response))),
)
}
})
}
fn modify_instance_fleet(
&self,
input: ModifyInstanceFleetInput,
) -> RusotoFuture<(), ModifyInstanceFleetError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.ModifyInstanceFleet");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ModifyInstanceFleetError::from_response(response))
}),
)
}
})
}
fn modify_instance_groups(
&self,
input: ModifyInstanceGroupsInput,
) -> RusotoFuture<(), ModifyInstanceGroupsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.ModifyInstanceGroups");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ModifyInstanceGroupsError::from_response(response))
}),
)
}
})
}
fn put_auto_scaling_policy(
&self,
input: PutAutoScalingPolicyInput,
) -> RusotoFuture<PutAutoScalingPolicyOutput, PutAutoScalingPolicyError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.PutAutoScalingPolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<PutAutoScalingPolicyOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutAutoScalingPolicyError::from_response(response))
}),
)
}
})
}
fn remove_auto_scaling_policy(
&self,
input: RemoveAutoScalingPolicyInput,
) -> RusotoFuture<RemoveAutoScalingPolicyOutput, RemoveAutoScalingPolicyError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.RemoveAutoScalingPolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<RemoveAutoScalingPolicyOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RemoveAutoScalingPolicyError::from_response(response))
}))
}
})
}
fn remove_tags(
&self,
input: RemoveTagsInput,
) -> RusotoFuture<RemoveTagsOutput, RemoveTagsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.RemoveTags");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<RemoveTagsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RemoveTagsError::from_response(response))),
)
}
})
}
fn run_job_flow(
&self,
input: RunJobFlowInput,
) -> RusotoFuture<RunJobFlowOutput, RunJobFlowError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.RunJobFlow");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<RunJobFlowOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RunJobFlowError::from_response(response))),
)
}
})
}
fn set_termination_protection(
&self,
input: SetTerminationProtectionInput,
) -> RusotoFuture<(), SetTerminationProtectionError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.SetTerminationProtection");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(SetTerminationProtectionError::from_response(response))
}))
}
})
}
fn set_visible_to_all_users(
&self,
input: SetVisibleToAllUsersInput,
) -> RusotoFuture<(), SetVisibleToAllUsersError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.SetVisibleToAllUsers");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(SetVisibleToAllUsersError::from_response(response))
}),
)
}
})
}
fn terminate_job_flows(
&self,
input: TerminateJobFlowsInput,
) -> RusotoFuture<(), TerminateJobFlowsError> {
let mut request = SignedRequest::new("POST", "elasticmapreduce", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "ElasticMapReduce.TerminateJobFlows");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TerminateJobFlowsError::from_response(response))),
)
}
})
}
}
#[cfg(test)]
mod protocol_tests {}