use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Address {
#[serde(rename = "AddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address_id: Option<String>,
#[serde(rename = "City")]
#[serde(skip_serializing_if = "Option::is_none")]
pub city: Option<String>,
#[serde(rename = "Company")]
#[serde(skip_serializing_if = "Option::is_none")]
pub company: Option<String>,
#[serde(rename = "Country")]
#[serde(skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
#[serde(rename = "IsRestricted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_restricted: Option<bool>,
#[serde(rename = "Landmark")]
#[serde(skip_serializing_if = "Option::is_none")]
pub landmark: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "PhoneNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub phone_number: Option<String>,
#[serde(rename = "PostalCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub postal_code: Option<String>,
#[serde(rename = "PrefectureOrDistrict")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefecture_or_district: Option<String>,
#[serde(rename = "StateOrProvince")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_or_province: Option<String>,
#[serde(rename = "Street1")]
#[serde(skip_serializing_if = "Option::is_none")]
pub street_1: Option<String>,
#[serde(rename = "Street2")]
#[serde(skip_serializing_if = "Option::is_none")]
pub street_2: Option<String>,
#[serde(rename = "Street3")]
#[serde(skip_serializing_if = "Option::is_none")]
pub street_3: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CancelClusterRequest {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CancelClusterResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CancelJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CancelJobResult {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ClusterListEntry {
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
#[serde(rename = "ClusterState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_state: Option<String>,
#[serde(rename = "CreationDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ClusterMetadata {
#[serde(rename = "AddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address_id: Option<String>,
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
#[serde(rename = "ClusterState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_state: Option<String>,
#[serde(rename = "CreationDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "ForwardingAddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub forwarding_address_id: Option<String>,
#[serde(rename = "JobType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_type: Option<String>,
#[serde(rename = "KmsKeyARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_arn: Option<String>,
#[serde(rename = "Notification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification: Option<Notification>,
#[serde(rename = "Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<JobResource>,
#[serde(rename = "RoleARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "ShippingOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shipping_option: Option<String>,
#[serde(rename = "SnowballType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CompatibleImage {
#[serde(rename = "AmiId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ami_id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateAddressRequest {
#[serde(rename = "Address")]
pub address: Address,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateAddressResult {
#[serde(rename = "AddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateClusterRequest {
#[serde(rename = "AddressId")]
pub address_id: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "ForwardingAddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub forwarding_address_id: Option<String>,
#[serde(rename = "JobType")]
pub job_type: String,
#[serde(rename = "KmsKeyARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_arn: Option<String>,
#[serde(rename = "Notification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification: Option<Notification>,
#[serde(rename = "Resources")]
pub resources: JobResource,
#[serde(rename = "RoleARN")]
pub role_arn: String,
#[serde(rename = "ShippingOption")]
pub shipping_option: String,
#[serde(rename = "SnowballType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateClusterResult {
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateJobRequest {
#[serde(rename = "AddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address_id: Option<String>,
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "ForwardingAddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub forwarding_address_id: Option<String>,
#[serde(rename = "JobType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_type: Option<String>,
#[serde(rename = "KmsKeyARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_arn: Option<String>,
#[serde(rename = "Notification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification: Option<Notification>,
#[serde(rename = "Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<JobResource>,
#[serde(rename = "RoleARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "ShippingOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shipping_option: Option<String>,
#[serde(rename = "SnowballCapacityPreference")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_capacity_preference: Option<String>,
#[serde(rename = "SnowballType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateJobResult {
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DataTransfer {
#[serde(rename = "BytesTransferred")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bytes_transferred: Option<i64>,
#[serde(rename = "ObjectsTransferred")]
#[serde(skip_serializing_if = "Option::is_none")]
pub objects_transferred: Option<i64>,
#[serde(rename = "TotalBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_bytes: Option<i64>,
#[serde(rename = "TotalObjects")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_objects: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeAddressRequest {
#[serde(rename = "AddressId")]
pub address_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeAddressResult {
#[serde(rename = "Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<Address>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeAddressesRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeAddressesResult {
#[serde(rename = "Addresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub addresses: Option<Vec<Address>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeClusterRequest {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeClusterResult {
#[serde(rename = "ClusterMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_metadata: Option<ClusterMetadata>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeJobRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeJobResult {
#[serde(rename = "JobMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_metadata: Option<JobMetadata>,
#[serde(rename = "SubJobMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sub_job_metadata: Option<Vec<JobMetadata>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Ec2AmiResource {
#[serde(rename = "AmiId")]
pub ami_id: String,
#[serde(rename = "SnowballAmiId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_ami_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EventTriggerDefinition {
#[serde(rename = "EventResourceARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_resource_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetJobManifestRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetJobManifestResult {
#[serde(rename = "ManifestURI")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_uri: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetJobUnlockCodeRequest {
#[serde(rename = "JobId")]
pub job_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetJobUnlockCodeResult {
#[serde(rename = "UnlockCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unlock_code: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetSnowballUsageRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetSnowballUsageResult {
#[serde(rename = "SnowballLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_limit: Option<i64>,
#[serde(rename = "SnowballsInUse")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowballs_in_use: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct JobListEntry {
#[serde(rename = "CreationDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IsMaster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_master: Option<bool>,
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_state: Option<String>,
#[serde(rename = "JobType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_type: Option<String>,
#[serde(rename = "SnowballType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct JobLogs {
#[serde(rename = "JobCompletionReportURI")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_completion_report_uri: Option<String>,
#[serde(rename = "JobFailureLogURI")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_failure_log_uri: Option<String>,
#[serde(rename = "JobSuccessLogURI")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_success_log_uri: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct JobMetadata {
#[serde(rename = "AddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address_id: Option<String>,
#[serde(rename = "ClusterId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_id: Option<String>,
#[serde(rename = "CreationDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date: Option<f64>,
#[serde(rename = "DataTransferProgress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_transfer_progress: Option<DataTransfer>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "ForwardingAddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub forwarding_address_id: Option<String>,
#[serde(rename = "JobId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_id: Option<String>,
#[serde(rename = "JobLogInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_log_info: Option<JobLogs>,
#[serde(rename = "JobState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_state: Option<String>,
#[serde(rename = "JobType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_type: Option<String>,
#[serde(rename = "KmsKeyARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_arn: Option<String>,
#[serde(rename = "Notification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification: Option<Notification>,
#[serde(rename = "Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<JobResource>,
#[serde(rename = "RoleARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "ShippingDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shipping_details: Option<ShippingDetails>,
#[serde(rename = "SnowballCapacityPreference")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_capacity_preference: Option<String>,
#[serde(rename = "SnowballType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct JobResource {
#[serde(rename = "Ec2AmiResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec_2_ami_resources: Option<Vec<Ec2AmiResource>>,
#[serde(rename = "LambdaResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_resources: Option<Vec<LambdaResource>>,
#[serde(rename = "S3Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_resources: Option<Vec<S3Resource>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct KeyRange {
#[serde(rename = "BeginMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub begin_marker: Option<String>,
#[serde(rename = "EndMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LambdaResource {
#[serde(rename = "EventTriggers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_triggers: Option<Vec<EventTriggerDefinition>>,
#[serde(rename = "LambdaArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lambda_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListClusterJobsRequest {
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListClusterJobsResult {
#[serde(rename = "JobListEntries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_list_entries: Option<Vec<JobListEntry>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListClustersRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListClustersResult {
#[serde(rename = "ClusterListEntries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_list_entries: Option<Vec<ClusterListEntry>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListCompatibleImagesRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListCompatibleImagesResult {
#[serde(rename = "CompatibleImages")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible_images: Option<Vec<CompatibleImage>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListJobsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListJobsResult {
#[serde(rename = "JobListEntries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_list_entries: Option<Vec<JobListEntry>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Notification {
#[serde(rename = "JobStatesToNotify")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_states_to_notify: Option<Vec<String>>,
#[serde(rename = "NotifyAll")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notify_all: Option<bool>,
#[serde(rename = "SnsTopicARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sns_topic_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct S3Resource {
#[serde(rename = "BucketArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bucket_arn: Option<String>,
#[serde(rename = "KeyRange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_range: Option<KeyRange>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Shipment {
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "TrackingNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tracking_number: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ShippingDetails {
#[serde(rename = "InboundShipment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub inbound_shipment: Option<Shipment>,
#[serde(rename = "OutboundShipment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub outbound_shipment: Option<Shipment>,
#[serde(rename = "ShippingOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shipping_option: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateClusterRequest {
#[serde(rename = "AddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address_id: Option<String>,
#[serde(rename = "ClusterId")]
pub cluster_id: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "ForwardingAddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub forwarding_address_id: Option<String>,
#[serde(rename = "Notification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification: Option<Notification>,
#[serde(rename = "Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<JobResource>,
#[serde(rename = "RoleARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "ShippingOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shipping_option: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateClusterResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateJobRequest {
#[serde(rename = "AddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address_id: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "ForwardingAddressId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub forwarding_address_id: Option<String>,
#[serde(rename = "JobId")]
pub job_id: String,
#[serde(rename = "Notification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification: Option<Notification>,
#[serde(rename = "Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<JobResource>,
#[serde(rename = "RoleARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "ShippingOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shipping_option: Option<String>,
#[serde(rename = "SnowballCapacityPreference")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snowball_capacity_preference: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateJobResult {}
#[derive(Debug, PartialEq)]
pub enum CancelClusterError {
InvalidJobState(String),
InvalidResource(String),
KMSRequestFailed(String),
}
impl CancelClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CancelClusterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidJobStateException" => {
return RusotoError::Service(CancelClusterError::InvalidJobState(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(CancelClusterError::InvalidResource(err.msg))
}
"KMSRequestFailedException" => {
return RusotoError::Service(CancelClusterError::KMSRequestFailed(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CancelClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CancelClusterError {
fn description(&self) -> &str {
match *self {
CancelClusterError::InvalidJobState(ref cause) => cause,
CancelClusterError::InvalidResource(ref cause) => cause,
CancelClusterError::KMSRequestFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CancelJobError {
InvalidJobState(String),
InvalidResource(String),
KMSRequestFailed(String),
}
impl CancelJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CancelJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidJobStateException" => {
return RusotoError::Service(CancelJobError::InvalidJobState(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(CancelJobError::InvalidResource(err.msg))
}
"KMSRequestFailedException" => {
return RusotoError::Service(CancelJobError::KMSRequestFailed(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CancelJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CancelJobError {
fn description(&self) -> &str {
match *self {
CancelJobError::InvalidJobState(ref cause) => cause,
CancelJobError::InvalidResource(ref cause) => cause,
CancelJobError::KMSRequestFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateAddressError {
InvalidAddress(String),
UnsupportedAddress(String),
}
impl CreateAddressError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAddressError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidAddressException" => {
return RusotoError::Service(CreateAddressError::InvalidAddress(err.msg))
}
"UnsupportedAddressException" => {
return RusotoError::Service(CreateAddressError::UnsupportedAddress(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateAddressError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAddressError {
fn description(&self) -> &str {
match *self {
CreateAddressError::InvalidAddress(ref cause) => cause,
CreateAddressError::UnsupportedAddress(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateClusterError {
Ec2RequestFailed(String),
InvalidInputCombination(String),
InvalidResource(String),
KMSRequestFailed(String),
}
impl CreateClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateClusterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"Ec2RequestFailedException" => {
return RusotoError::Service(CreateClusterError::Ec2RequestFailed(err.msg))
}
"InvalidInputCombinationException" => {
return RusotoError::Service(CreateClusterError::InvalidInputCombination(
err.msg,
))
}
"InvalidResourceException" => {
return RusotoError::Service(CreateClusterError::InvalidResource(err.msg))
}
"KMSRequestFailedException" => {
return RusotoError::Service(CreateClusterError::KMSRequestFailed(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateClusterError {
fn description(&self) -> &str {
match *self {
CreateClusterError::Ec2RequestFailed(ref cause) => cause,
CreateClusterError::InvalidInputCombination(ref cause) => cause,
CreateClusterError::InvalidResource(ref cause) => cause,
CreateClusterError::KMSRequestFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateJobError {
ClusterLimitExceeded(String),
Ec2RequestFailed(String),
InvalidInputCombination(String),
InvalidResource(String),
KMSRequestFailed(String),
}
impl CreateJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterLimitExceededException" => {
return RusotoError::Service(CreateJobError::ClusterLimitExceeded(err.msg))
}
"Ec2RequestFailedException" => {
return RusotoError::Service(CreateJobError::Ec2RequestFailed(err.msg))
}
"InvalidInputCombinationException" => {
return RusotoError::Service(CreateJobError::InvalidInputCombination(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(CreateJobError::InvalidResource(err.msg))
}
"KMSRequestFailedException" => {
return RusotoError::Service(CreateJobError::KMSRequestFailed(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateJobError {
fn description(&self) -> &str {
match *self {
CreateJobError::ClusterLimitExceeded(ref cause) => cause,
CreateJobError::Ec2RequestFailed(ref cause) => cause,
CreateJobError::InvalidInputCombination(ref cause) => cause,
CreateJobError::InvalidResource(ref cause) => cause,
CreateJobError::KMSRequestFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAddressError {
InvalidResource(String),
}
impl DescribeAddressError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAddressError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidResourceException" => {
return RusotoError::Service(DescribeAddressError::InvalidResource(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeAddressError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAddressError {
fn description(&self) -> &str {
match *self {
DescribeAddressError::InvalidResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAddressesError {
InvalidNextToken(String),
InvalidResource(String),
}
impl DescribeAddressesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAddressesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(DescribeAddressesError::InvalidNextToken(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(DescribeAddressesError::InvalidResource(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeAddressesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAddressesError {
fn description(&self) -> &str {
match *self {
DescribeAddressesError::InvalidNextToken(ref cause) => cause,
DescribeAddressesError::InvalidResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeClusterError {
InvalidResource(String),
}
impl DescribeClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeClusterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidResourceException" => {
return RusotoError::Service(DescribeClusterError::InvalidResource(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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::InvalidResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeJobError {
InvalidResource(String),
}
impl DescribeJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidResourceException" => {
return RusotoError::Service(DescribeJobError::InvalidResource(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeJobError {
fn description(&self) -> &str {
match *self {
DescribeJobError::InvalidResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetJobManifestError {
InvalidJobState(String),
InvalidResource(String),
}
impl GetJobManifestError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetJobManifestError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidJobStateException" => {
return RusotoError::Service(GetJobManifestError::InvalidJobState(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(GetJobManifestError::InvalidResource(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetJobManifestError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetJobManifestError {
fn description(&self) -> &str {
match *self {
GetJobManifestError::InvalidJobState(ref cause) => cause,
GetJobManifestError::InvalidResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetJobUnlockCodeError {
InvalidJobState(String),
InvalidResource(String),
}
impl GetJobUnlockCodeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetJobUnlockCodeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidJobStateException" => {
return RusotoError::Service(GetJobUnlockCodeError::InvalidJobState(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(GetJobUnlockCodeError::InvalidResource(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetJobUnlockCodeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetJobUnlockCodeError {
fn description(&self) -> &str {
match *self {
GetJobUnlockCodeError::InvalidJobState(ref cause) => cause,
GetJobUnlockCodeError::InvalidResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetSnowballUsageError {}
impl GetSnowballUsageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetSnowballUsageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetSnowballUsageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetSnowballUsageError {
fn description(&self) -> &str {
match *self {}
}
}
#[derive(Debug, PartialEq)]
pub enum ListClusterJobsError {
InvalidNextToken(String),
InvalidResource(String),
}
impl ListClusterJobsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListClusterJobsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListClusterJobsError::InvalidNextToken(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(ListClusterJobsError::InvalidResource(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListClusterJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListClusterJobsError {
fn description(&self) -> &str {
match *self {
ListClusterJobsError::InvalidNextToken(ref cause) => cause,
ListClusterJobsError::InvalidResource(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListClustersError {
InvalidNextToken(String),
}
impl ListClustersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListClustersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListClustersError::InvalidNextToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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::InvalidNextToken(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListCompatibleImagesError {
Ec2RequestFailed(String),
InvalidNextToken(String),
}
impl ListCompatibleImagesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListCompatibleImagesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"Ec2RequestFailedException" => {
return RusotoError::Service(ListCompatibleImagesError::Ec2RequestFailed(
err.msg,
))
}
"InvalidNextTokenException" => {
return RusotoError::Service(ListCompatibleImagesError::InvalidNextToken(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListCompatibleImagesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListCompatibleImagesError {
fn description(&self) -> &str {
match *self {
ListCompatibleImagesError::Ec2RequestFailed(ref cause) => cause,
ListCompatibleImagesError::InvalidNextToken(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListJobsError {
InvalidNextToken(String),
}
impl ListJobsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListJobsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListJobsError::InvalidNextToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListJobsError {
fn description(&self) -> &str {
match *self {
ListJobsError::InvalidNextToken(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateClusterError {
Ec2RequestFailed(String),
InvalidInputCombination(String),
InvalidJobState(String),
InvalidResource(String),
KMSRequestFailed(String),
}
impl UpdateClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateClusterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"Ec2RequestFailedException" => {
return RusotoError::Service(UpdateClusterError::Ec2RequestFailed(err.msg))
}
"InvalidInputCombinationException" => {
return RusotoError::Service(UpdateClusterError::InvalidInputCombination(
err.msg,
))
}
"InvalidJobStateException" => {
return RusotoError::Service(UpdateClusterError::InvalidJobState(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(UpdateClusterError::InvalidResource(err.msg))
}
"KMSRequestFailedException" => {
return RusotoError::Service(UpdateClusterError::KMSRequestFailed(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateClusterError {
fn description(&self) -> &str {
match *self {
UpdateClusterError::Ec2RequestFailed(ref cause) => cause,
UpdateClusterError::InvalidInputCombination(ref cause) => cause,
UpdateClusterError::InvalidJobState(ref cause) => cause,
UpdateClusterError::InvalidResource(ref cause) => cause,
UpdateClusterError::KMSRequestFailed(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateJobError {
ClusterLimitExceeded(String),
Ec2RequestFailed(String),
InvalidInputCombination(String),
InvalidJobState(String),
InvalidResource(String),
KMSRequestFailed(String),
}
impl UpdateJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateJobError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterLimitExceededException" => {
return RusotoError::Service(UpdateJobError::ClusterLimitExceeded(err.msg))
}
"Ec2RequestFailedException" => {
return RusotoError::Service(UpdateJobError::Ec2RequestFailed(err.msg))
}
"InvalidInputCombinationException" => {
return RusotoError::Service(UpdateJobError::InvalidInputCombination(err.msg))
}
"InvalidJobStateException" => {
return RusotoError::Service(UpdateJobError::InvalidJobState(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(UpdateJobError::InvalidResource(err.msg))
}
"KMSRequestFailedException" => {
return RusotoError::Service(UpdateJobError::KMSRequestFailed(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateJobError {
fn description(&self) -> &str {
match *self {
UpdateJobError::ClusterLimitExceeded(ref cause) => cause,
UpdateJobError::Ec2RequestFailed(ref cause) => cause,
UpdateJobError::InvalidInputCombination(ref cause) => cause,
UpdateJobError::InvalidJobState(ref cause) => cause,
UpdateJobError::InvalidResource(ref cause) => cause,
UpdateJobError::KMSRequestFailed(ref cause) => cause,
}
}
}
pub trait Snowball {
fn cancel_cluster(
&self,
input: CancelClusterRequest,
) -> RusotoFuture<CancelClusterResult, CancelClusterError>;
fn cancel_job(&self, input: CancelJobRequest) -> RusotoFuture<CancelJobResult, CancelJobError>;
fn create_address(
&self,
input: CreateAddressRequest,
) -> RusotoFuture<CreateAddressResult, CreateAddressError>;
fn create_cluster(
&self,
input: CreateClusterRequest,
) -> RusotoFuture<CreateClusterResult, CreateClusterError>;
fn create_job(&self, input: CreateJobRequest) -> RusotoFuture<CreateJobResult, CreateJobError>;
fn describe_address(
&self,
input: DescribeAddressRequest,
) -> RusotoFuture<DescribeAddressResult, DescribeAddressError>;
fn describe_addresses(
&self,
input: DescribeAddressesRequest,
) -> RusotoFuture<DescribeAddressesResult, DescribeAddressesError>;
fn describe_cluster(
&self,
input: DescribeClusterRequest,
) -> RusotoFuture<DescribeClusterResult, DescribeClusterError>;
fn describe_job(
&self,
input: DescribeJobRequest,
) -> RusotoFuture<DescribeJobResult, DescribeJobError>;
fn get_job_manifest(
&self,
input: GetJobManifestRequest,
) -> RusotoFuture<GetJobManifestResult, GetJobManifestError>;
fn get_job_unlock_code(
&self,
input: GetJobUnlockCodeRequest,
) -> RusotoFuture<GetJobUnlockCodeResult, GetJobUnlockCodeError>;
fn get_snowball_usage(&self) -> RusotoFuture<GetSnowballUsageResult, GetSnowballUsageError>;
fn list_cluster_jobs(
&self,
input: ListClusterJobsRequest,
) -> RusotoFuture<ListClusterJobsResult, ListClusterJobsError>;
fn list_clusters(
&self,
input: ListClustersRequest,
) -> RusotoFuture<ListClustersResult, ListClustersError>;
fn list_compatible_images(
&self,
input: ListCompatibleImagesRequest,
) -> RusotoFuture<ListCompatibleImagesResult, ListCompatibleImagesError>;
fn list_jobs(&self, input: ListJobsRequest) -> RusotoFuture<ListJobsResult, ListJobsError>;
fn update_cluster(
&self,
input: UpdateClusterRequest,
) -> RusotoFuture<UpdateClusterResult, UpdateClusterError>;
fn update_job(&self, input: UpdateJobRequest) -> RusotoFuture<UpdateJobResult, UpdateJobError>;
}
#[derive(Clone)]
pub struct SnowballClient {
client: Client,
region: region::Region,
}
impl SnowballClient {
pub fn new(region: region::Region) -> SnowballClient {
SnowballClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> SnowballClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
SnowballClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Snowball for SnowballClient {
fn cancel_cluster(
&self,
input: CancelClusterRequest,
) -> RusotoFuture<CancelClusterResult, CancelClusterError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.CancelCluster",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CancelClusterResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CancelClusterError::from_response(response))),
)
}
})
}
fn cancel_job(&self, input: CancelJobRequest) -> RusotoFuture<CancelJobResult, CancelJobError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.CancelJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<CancelJobResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CancelJobError::from_response(response))),
)
}
})
}
fn create_address(
&self,
input: CreateAddressRequest,
) -> RusotoFuture<CreateAddressResult, CreateAddressError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.CreateAddress",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateAddressResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateAddressError::from_response(response))),
)
}
})
}
fn create_cluster(
&self,
input: CreateClusterRequest,
) -> RusotoFuture<CreateClusterResult, CreateClusterError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.CreateCluster",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateClusterResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateClusterError::from_response(response))),
)
}
})
}
fn create_job(&self, input: CreateJobRequest) -> RusotoFuture<CreateJobResult, CreateJobError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.CreateJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<CreateJobResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateJobError::from_response(response))),
)
}
})
}
fn describe_address(
&self,
input: DescribeAddressRequest,
) -> RusotoFuture<DescribeAddressResult, DescribeAddressError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.DescribeAddress",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAddressResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeAddressError::from_response(response))),
)
}
})
}
fn describe_addresses(
&self,
input: DescribeAddressesRequest,
) -> RusotoFuture<DescribeAddressesResult, DescribeAddressesError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.DescribeAddresses",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAddressesResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeAddressesError::from_response(response))),
)
}
})
}
fn describe_cluster(
&self,
input: DescribeClusterRequest,
) -> RusotoFuture<DescribeClusterResult, DescribeClusterError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.DescribeCluster",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeClusterResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeClusterError::from_response(response))),
)
}
})
}
fn describe_job(
&self,
input: DescribeJobRequest,
) -> RusotoFuture<DescribeJobResult, DescribeJobError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.DescribeJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeJobResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeJobError::from_response(response))),
)
}
})
}
fn get_job_manifest(
&self,
input: GetJobManifestRequest,
) -> RusotoFuture<GetJobManifestResult, GetJobManifestError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.GetJobManifest",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetJobManifestResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetJobManifestError::from_response(response))),
)
}
})
}
fn get_job_unlock_code(
&self,
input: GetJobUnlockCodeRequest,
) -> RusotoFuture<GetJobUnlockCodeResult, GetJobUnlockCodeError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.GetJobUnlockCode",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetJobUnlockCodeResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetJobUnlockCodeError::from_response(response))),
)
}
})
}
fn get_snowball_usage(&self) -> RusotoFuture<GetSnowballUsageResult, GetSnowballUsageError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.GetSnowballUsage",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetSnowballUsageResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetSnowballUsageError::from_response(response))),
)
}
})
}
fn list_cluster_jobs(
&self,
input: ListClusterJobsRequest,
) -> RusotoFuture<ListClusterJobsResult, ListClusterJobsError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.ListClusterJobs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListClusterJobsResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListClusterJobsError::from_response(response))),
)
}
})
}
fn list_clusters(
&self,
input: ListClustersRequest,
) -> RusotoFuture<ListClustersResult, ListClustersError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.ListClusters",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListClustersResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListClustersError::from_response(response))),
)
}
})
}
fn list_compatible_images(
&self,
input: ListCompatibleImagesRequest,
) -> RusotoFuture<ListCompatibleImagesResult, ListCompatibleImagesError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.ListCompatibleImages",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListCompatibleImagesResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListCompatibleImagesError::from_response(response))
}),
)
}
})
}
fn list_jobs(&self, input: ListJobsRequest) -> RusotoFuture<ListJobsResult, ListJobsError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSIESnowballJobManagementService.ListJobs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<ListJobsResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListJobsError::from_response(response))),
)
}
})
}
fn update_cluster(
&self,
input: UpdateClusterRequest,
) -> RusotoFuture<UpdateClusterResult, UpdateClusterError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.UpdateCluster",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateClusterResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateClusterError::from_response(response))),
)
}
})
}
fn update_job(&self, input: UpdateJobRequest) -> RusotoFuture<UpdateJobResult, UpdateJobError> {
let mut request = SignedRequest::new("POST", "snowball", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSIESnowballJobManagementService.UpdateJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<UpdateJobResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateJobError::from_response(response))),
)
}
})
}
}