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 ActivateGatewayInput {
#[serde(rename = "ActivationKey")]
pub activation_key: String,
#[serde(rename = "GatewayName")]
pub gateway_name: String,
#[serde(rename = "GatewayRegion")]
pub gateway_region: String,
#[serde(rename = "GatewayTimezone")]
pub gateway_timezone: String,
#[serde(rename = "GatewayType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_type: Option<String>,
#[serde(rename = "MediumChangerType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub medium_changer_type: Option<String>,
#[serde(rename = "TapeDriveType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_drive_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivateGatewayOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddCacheInput {
#[serde(rename = "DiskIds")]
pub disk_ids: Vec<String>,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddCacheOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddTagsToResourceInput {
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddTagsToResourceOutput {
#[serde(rename = "ResourceARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddUploadBufferInput {
#[serde(rename = "DiskIds")]
pub disk_ids: Vec<String>,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddUploadBufferOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddWorkingStorageInput {
#[serde(rename = "DiskIds")]
pub disk_ids: Vec<String>,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddWorkingStorageOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AttachVolumeInput {
#[serde(rename = "DiskId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_id: Option<String>,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "NetworkInterfaceId")]
pub network_interface_id: String,
#[serde(rename = "TargetName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_name: Option<String>,
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AttachVolumeOutput {
#[serde(rename = "TargetARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CachediSCSIVolume {
#[serde(rename = "CreatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_date: Option<f64>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "SourceSnapshotId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_snapshot_id: Option<String>,
#[serde(rename = "TargetName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_name: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
#[serde(rename = "VolumeAttachmentStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_attachment_status: Option<String>,
#[serde(rename = "VolumeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_id: Option<String>,
#[serde(rename = "VolumeProgress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_progress: Option<f64>,
#[serde(rename = "VolumeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size_in_bytes: Option<i64>,
#[serde(rename = "VolumeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_status: Option<String>,
#[serde(rename = "VolumeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_type: Option<String>,
#[serde(rename = "VolumeUsedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_used_in_bytes: Option<i64>,
#[serde(rename = "VolumeiSCSIAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volumei_scsi_attributes: Option<VolumeiSCSIAttributes>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CancelArchivalInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "TapeARN")]
pub tape_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CancelArchivalOutput {
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CancelRetrievalInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "TapeARN")]
pub tape_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CancelRetrievalOutput {
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ChapInfo {
#[serde(rename = "InitiatorName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub initiator_name: Option<String>,
#[serde(rename = "SecretToAuthenticateInitiator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secret_to_authenticate_initiator: Option<String>,
#[serde(rename = "SecretToAuthenticateTarget")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secret_to_authenticate_target: Option<String>,
#[serde(rename = "TargetARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateCachediSCSIVolumeInput {
#[serde(rename = "ClientToken")]
pub client_token: String,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "NetworkInterfaceId")]
pub network_interface_id: String,
#[serde(rename = "SnapshotId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snapshot_id: Option<String>,
#[serde(rename = "SourceVolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_volume_arn: Option<String>,
#[serde(rename = "TargetName")]
pub target_name: String,
#[serde(rename = "VolumeSizeInBytes")]
pub volume_size_in_bytes: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateCachediSCSIVolumeOutput {
#[serde(rename = "TargetARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateNFSFileShareInput {
#[serde(rename = "ClientList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_list: Option<Vec<String>>,
#[serde(rename = "ClientToken")]
pub client_token: String,
#[serde(rename = "DefaultStorageClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_storage_class: Option<String>,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "GuessMIMETypeEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub guess_mime_type_enabled: Option<bool>,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "LocationARN")]
pub location_arn: String,
#[serde(rename = "NFSFileShareDefaults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nfs_file_share_defaults: Option<NFSFileShareDefaults>,
#[serde(rename = "ObjectACL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub object_acl: Option<String>,
#[serde(rename = "ReadOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "RequesterPays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_pays: Option<bool>,
#[serde(rename = "Role")]
pub role: String,
#[serde(rename = "Squash")]
#[serde(skip_serializing_if = "Option::is_none")]
pub squash: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateNFSFileShareOutput {
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateSMBFileShareInput {
#[serde(rename = "Authentication")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication: Option<String>,
#[serde(rename = "ClientToken")]
pub client_token: String,
#[serde(rename = "DefaultStorageClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_storage_class: Option<String>,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "GuessMIMETypeEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub guess_mime_type_enabled: Option<bool>,
#[serde(rename = "InvalidUserList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invalid_user_list: Option<Vec<String>>,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "LocationARN")]
pub location_arn: String,
#[serde(rename = "ObjectACL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub object_acl: Option<String>,
#[serde(rename = "ReadOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "RequesterPays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_pays: Option<bool>,
#[serde(rename = "Role")]
pub role: String,
#[serde(rename = "ValidUserList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub valid_user_list: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateSMBFileShareOutput {
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateSnapshotFromVolumeRecoveryPointInput {
#[serde(rename = "SnapshotDescription")]
pub snapshot_description: String,
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateSnapshotFromVolumeRecoveryPointOutput {
#[serde(rename = "SnapshotId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snapshot_id: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
#[serde(rename = "VolumeRecoveryPointTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_recovery_point_time: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateSnapshotInput {
#[serde(rename = "SnapshotDescription")]
pub snapshot_description: String,
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateSnapshotOutput {
#[serde(rename = "SnapshotId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snapshot_id: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateStorediSCSIVolumeInput {
#[serde(rename = "DiskId")]
pub disk_id: String,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "NetworkInterfaceId")]
pub network_interface_id: String,
#[serde(rename = "PreserveExistingData")]
pub preserve_existing_data: bool,
#[serde(rename = "SnapshotId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snapshot_id: Option<String>,
#[serde(rename = "TargetName")]
pub target_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateStorediSCSIVolumeOutput {
#[serde(rename = "TargetARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
#[serde(rename = "VolumeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size_in_bytes: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateTapeWithBarcodeInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "TapeBarcode")]
pub tape_barcode: String,
#[serde(rename = "TapeSizeInBytes")]
pub tape_size_in_bytes: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateTapeWithBarcodeOutput {
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateTapesInput {
#[serde(rename = "ClientToken")]
pub client_token: String,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "NumTapesToCreate")]
pub num_tapes_to_create: i64,
#[serde(rename = "TapeBarcodePrefix")]
pub tape_barcode_prefix: String,
#[serde(rename = "TapeSizeInBytes")]
pub tape_size_in_bytes: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateTapesOutput {
#[serde(rename = "TapeARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_ar_ns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteBandwidthRateLimitInput {
#[serde(rename = "BandwidthType")]
pub bandwidth_type: String,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteBandwidthRateLimitOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteChapCredentialsInput {
#[serde(rename = "InitiatorName")]
pub initiator_name: String,
#[serde(rename = "TargetARN")]
pub target_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteChapCredentialsOutput {
#[serde(rename = "InitiatorName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub initiator_name: Option<String>,
#[serde(rename = "TargetARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteFileShareInput {
#[serde(rename = "FileShareARN")]
pub file_share_arn: String,
#[serde(rename = "ForceDelete")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force_delete: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteFileShareOutput {
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteGatewayInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteGatewayOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteSnapshotScheduleInput {
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteSnapshotScheduleOutput {
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteTapeArchiveInput {
#[serde(rename = "TapeARN")]
pub tape_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteTapeArchiveOutput {
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteTapeInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "TapeARN")]
pub tape_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteTapeOutput {
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteVolumeInput {
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteVolumeOutput {
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeBandwidthRateLimitInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeBandwidthRateLimitOutput {
#[serde(rename = "AverageDownloadRateLimitInBitsPerSec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average_download_rate_limit_in_bits_per_sec: Option<i64>,
#[serde(rename = "AverageUploadRateLimitInBitsPerSec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average_upload_rate_limit_in_bits_per_sec: Option<i64>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeCacheInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeCacheOutput {
#[serde(rename = "CacheAllocatedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cache_allocated_in_bytes: Option<i64>,
#[serde(rename = "CacheDirtyPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cache_dirty_percentage: Option<f64>,
#[serde(rename = "CacheHitPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cache_hit_percentage: Option<f64>,
#[serde(rename = "CacheMissPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cache_miss_percentage: Option<f64>,
#[serde(rename = "CacheUsedPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cache_used_percentage: Option<f64>,
#[serde(rename = "DiskIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_ids: Option<Vec<String>>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeCachediSCSIVolumesInput {
#[serde(rename = "VolumeARNs")]
pub volume_ar_ns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeCachediSCSIVolumesOutput {
#[serde(rename = "CachediSCSIVolumes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cachedi_scsi_volumes: Option<Vec<CachediSCSIVolume>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeChapCredentialsInput {
#[serde(rename = "TargetARN")]
pub target_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeChapCredentialsOutput {
#[serde(rename = "ChapCredentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub chap_credentials: Option<Vec<ChapInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeGatewayInformationInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeGatewayInformationOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "GatewayId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_id: Option<String>,
#[serde(rename = "GatewayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_name: Option<String>,
#[serde(rename = "GatewayNetworkInterfaces")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_network_interfaces: Option<Vec<NetworkInterface>>,
#[serde(rename = "GatewayState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_state: Option<String>,
#[serde(rename = "GatewayTimezone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_timezone: Option<String>,
#[serde(rename = "GatewayType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_type: Option<String>,
#[serde(rename = "LastSoftwareUpdate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_software_update: Option<String>,
#[serde(rename = "NextUpdateAvailabilityDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_update_availability_date: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeMaintenanceStartTimeInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeMaintenanceStartTimeOutput {
#[serde(rename = "DayOfWeek")]
#[serde(skip_serializing_if = "Option::is_none")]
pub day_of_week: Option<i64>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "HourOfDay")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hour_of_day: Option<i64>,
#[serde(rename = "MinuteOfHour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub minute_of_hour: Option<i64>,
#[serde(rename = "Timezone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timezone: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeNFSFileSharesInput {
#[serde(rename = "FileShareARNList")]
pub file_share_arn_list: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeNFSFileSharesOutput {
#[serde(rename = "NFSFileShareInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nfs_file_share_info_list: Option<Vec<NFSFileShareInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeSMBFileSharesInput {
#[serde(rename = "FileShareARNList")]
pub file_share_arn_list: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeSMBFileSharesOutput {
#[serde(rename = "SMBFileShareInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub smb_file_share_info_list: Option<Vec<SMBFileShareInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeSMBSettingsInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeSMBSettingsOutput {
#[serde(rename = "DomainName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_name: Option<String>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "SMBGuestPasswordSet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub smb_guest_password_set: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeSnapshotScheduleInput {
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeSnapshotScheduleOutput {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "RecurrenceInHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recurrence_in_hours: Option<i64>,
#[serde(rename = "StartAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_at: Option<i64>,
#[serde(rename = "Timezone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timezone: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeStorediSCSIVolumesInput {
#[serde(rename = "VolumeARNs")]
pub volume_ar_ns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeStorediSCSIVolumesOutput {
#[serde(rename = "StorediSCSIVolumes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storedi_scsi_volumes: Option<Vec<StorediSCSIVolume>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeTapeArchivesInput {
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "TapeARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_ar_ns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeTapeArchivesOutput {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "TapeArchives")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_archives: Option<Vec<TapeArchive>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeTapeRecoveryPointsInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[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 DescribeTapeRecoveryPointsOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "TapeRecoveryPointInfos")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_recovery_point_infos: Option<Vec<TapeRecoveryPointInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeTapesInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "TapeARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_ar_ns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeTapesOutput {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "Tapes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tapes: Option<Vec<Tape>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeUploadBufferInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeUploadBufferOutput {
#[serde(rename = "DiskIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_ids: Option<Vec<String>>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "UploadBufferAllocatedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_buffer_allocated_in_bytes: Option<i64>,
#[serde(rename = "UploadBufferUsedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_buffer_used_in_bytes: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeVTLDevicesInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "VTLDeviceARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vtl_device_ar_ns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeVTLDevicesOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "VTLDevices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vtl_devices: Option<Vec<VTLDevice>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeWorkingStorageInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeWorkingStorageOutput {
#[serde(rename = "DiskIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_ids: Option<Vec<String>>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "WorkingStorageAllocatedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub working_storage_allocated_in_bytes: Option<i64>,
#[serde(rename = "WorkingStorageUsedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub working_storage_used_in_bytes: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetachVolumeInput {
#[serde(rename = "ForceDetach")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force_detach: Option<bool>,
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DetachVolumeOutput {
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeviceiSCSIAttributes {
#[serde(rename = "ChapEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub chap_enabled: Option<bool>,
#[serde(rename = "NetworkInterfaceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_interface_id: Option<String>,
#[serde(rename = "NetworkInterfacePort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_interface_port: Option<i64>,
#[serde(rename = "TargetARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisableGatewayInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisableGatewayOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Disk {
#[serde(rename = "DiskAllocationResource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_allocation_resource: Option<String>,
#[serde(rename = "DiskAllocationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_allocation_type: Option<String>,
#[serde(rename = "DiskAttributeList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_attribute_list: Option<Vec<String>>,
#[serde(rename = "DiskId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_id: Option<String>,
#[serde(rename = "DiskNode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_node: Option<String>,
#[serde(rename = "DiskPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_path: Option<String>,
#[serde(rename = "DiskSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_size_in_bytes: Option<i64>,
#[serde(rename = "DiskStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FileShareInfo {
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
#[serde(rename = "FileShareId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_id: Option<String>,
#[serde(rename = "FileShareStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_status: Option<String>,
#[serde(rename = "FileShareType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_type: Option<String>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GatewayInfo {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "GatewayId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_id: Option<String>,
#[serde(rename = "GatewayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_name: Option<String>,
#[serde(rename = "GatewayOperationalState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_operational_state: Option<String>,
#[serde(rename = "GatewayType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct JoinDomainInput {
#[serde(rename = "DomainControllers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_controllers: Option<Vec<String>>,
#[serde(rename = "DomainName")]
pub domain_name: String,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "OrganizationalUnit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organizational_unit: Option<String>,
#[serde(rename = "Password")]
pub password: String,
#[serde(rename = "UserName")]
pub user_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct JoinDomainOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListFileSharesInput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[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 ListFileSharesOutput {
#[serde(rename = "FileShareInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_info_list: Option<Vec<FileShareInfo>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "NextMarker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListGatewaysInput {
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[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 ListGatewaysOutput {
#[serde(rename = "Gateways")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateways: Option<Vec<GatewayInfo>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListLocalDisksInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListLocalDisksOutput {
#[serde(rename = "Disks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disks: Option<Vec<Disk>>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceInput {
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceOutput {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "ResourceARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTapesInput {
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "TapeARNs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_ar_ns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTapesOutput {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "TapeInfos")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_infos: Option<Vec<TapeInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListVolumeInitiatorsInput {
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListVolumeInitiatorsOutput {
#[serde(rename = "Initiators")]
#[serde(skip_serializing_if = "Option::is_none")]
pub initiators: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListVolumeRecoveryPointsInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListVolumeRecoveryPointsOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "VolumeRecoveryPointInfos")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_recovery_point_infos: Option<Vec<VolumeRecoveryPointInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListVolumesInput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[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 ListVolumesOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "VolumeInfos")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_infos: Option<Vec<VolumeInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct NFSFileShareDefaults {
#[serde(rename = "DirectoryMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub directory_mode: Option<String>,
#[serde(rename = "FileMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_mode: Option<String>,
#[serde(rename = "GroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_id: Option<i64>,
#[serde(rename = "OwnerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub owner_id: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NFSFileShareInfo {
#[serde(rename = "ClientList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_list: Option<Vec<String>>,
#[serde(rename = "DefaultStorageClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_storage_class: Option<String>,
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
#[serde(rename = "FileShareId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_id: Option<String>,
#[serde(rename = "FileShareStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_status: Option<String>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "GuessMIMETypeEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub guess_mime_type_enabled: Option<bool>,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "LocationARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location_arn: Option<String>,
#[serde(rename = "NFSFileShareDefaults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nfs_file_share_defaults: Option<NFSFileShareDefaults>,
#[serde(rename = "ObjectACL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub object_acl: Option<String>,
#[serde(rename = "Path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "ReadOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "RequesterPays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_pays: Option<bool>,
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
#[serde(rename = "Squash")]
#[serde(skip_serializing_if = "Option::is_none")]
pub squash: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NetworkInterface {
#[serde(rename = "Ipv4Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv_4_address: Option<String>,
#[serde(rename = "Ipv6Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv_6_address: Option<String>,
#[serde(rename = "MacAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mac_address: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct NotifyWhenUploadedInput {
#[serde(rename = "FileShareARN")]
pub file_share_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NotifyWhenUploadedOutput {
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
#[serde(rename = "NotificationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RefreshCacheInput {
#[serde(rename = "FileShareARN")]
pub file_share_arn: String,
#[serde(rename = "FolderList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub folder_list: Option<Vec<String>>,
#[serde(rename = "Recursive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recursive: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RefreshCacheOutput {
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
#[serde(rename = "NotificationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemoveTagsFromResourceInput {
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RemoveTagsFromResourceOutput {
#[serde(rename = "ResourceARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ResetCacheInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResetCacheOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RetrieveTapeArchiveInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "TapeARN")]
pub tape_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RetrieveTapeArchiveOutput {
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RetrieveTapeRecoveryPointInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "TapeARN")]
pub tape_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RetrieveTapeRecoveryPointOutput {
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SMBFileShareInfo {
#[serde(rename = "Authentication")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication: Option<String>,
#[serde(rename = "DefaultStorageClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_storage_class: Option<String>,
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
#[serde(rename = "FileShareId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_id: Option<String>,
#[serde(rename = "FileShareStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_status: Option<String>,
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "GuessMIMETypeEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub guess_mime_type_enabled: Option<bool>,
#[serde(rename = "InvalidUserList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invalid_user_list: Option<Vec<String>>,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "LocationARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location_arn: Option<String>,
#[serde(rename = "ObjectACL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub object_acl: Option<String>,
#[serde(rename = "Path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "ReadOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "RequesterPays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_pays: Option<bool>,
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
#[serde(rename = "ValidUserList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub valid_user_list: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SetLocalConsolePasswordInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "LocalConsolePassword")]
pub local_console_password: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SetLocalConsolePasswordOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SetSMBGuestPasswordInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "Password")]
pub password: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SetSMBGuestPasswordOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ShutdownGatewayInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ShutdownGatewayOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartGatewayInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartGatewayOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct StorageGatewayError {
pub error_code: Option<String>,
pub error_details: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StorediSCSIVolume {
#[serde(rename = "CreatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_date: Option<f64>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "PreservedExistingData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preserved_existing_data: Option<bool>,
#[serde(rename = "SourceSnapshotId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_snapshot_id: Option<String>,
#[serde(rename = "TargetName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_name: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
#[serde(rename = "VolumeAttachmentStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_attachment_status: Option<String>,
#[serde(rename = "VolumeDiskId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_disk_id: Option<String>,
#[serde(rename = "VolumeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_id: Option<String>,
#[serde(rename = "VolumeProgress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_progress: Option<f64>,
#[serde(rename = "VolumeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size_in_bytes: Option<i64>,
#[serde(rename = "VolumeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_status: Option<String>,
#[serde(rename = "VolumeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_type: Option<String>,
#[serde(rename = "VolumeUsedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_used_in_bytes: Option<i64>,
#[serde(rename = "VolumeiSCSIAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volumei_scsi_attributes: Option<VolumeiSCSIAttributes>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Tape {
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "Progress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress: Option<f64>,
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
#[serde(rename = "TapeBarcode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_barcode: Option<String>,
#[serde(rename = "TapeCreatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_created_date: Option<f64>,
#[serde(rename = "TapeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_size_in_bytes: Option<i64>,
#[serde(rename = "TapeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_status: Option<String>,
#[serde(rename = "TapeUsedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_used_in_bytes: Option<i64>,
#[serde(rename = "VTLDevice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vtl_device: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TapeArchive {
#[serde(rename = "CompletionTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completion_time: Option<f64>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "RetrievedTo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retrieved_to: Option<String>,
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
#[serde(rename = "TapeBarcode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_barcode: Option<String>,
#[serde(rename = "TapeCreatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_created_date: Option<f64>,
#[serde(rename = "TapeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_size_in_bytes: Option<i64>,
#[serde(rename = "TapeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_status: Option<String>,
#[serde(rename = "TapeUsedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_used_in_bytes: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TapeInfo {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
#[serde(rename = "TapeBarcode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_barcode: Option<String>,
#[serde(rename = "TapeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_size_in_bytes: Option<i64>,
#[serde(rename = "TapeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TapeRecoveryPointInfo {
#[serde(rename = "TapeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_arn: Option<String>,
#[serde(rename = "TapeRecoveryPointTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_recovery_point_time: Option<f64>,
#[serde(rename = "TapeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_size_in_bytes: Option<i64>,
#[serde(rename = "TapeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tape_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateBandwidthRateLimitInput {
#[serde(rename = "AverageDownloadRateLimitInBitsPerSec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average_download_rate_limit_in_bits_per_sec: Option<i64>,
#[serde(rename = "AverageUploadRateLimitInBitsPerSec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average_upload_rate_limit_in_bits_per_sec: Option<i64>,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateBandwidthRateLimitOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateChapCredentialsInput {
#[serde(rename = "InitiatorName")]
pub initiator_name: String,
#[serde(rename = "SecretToAuthenticateInitiator")]
pub secret_to_authenticate_initiator: String,
#[serde(rename = "SecretToAuthenticateTarget")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secret_to_authenticate_target: Option<String>,
#[serde(rename = "TargetARN")]
pub target_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateChapCredentialsOutput {
#[serde(rename = "InitiatorName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub initiator_name: Option<String>,
#[serde(rename = "TargetARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateGatewayInformationInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "GatewayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_name: Option<String>,
#[serde(rename = "GatewayTimezone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_timezone: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateGatewayInformationOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "GatewayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateGatewaySoftwareNowInput {
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateGatewaySoftwareNowOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateMaintenanceStartTimeInput {
#[serde(rename = "DayOfWeek")]
pub day_of_week: i64,
#[serde(rename = "GatewayARN")]
pub gateway_arn: String,
#[serde(rename = "HourOfDay")]
pub hour_of_day: i64,
#[serde(rename = "MinuteOfHour")]
pub minute_of_hour: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateMaintenanceStartTimeOutput {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateNFSFileShareInput {
#[serde(rename = "ClientList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_list: Option<Vec<String>>,
#[serde(rename = "DefaultStorageClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_storage_class: Option<String>,
#[serde(rename = "FileShareARN")]
pub file_share_arn: String,
#[serde(rename = "GuessMIMETypeEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub guess_mime_type_enabled: Option<bool>,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "NFSFileShareDefaults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nfs_file_share_defaults: Option<NFSFileShareDefaults>,
#[serde(rename = "ObjectACL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub object_acl: Option<String>,
#[serde(rename = "ReadOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "RequesterPays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_pays: Option<bool>,
#[serde(rename = "Squash")]
#[serde(skip_serializing_if = "Option::is_none")]
pub squash: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateNFSFileShareOutput {
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateSMBFileShareInput {
#[serde(rename = "DefaultStorageClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_storage_class: Option<String>,
#[serde(rename = "FileShareARN")]
pub file_share_arn: String,
#[serde(rename = "GuessMIMETypeEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub guess_mime_type_enabled: Option<bool>,
#[serde(rename = "InvalidUserList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invalid_user_list: Option<Vec<String>>,
#[serde(rename = "KMSEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_encrypted: Option<bool>,
#[serde(rename = "KMSKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
#[serde(rename = "ObjectACL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub object_acl: Option<String>,
#[serde(rename = "ReadOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "RequesterPays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_pays: Option<bool>,
#[serde(rename = "ValidUserList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub valid_user_list: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateSMBFileShareOutput {
#[serde(rename = "FileShareARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_share_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateSnapshotScheduleInput {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "RecurrenceInHours")]
pub recurrence_in_hours: i64,
#[serde(rename = "StartAt")]
pub start_at: i64,
#[serde(rename = "VolumeARN")]
pub volume_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateSnapshotScheduleOutput {
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateVTLDeviceTypeInput {
#[serde(rename = "DeviceType")]
pub device_type: String,
#[serde(rename = "VTLDeviceARN")]
pub vtl_device_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateVTLDeviceTypeOutput {
#[serde(rename = "VTLDeviceARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vtl_device_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct VTLDevice {
#[serde(rename = "DeviceiSCSIAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub devicei_scsi_attributes: Option<DeviceiSCSIAttributes>,
#[serde(rename = "VTLDeviceARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vtl_device_arn: Option<String>,
#[serde(rename = "VTLDeviceProductIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vtl_device_product_identifier: Option<String>,
#[serde(rename = "VTLDeviceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vtl_device_type: Option<String>,
#[serde(rename = "VTLDeviceVendor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vtl_device_vendor: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct VolumeInfo {
#[serde(rename = "GatewayARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_arn: Option<String>,
#[serde(rename = "GatewayId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_id: Option<String>,
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
#[serde(rename = "VolumeAttachmentStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_attachment_status: Option<String>,
#[serde(rename = "VolumeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_id: Option<String>,
#[serde(rename = "VolumeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size_in_bytes: Option<i64>,
#[serde(rename = "VolumeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct VolumeRecoveryPointInfo {
#[serde(rename = "VolumeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_arn: Option<String>,
#[serde(rename = "VolumeRecoveryPointTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_recovery_point_time: Option<String>,
#[serde(rename = "VolumeSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size_in_bytes: Option<i64>,
#[serde(rename = "VolumeUsageInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_usage_in_bytes: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct VolumeiSCSIAttributes {
#[serde(rename = "ChapEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub chap_enabled: Option<bool>,
#[serde(rename = "LunNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lun_number: Option<i64>,
#[serde(rename = "NetworkInterfaceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_interface_id: Option<String>,
#[serde(rename = "NetworkInterfacePort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_interface_port: Option<i64>,
#[serde(rename = "TargetARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum ActivateGatewayError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ActivateGatewayError {
pub fn from_response(res: BufferedHttpResponse) -> ActivateGatewayError {
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 ActivateGatewayError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return ActivateGatewayError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return ActivateGatewayError::Validation(error_message.to_string());
}
_ => {}
}
}
return ActivateGatewayError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ActivateGatewayError {
fn from(err: serde_json::error::Error) -> ActivateGatewayError {
ActivateGatewayError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ActivateGatewayError {
fn from(err: CredentialsError) -> ActivateGatewayError {
ActivateGatewayError::Credentials(err)
}
}
impl From<HttpDispatchError> for ActivateGatewayError {
fn from(err: HttpDispatchError) -> ActivateGatewayError {
ActivateGatewayError::HttpDispatch(err)
}
}
impl From<io::Error> for ActivateGatewayError {
fn from(err: io::Error) -> ActivateGatewayError {
ActivateGatewayError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ActivateGatewayError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ActivateGatewayError {
fn description(&self) -> &str {
match *self {
ActivateGatewayError::InternalServerError(ref cause) => cause,
ActivateGatewayError::InvalidGatewayRequest(ref cause) => cause,
ActivateGatewayError::Validation(ref cause) => cause,
ActivateGatewayError::Credentials(ref err) => err.description(),
ActivateGatewayError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ActivateGatewayError::ParseError(ref cause) => cause,
ActivateGatewayError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddCacheError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddCacheError {
pub fn from_response(res: BufferedHttpResponse) -> AddCacheError {
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 AddCacheError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return AddCacheError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return AddCacheError::Validation(error_message.to_string());
}
_ => {}
}
}
return AddCacheError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddCacheError {
fn from(err: serde_json::error::Error) -> AddCacheError {
AddCacheError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddCacheError {
fn from(err: CredentialsError) -> AddCacheError {
AddCacheError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddCacheError {
fn from(err: HttpDispatchError) -> AddCacheError {
AddCacheError::HttpDispatch(err)
}
}
impl From<io::Error> for AddCacheError {
fn from(err: io::Error) -> AddCacheError {
AddCacheError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddCacheError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddCacheError {
fn description(&self) -> &str {
match *self {
AddCacheError::InternalServerError(ref cause) => cause,
AddCacheError::InvalidGatewayRequest(ref cause) => cause,
AddCacheError::Validation(ref cause) => cause,
AddCacheError::Credentials(ref err) => err.description(),
AddCacheError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AddCacheError::ParseError(ref cause) => cause,
AddCacheError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddTagsToResourceError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddTagsToResourceError {
pub fn from_response(res: BufferedHttpResponse) -> AddTagsToResourceError {
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 AddTagsToResourceError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return AddTagsToResourceError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return AddTagsToResourceError::Validation(error_message.to_string());
}
_ => {}
}
}
return AddTagsToResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddTagsToResourceError {
fn from(err: serde_json::error::Error) -> AddTagsToResourceError {
AddTagsToResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddTagsToResourceError {
fn from(err: CredentialsError) -> AddTagsToResourceError {
AddTagsToResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddTagsToResourceError {
fn from(err: HttpDispatchError) -> AddTagsToResourceError {
AddTagsToResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for AddTagsToResourceError {
fn from(err: io::Error) -> AddTagsToResourceError {
AddTagsToResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddTagsToResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddTagsToResourceError {
fn description(&self) -> &str {
match *self {
AddTagsToResourceError::InternalServerError(ref cause) => cause,
AddTagsToResourceError::InvalidGatewayRequest(ref cause) => cause,
AddTagsToResourceError::Validation(ref cause) => cause,
AddTagsToResourceError::Credentials(ref err) => err.description(),
AddTagsToResourceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AddTagsToResourceError::ParseError(ref cause) => cause,
AddTagsToResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddUploadBufferError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddUploadBufferError {
pub fn from_response(res: BufferedHttpResponse) -> AddUploadBufferError {
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 AddUploadBufferError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return AddUploadBufferError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return AddUploadBufferError::Validation(error_message.to_string());
}
_ => {}
}
}
return AddUploadBufferError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddUploadBufferError {
fn from(err: serde_json::error::Error) -> AddUploadBufferError {
AddUploadBufferError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddUploadBufferError {
fn from(err: CredentialsError) -> AddUploadBufferError {
AddUploadBufferError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddUploadBufferError {
fn from(err: HttpDispatchError) -> AddUploadBufferError {
AddUploadBufferError::HttpDispatch(err)
}
}
impl From<io::Error> for AddUploadBufferError {
fn from(err: io::Error) -> AddUploadBufferError {
AddUploadBufferError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddUploadBufferError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddUploadBufferError {
fn description(&self) -> &str {
match *self {
AddUploadBufferError::InternalServerError(ref cause) => cause,
AddUploadBufferError::InvalidGatewayRequest(ref cause) => cause,
AddUploadBufferError::Validation(ref cause) => cause,
AddUploadBufferError::Credentials(ref err) => err.description(),
AddUploadBufferError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AddUploadBufferError::ParseError(ref cause) => cause,
AddUploadBufferError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddWorkingStorageError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddWorkingStorageError {
pub fn from_response(res: BufferedHttpResponse) -> AddWorkingStorageError {
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 AddWorkingStorageError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return AddWorkingStorageError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return AddWorkingStorageError::Validation(error_message.to_string());
}
_ => {}
}
}
return AddWorkingStorageError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddWorkingStorageError {
fn from(err: serde_json::error::Error) -> AddWorkingStorageError {
AddWorkingStorageError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddWorkingStorageError {
fn from(err: CredentialsError) -> AddWorkingStorageError {
AddWorkingStorageError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddWorkingStorageError {
fn from(err: HttpDispatchError) -> AddWorkingStorageError {
AddWorkingStorageError::HttpDispatch(err)
}
}
impl From<io::Error> for AddWorkingStorageError {
fn from(err: io::Error) -> AddWorkingStorageError {
AddWorkingStorageError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddWorkingStorageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddWorkingStorageError {
fn description(&self) -> &str {
match *self {
AddWorkingStorageError::InternalServerError(ref cause) => cause,
AddWorkingStorageError::InvalidGatewayRequest(ref cause) => cause,
AddWorkingStorageError::Validation(ref cause) => cause,
AddWorkingStorageError::Credentials(ref err) => err.description(),
AddWorkingStorageError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AddWorkingStorageError::ParseError(ref cause) => cause,
AddWorkingStorageError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AttachVolumeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AttachVolumeError {
pub fn from_response(res: BufferedHttpResponse) -> AttachVolumeError {
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 AttachVolumeError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return AttachVolumeError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return AttachVolumeError::Validation(error_message.to_string());
}
_ => {}
}
}
return AttachVolumeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AttachVolumeError {
fn from(err: serde_json::error::Error) -> AttachVolumeError {
AttachVolumeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AttachVolumeError {
fn from(err: CredentialsError) -> AttachVolumeError {
AttachVolumeError::Credentials(err)
}
}
impl From<HttpDispatchError> for AttachVolumeError {
fn from(err: HttpDispatchError) -> AttachVolumeError {
AttachVolumeError::HttpDispatch(err)
}
}
impl From<io::Error> for AttachVolumeError {
fn from(err: io::Error) -> AttachVolumeError {
AttachVolumeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AttachVolumeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AttachVolumeError {
fn description(&self) -> &str {
match *self {
AttachVolumeError::InternalServerError(ref cause) => cause,
AttachVolumeError::InvalidGatewayRequest(ref cause) => cause,
AttachVolumeError::Validation(ref cause) => cause,
AttachVolumeError::Credentials(ref err) => err.description(),
AttachVolumeError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AttachVolumeError::ParseError(ref cause) => cause,
AttachVolumeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CancelArchivalError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CancelArchivalError {
pub fn from_response(res: BufferedHttpResponse) -> CancelArchivalError {
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 CancelArchivalError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return CancelArchivalError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return CancelArchivalError::Validation(error_message.to_string());
}
_ => {}
}
}
return CancelArchivalError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CancelArchivalError {
fn from(err: serde_json::error::Error) -> CancelArchivalError {
CancelArchivalError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CancelArchivalError {
fn from(err: CredentialsError) -> CancelArchivalError {
CancelArchivalError::Credentials(err)
}
}
impl From<HttpDispatchError> for CancelArchivalError {
fn from(err: HttpDispatchError) -> CancelArchivalError {
CancelArchivalError::HttpDispatch(err)
}
}
impl From<io::Error> for CancelArchivalError {
fn from(err: io::Error) -> CancelArchivalError {
CancelArchivalError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CancelArchivalError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CancelArchivalError {
fn description(&self) -> &str {
match *self {
CancelArchivalError::InternalServerError(ref cause) => cause,
CancelArchivalError::InvalidGatewayRequest(ref cause) => cause,
CancelArchivalError::Validation(ref cause) => cause,
CancelArchivalError::Credentials(ref err) => err.description(),
CancelArchivalError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CancelArchivalError::ParseError(ref cause) => cause,
CancelArchivalError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CancelRetrievalError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CancelRetrievalError {
pub fn from_response(res: BufferedHttpResponse) -> CancelRetrievalError {
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 CancelRetrievalError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return CancelRetrievalError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return CancelRetrievalError::Validation(error_message.to_string());
}
_ => {}
}
}
return CancelRetrievalError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CancelRetrievalError {
fn from(err: serde_json::error::Error) -> CancelRetrievalError {
CancelRetrievalError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CancelRetrievalError {
fn from(err: CredentialsError) -> CancelRetrievalError {
CancelRetrievalError::Credentials(err)
}
}
impl From<HttpDispatchError> for CancelRetrievalError {
fn from(err: HttpDispatchError) -> CancelRetrievalError {
CancelRetrievalError::HttpDispatch(err)
}
}
impl From<io::Error> for CancelRetrievalError {
fn from(err: io::Error) -> CancelRetrievalError {
CancelRetrievalError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CancelRetrievalError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CancelRetrievalError {
fn description(&self) -> &str {
match *self {
CancelRetrievalError::InternalServerError(ref cause) => cause,
CancelRetrievalError::InvalidGatewayRequest(ref cause) => cause,
CancelRetrievalError::Validation(ref cause) => cause,
CancelRetrievalError::Credentials(ref err) => err.description(),
CancelRetrievalError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CancelRetrievalError::ParseError(ref cause) => cause,
CancelRetrievalError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCachediSCSIVolumeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateCachediSCSIVolumeError {
pub fn from_response(res: BufferedHttpResponse) -> CreateCachediSCSIVolumeError {
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 CreateCachediSCSIVolumeError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return CreateCachediSCSIVolumeError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return CreateCachediSCSIVolumeError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateCachediSCSIVolumeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateCachediSCSIVolumeError {
fn from(err: serde_json::error::Error) -> CreateCachediSCSIVolumeError {
CreateCachediSCSIVolumeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateCachediSCSIVolumeError {
fn from(err: CredentialsError) -> CreateCachediSCSIVolumeError {
CreateCachediSCSIVolumeError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateCachediSCSIVolumeError {
fn from(err: HttpDispatchError) -> CreateCachediSCSIVolumeError {
CreateCachediSCSIVolumeError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateCachediSCSIVolumeError {
fn from(err: io::Error) -> CreateCachediSCSIVolumeError {
CreateCachediSCSIVolumeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateCachediSCSIVolumeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCachediSCSIVolumeError {
fn description(&self) -> &str {
match *self {
CreateCachediSCSIVolumeError::InternalServerError(ref cause) => cause,
CreateCachediSCSIVolumeError::InvalidGatewayRequest(ref cause) => cause,
CreateCachediSCSIVolumeError::Validation(ref cause) => cause,
CreateCachediSCSIVolumeError::Credentials(ref err) => err.description(),
CreateCachediSCSIVolumeError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateCachediSCSIVolumeError::ParseError(ref cause) => cause,
CreateCachediSCSIVolumeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateNFSFileShareError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateNFSFileShareError {
pub fn from_response(res: BufferedHttpResponse) -> CreateNFSFileShareError {
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 CreateNFSFileShareError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return CreateNFSFileShareError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return CreateNFSFileShareError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateNFSFileShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateNFSFileShareError {
fn from(err: serde_json::error::Error) -> CreateNFSFileShareError {
CreateNFSFileShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateNFSFileShareError {
fn from(err: CredentialsError) -> CreateNFSFileShareError {
CreateNFSFileShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateNFSFileShareError {
fn from(err: HttpDispatchError) -> CreateNFSFileShareError {
CreateNFSFileShareError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateNFSFileShareError {
fn from(err: io::Error) -> CreateNFSFileShareError {
CreateNFSFileShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateNFSFileShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateNFSFileShareError {
fn description(&self) -> &str {
match *self {
CreateNFSFileShareError::InternalServerError(ref cause) => cause,
CreateNFSFileShareError::InvalidGatewayRequest(ref cause) => cause,
CreateNFSFileShareError::Validation(ref cause) => cause,
CreateNFSFileShareError::Credentials(ref err) => err.description(),
CreateNFSFileShareError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateNFSFileShareError::ParseError(ref cause) => cause,
CreateNFSFileShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateSMBFileShareError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateSMBFileShareError {
pub fn from_response(res: BufferedHttpResponse) -> CreateSMBFileShareError {
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 CreateSMBFileShareError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return CreateSMBFileShareError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return CreateSMBFileShareError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateSMBFileShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateSMBFileShareError {
fn from(err: serde_json::error::Error) -> CreateSMBFileShareError {
CreateSMBFileShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateSMBFileShareError {
fn from(err: CredentialsError) -> CreateSMBFileShareError {
CreateSMBFileShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateSMBFileShareError {
fn from(err: HttpDispatchError) -> CreateSMBFileShareError {
CreateSMBFileShareError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateSMBFileShareError {
fn from(err: io::Error) -> CreateSMBFileShareError {
CreateSMBFileShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateSMBFileShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateSMBFileShareError {
fn description(&self) -> &str {
match *self {
CreateSMBFileShareError::InternalServerError(ref cause) => cause,
CreateSMBFileShareError::InvalidGatewayRequest(ref cause) => cause,
CreateSMBFileShareError::Validation(ref cause) => cause,
CreateSMBFileShareError::Credentials(ref err) => err.description(),
CreateSMBFileShareError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateSMBFileShareError::ParseError(ref cause) => cause,
CreateSMBFileShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateSnapshotError {
InternalServerError(String),
InvalidGatewayRequest(String),
ServiceUnavailableError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> CreateSnapshotError {
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 CreateSnapshotError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return CreateSnapshotError::InvalidGatewayRequest(String::from(error_message));
}
"ServiceUnavailableError" => {
return CreateSnapshotError::ServiceUnavailableError(String::from(error_message));
}
"ValidationException" => {
return CreateSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateSnapshotError {
fn from(err: serde_json::error::Error) -> CreateSnapshotError {
CreateSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateSnapshotError {
fn from(err: CredentialsError) -> CreateSnapshotError {
CreateSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateSnapshotError {
fn from(err: HttpDispatchError) -> CreateSnapshotError {
CreateSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateSnapshotError {
fn from(err: io::Error) -> CreateSnapshotError {
CreateSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateSnapshotError {
fn description(&self) -> &str {
match *self {
CreateSnapshotError::InternalServerError(ref cause) => cause,
CreateSnapshotError::InvalidGatewayRequest(ref cause) => cause,
CreateSnapshotError::ServiceUnavailableError(ref cause) => cause,
CreateSnapshotError::Validation(ref cause) => cause,
CreateSnapshotError::Credentials(ref err) => err.description(),
CreateSnapshotError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateSnapshotError::ParseError(ref cause) => cause,
CreateSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateSnapshotFromVolumeRecoveryPointError {
InternalServerError(String),
InvalidGatewayRequest(String),
ServiceUnavailableError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateSnapshotFromVolumeRecoveryPointError {
pub fn from_response(res: BufferedHttpResponse) -> CreateSnapshotFromVolumeRecoveryPointError {
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 CreateSnapshotFromVolumeRecoveryPointError::InternalServerError(
String::from(error_message),
);
}
"InvalidGatewayRequestException" => {
return CreateSnapshotFromVolumeRecoveryPointError::InvalidGatewayRequest(
String::from(error_message),
);
}
"ServiceUnavailableError" => {
return CreateSnapshotFromVolumeRecoveryPointError::ServiceUnavailableError(
String::from(error_message),
);
}
"ValidationException" => {
return CreateSnapshotFromVolumeRecoveryPointError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return CreateSnapshotFromVolumeRecoveryPointError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateSnapshotFromVolumeRecoveryPointError {
fn from(err: serde_json::error::Error) -> CreateSnapshotFromVolumeRecoveryPointError {
CreateSnapshotFromVolumeRecoveryPointError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateSnapshotFromVolumeRecoveryPointError {
fn from(err: CredentialsError) -> CreateSnapshotFromVolumeRecoveryPointError {
CreateSnapshotFromVolumeRecoveryPointError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateSnapshotFromVolumeRecoveryPointError {
fn from(err: HttpDispatchError) -> CreateSnapshotFromVolumeRecoveryPointError {
CreateSnapshotFromVolumeRecoveryPointError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateSnapshotFromVolumeRecoveryPointError {
fn from(err: io::Error) -> CreateSnapshotFromVolumeRecoveryPointError {
CreateSnapshotFromVolumeRecoveryPointError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateSnapshotFromVolumeRecoveryPointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateSnapshotFromVolumeRecoveryPointError {
fn description(&self) -> &str {
match *self {
CreateSnapshotFromVolumeRecoveryPointError::InternalServerError(ref cause) => cause,
CreateSnapshotFromVolumeRecoveryPointError::InvalidGatewayRequest(ref cause) => cause,
CreateSnapshotFromVolumeRecoveryPointError::ServiceUnavailableError(ref cause) => cause,
CreateSnapshotFromVolumeRecoveryPointError::Validation(ref cause) => cause,
CreateSnapshotFromVolumeRecoveryPointError::Credentials(ref err) => err.description(),
CreateSnapshotFromVolumeRecoveryPointError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateSnapshotFromVolumeRecoveryPointError::ParseError(ref cause) => cause,
CreateSnapshotFromVolumeRecoveryPointError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateStorediSCSIVolumeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateStorediSCSIVolumeError {
pub fn from_response(res: BufferedHttpResponse) -> CreateStorediSCSIVolumeError {
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 CreateStorediSCSIVolumeError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return CreateStorediSCSIVolumeError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return CreateStorediSCSIVolumeError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateStorediSCSIVolumeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateStorediSCSIVolumeError {
fn from(err: serde_json::error::Error) -> CreateStorediSCSIVolumeError {
CreateStorediSCSIVolumeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateStorediSCSIVolumeError {
fn from(err: CredentialsError) -> CreateStorediSCSIVolumeError {
CreateStorediSCSIVolumeError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateStorediSCSIVolumeError {
fn from(err: HttpDispatchError) -> CreateStorediSCSIVolumeError {
CreateStorediSCSIVolumeError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateStorediSCSIVolumeError {
fn from(err: io::Error) -> CreateStorediSCSIVolumeError {
CreateStorediSCSIVolumeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateStorediSCSIVolumeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateStorediSCSIVolumeError {
fn description(&self) -> &str {
match *self {
CreateStorediSCSIVolumeError::InternalServerError(ref cause) => cause,
CreateStorediSCSIVolumeError::InvalidGatewayRequest(ref cause) => cause,
CreateStorediSCSIVolumeError::Validation(ref cause) => cause,
CreateStorediSCSIVolumeError::Credentials(ref err) => err.description(),
CreateStorediSCSIVolumeError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateStorediSCSIVolumeError::ParseError(ref cause) => cause,
CreateStorediSCSIVolumeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateTapeWithBarcodeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateTapeWithBarcodeError {
pub fn from_response(res: BufferedHttpResponse) -> CreateTapeWithBarcodeError {
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 CreateTapeWithBarcodeError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return CreateTapeWithBarcodeError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return CreateTapeWithBarcodeError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateTapeWithBarcodeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateTapeWithBarcodeError {
fn from(err: serde_json::error::Error) -> CreateTapeWithBarcodeError {
CreateTapeWithBarcodeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateTapeWithBarcodeError {
fn from(err: CredentialsError) -> CreateTapeWithBarcodeError {
CreateTapeWithBarcodeError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateTapeWithBarcodeError {
fn from(err: HttpDispatchError) -> CreateTapeWithBarcodeError {
CreateTapeWithBarcodeError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateTapeWithBarcodeError {
fn from(err: io::Error) -> CreateTapeWithBarcodeError {
CreateTapeWithBarcodeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateTapeWithBarcodeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateTapeWithBarcodeError {
fn description(&self) -> &str {
match *self {
CreateTapeWithBarcodeError::InternalServerError(ref cause) => cause,
CreateTapeWithBarcodeError::InvalidGatewayRequest(ref cause) => cause,
CreateTapeWithBarcodeError::Validation(ref cause) => cause,
CreateTapeWithBarcodeError::Credentials(ref err) => err.description(),
CreateTapeWithBarcodeError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateTapeWithBarcodeError::ParseError(ref cause) => cause,
CreateTapeWithBarcodeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateTapesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateTapesError {
pub fn from_response(res: BufferedHttpResponse) -> CreateTapesError {
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 CreateTapesError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return CreateTapesError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return CreateTapesError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateTapesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateTapesError {
fn from(err: serde_json::error::Error) -> CreateTapesError {
CreateTapesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateTapesError {
fn from(err: CredentialsError) -> CreateTapesError {
CreateTapesError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateTapesError {
fn from(err: HttpDispatchError) -> CreateTapesError {
CreateTapesError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateTapesError {
fn from(err: io::Error) -> CreateTapesError {
CreateTapesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateTapesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateTapesError {
fn description(&self) -> &str {
match *self {
CreateTapesError::InternalServerError(ref cause) => cause,
CreateTapesError::InvalidGatewayRequest(ref cause) => cause,
CreateTapesError::Validation(ref cause) => cause,
CreateTapesError::Credentials(ref err) => err.description(),
CreateTapesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateTapesError::ParseError(ref cause) => cause,
CreateTapesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteBandwidthRateLimitError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteBandwidthRateLimitError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteBandwidthRateLimitError {
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 DeleteBandwidthRateLimitError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DeleteBandwidthRateLimitError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteBandwidthRateLimitError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteBandwidthRateLimitError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteBandwidthRateLimitError {
fn from(err: serde_json::error::Error) -> DeleteBandwidthRateLimitError {
DeleteBandwidthRateLimitError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteBandwidthRateLimitError {
fn from(err: CredentialsError) -> DeleteBandwidthRateLimitError {
DeleteBandwidthRateLimitError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteBandwidthRateLimitError {
fn from(err: HttpDispatchError) -> DeleteBandwidthRateLimitError {
DeleteBandwidthRateLimitError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteBandwidthRateLimitError {
fn from(err: io::Error) -> DeleteBandwidthRateLimitError {
DeleteBandwidthRateLimitError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteBandwidthRateLimitError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteBandwidthRateLimitError {
fn description(&self) -> &str {
match *self {
DeleteBandwidthRateLimitError::InternalServerError(ref cause) => cause,
DeleteBandwidthRateLimitError::InvalidGatewayRequest(ref cause) => cause,
DeleteBandwidthRateLimitError::Validation(ref cause) => cause,
DeleteBandwidthRateLimitError::Credentials(ref err) => err.description(),
DeleteBandwidthRateLimitError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteBandwidthRateLimitError::ParseError(ref cause) => cause,
DeleteBandwidthRateLimitError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteChapCredentialsError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteChapCredentialsError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteChapCredentialsError {
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 DeleteChapCredentialsError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DeleteChapCredentialsError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteChapCredentialsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteChapCredentialsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteChapCredentialsError {
fn from(err: serde_json::error::Error) -> DeleteChapCredentialsError {
DeleteChapCredentialsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteChapCredentialsError {
fn from(err: CredentialsError) -> DeleteChapCredentialsError {
DeleteChapCredentialsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteChapCredentialsError {
fn from(err: HttpDispatchError) -> DeleteChapCredentialsError {
DeleteChapCredentialsError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteChapCredentialsError {
fn from(err: io::Error) -> DeleteChapCredentialsError {
DeleteChapCredentialsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteChapCredentialsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteChapCredentialsError {
fn description(&self) -> &str {
match *self {
DeleteChapCredentialsError::InternalServerError(ref cause) => cause,
DeleteChapCredentialsError::InvalidGatewayRequest(ref cause) => cause,
DeleteChapCredentialsError::Validation(ref cause) => cause,
DeleteChapCredentialsError::Credentials(ref err) => err.description(),
DeleteChapCredentialsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteChapCredentialsError::ParseError(ref cause) => cause,
DeleteChapCredentialsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFileShareError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteFileShareError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteFileShareError {
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 DeleteFileShareError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DeleteFileShareError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return DeleteFileShareError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteFileShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteFileShareError {
fn from(err: serde_json::error::Error) -> DeleteFileShareError {
DeleteFileShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteFileShareError {
fn from(err: CredentialsError) -> DeleteFileShareError {
DeleteFileShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteFileShareError {
fn from(err: HttpDispatchError) -> DeleteFileShareError {
DeleteFileShareError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteFileShareError {
fn from(err: io::Error) -> DeleteFileShareError {
DeleteFileShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteFileShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFileShareError {
fn description(&self) -> &str {
match *self {
DeleteFileShareError::InternalServerError(ref cause) => cause,
DeleteFileShareError::InvalidGatewayRequest(ref cause) => cause,
DeleteFileShareError::Validation(ref cause) => cause,
DeleteFileShareError::Credentials(ref err) => err.description(),
DeleteFileShareError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteFileShareError::ParseError(ref cause) => cause,
DeleteFileShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteGatewayError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteGatewayError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteGatewayError {
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 DeleteGatewayError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DeleteGatewayError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return DeleteGatewayError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteGatewayError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteGatewayError {
fn from(err: serde_json::error::Error) -> DeleteGatewayError {
DeleteGatewayError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteGatewayError {
fn from(err: CredentialsError) -> DeleteGatewayError {
DeleteGatewayError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteGatewayError {
fn from(err: HttpDispatchError) -> DeleteGatewayError {
DeleteGatewayError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteGatewayError {
fn from(err: io::Error) -> DeleteGatewayError {
DeleteGatewayError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteGatewayError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteGatewayError {
fn description(&self) -> &str {
match *self {
DeleteGatewayError::InternalServerError(ref cause) => cause,
DeleteGatewayError::InvalidGatewayRequest(ref cause) => cause,
DeleteGatewayError::Validation(ref cause) => cause,
DeleteGatewayError::Credentials(ref err) => err.description(),
DeleteGatewayError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteGatewayError::ParseError(ref cause) => cause,
DeleteGatewayError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteSnapshotScheduleError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteSnapshotScheduleError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteSnapshotScheduleError {
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 DeleteSnapshotScheduleError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DeleteSnapshotScheduleError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteSnapshotScheduleError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteSnapshotScheduleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteSnapshotScheduleError {
fn from(err: serde_json::error::Error) -> DeleteSnapshotScheduleError {
DeleteSnapshotScheduleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteSnapshotScheduleError {
fn from(err: CredentialsError) -> DeleteSnapshotScheduleError {
DeleteSnapshotScheduleError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteSnapshotScheduleError {
fn from(err: HttpDispatchError) -> DeleteSnapshotScheduleError {
DeleteSnapshotScheduleError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteSnapshotScheduleError {
fn from(err: io::Error) -> DeleteSnapshotScheduleError {
DeleteSnapshotScheduleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteSnapshotScheduleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteSnapshotScheduleError {
fn description(&self) -> &str {
match *self {
DeleteSnapshotScheduleError::InternalServerError(ref cause) => cause,
DeleteSnapshotScheduleError::InvalidGatewayRequest(ref cause) => cause,
DeleteSnapshotScheduleError::Validation(ref cause) => cause,
DeleteSnapshotScheduleError::Credentials(ref err) => err.description(),
DeleteSnapshotScheduleError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteSnapshotScheduleError::ParseError(ref cause) => cause,
DeleteSnapshotScheduleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteTapeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteTapeError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteTapeError {
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 DeleteTapeError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DeleteTapeError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return DeleteTapeError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteTapeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteTapeError {
fn from(err: serde_json::error::Error) -> DeleteTapeError {
DeleteTapeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteTapeError {
fn from(err: CredentialsError) -> DeleteTapeError {
DeleteTapeError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteTapeError {
fn from(err: HttpDispatchError) -> DeleteTapeError {
DeleteTapeError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteTapeError {
fn from(err: io::Error) -> DeleteTapeError {
DeleteTapeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteTapeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteTapeError {
fn description(&self) -> &str {
match *self {
DeleteTapeError::InternalServerError(ref cause) => cause,
DeleteTapeError::InvalidGatewayRequest(ref cause) => cause,
DeleteTapeError::Validation(ref cause) => cause,
DeleteTapeError::Credentials(ref err) => err.description(),
DeleteTapeError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteTapeError::ParseError(ref cause) => cause,
DeleteTapeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteTapeArchiveError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteTapeArchiveError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteTapeArchiveError {
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 DeleteTapeArchiveError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DeleteTapeArchiveError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteTapeArchiveError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteTapeArchiveError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteTapeArchiveError {
fn from(err: serde_json::error::Error) -> DeleteTapeArchiveError {
DeleteTapeArchiveError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteTapeArchiveError {
fn from(err: CredentialsError) -> DeleteTapeArchiveError {
DeleteTapeArchiveError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteTapeArchiveError {
fn from(err: HttpDispatchError) -> DeleteTapeArchiveError {
DeleteTapeArchiveError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteTapeArchiveError {
fn from(err: io::Error) -> DeleteTapeArchiveError {
DeleteTapeArchiveError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteTapeArchiveError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteTapeArchiveError {
fn description(&self) -> &str {
match *self {
DeleteTapeArchiveError::InternalServerError(ref cause) => cause,
DeleteTapeArchiveError::InvalidGatewayRequest(ref cause) => cause,
DeleteTapeArchiveError::Validation(ref cause) => cause,
DeleteTapeArchiveError::Credentials(ref err) => err.description(),
DeleteTapeArchiveError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteTapeArchiveError::ParseError(ref cause) => cause,
DeleteTapeArchiveError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteVolumeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteVolumeError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteVolumeError {
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 DeleteVolumeError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DeleteVolumeError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return DeleteVolumeError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteVolumeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteVolumeError {
fn from(err: serde_json::error::Error) -> DeleteVolumeError {
DeleteVolumeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteVolumeError {
fn from(err: CredentialsError) -> DeleteVolumeError {
DeleteVolumeError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteVolumeError {
fn from(err: HttpDispatchError) -> DeleteVolumeError {
DeleteVolumeError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteVolumeError {
fn from(err: io::Error) -> DeleteVolumeError {
DeleteVolumeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteVolumeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteVolumeError {
fn description(&self) -> &str {
match *self {
DeleteVolumeError::InternalServerError(ref cause) => cause,
DeleteVolumeError::InvalidGatewayRequest(ref cause) => cause,
DeleteVolumeError::Validation(ref cause) => cause,
DeleteVolumeError::Credentials(ref err) => err.description(),
DeleteVolumeError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteVolumeError::ParseError(ref cause) => cause,
DeleteVolumeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeBandwidthRateLimitError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeBandwidthRateLimitError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeBandwidthRateLimitError {
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 DescribeBandwidthRateLimitError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeBandwidthRateLimitError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeBandwidthRateLimitError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeBandwidthRateLimitError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeBandwidthRateLimitError {
fn from(err: serde_json::error::Error) -> DescribeBandwidthRateLimitError {
DescribeBandwidthRateLimitError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeBandwidthRateLimitError {
fn from(err: CredentialsError) -> DescribeBandwidthRateLimitError {
DescribeBandwidthRateLimitError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeBandwidthRateLimitError {
fn from(err: HttpDispatchError) -> DescribeBandwidthRateLimitError {
DescribeBandwidthRateLimitError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeBandwidthRateLimitError {
fn from(err: io::Error) -> DescribeBandwidthRateLimitError {
DescribeBandwidthRateLimitError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeBandwidthRateLimitError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeBandwidthRateLimitError {
fn description(&self) -> &str {
match *self {
DescribeBandwidthRateLimitError::InternalServerError(ref cause) => cause,
DescribeBandwidthRateLimitError::InvalidGatewayRequest(ref cause) => cause,
DescribeBandwidthRateLimitError::Validation(ref cause) => cause,
DescribeBandwidthRateLimitError::Credentials(ref err) => err.description(),
DescribeBandwidthRateLimitError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeBandwidthRateLimitError::ParseError(ref cause) => cause,
DescribeBandwidthRateLimitError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCacheError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeCacheError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeCacheError {
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 DescribeCacheError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DescribeCacheError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return DescribeCacheError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeCacheError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeCacheError {
fn from(err: serde_json::error::Error) -> DescribeCacheError {
DescribeCacheError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeCacheError {
fn from(err: CredentialsError) -> DescribeCacheError {
DescribeCacheError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeCacheError {
fn from(err: HttpDispatchError) -> DescribeCacheError {
DescribeCacheError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeCacheError {
fn from(err: io::Error) -> DescribeCacheError {
DescribeCacheError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeCacheError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCacheError {
fn description(&self) -> &str {
match *self {
DescribeCacheError::InternalServerError(ref cause) => cause,
DescribeCacheError::InvalidGatewayRequest(ref cause) => cause,
DescribeCacheError::Validation(ref cause) => cause,
DescribeCacheError::Credentials(ref err) => err.description(),
DescribeCacheError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeCacheError::ParseError(ref cause) => cause,
DescribeCacheError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCachediSCSIVolumesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeCachediSCSIVolumesError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeCachediSCSIVolumesError {
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 DescribeCachediSCSIVolumesError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeCachediSCSIVolumesError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeCachediSCSIVolumesError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeCachediSCSIVolumesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeCachediSCSIVolumesError {
fn from(err: serde_json::error::Error) -> DescribeCachediSCSIVolumesError {
DescribeCachediSCSIVolumesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeCachediSCSIVolumesError {
fn from(err: CredentialsError) -> DescribeCachediSCSIVolumesError {
DescribeCachediSCSIVolumesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeCachediSCSIVolumesError {
fn from(err: HttpDispatchError) -> DescribeCachediSCSIVolumesError {
DescribeCachediSCSIVolumesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeCachediSCSIVolumesError {
fn from(err: io::Error) -> DescribeCachediSCSIVolumesError {
DescribeCachediSCSIVolumesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeCachediSCSIVolumesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCachediSCSIVolumesError {
fn description(&self) -> &str {
match *self {
DescribeCachediSCSIVolumesError::InternalServerError(ref cause) => cause,
DescribeCachediSCSIVolumesError::InvalidGatewayRequest(ref cause) => cause,
DescribeCachediSCSIVolumesError::Validation(ref cause) => cause,
DescribeCachediSCSIVolumesError::Credentials(ref err) => err.description(),
DescribeCachediSCSIVolumesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeCachediSCSIVolumesError::ParseError(ref cause) => cause,
DescribeCachediSCSIVolumesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeChapCredentialsError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeChapCredentialsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeChapCredentialsError {
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 DescribeChapCredentialsError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeChapCredentialsError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeChapCredentialsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeChapCredentialsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeChapCredentialsError {
fn from(err: serde_json::error::Error) -> DescribeChapCredentialsError {
DescribeChapCredentialsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeChapCredentialsError {
fn from(err: CredentialsError) -> DescribeChapCredentialsError {
DescribeChapCredentialsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeChapCredentialsError {
fn from(err: HttpDispatchError) -> DescribeChapCredentialsError {
DescribeChapCredentialsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeChapCredentialsError {
fn from(err: io::Error) -> DescribeChapCredentialsError {
DescribeChapCredentialsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeChapCredentialsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeChapCredentialsError {
fn description(&self) -> &str {
match *self {
DescribeChapCredentialsError::InternalServerError(ref cause) => cause,
DescribeChapCredentialsError::InvalidGatewayRequest(ref cause) => cause,
DescribeChapCredentialsError::Validation(ref cause) => cause,
DescribeChapCredentialsError::Credentials(ref err) => err.description(),
DescribeChapCredentialsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeChapCredentialsError::ParseError(ref cause) => cause,
DescribeChapCredentialsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeGatewayInformationError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeGatewayInformationError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeGatewayInformationError {
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 DescribeGatewayInformationError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeGatewayInformationError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeGatewayInformationError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeGatewayInformationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeGatewayInformationError {
fn from(err: serde_json::error::Error) -> DescribeGatewayInformationError {
DescribeGatewayInformationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeGatewayInformationError {
fn from(err: CredentialsError) -> DescribeGatewayInformationError {
DescribeGatewayInformationError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeGatewayInformationError {
fn from(err: HttpDispatchError) -> DescribeGatewayInformationError {
DescribeGatewayInformationError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeGatewayInformationError {
fn from(err: io::Error) -> DescribeGatewayInformationError {
DescribeGatewayInformationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeGatewayInformationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeGatewayInformationError {
fn description(&self) -> &str {
match *self {
DescribeGatewayInformationError::InternalServerError(ref cause) => cause,
DescribeGatewayInformationError::InvalidGatewayRequest(ref cause) => cause,
DescribeGatewayInformationError::Validation(ref cause) => cause,
DescribeGatewayInformationError::Credentials(ref err) => err.description(),
DescribeGatewayInformationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeGatewayInformationError::ParseError(ref cause) => cause,
DescribeGatewayInformationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeMaintenanceStartTimeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeMaintenanceStartTimeError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeMaintenanceStartTimeError {
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 DescribeMaintenanceStartTimeError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeMaintenanceStartTimeError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeMaintenanceStartTimeError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeMaintenanceStartTimeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeMaintenanceStartTimeError {
fn from(err: serde_json::error::Error) -> DescribeMaintenanceStartTimeError {
DescribeMaintenanceStartTimeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeMaintenanceStartTimeError {
fn from(err: CredentialsError) -> DescribeMaintenanceStartTimeError {
DescribeMaintenanceStartTimeError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeMaintenanceStartTimeError {
fn from(err: HttpDispatchError) -> DescribeMaintenanceStartTimeError {
DescribeMaintenanceStartTimeError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeMaintenanceStartTimeError {
fn from(err: io::Error) -> DescribeMaintenanceStartTimeError {
DescribeMaintenanceStartTimeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeMaintenanceStartTimeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeMaintenanceStartTimeError {
fn description(&self) -> &str {
match *self {
DescribeMaintenanceStartTimeError::InternalServerError(ref cause) => cause,
DescribeMaintenanceStartTimeError::InvalidGatewayRequest(ref cause) => cause,
DescribeMaintenanceStartTimeError::Validation(ref cause) => cause,
DescribeMaintenanceStartTimeError::Credentials(ref err) => err.description(),
DescribeMaintenanceStartTimeError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeMaintenanceStartTimeError::ParseError(ref cause) => cause,
DescribeMaintenanceStartTimeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeNFSFileSharesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeNFSFileSharesError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeNFSFileSharesError {
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 DescribeNFSFileSharesError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeNFSFileSharesError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeNFSFileSharesError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeNFSFileSharesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeNFSFileSharesError {
fn from(err: serde_json::error::Error) -> DescribeNFSFileSharesError {
DescribeNFSFileSharesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeNFSFileSharesError {
fn from(err: CredentialsError) -> DescribeNFSFileSharesError {
DescribeNFSFileSharesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeNFSFileSharesError {
fn from(err: HttpDispatchError) -> DescribeNFSFileSharesError {
DescribeNFSFileSharesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeNFSFileSharesError {
fn from(err: io::Error) -> DescribeNFSFileSharesError {
DescribeNFSFileSharesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeNFSFileSharesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeNFSFileSharesError {
fn description(&self) -> &str {
match *self {
DescribeNFSFileSharesError::InternalServerError(ref cause) => cause,
DescribeNFSFileSharesError::InvalidGatewayRequest(ref cause) => cause,
DescribeNFSFileSharesError::Validation(ref cause) => cause,
DescribeNFSFileSharesError::Credentials(ref err) => err.description(),
DescribeNFSFileSharesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeNFSFileSharesError::ParseError(ref cause) => cause,
DescribeNFSFileSharesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSMBFileSharesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeSMBFileSharesError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeSMBFileSharesError {
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 DescribeSMBFileSharesError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeSMBFileSharesError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeSMBFileSharesError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeSMBFileSharesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeSMBFileSharesError {
fn from(err: serde_json::error::Error) -> DescribeSMBFileSharesError {
DescribeSMBFileSharesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeSMBFileSharesError {
fn from(err: CredentialsError) -> DescribeSMBFileSharesError {
DescribeSMBFileSharesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeSMBFileSharesError {
fn from(err: HttpDispatchError) -> DescribeSMBFileSharesError {
DescribeSMBFileSharesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeSMBFileSharesError {
fn from(err: io::Error) -> DescribeSMBFileSharesError {
DescribeSMBFileSharesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeSMBFileSharesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSMBFileSharesError {
fn description(&self) -> &str {
match *self {
DescribeSMBFileSharesError::InternalServerError(ref cause) => cause,
DescribeSMBFileSharesError::InvalidGatewayRequest(ref cause) => cause,
DescribeSMBFileSharesError::Validation(ref cause) => cause,
DescribeSMBFileSharesError::Credentials(ref err) => err.description(),
DescribeSMBFileSharesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeSMBFileSharesError::ParseError(ref cause) => cause,
DescribeSMBFileSharesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSMBSettingsError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeSMBSettingsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeSMBSettingsError {
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 DescribeSMBSettingsError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeSMBSettingsError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeSMBSettingsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeSMBSettingsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeSMBSettingsError {
fn from(err: serde_json::error::Error) -> DescribeSMBSettingsError {
DescribeSMBSettingsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeSMBSettingsError {
fn from(err: CredentialsError) -> DescribeSMBSettingsError {
DescribeSMBSettingsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeSMBSettingsError {
fn from(err: HttpDispatchError) -> DescribeSMBSettingsError {
DescribeSMBSettingsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeSMBSettingsError {
fn from(err: io::Error) -> DescribeSMBSettingsError {
DescribeSMBSettingsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeSMBSettingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSMBSettingsError {
fn description(&self) -> &str {
match *self {
DescribeSMBSettingsError::InternalServerError(ref cause) => cause,
DescribeSMBSettingsError::InvalidGatewayRequest(ref cause) => cause,
DescribeSMBSettingsError::Validation(ref cause) => cause,
DescribeSMBSettingsError::Credentials(ref err) => err.description(),
DescribeSMBSettingsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeSMBSettingsError::ParseError(ref cause) => cause,
DescribeSMBSettingsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSnapshotScheduleError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeSnapshotScheduleError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeSnapshotScheduleError {
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 DescribeSnapshotScheduleError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeSnapshotScheduleError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeSnapshotScheduleError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeSnapshotScheduleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeSnapshotScheduleError {
fn from(err: serde_json::error::Error) -> DescribeSnapshotScheduleError {
DescribeSnapshotScheduleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeSnapshotScheduleError {
fn from(err: CredentialsError) -> DescribeSnapshotScheduleError {
DescribeSnapshotScheduleError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeSnapshotScheduleError {
fn from(err: HttpDispatchError) -> DescribeSnapshotScheduleError {
DescribeSnapshotScheduleError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeSnapshotScheduleError {
fn from(err: io::Error) -> DescribeSnapshotScheduleError {
DescribeSnapshotScheduleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeSnapshotScheduleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSnapshotScheduleError {
fn description(&self) -> &str {
match *self {
DescribeSnapshotScheduleError::InternalServerError(ref cause) => cause,
DescribeSnapshotScheduleError::InvalidGatewayRequest(ref cause) => cause,
DescribeSnapshotScheduleError::Validation(ref cause) => cause,
DescribeSnapshotScheduleError::Credentials(ref err) => err.description(),
DescribeSnapshotScheduleError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeSnapshotScheduleError::ParseError(ref cause) => cause,
DescribeSnapshotScheduleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeStorediSCSIVolumesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeStorediSCSIVolumesError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeStorediSCSIVolumesError {
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 DescribeStorediSCSIVolumesError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeStorediSCSIVolumesError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeStorediSCSIVolumesError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeStorediSCSIVolumesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeStorediSCSIVolumesError {
fn from(err: serde_json::error::Error) -> DescribeStorediSCSIVolumesError {
DescribeStorediSCSIVolumesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeStorediSCSIVolumesError {
fn from(err: CredentialsError) -> DescribeStorediSCSIVolumesError {
DescribeStorediSCSIVolumesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeStorediSCSIVolumesError {
fn from(err: HttpDispatchError) -> DescribeStorediSCSIVolumesError {
DescribeStorediSCSIVolumesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeStorediSCSIVolumesError {
fn from(err: io::Error) -> DescribeStorediSCSIVolumesError {
DescribeStorediSCSIVolumesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeStorediSCSIVolumesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeStorediSCSIVolumesError {
fn description(&self) -> &str {
match *self {
DescribeStorediSCSIVolumesError::InternalServerError(ref cause) => cause,
DescribeStorediSCSIVolumesError::InvalidGatewayRequest(ref cause) => cause,
DescribeStorediSCSIVolumesError::Validation(ref cause) => cause,
DescribeStorediSCSIVolumesError::Credentials(ref err) => err.description(),
DescribeStorediSCSIVolumesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeStorediSCSIVolumesError::ParseError(ref cause) => cause,
DescribeStorediSCSIVolumesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTapeArchivesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeTapeArchivesError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeTapeArchivesError {
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 DescribeTapeArchivesError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeTapeArchivesError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeTapeArchivesError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeTapeArchivesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeTapeArchivesError {
fn from(err: serde_json::error::Error) -> DescribeTapeArchivesError {
DescribeTapeArchivesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeTapeArchivesError {
fn from(err: CredentialsError) -> DescribeTapeArchivesError {
DescribeTapeArchivesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeTapeArchivesError {
fn from(err: HttpDispatchError) -> DescribeTapeArchivesError {
DescribeTapeArchivesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeTapeArchivesError {
fn from(err: io::Error) -> DescribeTapeArchivesError {
DescribeTapeArchivesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeTapeArchivesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTapeArchivesError {
fn description(&self) -> &str {
match *self {
DescribeTapeArchivesError::InternalServerError(ref cause) => cause,
DescribeTapeArchivesError::InvalidGatewayRequest(ref cause) => cause,
DescribeTapeArchivesError::Validation(ref cause) => cause,
DescribeTapeArchivesError::Credentials(ref err) => err.description(),
DescribeTapeArchivesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeTapeArchivesError::ParseError(ref cause) => cause,
DescribeTapeArchivesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTapeRecoveryPointsError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeTapeRecoveryPointsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeTapeRecoveryPointsError {
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 DescribeTapeRecoveryPointsError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeTapeRecoveryPointsError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeTapeRecoveryPointsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeTapeRecoveryPointsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeTapeRecoveryPointsError {
fn from(err: serde_json::error::Error) -> DescribeTapeRecoveryPointsError {
DescribeTapeRecoveryPointsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeTapeRecoveryPointsError {
fn from(err: CredentialsError) -> DescribeTapeRecoveryPointsError {
DescribeTapeRecoveryPointsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeTapeRecoveryPointsError {
fn from(err: HttpDispatchError) -> DescribeTapeRecoveryPointsError {
DescribeTapeRecoveryPointsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeTapeRecoveryPointsError {
fn from(err: io::Error) -> DescribeTapeRecoveryPointsError {
DescribeTapeRecoveryPointsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeTapeRecoveryPointsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTapeRecoveryPointsError {
fn description(&self) -> &str {
match *self {
DescribeTapeRecoveryPointsError::InternalServerError(ref cause) => cause,
DescribeTapeRecoveryPointsError::InvalidGatewayRequest(ref cause) => cause,
DescribeTapeRecoveryPointsError::Validation(ref cause) => cause,
DescribeTapeRecoveryPointsError::Credentials(ref err) => err.description(),
DescribeTapeRecoveryPointsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeTapeRecoveryPointsError::ParseError(ref cause) => cause,
DescribeTapeRecoveryPointsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTapesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeTapesError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeTapesError {
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 DescribeTapesError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DescribeTapesError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return DescribeTapesError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeTapesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeTapesError {
fn from(err: serde_json::error::Error) -> DescribeTapesError {
DescribeTapesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeTapesError {
fn from(err: CredentialsError) -> DescribeTapesError {
DescribeTapesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeTapesError {
fn from(err: HttpDispatchError) -> DescribeTapesError {
DescribeTapesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeTapesError {
fn from(err: io::Error) -> DescribeTapesError {
DescribeTapesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeTapesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTapesError {
fn description(&self) -> &str {
match *self {
DescribeTapesError::InternalServerError(ref cause) => cause,
DescribeTapesError::InvalidGatewayRequest(ref cause) => cause,
DescribeTapesError::Validation(ref cause) => cause,
DescribeTapesError::Credentials(ref err) => err.description(),
DescribeTapesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeTapesError::ParseError(ref cause) => cause,
DescribeTapesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUploadBufferError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeUploadBufferError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeUploadBufferError {
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 DescribeUploadBufferError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeUploadBufferError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeUploadBufferError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeUploadBufferError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeUploadBufferError {
fn from(err: serde_json::error::Error) -> DescribeUploadBufferError {
DescribeUploadBufferError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeUploadBufferError {
fn from(err: CredentialsError) -> DescribeUploadBufferError {
DescribeUploadBufferError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeUploadBufferError {
fn from(err: HttpDispatchError) -> DescribeUploadBufferError {
DescribeUploadBufferError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeUploadBufferError {
fn from(err: io::Error) -> DescribeUploadBufferError {
DescribeUploadBufferError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeUploadBufferError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeUploadBufferError {
fn description(&self) -> &str {
match *self {
DescribeUploadBufferError::InternalServerError(ref cause) => cause,
DescribeUploadBufferError::InvalidGatewayRequest(ref cause) => cause,
DescribeUploadBufferError::Validation(ref cause) => cause,
DescribeUploadBufferError::Credentials(ref err) => err.description(),
DescribeUploadBufferError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeUploadBufferError::ParseError(ref cause) => cause,
DescribeUploadBufferError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeVTLDevicesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeVTLDevicesError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeVTLDevicesError {
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 DescribeVTLDevicesError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DescribeVTLDevicesError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeVTLDevicesError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeVTLDevicesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeVTLDevicesError {
fn from(err: serde_json::error::Error) -> DescribeVTLDevicesError {
DescribeVTLDevicesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeVTLDevicesError {
fn from(err: CredentialsError) -> DescribeVTLDevicesError {
DescribeVTLDevicesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeVTLDevicesError {
fn from(err: HttpDispatchError) -> DescribeVTLDevicesError {
DescribeVTLDevicesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeVTLDevicesError {
fn from(err: io::Error) -> DescribeVTLDevicesError {
DescribeVTLDevicesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeVTLDevicesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeVTLDevicesError {
fn description(&self) -> &str {
match *self {
DescribeVTLDevicesError::InternalServerError(ref cause) => cause,
DescribeVTLDevicesError::InvalidGatewayRequest(ref cause) => cause,
DescribeVTLDevicesError::Validation(ref cause) => cause,
DescribeVTLDevicesError::Credentials(ref err) => err.description(),
DescribeVTLDevicesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeVTLDevicesError::ParseError(ref cause) => cause,
DescribeVTLDevicesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeWorkingStorageError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeWorkingStorageError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeWorkingStorageError {
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 DescribeWorkingStorageError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return DescribeWorkingStorageError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeWorkingStorageError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeWorkingStorageError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeWorkingStorageError {
fn from(err: serde_json::error::Error) -> DescribeWorkingStorageError {
DescribeWorkingStorageError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeWorkingStorageError {
fn from(err: CredentialsError) -> DescribeWorkingStorageError {
DescribeWorkingStorageError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeWorkingStorageError {
fn from(err: HttpDispatchError) -> DescribeWorkingStorageError {
DescribeWorkingStorageError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeWorkingStorageError {
fn from(err: io::Error) -> DescribeWorkingStorageError {
DescribeWorkingStorageError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeWorkingStorageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeWorkingStorageError {
fn description(&self) -> &str {
match *self {
DescribeWorkingStorageError::InternalServerError(ref cause) => cause,
DescribeWorkingStorageError::InvalidGatewayRequest(ref cause) => cause,
DescribeWorkingStorageError::Validation(ref cause) => cause,
DescribeWorkingStorageError::Credentials(ref err) => err.description(),
DescribeWorkingStorageError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeWorkingStorageError::ParseError(ref cause) => cause,
DescribeWorkingStorageError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DetachVolumeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DetachVolumeError {
pub fn from_response(res: BufferedHttpResponse) -> DetachVolumeError {
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 DetachVolumeError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DetachVolumeError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return DetachVolumeError::Validation(error_message.to_string());
}
_ => {}
}
}
return DetachVolumeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DetachVolumeError {
fn from(err: serde_json::error::Error) -> DetachVolumeError {
DetachVolumeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DetachVolumeError {
fn from(err: CredentialsError) -> DetachVolumeError {
DetachVolumeError::Credentials(err)
}
}
impl From<HttpDispatchError> for DetachVolumeError {
fn from(err: HttpDispatchError) -> DetachVolumeError {
DetachVolumeError::HttpDispatch(err)
}
}
impl From<io::Error> for DetachVolumeError {
fn from(err: io::Error) -> DetachVolumeError {
DetachVolumeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DetachVolumeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetachVolumeError {
fn description(&self) -> &str {
match *self {
DetachVolumeError::InternalServerError(ref cause) => cause,
DetachVolumeError::InvalidGatewayRequest(ref cause) => cause,
DetachVolumeError::Validation(ref cause) => cause,
DetachVolumeError::Credentials(ref err) => err.description(),
DetachVolumeError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DetachVolumeError::ParseError(ref cause) => cause,
DetachVolumeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisableGatewayError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DisableGatewayError {
pub fn from_response(res: BufferedHttpResponse) -> DisableGatewayError {
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 DisableGatewayError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return DisableGatewayError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return DisableGatewayError::Validation(error_message.to_string());
}
_ => {}
}
}
return DisableGatewayError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DisableGatewayError {
fn from(err: serde_json::error::Error) -> DisableGatewayError {
DisableGatewayError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DisableGatewayError {
fn from(err: CredentialsError) -> DisableGatewayError {
DisableGatewayError::Credentials(err)
}
}
impl From<HttpDispatchError> for DisableGatewayError {
fn from(err: HttpDispatchError) -> DisableGatewayError {
DisableGatewayError::HttpDispatch(err)
}
}
impl From<io::Error> for DisableGatewayError {
fn from(err: io::Error) -> DisableGatewayError {
DisableGatewayError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DisableGatewayError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisableGatewayError {
fn description(&self) -> &str {
match *self {
DisableGatewayError::InternalServerError(ref cause) => cause,
DisableGatewayError::InvalidGatewayRequest(ref cause) => cause,
DisableGatewayError::Validation(ref cause) => cause,
DisableGatewayError::Credentials(ref err) => err.description(),
DisableGatewayError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DisableGatewayError::ParseError(ref cause) => cause,
DisableGatewayError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum JoinDomainError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl JoinDomainError {
pub fn from_response(res: BufferedHttpResponse) -> JoinDomainError {
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 JoinDomainError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return JoinDomainError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return JoinDomainError::Validation(error_message.to_string());
}
_ => {}
}
}
return JoinDomainError::Unknown(res);
}
}
impl From<serde_json::error::Error> for JoinDomainError {
fn from(err: serde_json::error::Error) -> JoinDomainError {
JoinDomainError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for JoinDomainError {
fn from(err: CredentialsError) -> JoinDomainError {
JoinDomainError::Credentials(err)
}
}
impl From<HttpDispatchError> for JoinDomainError {
fn from(err: HttpDispatchError) -> JoinDomainError {
JoinDomainError::HttpDispatch(err)
}
}
impl From<io::Error> for JoinDomainError {
fn from(err: io::Error) -> JoinDomainError {
JoinDomainError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for JoinDomainError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for JoinDomainError {
fn description(&self) -> &str {
match *self {
JoinDomainError::InternalServerError(ref cause) => cause,
JoinDomainError::InvalidGatewayRequest(ref cause) => cause,
JoinDomainError::Validation(ref cause) => cause,
JoinDomainError::Credentials(ref err) => err.description(),
JoinDomainError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
JoinDomainError::ParseError(ref cause) => cause,
JoinDomainError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListFileSharesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListFileSharesError {
pub fn from_response(res: BufferedHttpResponse) -> ListFileSharesError {
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 ListFileSharesError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return ListFileSharesError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return ListFileSharesError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListFileSharesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListFileSharesError {
fn from(err: serde_json::error::Error) -> ListFileSharesError {
ListFileSharesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListFileSharesError {
fn from(err: CredentialsError) -> ListFileSharesError {
ListFileSharesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListFileSharesError {
fn from(err: HttpDispatchError) -> ListFileSharesError {
ListFileSharesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListFileSharesError {
fn from(err: io::Error) -> ListFileSharesError {
ListFileSharesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListFileSharesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListFileSharesError {
fn description(&self) -> &str {
match *self {
ListFileSharesError::InternalServerError(ref cause) => cause,
ListFileSharesError::InvalidGatewayRequest(ref cause) => cause,
ListFileSharesError::Validation(ref cause) => cause,
ListFileSharesError::Credentials(ref err) => err.description(),
ListFileSharesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListFileSharesError::ParseError(ref cause) => cause,
ListFileSharesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListGatewaysError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListGatewaysError {
pub fn from_response(res: BufferedHttpResponse) -> ListGatewaysError {
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 ListGatewaysError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return ListGatewaysError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return ListGatewaysError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListGatewaysError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListGatewaysError {
fn from(err: serde_json::error::Error) -> ListGatewaysError {
ListGatewaysError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListGatewaysError {
fn from(err: CredentialsError) -> ListGatewaysError {
ListGatewaysError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListGatewaysError {
fn from(err: HttpDispatchError) -> ListGatewaysError {
ListGatewaysError::HttpDispatch(err)
}
}
impl From<io::Error> for ListGatewaysError {
fn from(err: io::Error) -> ListGatewaysError {
ListGatewaysError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListGatewaysError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListGatewaysError {
fn description(&self) -> &str {
match *self {
ListGatewaysError::InternalServerError(ref cause) => cause,
ListGatewaysError::InvalidGatewayRequest(ref cause) => cause,
ListGatewaysError::Validation(ref cause) => cause,
ListGatewaysError::Credentials(ref err) => err.description(),
ListGatewaysError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListGatewaysError::ParseError(ref cause) => cause,
ListGatewaysError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListLocalDisksError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListLocalDisksError {
pub fn from_response(res: BufferedHttpResponse) -> ListLocalDisksError {
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 ListLocalDisksError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return ListLocalDisksError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return ListLocalDisksError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListLocalDisksError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListLocalDisksError {
fn from(err: serde_json::error::Error) -> ListLocalDisksError {
ListLocalDisksError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListLocalDisksError {
fn from(err: CredentialsError) -> ListLocalDisksError {
ListLocalDisksError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListLocalDisksError {
fn from(err: HttpDispatchError) -> ListLocalDisksError {
ListLocalDisksError::HttpDispatch(err)
}
}
impl From<io::Error> for ListLocalDisksError {
fn from(err: io::Error) -> ListLocalDisksError {
ListLocalDisksError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListLocalDisksError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListLocalDisksError {
fn description(&self) -> &str {
match *self {
ListLocalDisksError::InternalServerError(ref cause) => cause,
ListLocalDisksError::InvalidGatewayRequest(ref cause) => cause,
ListLocalDisksError::Validation(ref cause) => cause,
ListLocalDisksError::Credentials(ref err) => err.description(),
ListLocalDisksError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListLocalDisksError::ParseError(ref cause) => cause,
ListLocalDisksError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> ListTagsForResourceError {
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 ListTagsForResourceError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return ListTagsForResourceError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return ListTagsForResourceError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListTagsForResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTagsForResourceError {
fn from(err: serde_json::error::Error) -> ListTagsForResourceError {
ListTagsForResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTagsForResourceError {
fn from(err: CredentialsError) -> ListTagsForResourceError {
ListTagsForResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTagsForResourceError {
fn from(err: HttpDispatchError) -> ListTagsForResourceError {
ListTagsForResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTagsForResourceError {
fn from(err: io::Error) -> ListTagsForResourceError {
ListTagsForResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::InternalServerError(ref cause) => cause,
ListTagsForResourceError::InvalidGatewayRequest(ref cause) => cause,
ListTagsForResourceError::Validation(ref cause) => cause,
ListTagsForResourceError::Credentials(ref err) => err.description(),
ListTagsForResourceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListTagsForResourceError::ParseError(ref cause) => cause,
ListTagsForResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTapesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTapesError {
pub fn from_response(res: BufferedHttpResponse) -> ListTapesError {
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 ListTapesError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return ListTapesError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return ListTapesError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListTapesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTapesError {
fn from(err: serde_json::error::Error) -> ListTapesError {
ListTapesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTapesError {
fn from(err: CredentialsError) -> ListTapesError {
ListTapesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTapesError {
fn from(err: HttpDispatchError) -> ListTapesError {
ListTapesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTapesError {
fn from(err: io::Error) -> ListTapesError {
ListTapesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListTapesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTapesError {
fn description(&self) -> &str {
match *self {
ListTapesError::InternalServerError(ref cause) => cause,
ListTapesError::InvalidGatewayRequest(ref cause) => cause,
ListTapesError::Validation(ref cause) => cause,
ListTapesError::Credentials(ref err) => err.description(),
ListTapesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListTapesError::ParseError(ref cause) => cause,
ListTapesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListVolumeInitiatorsError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListVolumeInitiatorsError {
pub fn from_response(res: BufferedHttpResponse) -> ListVolumeInitiatorsError {
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 ListVolumeInitiatorsError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return ListVolumeInitiatorsError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return ListVolumeInitiatorsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListVolumeInitiatorsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListVolumeInitiatorsError {
fn from(err: serde_json::error::Error) -> ListVolumeInitiatorsError {
ListVolumeInitiatorsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListVolumeInitiatorsError {
fn from(err: CredentialsError) -> ListVolumeInitiatorsError {
ListVolumeInitiatorsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListVolumeInitiatorsError {
fn from(err: HttpDispatchError) -> ListVolumeInitiatorsError {
ListVolumeInitiatorsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListVolumeInitiatorsError {
fn from(err: io::Error) -> ListVolumeInitiatorsError {
ListVolumeInitiatorsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListVolumeInitiatorsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListVolumeInitiatorsError {
fn description(&self) -> &str {
match *self {
ListVolumeInitiatorsError::InternalServerError(ref cause) => cause,
ListVolumeInitiatorsError::InvalidGatewayRequest(ref cause) => cause,
ListVolumeInitiatorsError::Validation(ref cause) => cause,
ListVolumeInitiatorsError::Credentials(ref err) => err.description(),
ListVolumeInitiatorsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListVolumeInitiatorsError::ParseError(ref cause) => cause,
ListVolumeInitiatorsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListVolumeRecoveryPointsError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListVolumeRecoveryPointsError {
pub fn from_response(res: BufferedHttpResponse) -> ListVolumeRecoveryPointsError {
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 ListVolumeRecoveryPointsError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return ListVolumeRecoveryPointsError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return ListVolumeRecoveryPointsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListVolumeRecoveryPointsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListVolumeRecoveryPointsError {
fn from(err: serde_json::error::Error) -> ListVolumeRecoveryPointsError {
ListVolumeRecoveryPointsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListVolumeRecoveryPointsError {
fn from(err: CredentialsError) -> ListVolumeRecoveryPointsError {
ListVolumeRecoveryPointsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListVolumeRecoveryPointsError {
fn from(err: HttpDispatchError) -> ListVolumeRecoveryPointsError {
ListVolumeRecoveryPointsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListVolumeRecoveryPointsError {
fn from(err: io::Error) -> ListVolumeRecoveryPointsError {
ListVolumeRecoveryPointsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListVolumeRecoveryPointsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListVolumeRecoveryPointsError {
fn description(&self) -> &str {
match *self {
ListVolumeRecoveryPointsError::InternalServerError(ref cause) => cause,
ListVolumeRecoveryPointsError::InvalidGatewayRequest(ref cause) => cause,
ListVolumeRecoveryPointsError::Validation(ref cause) => cause,
ListVolumeRecoveryPointsError::Credentials(ref err) => err.description(),
ListVolumeRecoveryPointsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListVolumeRecoveryPointsError::ParseError(ref cause) => cause,
ListVolumeRecoveryPointsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListVolumesError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListVolumesError {
pub fn from_response(res: BufferedHttpResponse) -> ListVolumesError {
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 ListVolumesError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return ListVolumesError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return ListVolumesError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListVolumesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListVolumesError {
fn from(err: serde_json::error::Error) -> ListVolumesError {
ListVolumesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListVolumesError {
fn from(err: CredentialsError) -> ListVolumesError {
ListVolumesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListVolumesError {
fn from(err: HttpDispatchError) -> ListVolumesError {
ListVolumesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListVolumesError {
fn from(err: io::Error) -> ListVolumesError {
ListVolumesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListVolumesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListVolumesError {
fn description(&self) -> &str {
match *self {
ListVolumesError::InternalServerError(ref cause) => cause,
ListVolumesError::InvalidGatewayRequest(ref cause) => cause,
ListVolumesError::Validation(ref cause) => cause,
ListVolumesError::Credentials(ref err) => err.description(),
ListVolumesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListVolumesError::ParseError(ref cause) => cause,
ListVolumesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum NotifyWhenUploadedError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl NotifyWhenUploadedError {
pub fn from_response(res: BufferedHttpResponse) -> NotifyWhenUploadedError {
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 NotifyWhenUploadedError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return NotifyWhenUploadedError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return NotifyWhenUploadedError::Validation(error_message.to_string());
}
_ => {}
}
}
return NotifyWhenUploadedError::Unknown(res);
}
}
impl From<serde_json::error::Error> for NotifyWhenUploadedError {
fn from(err: serde_json::error::Error) -> NotifyWhenUploadedError {
NotifyWhenUploadedError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for NotifyWhenUploadedError {
fn from(err: CredentialsError) -> NotifyWhenUploadedError {
NotifyWhenUploadedError::Credentials(err)
}
}
impl From<HttpDispatchError> for NotifyWhenUploadedError {
fn from(err: HttpDispatchError) -> NotifyWhenUploadedError {
NotifyWhenUploadedError::HttpDispatch(err)
}
}
impl From<io::Error> for NotifyWhenUploadedError {
fn from(err: io::Error) -> NotifyWhenUploadedError {
NotifyWhenUploadedError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for NotifyWhenUploadedError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for NotifyWhenUploadedError {
fn description(&self) -> &str {
match *self {
NotifyWhenUploadedError::InternalServerError(ref cause) => cause,
NotifyWhenUploadedError::InvalidGatewayRequest(ref cause) => cause,
NotifyWhenUploadedError::Validation(ref cause) => cause,
NotifyWhenUploadedError::Credentials(ref err) => err.description(),
NotifyWhenUploadedError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
NotifyWhenUploadedError::ParseError(ref cause) => cause,
NotifyWhenUploadedError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RefreshCacheError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RefreshCacheError {
pub fn from_response(res: BufferedHttpResponse) -> RefreshCacheError {
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 RefreshCacheError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return RefreshCacheError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return RefreshCacheError::Validation(error_message.to_string());
}
_ => {}
}
}
return RefreshCacheError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RefreshCacheError {
fn from(err: serde_json::error::Error) -> RefreshCacheError {
RefreshCacheError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RefreshCacheError {
fn from(err: CredentialsError) -> RefreshCacheError {
RefreshCacheError::Credentials(err)
}
}
impl From<HttpDispatchError> for RefreshCacheError {
fn from(err: HttpDispatchError) -> RefreshCacheError {
RefreshCacheError::HttpDispatch(err)
}
}
impl From<io::Error> for RefreshCacheError {
fn from(err: io::Error) -> RefreshCacheError {
RefreshCacheError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RefreshCacheError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RefreshCacheError {
fn description(&self) -> &str {
match *self {
RefreshCacheError::InternalServerError(ref cause) => cause,
RefreshCacheError::InvalidGatewayRequest(ref cause) => cause,
RefreshCacheError::Validation(ref cause) => cause,
RefreshCacheError::Credentials(ref err) => err.description(),
RefreshCacheError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
RefreshCacheError::ParseError(ref cause) => cause,
RefreshCacheError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveTagsFromResourceError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RemoveTagsFromResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RemoveTagsFromResourceError {
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 RemoveTagsFromResourceError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return RemoveTagsFromResourceError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return RemoveTagsFromResourceError::Validation(error_message.to_string());
}
_ => {}
}
}
return RemoveTagsFromResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RemoveTagsFromResourceError {
fn from(err: serde_json::error::Error) -> RemoveTagsFromResourceError {
RemoveTagsFromResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RemoveTagsFromResourceError {
fn from(err: CredentialsError) -> RemoveTagsFromResourceError {
RemoveTagsFromResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for RemoveTagsFromResourceError {
fn from(err: HttpDispatchError) -> RemoveTagsFromResourceError {
RemoveTagsFromResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for RemoveTagsFromResourceError {
fn from(err: io::Error) -> RemoveTagsFromResourceError {
RemoveTagsFromResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RemoveTagsFromResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveTagsFromResourceError {
fn description(&self) -> &str {
match *self {
RemoveTagsFromResourceError::InternalServerError(ref cause) => cause,
RemoveTagsFromResourceError::InvalidGatewayRequest(ref cause) => cause,
RemoveTagsFromResourceError::Validation(ref cause) => cause,
RemoveTagsFromResourceError::Credentials(ref err) => err.description(),
RemoveTagsFromResourceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
RemoveTagsFromResourceError::ParseError(ref cause) => cause,
RemoveTagsFromResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ResetCacheError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ResetCacheError {
pub fn from_response(res: BufferedHttpResponse) -> ResetCacheError {
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 ResetCacheError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return ResetCacheError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return ResetCacheError::Validation(error_message.to_string());
}
_ => {}
}
}
return ResetCacheError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ResetCacheError {
fn from(err: serde_json::error::Error) -> ResetCacheError {
ResetCacheError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ResetCacheError {
fn from(err: CredentialsError) -> ResetCacheError {
ResetCacheError::Credentials(err)
}
}
impl From<HttpDispatchError> for ResetCacheError {
fn from(err: HttpDispatchError) -> ResetCacheError {
ResetCacheError::HttpDispatch(err)
}
}
impl From<io::Error> for ResetCacheError {
fn from(err: io::Error) -> ResetCacheError {
ResetCacheError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ResetCacheError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ResetCacheError {
fn description(&self) -> &str {
match *self {
ResetCacheError::InternalServerError(ref cause) => cause,
ResetCacheError::InvalidGatewayRequest(ref cause) => cause,
ResetCacheError::Validation(ref cause) => cause,
ResetCacheError::Credentials(ref err) => err.description(),
ResetCacheError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ResetCacheError::ParseError(ref cause) => cause,
ResetCacheError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RetrieveTapeArchiveError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RetrieveTapeArchiveError {
pub fn from_response(res: BufferedHttpResponse) -> RetrieveTapeArchiveError {
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 RetrieveTapeArchiveError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return RetrieveTapeArchiveError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return RetrieveTapeArchiveError::Validation(error_message.to_string());
}
_ => {}
}
}
return RetrieveTapeArchiveError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RetrieveTapeArchiveError {
fn from(err: serde_json::error::Error) -> RetrieveTapeArchiveError {
RetrieveTapeArchiveError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RetrieveTapeArchiveError {
fn from(err: CredentialsError) -> RetrieveTapeArchiveError {
RetrieveTapeArchiveError::Credentials(err)
}
}
impl From<HttpDispatchError> for RetrieveTapeArchiveError {
fn from(err: HttpDispatchError) -> RetrieveTapeArchiveError {
RetrieveTapeArchiveError::HttpDispatch(err)
}
}
impl From<io::Error> for RetrieveTapeArchiveError {
fn from(err: io::Error) -> RetrieveTapeArchiveError {
RetrieveTapeArchiveError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RetrieveTapeArchiveError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RetrieveTapeArchiveError {
fn description(&self) -> &str {
match *self {
RetrieveTapeArchiveError::InternalServerError(ref cause) => cause,
RetrieveTapeArchiveError::InvalidGatewayRequest(ref cause) => cause,
RetrieveTapeArchiveError::Validation(ref cause) => cause,
RetrieveTapeArchiveError::Credentials(ref err) => err.description(),
RetrieveTapeArchiveError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
RetrieveTapeArchiveError::ParseError(ref cause) => cause,
RetrieveTapeArchiveError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RetrieveTapeRecoveryPointError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RetrieveTapeRecoveryPointError {
pub fn from_response(res: BufferedHttpResponse) -> RetrieveTapeRecoveryPointError {
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 RetrieveTapeRecoveryPointError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return RetrieveTapeRecoveryPointError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return RetrieveTapeRecoveryPointError::Validation(error_message.to_string());
}
_ => {}
}
}
return RetrieveTapeRecoveryPointError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RetrieveTapeRecoveryPointError {
fn from(err: serde_json::error::Error) -> RetrieveTapeRecoveryPointError {
RetrieveTapeRecoveryPointError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RetrieveTapeRecoveryPointError {
fn from(err: CredentialsError) -> RetrieveTapeRecoveryPointError {
RetrieveTapeRecoveryPointError::Credentials(err)
}
}
impl From<HttpDispatchError> for RetrieveTapeRecoveryPointError {
fn from(err: HttpDispatchError) -> RetrieveTapeRecoveryPointError {
RetrieveTapeRecoveryPointError::HttpDispatch(err)
}
}
impl From<io::Error> for RetrieveTapeRecoveryPointError {
fn from(err: io::Error) -> RetrieveTapeRecoveryPointError {
RetrieveTapeRecoveryPointError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RetrieveTapeRecoveryPointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RetrieveTapeRecoveryPointError {
fn description(&self) -> &str {
match *self {
RetrieveTapeRecoveryPointError::InternalServerError(ref cause) => cause,
RetrieveTapeRecoveryPointError::InvalidGatewayRequest(ref cause) => cause,
RetrieveTapeRecoveryPointError::Validation(ref cause) => cause,
RetrieveTapeRecoveryPointError::Credentials(ref err) => err.description(),
RetrieveTapeRecoveryPointError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
RetrieveTapeRecoveryPointError::ParseError(ref cause) => cause,
RetrieveTapeRecoveryPointError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetLocalConsolePasswordError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl SetLocalConsolePasswordError {
pub fn from_response(res: BufferedHttpResponse) -> SetLocalConsolePasswordError {
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 SetLocalConsolePasswordError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return SetLocalConsolePasswordError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return SetLocalConsolePasswordError::Validation(error_message.to_string());
}
_ => {}
}
}
return SetLocalConsolePasswordError::Unknown(res);
}
}
impl From<serde_json::error::Error> for SetLocalConsolePasswordError {
fn from(err: serde_json::error::Error) -> SetLocalConsolePasswordError {
SetLocalConsolePasswordError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for SetLocalConsolePasswordError {
fn from(err: CredentialsError) -> SetLocalConsolePasswordError {
SetLocalConsolePasswordError::Credentials(err)
}
}
impl From<HttpDispatchError> for SetLocalConsolePasswordError {
fn from(err: HttpDispatchError) -> SetLocalConsolePasswordError {
SetLocalConsolePasswordError::HttpDispatch(err)
}
}
impl From<io::Error> for SetLocalConsolePasswordError {
fn from(err: io::Error) -> SetLocalConsolePasswordError {
SetLocalConsolePasswordError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for SetLocalConsolePasswordError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetLocalConsolePasswordError {
fn description(&self) -> &str {
match *self {
SetLocalConsolePasswordError::InternalServerError(ref cause) => cause,
SetLocalConsolePasswordError::InvalidGatewayRequest(ref cause) => cause,
SetLocalConsolePasswordError::Validation(ref cause) => cause,
SetLocalConsolePasswordError::Credentials(ref err) => err.description(),
SetLocalConsolePasswordError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
SetLocalConsolePasswordError::ParseError(ref cause) => cause,
SetLocalConsolePasswordError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetSMBGuestPasswordError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl SetSMBGuestPasswordError {
pub fn from_response(res: BufferedHttpResponse) -> SetSMBGuestPasswordError {
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 SetSMBGuestPasswordError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return SetSMBGuestPasswordError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return SetSMBGuestPasswordError::Validation(error_message.to_string());
}
_ => {}
}
}
return SetSMBGuestPasswordError::Unknown(res);
}
}
impl From<serde_json::error::Error> for SetSMBGuestPasswordError {
fn from(err: serde_json::error::Error) -> SetSMBGuestPasswordError {
SetSMBGuestPasswordError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for SetSMBGuestPasswordError {
fn from(err: CredentialsError) -> SetSMBGuestPasswordError {
SetSMBGuestPasswordError::Credentials(err)
}
}
impl From<HttpDispatchError> for SetSMBGuestPasswordError {
fn from(err: HttpDispatchError) -> SetSMBGuestPasswordError {
SetSMBGuestPasswordError::HttpDispatch(err)
}
}
impl From<io::Error> for SetSMBGuestPasswordError {
fn from(err: io::Error) -> SetSMBGuestPasswordError {
SetSMBGuestPasswordError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for SetSMBGuestPasswordError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetSMBGuestPasswordError {
fn description(&self) -> &str {
match *self {
SetSMBGuestPasswordError::InternalServerError(ref cause) => cause,
SetSMBGuestPasswordError::InvalidGatewayRequest(ref cause) => cause,
SetSMBGuestPasswordError::Validation(ref cause) => cause,
SetSMBGuestPasswordError::Credentials(ref err) => err.description(),
SetSMBGuestPasswordError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
SetSMBGuestPasswordError::ParseError(ref cause) => cause,
SetSMBGuestPasswordError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ShutdownGatewayError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ShutdownGatewayError {
pub fn from_response(res: BufferedHttpResponse) -> ShutdownGatewayError {
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 ShutdownGatewayError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return ShutdownGatewayError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return ShutdownGatewayError::Validation(error_message.to_string());
}
_ => {}
}
}
return ShutdownGatewayError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ShutdownGatewayError {
fn from(err: serde_json::error::Error) -> ShutdownGatewayError {
ShutdownGatewayError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ShutdownGatewayError {
fn from(err: CredentialsError) -> ShutdownGatewayError {
ShutdownGatewayError::Credentials(err)
}
}
impl From<HttpDispatchError> for ShutdownGatewayError {
fn from(err: HttpDispatchError) -> ShutdownGatewayError {
ShutdownGatewayError::HttpDispatch(err)
}
}
impl From<io::Error> for ShutdownGatewayError {
fn from(err: io::Error) -> ShutdownGatewayError {
ShutdownGatewayError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ShutdownGatewayError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ShutdownGatewayError {
fn description(&self) -> &str {
match *self {
ShutdownGatewayError::InternalServerError(ref cause) => cause,
ShutdownGatewayError::InvalidGatewayRequest(ref cause) => cause,
ShutdownGatewayError::Validation(ref cause) => cause,
ShutdownGatewayError::Credentials(ref err) => err.description(),
ShutdownGatewayError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ShutdownGatewayError::ParseError(ref cause) => cause,
ShutdownGatewayError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartGatewayError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StartGatewayError {
pub fn from_response(res: BufferedHttpResponse) -> StartGatewayError {
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 StartGatewayError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return StartGatewayError::InvalidGatewayRequest(String::from(error_message));
}
"ValidationException" => {
return StartGatewayError::Validation(error_message.to_string());
}
_ => {}
}
}
return StartGatewayError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StartGatewayError {
fn from(err: serde_json::error::Error) -> StartGatewayError {
StartGatewayError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StartGatewayError {
fn from(err: CredentialsError) -> StartGatewayError {
StartGatewayError::Credentials(err)
}
}
impl From<HttpDispatchError> for StartGatewayError {
fn from(err: HttpDispatchError) -> StartGatewayError {
StartGatewayError::HttpDispatch(err)
}
}
impl From<io::Error> for StartGatewayError {
fn from(err: io::Error) -> StartGatewayError {
StartGatewayError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StartGatewayError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartGatewayError {
fn description(&self) -> &str {
match *self {
StartGatewayError::InternalServerError(ref cause) => cause,
StartGatewayError::InvalidGatewayRequest(ref cause) => cause,
StartGatewayError::Validation(ref cause) => cause,
StartGatewayError::Credentials(ref err) => err.description(),
StartGatewayError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
StartGatewayError::ParseError(ref cause) => cause,
StartGatewayError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateBandwidthRateLimitError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateBandwidthRateLimitError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateBandwidthRateLimitError {
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 UpdateBandwidthRateLimitError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return UpdateBandwidthRateLimitError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateBandwidthRateLimitError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateBandwidthRateLimitError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateBandwidthRateLimitError {
fn from(err: serde_json::error::Error) -> UpdateBandwidthRateLimitError {
UpdateBandwidthRateLimitError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateBandwidthRateLimitError {
fn from(err: CredentialsError) -> UpdateBandwidthRateLimitError {
UpdateBandwidthRateLimitError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateBandwidthRateLimitError {
fn from(err: HttpDispatchError) -> UpdateBandwidthRateLimitError {
UpdateBandwidthRateLimitError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateBandwidthRateLimitError {
fn from(err: io::Error) -> UpdateBandwidthRateLimitError {
UpdateBandwidthRateLimitError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateBandwidthRateLimitError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateBandwidthRateLimitError {
fn description(&self) -> &str {
match *self {
UpdateBandwidthRateLimitError::InternalServerError(ref cause) => cause,
UpdateBandwidthRateLimitError::InvalidGatewayRequest(ref cause) => cause,
UpdateBandwidthRateLimitError::Validation(ref cause) => cause,
UpdateBandwidthRateLimitError::Credentials(ref err) => err.description(),
UpdateBandwidthRateLimitError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateBandwidthRateLimitError::ParseError(ref cause) => cause,
UpdateBandwidthRateLimitError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateChapCredentialsError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateChapCredentialsError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateChapCredentialsError {
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 UpdateChapCredentialsError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return UpdateChapCredentialsError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateChapCredentialsError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateChapCredentialsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateChapCredentialsError {
fn from(err: serde_json::error::Error) -> UpdateChapCredentialsError {
UpdateChapCredentialsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateChapCredentialsError {
fn from(err: CredentialsError) -> UpdateChapCredentialsError {
UpdateChapCredentialsError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateChapCredentialsError {
fn from(err: HttpDispatchError) -> UpdateChapCredentialsError {
UpdateChapCredentialsError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateChapCredentialsError {
fn from(err: io::Error) -> UpdateChapCredentialsError {
UpdateChapCredentialsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateChapCredentialsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateChapCredentialsError {
fn description(&self) -> &str {
match *self {
UpdateChapCredentialsError::InternalServerError(ref cause) => cause,
UpdateChapCredentialsError::InvalidGatewayRequest(ref cause) => cause,
UpdateChapCredentialsError::Validation(ref cause) => cause,
UpdateChapCredentialsError::Credentials(ref err) => err.description(),
UpdateChapCredentialsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateChapCredentialsError::ParseError(ref cause) => cause,
UpdateChapCredentialsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateGatewayInformationError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateGatewayInformationError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateGatewayInformationError {
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 UpdateGatewayInformationError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return UpdateGatewayInformationError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateGatewayInformationError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateGatewayInformationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateGatewayInformationError {
fn from(err: serde_json::error::Error) -> UpdateGatewayInformationError {
UpdateGatewayInformationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateGatewayInformationError {
fn from(err: CredentialsError) -> UpdateGatewayInformationError {
UpdateGatewayInformationError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateGatewayInformationError {
fn from(err: HttpDispatchError) -> UpdateGatewayInformationError {
UpdateGatewayInformationError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateGatewayInformationError {
fn from(err: io::Error) -> UpdateGatewayInformationError {
UpdateGatewayInformationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateGatewayInformationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateGatewayInformationError {
fn description(&self) -> &str {
match *self {
UpdateGatewayInformationError::InternalServerError(ref cause) => cause,
UpdateGatewayInformationError::InvalidGatewayRequest(ref cause) => cause,
UpdateGatewayInformationError::Validation(ref cause) => cause,
UpdateGatewayInformationError::Credentials(ref err) => err.description(),
UpdateGatewayInformationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateGatewayInformationError::ParseError(ref cause) => cause,
UpdateGatewayInformationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateGatewaySoftwareNowError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateGatewaySoftwareNowError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateGatewaySoftwareNowError {
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 UpdateGatewaySoftwareNowError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return UpdateGatewaySoftwareNowError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateGatewaySoftwareNowError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateGatewaySoftwareNowError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateGatewaySoftwareNowError {
fn from(err: serde_json::error::Error) -> UpdateGatewaySoftwareNowError {
UpdateGatewaySoftwareNowError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateGatewaySoftwareNowError {
fn from(err: CredentialsError) -> UpdateGatewaySoftwareNowError {
UpdateGatewaySoftwareNowError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateGatewaySoftwareNowError {
fn from(err: HttpDispatchError) -> UpdateGatewaySoftwareNowError {
UpdateGatewaySoftwareNowError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateGatewaySoftwareNowError {
fn from(err: io::Error) -> UpdateGatewaySoftwareNowError {
UpdateGatewaySoftwareNowError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateGatewaySoftwareNowError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateGatewaySoftwareNowError {
fn description(&self) -> &str {
match *self {
UpdateGatewaySoftwareNowError::InternalServerError(ref cause) => cause,
UpdateGatewaySoftwareNowError::InvalidGatewayRequest(ref cause) => cause,
UpdateGatewaySoftwareNowError::Validation(ref cause) => cause,
UpdateGatewaySoftwareNowError::Credentials(ref err) => err.description(),
UpdateGatewaySoftwareNowError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateGatewaySoftwareNowError::ParseError(ref cause) => cause,
UpdateGatewaySoftwareNowError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateMaintenanceStartTimeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateMaintenanceStartTimeError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateMaintenanceStartTimeError {
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 UpdateMaintenanceStartTimeError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return UpdateMaintenanceStartTimeError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateMaintenanceStartTimeError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateMaintenanceStartTimeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateMaintenanceStartTimeError {
fn from(err: serde_json::error::Error) -> UpdateMaintenanceStartTimeError {
UpdateMaintenanceStartTimeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateMaintenanceStartTimeError {
fn from(err: CredentialsError) -> UpdateMaintenanceStartTimeError {
UpdateMaintenanceStartTimeError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateMaintenanceStartTimeError {
fn from(err: HttpDispatchError) -> UpdateMaintenanceStartTimeError {
UpdateMaintenanceStartTimeError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateMaintenanceStartTimeError {
fn from(err: io::Error) -> UpdateMaintenanceStartTimeError {
UpdateMaintenanceStartTimeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateMaintenanceStartTimeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateMaintenanceStartTimeError {
fn description(&self) -> &str {
match *self {
UpdateMaintenanceStartTimeError::InternalServerError(ref cause) => cause,
UpdateMaintenanceStartTimeError::InvalidGatewayRequest(ref cause) => cause,
UpdateMaintenanceStartTimeError::Validation(ref cause) => cause,
UpdateMaintenanceStartTimeError::Credentials(ref err) => err.description(),
UpdateMaintenanceStartTimeError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateMaintenanceStartTimeError::ParseError(ref cause) => cause,
UpdateMaintenanceStartTimeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateNFSFileShareError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateNFSFileShareError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateNFSFileShareError {
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 UpdateNFSFileShareError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return UpdateNFSFileShareError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateNFSFileShareError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateNFSFileShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateNFSFileShareError {
fn from(err: serde_json::error::Error) -> UpdateNFSFileShareError {
UpdateNFSFileShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateNFSFileShareError {
fn from(err: CredentialsError) -> UpdateNFSFileShareError {
UpdateNFSFileShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateNFSFileShareError {
fn from(err: HttpDispatchError) -> UpdateNFSFileShareError {
UpdateNFSFileShareError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateNFSFileShareError {
fn from(err: io::Error) -> UpdateNFSFileShareError {
UpdateNFSFileShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateNFSFileShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateNFSFileShareError {
fn description(&self) -> &str {
match *self {
UpdateNFSFileShareError::InternalServerError(ref cause) => cause,
UpdateNFSFileShareError::InvalidGatewayRequest(ref cause) => cause,
UpdateNFSFileShareError::Validation(ref cause) => cause,
UpdateNFSFileShareError::Credentials(ref err) => err.description(),
UpdateNFSFileShareError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateNFSFileShareError::ParseError(ref cause) => cause,
UpdateNFSFileShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateSMBFileShareError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateSMBFileShareError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateSMBFileShareError {
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 UpdateSMBFileShareError::InternalServerError(String::from(error_message));
}
"InvalidGatewayRequestException" => {
return UpdateSMBFileShareError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateSMBFileShareError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateSMBFileShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateSMBFileShareError {
fn from(err: serde_json::error::Error) -> UpdateSMBFileShareError {
UpdateSMBFileShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateSMBFileShareError {
fn from(err: CredentialsError) -> UpdateSMBFileShareError {
UpdateSMBFileShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateSMBFileShareError {
fn from(err: HttpDispatchError) -> UpdateSMBFileShareError {
UpdateSMBFileShareError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateSMBFileShareError {
fn from(err: io::Error) -> UpdateSMBFileShareError {
UpdateSMBFileShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateSMBFileShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateSMBFileShareError {
fn description(&self) -> &str {
match *self {
UpdateSMBFileShareError::InternalServerError(ref cause) => cause,
UpdateSMBFileShareError::InvalidGatewayRequest(ref cause) => cause,
UpdateSMBFileShareError::Validation(ref cause) => cause,
UpdateSMBFileShareError::Credentials(ref err) => err.description(),
UpdateSMBFileShareError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateSMBFileShareError::ParseError(ref cause) => cause,
UpdateSMBFileShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateSnapshotScheduleError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateSnapshotScheduleError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateSnapshotScheduleError {
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 UpdateSnapshotScheduleError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return UpdateSnapshotScheduleError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateSnapshotScheduleError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateSnapshotScheduleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateSnapshotScheduleError {
fn from(err: serde_json::error::Error) -> UpdateSnapshotScheduleError {
UpdateSnapshotScheduleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateSnapshotScheduleError {
fn from(err: CredentialsError) -> UpdateSnapshotScheduleError {
UpdateSnapshotScheduleError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateSnapshotScheduleError {
fn from(err: HttpDispatchError) -> UpdateSnapshotScheduleError {
UpdateSnapshotScheduleError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateSnapshotScheduleError {
fn from(err: io::Error) -> UpdateSnapshotScheduleError {
UpdateSnapshotScheduleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateSnapshotScheduleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateSnapshotScheduleError {
fn description(&self) -> &str {
match *self {
UpdateSnapshotScheduleError::InternalServerError(ref cause) => cause,
UpdateSnapshotScheduleError::InvalidGatewayRequest(ref cause) => cause,
UpdateSnapshotScheduleError::Validation(ref cause) => cause,
UpdateSnapshotScheduleError::Credentials(ref err) => err.description(),
UpdateSnapshotScheduleError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateSnapshotScheduleError::ParseError(ref cause) => cause,
UpdateSnapshotScheduleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateVTLDeviceTypeError {
InternalServerError(String),
InvalidGatewayRequest(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateVTLDeviceTypeError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateVTLDeviceTypeError {
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 UpdateVTLDeviceTypeError::InternalServerError(String::from(
error_message,
));
}
"InvalidGatewayRequestException" => {
return UpdateVTLDeviceTypeError::InvalidGatewayRequest(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateVTLDeviceTypeError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateVTLDeviceTypeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateVTLDeviceTypeError {
fn from(err: serde_json::error::Error) -> UpdateVTLDeviceTypeError {
UpdateVTLDeviceTypeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateVTLDeviceTypeError {
fn from(err: CredentialsError) -> UpdateVTLDeviceTypeError {
UpdateVTLDeviceTypeError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateVTLDeviceTypeError {
fn from(err: HttpDispatchError) -> UpdateVTLDeviceTypeError {
UpdateVTLDeviceTypeError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateVTLDeviceTypeError {
fn from(err: io::Error) -> UpdateVTLDeviceTypeError {
UpdateVTLDeviceTypeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateVTLDeviceTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateVTLDeviceTypeError {
fn description(&self) -> &str {
match *self {
UpdateVTLDeviceTypeError::InternalServerError(ref cause) => cause,
UpdateVTLDeviceTypeError::InvalidGatewayRequest(ref cause) => cause,
UpdateVTLDeviceTypeError::Validation(ref cause) => cause,
UpdateVTLDeviceTypeError::Credentials(ref err) => err.description(),
UpdateVTLDeviceTypeError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateVTLDeviceTypeError::ParseError(ref cause) => cause,
UpdateVTLDeviceTypeError::Unknown(_) => "unknown error",
}
}
}
pub trait StorageGateway {
fn activate_gateway(
&self,
input: ActivateGatewayInput,
) -> RusotoFuture<ActivateGatewayOutput, ActivateGatewayError>;
fn add_cache(&self, input: AddCacheInput) -> RusotoFuture<AddCacheOutput, AddCacheError>;
fn add_tags_to_resource(
&self,
input: AddTagsToResourceInput,
) -> RusotoFuture<AddTagsToResourceOutput, AddTagsToResourceError>;
fn add_upload_buffer(
&self,
input: AddUploadBufferInput,
) -> RusotoFuture<AddUploadBufferOutput, AddUploadBufferError>;
fn add_working_storage(
&self,
input: AddWorkingStorageInput,
) -> RusotoFuture<AddWorkingStorageOutput, AddWorkingStorageError>;
fn attach_volume(
&self,
input: AttachVolumeInput,
) -> RusotoFuture<AttachVolumeOutput, AttachVolumeError>;
fn cancel_archival(
&self,
input: CancelArchivalInput,
) -> RusotoFuture<CancelArchivalOutput, CancelArchivalError>;
fn cancel_retrieval(
&self,
input: CancelRetrievalInput,
) -> RusotoFuture<CancelRetrievalOutput, CancelRetrievalError>;
fn create_cachedi_scsi_volume(
&self,
input: CreateCachediSCSIVolumeInput,
) -> RusotoFuture<CreateCachediSCSIVolumeOutput, CreateCachediSCSIVolumeError>;
fn create_nfs_file_share(
&self,
input: CreateNFSFileShareInput,
) -> RusotoFuture<CreateNFSFileShareOutput, CreateNFSFileShareError>;
fn create_smb_file_share(
&self,
input: CreateSMBFileShareInput,
) -> RusotoFuture<CreateSMBFileShareOutput, CreateSMBFileShareError>;
fn create_snapshot(
&self,
input: CreateSnapshotInput,
) -> RusotoFuture<CreateSnapshotOutput, CreateSnapshotError>;
fn create_snapshot_from_volume_recovery_point(
&self,
input: CreateSnapshotFromVolumeRecoveryPointInput,
) -> RusotoFuture<
CreateSnapshotFromVolumeRecoveryPointOutput,
CreateSnapshotFromVolumeRecoveryPointError,
>;
fn create_storedi_scsi_volume(
&self,
input: CreateStorediSCSIVolumeInput,
) -> RusotoFuture<CreateStorediSCSIVolumeOutput, CreateStorediSCSIVolumeError>;
fn create_tape_with_barcode(
&self,
input: CreateTapeWithBarcodeInput,
) -> RusotoFuture<CreateTapeWithBarcodeOutput, CreateTapeWithBarcodeError>;
fn create_tapes(
&self,
input: CreateTapesInput,
) -> RusotoFuture<CreateTapesOutput, CreateTapesError>;
fn delete_bandwidth_rate_limit(
&self,
input: DeleteBandwidthRateLimitInput,
) -> RusotoFuture<DeleteBandwidthRateLimitOutput, DeleteBandwidthRateLimitError>;
fn delete_chap_credentials(
&self,
input: DeleteChapCredentialsInput,
) -> RusotoFuture<DeleteChapCredentialsOutput, DeleteChapCredentialsError>;
fn delete_file_share(
&self,
input: DeleteFileShareInput,
) -> RusotoFuture<DeleteFileShareOutput, DeleteFileShareError>;
fn delete_gateway(
&self,
input: DeleteGatewayInput,
) -> RusotoFuture<DeleteGatewayOutput, DeleteGatewayError>;
fn delete_snapshot_schedule(
&self,
input: DeleteSnapshotScheduleInput,
) -> RusotoFuture<DeleteSnapshotScheduleOutput, DeleteSnapshotScheduleError>;
fn delete_tape(
&self,
input: DeleteTapeInput,
) -> RusotoFuture<DeleteTapeOutput, DeleteTapeError>;
fn delete_tape_archive(
&self,
input: DeleteTapeArchiveInput,
) -> RusotoFuture<DeleteTapeArchiveOutput, DeleteTapeArchiveError>;
fn delete_volume(
&self,
input: DeleteVolumeInput,
) -> RusotoFuture<DeleteVolumeOutput, DeleteVolumeError>;
fn describe_bandwidth_rate_limit(
&self,
input: DescribeBandwidthRateLimitInput,
) -> RusotoFuture<DescribeBandwidthRateLimitOutput, DescribeBandwidthRateLimitError>;
fn describe_cache(
&self,
input: DescribeCacheInput,
) -> RusotoFuture<DescribeCacheOutput, DescribeCacheError>;
fn describe_cachedi_scsi_volumes(
&self,
input: DescribeCachediSCSIVolumesInput,
) -> RusotoFuture<DescribeCachediSCSIVolumesOutput, DescribeCachediSCSIVolumesError>;
fn describe_chap_credentials(
&self,
input: DescribeChapCredentialsInput,
) -> RusotoFuture<DescribeChapCredentialsOutput, DescribeChapCredentialsError>;
fn describe_gateway_information(
&self,
input: DescribeGatewayInformationInput,
) -> RusotoFuture<DescribeGatewayInformationOutput, DescribeGatewayInformationError>;
fn describe_maintenance_start_time(
&self,
input: DescribeMaintenanceStartTimeInput,
) -> RusotoFuture<DescribeMaintenanceStartTimeOutput, DescribeMaintenanceStartTimeError>;
fn describe_nfs_file_shares(
&self,
input: DescribeNFSFileSharesInput,
) -> RusotoFuture<DescribeNFSFileSharesOutput, DescribeNFSFileSharesError>;
fn describe_smb_file_shares(
&self,
input: DescribeSMBFileSharesInput,
) -> RusotoFuture<DescribeSMBFileSharesOutput, DescribeSMBFileSharesError>;
fn describe_smb_settings(
&self,
input: DescribeSMBSettingsInput,
) -> RusotoFuture<DescribeSMBSettingsOutput, DescribeSMBSettingsError>;
fn describe_snapshot_schedule(
&self,
input: DescribeSnapshotScheduleInput,
) -> RusotoFuture<DescribeSnapshotScheduleOutput, DescribeSnapshotScheduleError>;
fn describe_storedi_scsi_volumes(
&self,
input: DescribeStorediSCSIVolumesInput,
) -> RusotoFuture<DescribeStorediSCSIVolumesOutput, DescribeStorediSCSIVolumesError>;
fn describe_tape_archives(
&self,
input: DescribeTapeArchivesInput,
) -> RusotoFuture<DescribeTapeArchivesOutput, DescribeTapeArchivesError>;
fn describe_tape_recovery_points(
&self,
input: DescribeTapeRecoveryPointsInput,
) -> RusotoFuture<DescribeTapeRecoveryPointsOutput, DescribeTapeRecoveryPointsError>;
fn describe_tapes(
&self,
input: DescribeTapesInput,
) -> RusotoFuture<DescribeTapesOutput, DescribeTapesError>;
fn describe_upload_buffer(
&self,
input: DescribeUploadBufferInput,
) -> RusotoFuture<DescribeUploadBufferOutput, DescribeUploadBufferError>;
fn describe_vtl_devices(
&self,
input: DescribeVTLDevicesInput,
) -> RusotoFuture<DescribeVTLDevicesOutput, DescribeVTLDevicesError>;
fn describe_working_storage(
&self,
input: DescribeWorkingStorageInput,
) -> RusotoFuture<DescribeWorkingStorageOutput, DescribeWorkingStorageError>;
fn detach_volume(
&self,
input: DetachVolumeInput,
) -> RusotoFuture<DetachVolumeOutput, DetachVolumeError>;
fn disable_gateway(
&self,
input: DisableGatewayInput,
) -> RusotoFuture<DisableGatewayOutput, DisableGatewayError>;
fn join_domain(
&self,
input: JoinDomainInput,
) -> RusotoFuture<JoinDomainOutput, JoinDomainError>;
fn list_file_shares(
&self,
input: ListFileSharesInput,
) -> RusotoFuture<ListFileSharesOutput, ListFileSharesError>;
fn list_gateways(
&self,
input: ListGatewaysInput,
) -> RusotoFuture<ListGatewaysOutput, ListGatewaysError>;
fn list_local_disks(
&self,
input: ListLocalDisksInput,
) -> RusotoFuture<ListLocalDisksOutput, ListLocalDisksError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> RusotoFuture<ListTagsForResourceOutput, ListTagsForResourceError>;
fn list_tapes(&self, input: ListTapesInput) -> RusotoFuture<ListTapesOutput, ListTapesError>;
fn list_volume_initiators(
&self,
input: ListVolumeInitiatorsInput,
) -> RusotoFuture<ListVolumeInitiatorsOutput, ListVolumeInitiatorsError>;
fn list_volume_recovery_points(
&self,
input: ListVolumeRecoveryPointsInput,
) -> RusotoFuture<ListVolumeRecoveryPointsOutput, ListVolumeRecoveryPointsError>;
fn list_volumes(
&self,
input: ListVolumesInput,
) -> RusotoFuture<ListVolumesOutput, ListVolumesError>;
fn notify_when_uploaded(
&self,
input: NotifyWhenUploadedInput,
) -> RusotoFuture<NotifyWhenUploadedOutput, NotifyWhenUploadedError>;
fn refresh_cache(
&self,
input: RefreshCacheInput,
) -> RusotoFuture<RefreshCacheOutput, RefreshCacheError>;
fn remove_tags_from_resource(
&self,
input: RemoveTagsFromResourceInput,
) -> RusotoFuture<RemoveTagsFromResourceOutput, RemoveTagsFromResourceError>;
fn reset_cache(
&self,
input: ResetCacheInput,
) -> RusotoFuture<ResetCacheOutput, ResetCacheError>;
fn retrieve_tape_archive(
&self,
input: RetrieveTapeArchiveInput,
) -> RusotoFuture<RetrieveTapeArchiveOutput, RetrieveTapeArchiveError>;
fn retrieve_tape_recovery_point(
&self,
input: RetrieveTapeRecoveryPointInput,
) -> RusotoFuture<RetrieveTapeRecoveryPointOutput, RetrieveTapeRecoveryPointError>;
fn set_local_console_password(
&self,
input: SetLocalConsolePasswordInput,
) -> RusotoFuture<SetLocalConsolePasswordOutput, SetLocalConsolePasswordError>;
fn set_smb_guest_password(
&self,
input: SetSMBGuestPasswordInput,
) -> RusotoFuture<SetSMBGuestPasswordOutput, SetSMBGuestPasswordError>;
fn shutdown_gateway(
&self,
input: ShutdownGatewayInput,
) -> RusotoFuture<ShutdownGatewayOutput, ShutdownGatewayError>;
fn start_gateway(
&self,
input: StartGatewayInput,
) -> RusotoFuture<StartGatewayOutput, StartGatewayError>;
fn update_bandwidth_rate_limit(
&self,
input: UpdateBandwidthRateLimitInput,
) -> RusotoFuture<UpdateBandwidthRateLimitOutput, UpdateBandwidthRateLimitError>;
fn update_chap_credentials(
&self,
input: UpdateChapCredentialsInput,
) -> RusotoFuture<UpdateChapCredentialsOutput, UpdateChapCredentialsError>;
fn update_gateway_information(
&self,
input: UpdateGatewayInformationInput,
) -> RusotoFuture<UpdateGatewayInformationOutput, UpdateGatewayInformationError>;
fn update_gateway_software_now(
&self,
input: UpdateGatewaySoftwareNowInput,
) -> RusotoFuture<UpdateGatewaySoftwareNowOutput, UpdateGatewaySoftwareNowError>;
fn update_maintenance_start_time(
&self,
input: UpdateMaintenanceStartTimeInput,
) -> RusotoFuture<UpdateMaintenanceStartTimeOutput, UpdateMaintenanceStartTimeError>;
fn update_nfs_file_share(
&self,
input: UpdateNFSFileShareInput,
) -> RusotoFuture<UpdateNFSFileShareOutput, UpdateNFSFileShareError>;
fn update_smb_file_share(
&self,
input: UpdateSMBFileShareInput,
) -> RusotoFuture<UpdateSMBFileShareOutput, UpdateSMBFileShareError>;
fn update_snapshot_schedule(
&self,
input: UpdateSnapshotScheduleInput,
) -> RusotoFuture<UpdateSnapshotScheduleOutput, UpdateSnapshotScheduleError>;
fn update_vtl_device_type(
&self,
input: UpdateVTLDeviceTypeInput,
) -> RusotoFuture<UpdateVTLDeviceTypeOutput, UpdateVTLDeviceTypeError>;
}
#[derive(Clone)]
pub struct StorageGatewayClient {
client: Client,
region: region::Region,
}
impl StorageGatewayClient {
pub fn new(region: region::Region) -> StorageGatewayClient {
StorageGatewayClient {
client: Client::shared(),
region: region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> StorageGatewayClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
StorageGatewayClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region: region,
}
}
}
impl StorageGateway for StorageGatewayClient {
fn activate_gateway(
&self,
input: ActivateGatewayInput,
) -> RusotoFuture<ActivateGatewayOutput, ActivateGatewayError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.ActivateGateway");
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::<ActivateGatewayOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ActivateGatewayError::from_response(response))),
)
}
})
}
fn add_cache(&self, input: AddCacheInput) -> RusotoFuture<AddCacheOutput, AddCacheError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.AddCache");
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::<AddCacheOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddCacheError::from_response(response))),
)
}
})
}
fn add_tags_to_resource(
&self,
input: AddTagsToResourceInput,
) -> RusotoFuture<AddTagsToResourceOutput, AddTagsToResourceError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.AddTagsToResource");
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::<AddTagsToResourceOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddTagsToResourceError::from_response(response))),
)
}
})
}
fn add_upload_buffer(
&self,
input: AddUploadBufferInput,
) -> RusotoFuture<AddUploadBufferOutput, AddUploadBufferError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.AddUploadBuffer");
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::<AddUploadBufferOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddUploadBufferError::from_response(response))),
)
}
})
}
fn add_working_storage(
&self,
input: AddWorkingStorageInput,
) -> RusotoFuture<AddWorkingStorageOutput, AddWorkingStorageError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.AddWorkingStorage");
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::<AddWorkingStorageOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddWorkingStorageError::from_response(response))),
)
}
})
}
fn attach_volume(
&self,
input: AttachVolumeInput,
) -> RusotoFuture<AttachVolumeOutput, AttachVolumeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.AttachVolume");
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::<AttachVolumeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AttachVolumeError::from_response(response))),
)
}
})
}
fn cancel_archival(
&self,
input: CancelArchivalInput,
) -> RusotoFuture<CancelArchivalOutput, CancelArchivalError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.CancelArchival");
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::<CancelArchivalOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CancelArchivalError::from_response(response))),
)
}
})
}
fn cancel_retrieval(
&self,
input: CancelRetrievalInput,
) -> RusotoFuture<CancelRetrievalOutput, CancelRetrievalError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.CancelRetrieval");
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::<CancelRetrievalOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CancelRetrievalError::from_response(response))),
)
}
})
}
fn create_cachedi_scsi_volume(
&self,
input: CreateCachediSCSIVolumeInput,
) -> RusotoFuture<CreateCachediSCSIVolumeOutput, CreateCachediSCSIVolumeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.CreateCachediSCSIVolume",
);
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::<CreateCachediSCSIVolumeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateCachediSCSIVolumeError::from_response(response))
}))
}
})
}
fn create_nfs_file_share(
&self,
input: CreateNFSFileShareInput,
) -> RusotoFuture<CreateNFSFileShareOutput, CreateNFSFileShareError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.CreateNFSFileShare");
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::<CreateNFSFileShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateNFSFileShareError::from_response(response))),
)
}
})
}
fn create_smb_file_share(
&self,
input: CreateSMBFileShareInput,
) -> RusotoFuture<CreateSMBFileShareOutput, CreateSMBFileShareError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.CreateSMBFileShare");
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::<CreateSMBFileShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateSMBFileShareError::from_response(response))),
)
}
})
}
fn create_snapshot(
&self,
input: CreateSnapshotInput,
) -> RusotoFuture<CreateSnapshotOutput, CreateSnapshotError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.CreateSnapshot");
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::<CreateSnapshotOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateSnapshotError::from_response(response))),
)
}
})
}
fn create_snapshot_from_volume_recovery_point(
&self,
input: CreateSnapshotFromVolumeRecoveryPointInput,
) -> RusotoFuture<
CreateSnapshotFromVolumeRecoveryPointOutput,
CreateSnapshotFromVolumeRecoveryPointError,
> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.CreateSnapshotFromVolumeRecoveryPoint",
);
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::<CreateSnapshotFromVolumeRecoveryPointOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateSnapshotFromVolumeRecoveryPointError::from_response(
response,
))
}))
}
})
}
fn create_storedi_scsi_volume(
&self,
input: CreateStorediSCSIVolumeInput,
) -> RusotoFuture<CreateStorediSCSIVolumeOutput, CreateStorediSCSIVolumeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.CreateStorediSCSIVolume",
);
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::<CreateStorediSCSIVolumeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateStorediSCSIVolumeError::from_response(response))
}))
}
})
}
fn create_tape_with_barcode(
&self,
input: CreateTapeWithBarcodeInput,
) -> RusotoFuture<CreateTapeWithBarcodeOutput, CreateTapeWithBarcodeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.CreateTapeWithBarcode",
);
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::<CreateTapeWithBarcodeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateTapeWithBarcodeError::from_response(response))
}),
)
}
})
}
fn create_tapes(
&self,
input: CreateTapesInput,
) -> RusotoFuture<CreateTapesOutput, CreateTapesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.CreateTapes");
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::<CreateTapesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateTapesError::from_response(response))),
)
}
})
}
fn delete_bandwidth_rate_limit(
&self,
input: DeleteBandwidthRateLimitInput,
) -> RusotoFuture<DeleteBandwidthRateLimitOutput, DeleteBandwidthRateLimitError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DeleteBandwidthRateLimit",
);
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::<DeleteBandwidthRateLimitOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteBandwidthRateLimitError::from_response(response))
}))
}
})
}
fn delete_chap_credentials(
&self,
input: DeleteChapCredentialsInput,
) -> RusotoFuture<DeleteChapCredentialsOutput, DeleteChapCredentialsError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DeleteChapCredentials",
);
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::<DeleteChapCredentialsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteChapCredentialsError::from_response(response))
}),
)
}
})
}
fn delete_file_share(
&self,
input: DeleteFileShareInput,
) -> RusotoFuture<DeleteFileShareOutput, DeleteFileShareError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DeleteFileShare");
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::<DeleteFileShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteFileShareError::from_response(response))),
)
}
})
}
fn delete_gateway(
&self,
input: DeleteGatewayInput,
) -> RusotoFuture<DeleteGatewayOutput, DeleteGatewayError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DeleteGateway");
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::<DeleteGatewayOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteGatewayError::from_response(response))),
)
}
})
}
fn delete_snapshot_schedule(
&self,
input: DeleteSnapshotScheduleInput,
) -> RusotoFuture<DeleteSnapshotScheduleOutput, DeleteSnapshotScheduleError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DeleteSnapshotSchedule",
);
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::<DeleteSnapshotScheduleOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteSnapshotScheduleError::from_response(response))
}),
)
}
})
}
fn delete_tape(
&self,
input: DeleteTapeInput,
) -> RusotoFuture<DeleteTapeOutput, DeleteTapeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DeleteTape");
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::<DeleteTapeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteTapeError::from_response(response))),
)
}
})
}
fn delete_tape_archive(
&self,
input: DeleteTapeArchiveInput,
) -> RusotoFuture<DeleteTapeArchiveOutput, DeleteTapeArchiveError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DeleteTapeArchive");
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::<DeleteTapeArchiveOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteTapeArchiveError::from_response(response))),
)
}
})
}
fn delete_volume(
&self,
input: DeleteVolumeInput,
) -> RusotoFuture<DeleteVolumeOutput, DeleteVolumeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DeleteVolume");
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::<DeleteVolumeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteVolumeError::from_response(response))),
)
}
})
}
fn describe_bandwidth_rate_limit(
&self,
input: DescribeBandwidthRateLimitInput,
) -> RusotoFuture<DescribeBandwidthRateLimitOutput, DescribeBandwidthRateLimitError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeBandwidthRateLimit",
);
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::<DescribeBandwidthRateLimitOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeBandwidthRateLimitError::from_response(response))
}))
}
})
}
fn describe_cache(
&self,
input: DescribeCacheInput,
) -> RusotoFuture<DescribeCacheOutput, DescribeCacheError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DescribeCache");
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::<DescribeCacheOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeCacheError::from_response(response))),
)
}
})
}
fn describe_cachedi_scsi_volumes(
&self,
input: DescribeCachediSCSIVolumesInput,
) -> RusotoFuture<DescribeCachediSCSIVolumesOutput, DescribeCachediSCSIVolumesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeCachediSCSIVolumes",
);
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::<DescribeCachediSCSIVolumesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeCachediSCSIVolumesError::from_response(response))
}))
}
})
}
fn describe_chap_credentials(
&self,
input: DescribeChapCredentialsInput,
) -> RusotoFuture<DescribeChapCredentialsOutput, DescribeChapCredentialsError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeChapCredentials",
);
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::<DescribeChapCredentialsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeChapCredentialsError::from_response(response))
}))
}
})
}
fn describe_gateway_information(
&self,
input: DescribeGatewayInformationInput,
) -> RusotoFuture<DescribeGatewayInformationOutput, DescribeGatewayInformationError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeGatewayInformation",
);
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::<DescribeGatewayInformationOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeGatewayInformationError::from_response(response))
}))
}
})
}
fn describe_maintenance_start_time(
&self,
input: DescribeMaintenanceStartTimeInput,
) -> RusotoFuture<DescribeMaintenanceStartTimeOutput, DescribeMaintenanceStartTimeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeMaintenanceStartTime",
);
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::<DescribeMaintenanceStartTimeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeMaintenanceStartTimeError::from_response(response))
}))
}
})
}
fn describe_nfs_file_shares(
&self,
input: DescribeNFSFileSharesInput,
) -> RusotoFuture<DescribeNFSFileSharesOutput, DescribeNFSFileSharesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeNFSFileShares",
);
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::<DescribeNFSFileSharesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeNFSFileSharesError::from_response(response))
}),
)
}
})
}
fn describe_smb_file_shares(
&self,
input: DescribeSMBFileSharesInput,
) -> RusotoFuture<DescribeSMBFileSharesOutput, DescribeSMBFileSharesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeSMBFileShares",
);
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::<DescribeSMBFileSharesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeSMBFileSharesError::from_response(response))
}),
)
}
})
}
fn describe_smb_settings(
&self,
input: DescribeSMBSettingsInput,
) -> RusotoFuture<DescribeSMBSettingsOutput, DescribeSMBSettingsError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeSMBSettings",
);
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::<DescribeSMBSettingsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeSMBSettingsError::from_response(response))
}),
)
}
})
}
fn describe_snapshot_schedule(
&self,
input: DescribeSnapshotScheduleInput,
) -> RusotoFuture<DescribeSnapshotScheduleOutput, DescribeSnapshotScheduleError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeSnapshotSchedule",
);
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::<DescribeSnapshotScheduleOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeSnapshotScheduleError::from_response(response))
}))
}
})
}
fn describe_storedi_scsi_volumes(
&self,
input: DescribeStorediSCSIVolumesInput,
) -> RusotoFuture<DescribeStorediSCSIVolumesOutput, DescribeStorediSCSIVolumesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeStorediSCSIVolumes",
);
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::<DescribeStorediSCSIVolumesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeStorediSCSIVolumesError::from_response(response))
}))
}
})
}
fn describe_tape_archives(
&self,
input: DescribeTapeArchivesInput,
) -> RusotoFuture<DescribeTapeArchivesOutput, DescribeTapeArchivesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeTapeArchives",
);
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::<DescribeTapeArchivesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeTapeArchivesError::from_response(response))
}),
)
}
})
}
fn describe_tape_recovery_points(
&self,
input: DescribeTapeRecoveryPointsInput,
) -> RusotoFuture<DescribeTapeRecoveryPointsOutput, DescribeTapeRecoveryPointsError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeTapeRecoveryPoints",
);
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::<DescribeTapeRecoveryPointsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeTapeRecoveryPointsError::from_response(response))
}))
}
})
}
fn describe_tapes(
&self,
input: DescribeTapesInput,
) -> RusotoFuture<DescribeTapesOutput, DescribeTapesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DescribeTapes");
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::<DescribeTapesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeTapesError::from_response(response))),
)
}
})
}
fn describe_upload_buffer(
&self,
input: DescribeUploadBufferInput,
) -> RusotoFuture<DescribeUploadBufferOutput, DescribeUploadBufferError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeUploadBuffer",
);
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::<DescribeUploadBufferOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeUploadBufferError::from_response(response))
}),
)
}
})
}
fn describe_vtl_devices(
&self,
input: DescribeVTLDevicesInput,
) -> RusotoFuture<DescribeVTLDevicesOutput, DescribeVTLDevicesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DescribeVTLDevices");
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::<DescribeVTLDevicesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeVTLDevicesError::from_response(response))),
)
}
})
}
fn describe_working_storage(
&self,
input: DescribeWorkingStorageInput,
) -> RusotoFuture<DescribeWorkingStorageOutput, DescribeWorkingStorageError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.DescribeWorkingStorage",
);
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::<DescribeWorkingStorageOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeWorkingStorageError::from_response(response))
}),
)
}
})
}
fn detach_volume(
&self,
input: DetachVolumeInput,
) -> RusotoFuture<DetachVolumeOutput, DetachVolumeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DetachVolume");
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::<DetachVolumeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DetachVolumeError::from_response(response))),
)
}
})
}
fn disable_gateway(
&self,
input: DisableGatewayInput,
) -> RusotoFuture<DisableGatewayOutput, DisableGatewayError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.DisableGateway");
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::<DisableGatewayOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DisableGatewayError::from_response(response))),
)
}
})
}
fn join_domain(
&self,
input: JoinDomainInput,
) -> RusotoFuture<JoinDomainOutput, JoinDomainError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.JoinDomain");
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::<JoinDomainOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(JoinDomainError::from_response(response))),
)
}
})
}
fn list_file_shares(
&self,
input: ListFileSharesInput,
) -> RusotoFuture<ListFileSharesOutput, ListFileSharesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.ListFileShares");
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::<ListFileSharesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListFileSharesError::from_response(response))),
)
}
})
}
fn list_gateways(
&self,
input: ListGatewaysInput,
) -> RusotoFuture<ListGatewaysOutput, ListGatewaysError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.ListGateways");
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::<ListGatewaysOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListGatewaysError::from_response(response))),
)
}
})
}
fn list_local_disks(
&self,
input: ListLocalDisksInput,
) -> RusotoFuture<ListLocalDisksOutput, ListLocalDisksError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.ListLocalDisks");
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::<ListLocalDisksOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListLocalDisksError::from_response(response))),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> RusotoFuture<ListTagsForResourceOutput, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.ListTagsForResource",
);
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::<ListTagsForResourceOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn list_tapes(&self, input: ListTapesInput) -> RusotoFuture<ListTapesOutput, ListTapesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.ListTapes");
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::<ListTapesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTapesError::from_response(response))),
)
}
})
}
fn list_volume_initiators(
&self,
input: ListVolumeInitiatorsInput,
) -> RusotoFuture<ListVolumeInitiatorsOutput, ListVolumeInitiatorsError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.ListVolumeInitiators",
);
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::<ListVolumeInitiatorsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListVolumeInitiatorsError::from_response(response))
}),
)
}
})
}
fn list_volume_recovery_points(
&self,
input: ListVolumeRecoveryPointsInput,
) -> RusotoFuture<ListVolumeRecoveryPointsOutput, ListVolumeRecoveryPointsError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.ListVolumeRecoveryPoints",
);
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::<ListVolumeRecoveryPointsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListVolumeRecoveryPointsError::from_response(response))
}))
}
})
}
fn list_volumes(
&self,
input: ListVolumesInput,
) -> RusotoFuture<ListVolumesOutput, ListVolumesError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.ListVolumes");
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::<ListVolumesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListVolumesError::from_response(response))),
)
}
})
}
fn notify_when_uploaded(
&self,
input: NotifyWhenUploadedInput,
) -> RusotoFuture<NotifyWhenUploadedOutput, NotifyWhenUploadedError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.NotifyWhenUploaded");
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::<NotifyWhenUploadedOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(NotifyWhenUploadedError::from_response(response))),
)
}
})
}
fn refresh_cache(
&self,
input: RefreshCacheInput,
) -> RusotoFuture<RefreshCacheOutput, RefreshCacheError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.RefreshCache");
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::<RefreshCacheOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RefreshCacheError::from_response(response))),
)
}
})
}
fn remove_tags_from_resource(
&self,
input: RemoveTagsFromResourceInput,
) -> RusotoFuture<RemoveTagsFromResourceOutput, RemoveTagsFromResourceError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.RemoveTagsFromResource",
);
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::<RemoveTagsFromResourceOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(RemoveTagsFromResourceError::from_response(response))
}),
)
}
})
}
fn reset_cache(
&self,
input: ResetCacheInput,
) -> RusotoFuture<ResetCacheOutput, ResetCacheError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.ResetCache");
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::<ResetCacheOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ResetCacheError::from_response(response))),
)
}
})
}
fn retrieve_tape_archive(
&self,
input: RetrieveTapeArchiveInput,
) -> RusotoFuture<RetrieveTapeArchiveOutput, RetrieveTapeArchiveError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.RetrieveTapeArchive",
);
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::<RetrieveTapeArchiveOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(RetrieveTapeArchiveError::from_response(response))
}),
)
}
})
}
fn retrieve_tape_recovery_point(
&self,
input: RetrieveTapeRecoveryPointInput,
) -> RusotoFuture<RetrieveTapeRecoveryPointOutput, RetrieveTapeRecoveryPointError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.RetrieveTapeRecoveryPoint",
);
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::<RetrieveTapeRecoveryPointOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RetrieveTapeRecoveryPointError::from_response(response))
}))
}
})
}
fn set_local_console_password(
&self,
input: SetLocalConsolePasswordInput,
) -> RusotoFuture<SetLocalConsolePasswordOutput, SetLocalConsolePasswordError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.SetLocalConsolePassword",
);
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::<SetLocalConsolePasswordOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(SetLocalConsolePasswordError::from_response(response))
}))
}
})
}
fn set_smb_guest_password(
&self,
input: SetSMBGuestPasswordInput,
) -> RusotoFuture<SetSMBGuestPasswordOutput, SetSMBGuestPasswordError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.SetSMBGuestPassword",
);
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::<SetSMBGuestPasswordOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(SetSMBGuestPasswordError::from_response(response))
}),
)
}
})
}
fn shutdown_gateway(
&self,
input: ShutdownGatewayInput,
) -> RusotoFuture<ShutdownGatewayOutput, ShutdownGatewayError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.ShutdownGateway");
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::<ShutdownGatewayOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ShutdownGatewayError::from_response(response))),
)
}
})
}
fn start_gateway(
&self,
input: StartGatewayInput,
) -> RusotoFuture<StartGatewayOutput, StartGatewayError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.StartGateway");
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::<StartGatewayOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StartGatewayError::from_response(response))),
)
}
})
}
fn update_bandwidth_rate_limit(
&self,
input: UpdateBandwidthRateLimitInput,
) -> RusotoFuture<UpdateBandwidthRateLimitOutput, UpdateBandwidthRateLimitError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.UpdateBandwidthRateLimit",
);
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::<UpdateBandwidthRateLimitOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateBandwidthRateLimitError::from_response(response))
}))
}
})
}
fn update_chap_credentials(
&self,
input: UpdateChapCredentialsInput,
) -> RusotoFuture<UpdateChapCredentialsOutput, UpdateChapCredentialsError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.UpdateChapCredentials",
);
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::<UpdateChapCredentialsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateChapCredentialsError::from_response(response))
}),
)
}
})
}
fn update_gateway_information(
&self,
input: UpdateGatewayInformationInput,
) -> RusotoFuture<UpdateGatewayInformationOutput, UpdateGatewayInformationError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.UpdateGatewayInformation",
);
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::<UpdateGatewayInformationOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateGatewayInformationError::from_response(response))
}))
}
})
}
fn update_gateway_software_now(
&self,
input: UpdateGatewaySoftwareNowInput,
) -> RusotoFuture<UpdateGatewaySoftwareNowOutput, UpdateGatewaySoftwareNowError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.UpdateGatewaySoftwareNow",
);
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::<UpdateGatewaySoftwareNowOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateGatewaySoftwareNowError::from_response(response))
}))
}
})
}
fn update_maintenance_start_time(
&self,
input: UpdateMaintenanceStartTimeInput,
) -> RusotoFuture<UpdateMaintenanceStartTimeOutput, UpdateMaintenanceStartTimeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.UpdateMaintenanceStartTime",
);
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::<UpdateMaintenanceStartTimeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateMaintenanceStartTimeError::from_response(response))
}))
}
})
}
fn update_nfs_file_share(
&self,
input: UpdateNFSFileShareInput,
) -> RusotoFuture<UpdateNFSFileShareOutput, UpdateNFSFileShareError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.UpdateNFSFileShare");
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::<UpdateNFSFileShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateNFSFileShareError::from_response(response))),
)
}
})
}
fn update_smb_file_share(
&self,
input: UpdateSMBFileShareInput,
) -> RusotoFuture<UpdateSMBFileShareOutput, UpdateSMBFileShareError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StorageGateway_20130630.UpdateSMBFileShare");
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::<UpdateSMBFileShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateSMBFileShareError::from_response(response))),
)
}
})
}
fn update_snapshot_schedule(
&self,
input: UpdateSnapshotScheduleInput,
) -> RusotoFuture<UpdateSnapshotScheduleOutput, UpdateSnapshotScheduleError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.UpdateSnapshotSchedule",
);
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::<UpdateSnapshotScheduleOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateSnapshotScheduleError::from_response(response))
}),
)
}
})
}
fn update_vtl_device_type(
&self,
input: UpdateVTLDeviceTypeInput,
) -> RusotoFuture<UpdateVTLDeviceTypeOutput, UpdateVTLDeviceTypeError> {
let mut request = SignedRequest::new("POST", "storagegateway", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StorageGateway_20130630.UpdateVTLDeviceType",
);
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::<UpdateVTLDeviceTypeOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateVTLDeviceTypeError::from_response(response))
}),
)
}
})
}
}
#[cfg(test)]
mod protocol_tests {}