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 AllocateStaticIpRequest {
#[serde(rename = "staticIpName")]
pub static_ip_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AllocateStaticIpResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AttachDiskRequest {
#[serde(rename = "diskName")]
pub disk_name: String,
#[serde(rename = "diskPath")]
pub disk_path: String,
#[serde(rename = "instanceName")]
pub instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AttachDiskResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AttachInstancesToLoadBalancerRequest {
#[serde(rename = "instanceNames")]
pub instance_names: Vec<String>,
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AttachInstancesToLoadBalancerResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AttachLoadBalancerTlsCertificateRequest {
#[serde(rename = "certificateName")]
pub certificate_name: String,
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AttachLoadBalancerTlsCertificateResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AttachStaticIpRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
#[serde(rename = "staticIpName")]
pub static_ip_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AttachStaticIpResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AvailabilityZone {
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "zoneName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub zone_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Blueprint {
#[serde(rename = "blueprintId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blueprint_id: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "group")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group: Option<String>,
#[serde(rename = "isActive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[serde(rename = "licenseUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_url: Option<String>,
#[serde(rename = "minPower")]
#[serde(skip_serializing_if = "Option::is_none")]
pub min_power: Option<i64>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "productUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_url: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
#[serde(rename = "versionCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version_code: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Bundle {
#[serde(rename = "bundleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bundle_id: Option<String>,
#[serde(rename = "cpuCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_count: Option<i64>,
#[serde(rename = "diskSizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_size_in_gb: Option<i64>,
#[serde(rename = "instanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "isActive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "power")]
#[serde(skip_serializing_if = "Option::is_none")]
pub power: Option<i64>,
#[serde(rename = "price")]
#[serde(skip_serializing_if = "Option::is_none")]
pub price: Option<f32>,
#[serde(rename = "ramSizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ram_size_in_gb: Option<f32>,
#[serde(rename = "supportedPlatforms")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_platforms: Option<Vec<String>>,
#[serde(rename = "transferPerMonthInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transfer_per_month_in_gb: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CloseInstancePublicPortsRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
#[serde(rename = "portInfo")]
pub port_info: PortInfo,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CloseInstancePublicPortsResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CloudFormationStackRecord {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "destinationInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_info: Option<DestinationInfo>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "sourceInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_info: Option<Vec<CloudFormationStackRecordSourceInfo>>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CloudFormationStackRecordSourceInfo {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CopySnapshotRequest {
#[serde(rename = "sourceRegion")]
pub source_region: String,
#[serde(rename = "sourceSnapshotName")]
pub source_snapshot_name: String,
#[serde(rename = "targetSnapshotName")]
pub target_snapshot_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CopySnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateCloudFormationStackRequest {
#[serde(rename = "instances")]
pub instances: Vec<InstanceEntry>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateCloudFormationStackResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDiskFromSnapshotRequest {
#[serde(rename = "availabilityZone")]
pub availability_zone: String,
#[serde(rename = "diskName")]
pub disk_name: String,
#[serde(rename = "diskSnapshotName")]
pub disk_snapshot_name: String,
#[serde(rename = "sizeInGb")]
pub size_in_gb: i64,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDiskFromSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDiskRequest {
#[serde(rename = "availabilityZone")]
pub availability_zone: String,
#[serde(rename = "diskName")]
pub disk_name: String,
#[serde(rename = "sizeInGb")]
pub size_in_gb: i64,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDiskResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDiskSnapshotRequest {
#[serde(rename = "diskName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_name: Option<String>,
#[serde(rename = "diskSnapshotName")]
pub disk_snapshot_name: String,
#[serde(rename = "instanceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_name: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDiskSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDomainEntryRequest {
#[serde(rename = "domainEntry")]
pub domain_entry: DomainEntry,
#[serde(rename = "domainName")]
pub domain_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDomainEntryResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDomainRequest {
#[serde(rename = "domainName")]
pub domain_name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDomainResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateInstanceSnapshotRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
#[serde(rename = "instanceSnapshotName")]
pub instance_snapshot_name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateInstanceSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateInstancesFromSnapshotRequest {
#[serde(rename = "attachedDiskMapping")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attached_disk_mapping: Option<::std::collections::HashMap<String, Vec<DiskMap>>>,
#[serde(rename = "availabilityZone")]
pub availability_zone: String,
#[serde(rename = "bundleId")]
pub bundle_id: String,
#[serde(rename = "instanceNames")]
pub instance_names: Vec<String>,
#[serde(rename = "instanceSnapshotName")]
pub instance_snapshot_name: String,
#[serde(rename = "keyPairName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_pair_name: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "userData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_data: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateInstancesFromSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateInstancesRequest {
#[serde(rename = "availabilityZone")]
pub availability_zone: String,
#[serde(rename = "blueprintId")]
pub blueprint_id: String,
#[serde(rename = "bundleId")]
pub bundle_id: String,
#[serde(rename = "instanceNames")]
pub instance_names: Vec<String>,
#[serde(rename = "keyPairName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_pair_name: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "userData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_data: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateInstancesResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateKeyPairRequest {
#[serde(rename = "keyPairName")]
pub key_pair_name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateKeyPairResult {
#[serde(rename = "keyPair")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_pair: Option<KeyPair>,
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
#[serde(rename = "privateKeyBase64")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_key_base_64: Option<String>,
#[serde(rename = "publicKeyBase64")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_key_base_64: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateLoadBalancerRequest {
#[serde(rename = "certificateAlternativeNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_alternative_names: Option<Vec<String>>,
#[serde(rename = "certificateDomainName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_domain_name: Option<String>,
#[serde(rename = "certificateName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_name: Option<String>,
#[serde(rename = "healthCheckPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_path: Option<String>,
#[serde(rename = "instancePort")]
pub instance_port: i64,
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateLoadBalancerResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateLoadBalancerTlsCertificateRequest {
#[serde(rename = "certificateAlternativeNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_alternative_names: Option<Vec<String>>,
#[serde(rename = "certificateDomainName")]
pub certificate_domain_name: String,
#[serde(rename = "certificateName")]
pub certificate_name: String,
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateLoadBalancerTlsCertificateResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateRelationalDatabaseFromSnapshotRequest {
#[serde(rename = "availabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "publiclyAccessible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publicly_accessible: Option<bool>,
#[serde(rename = "relationalDatabaseBundleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_bundle_id: Option<String>,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
#[serde(rename = "relationalDatabaseSnapshotName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_snapshot_name: Option<String>,
#[serde(rename = "restoreTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub restore_time: Option<f64>,
#[serde(rename = "sourceRelationalDatabaseName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_relational_database_name: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "useLatestRestorableTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub use_latest_restorable_time: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateRelationalDatabaseFromSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateRelationalDatabaseRequest {
#[serde(rename = "availabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "masterDatabaseName")]
pub master_database_name: String,
#[serde(rename = "masterUserPassword")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_user_password: Option<String>,
#[serde(rename = "masterUsername")]
pub master_username: String,
#[serde(rename = "preferredBackupWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_backup_window: Option<String>,
#[serde(rename = "preferredMaintenanceWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_maintenance_window: Option<String>,
#[serde(rename = "publiclyAccessible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publicly_accessible: Option<bool>,
#[serde(rename = "relationalDatabaseBlueprintId")]
pub relational_database_blueprint_id: String,
#[serde(rename = "relationalDatabaseBundleId")]
pub relational_database_bundle_id: String,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateRelationalDatabaseResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateRelationalDatabaseSnapshotRequest {
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
#[serde(rename = "relationalDatabaseSnapshotName")]
pub relational_database_snapshot_name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateRelationalDatabaseSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDiskRequest {
#[serde(rename = "diskName")]
pub disk_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDiskResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDiskSnapshotRequest {
#[serde(rename = "diskSnapshotName")]
pub disk_snapshot_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDiskSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDomainEntryRequest {
#[serde(rename = "domainEntry")]
pub domain_entry: DomainEntry,
#[serde(rename = "domainName")]
pub domain_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDomainEntryResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDomainRequest {
#[serde(rename = "domainName")]
pub domain_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDomainResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteInstanceRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteInstanceResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteInstanceSnapshotRequest {
#[serde(rename = "instanceSnapshotName")]
pub instance_snapshot_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteInstanceSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteKeyPairRequest {
#[serde(rename = "keyPairName")]
pub key_pair_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteKeyPairResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteLoadBalancerRequest {
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteLoadBalancerResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteLoadBalancerTlsCertificateRequest {
#[serde(rename = "certificateName")]
pub certificate_name: String,
#[serde(rename = "force")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force: Option<bool>,
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteLoadBalancerTlsCertificateResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteRelationalDatabaseRequest {
#[serde(rename = "finalRelationalDatabaseSnapshotName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub final_relational_database_snapshot_name: Option<String>,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
#[serde(rename = "skipFinalSnapshot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub skip_final_snapshot: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteRelationalDatabaseResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteRelationalDatabaseSnapshotRequest {
#[serde(rename = "relationalDatabaseSnapshotName")]
pub relational_database_snapshot_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteRelationalDatabaseSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DestinationInfo {
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "service")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetachDiskRequest {
#[serde(rename = "diskName")]
pub disk_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DetachDiskResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetachInstancesFromLoadBalancerRequest {
#[serde(rename = "instanceNames")]
pub instance_names: Vec<String>,
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DetachInstancesFromLoadBalancerResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DetachStaticIpRequest {
#[serde(rename = "staticIpName")]
pub static_ip_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DetachStaticIpResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Disk {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "attachedTo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attached_to: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "iops")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iops: Option<i64>,
#[serde(rename = "isAttached")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_attached: Option<bool>,
#[serde(rename = "isSystemDisk")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_system_disk: Option<bool>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "sizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_in_gb: Option<i64>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DiskInfo {
#[serde(rename = "isSystemDisk")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_system_disk: Option<bool>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "sizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_in_gb: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DiskMap {
#[serde(rename = "newDiskName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub new_disk_name: Option<String>,
#[serde(rename = "originalDiskPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub original_disk_path: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DiskSnapshot {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "fromDiskArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_disk_arn: Option<String>,
#[serde(rename = "fromDiskName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_disk_name: Option<String>,
#[serde(rename = "fromInstanceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_instance_arn: Option<String>,
#[serde(rename = "fromInstanceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_instance_name: Option<String>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "progress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "sizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_in_gb: Option<i64>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DiskSnapshotInfo {
#[serde(rename = "sizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_in_gb: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Domain {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "domainEntries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_entries: Option<Vec<DomainEntry>>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DomainEntry {
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "isAlias")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_alias: Option<bool>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "target")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DownloadDefaultKeyPairRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DownloadDefaultKeyPairResult {
#[serde(rename = "privateKeyBase64")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_key_base_64: Option<String>,
#[serde(rename = "publicKeyBase64")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_key_base_64: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExportSnapshotRecord {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "destinationInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_info: Option<DestinationInfo>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "sourceInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_info: Option<ExportSnapshotRecordSourceInfo>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExportSnapshotRecordSourceInfo {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "diskSnapshotInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_snapshot_info: Option<DiskSnapshotInfo>,
#[serde(rename = "fromResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_resource_arn: Option<String>,
#[serde(rename = "fromResourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_resource_name: Option<String>,
#[serde(rename = "instanceSnapshotInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_snapshot_info: Option<InstanceSnapshotInfo>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ExportSnapshotRequest {
#[serde(rename = "sourceSnapshotName")]
pub source_snapshot_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExportSnapshotResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetActiveNamesRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetActiveNamesResult {
#[serde(rename = "activeNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active_names: Option<Vec<String>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetBlueprintsRequest {
#[serde(rename = "includeInactive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_inactive: Option<bool>,
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetBlueprintsResult {
#[serde(rename = "blueprints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blueprints: Option<Vec<Blueprint>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetBundlesRequest {
#[serde(rename = "includeInactive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_inactive: Option<bool>,
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetBundlesResult {
#[serde(rename = "bundles")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bundles: Option<Vec<Bundle>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetCloudFormationStackRecordsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetCloudFormationStackRecordsResult {
#[serde(rename = "cloudFormationStackRecords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cloud_formation_stack_records: Option<Vec<CloudFormationStackRecord>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDiskRequest {
#[serde(rename = "diskName")]
pub disk_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDiskResult {
#[serde(rename = "disk")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk: Option<Disk>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDiskSnapshotRequest {
#[serde(rename = "diskSnapshotName")]
pub disk_snapshot_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDiskSnapshotResult {
#[serde(rename = "diskSnapshot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_snapshot: Option<DiskSnapshot>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDiskSnapshotsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDiskSnapshotsResult {
#[serde(rename = "diskSnapshots")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_snapshots: Option<Vec<DiskSnapshot>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDisksRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDisksResult {
#[serde(rename = "disks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disks: Option<Vec<Disk>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDomainRequest {
#[serde(rename = "domainName")]
pub domain_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDomainResult {
#[serde(rename = "domain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain: Option<Domain>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDomainsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDomainsResult {
#[serde(rename = "domains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domains: Option<Vec<Domain>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetExportSnapshotRecordsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetExportSnapshotRecordsResult {
#[serde(rename = "exportSnapshotRecords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub export_snapshot_records: Option<Vec<ExportSnapshotRecord>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstanceAccessDetailsRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
#[serde(rename = "protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstanceAccessDetailsResult {
#[serde(rename = "accessDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_details: Option<InstanceAccessDetails>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstanceMetricDataRequest {
#[serde(rename = "endTime")]
pub end_time: f64,
#[serde(rename = "instanceName")]
pub instance_name: String,
#[serde(rename = "metricName")]
pub metric_name: String,
#[serde(rename = "period")]
pub period: i64,
#[serde(rename = "startTime")]
pub start_time: f64,
#[serde(rename = "statistics")]
pub statistics: Vec<String>,
#[serde(rename = "unit")]
pub unit: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstanceMetricDataResult {
#[serde(rename = "metricData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_data: Option<Vec<MetricDatapoint>>,
#[serde(rename = "metricName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstancePortStatesRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstancePortStatesResult {
#[serde(rename = "portStates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port_states: Option<Vec<InstancePortState>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstanceRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstanceResult {
#[serde(rename = "instance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance: Option<Instance>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstanceSnapshotRequest {
#[serde(rename = "instanceSnapshotName")]
pub instance_snapshot_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstanceSnapshotResult {
#[serde(rename = "instanceSnapshot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_snapshot: Option<InstanceSnapshot>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstanceSnapshotsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstanceSnapshotsResult {
#[serde(rename = "instanceSnapshots")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_snapshots: Option<Vec<InstanceSnapshot>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstanceStateRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstanceStateResult {
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<InstanceState>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstancesRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstancesResult {
#[serde(rename = "instances")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instances: Option<Vec<Instance>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetKeyPairRequest {
#[serde(rename = "keyPairName")]
pub key_pair_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetKeyPairResult {
#[serde(rename = "keyPair")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_pair: Option<KeyPair>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetKeyPairsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetKeyPairsResult {
#[serde(rename = "keyPairs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_pairs: Option<Vec<KeyPair>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLoadBalancerMetricDataRequest {
#[serde(rename = "endTime")]
pub end_time: f64,
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
#[serde(rename = "metricName")]
pub metric_name: String,
#[serde(rename = "period")]
pub period: i64,
#[serde(rename = "startTime")]
pub start_time: f64,
#[serde(rename = "statistics")]
pub statistics: Vec<String>,
#[serde(rename = "unit")]
pub unit: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLoadBalancerMetricDataResult {
#[serde(rename = "metricData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_data: Option<Vec<MetricDatapoint>>,
#[serde(rename = "metricName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLoadBalancerRequest {
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLoadBalancerResult {
#[serde(rename = "loadBalancer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub load_balancer: Option<LoadBalancer>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLoadBalancerTlsCertificatesRequest {
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLoadBalancerTlsCertificatesResult {
#[serde(rename = "tlsCertificates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tls_certificates: Option<Vec<LoadBalancerTlsCertificate>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLoadBalancersRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLoadBalancersResult {
#[serde(rename = "loadBalancers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub load_balancers: Option<Vec<LoadBalancer>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetOperationRequest {
#[serde(rename = "operationId")]
pub operation_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetOperationResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetOperationsForResourceRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "resourceName")]
pub resource_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetOperationsForResourceResult {
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetOperationsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetOperationsResult {
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRegionsRequest {
#[serde(rename = "includeAvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_availability_zones: Option<bool>,
#[serde(rename = "includeRelationalDatabaseAvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_relational_database_availability_zones: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRegionsResult {
#[serde(rename = "regions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub regions: Option<Vec<Region>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseBlueprintsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseBlueprintsResult {
#[serde(rename = "blueprints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blueprints: Option<Vec<RelationalDatabaseBlueprint>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseBundlesRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseBundlesResult {
#[serde(rename = "bundles")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bundles: Option<Vec<RelationalDatabaseBundle>>,
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseEventsRequest {
#[serde(rename = "durationInMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_in_minutes: Option<i64>,
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseEventsResult {
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "relationalDatabaseEvents")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_events: Option<Vec<RelationalDatabaseEvent>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseLogEventsRequest {
#[serde(rename = "endTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "logStreamName")]
pub log_stream_name: String,
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
#[serde(rename = "startFromHead")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_from_head: Option<bool>,
#[serde(rename = "startTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseLogEventsResult {
#[serde(rename = "nextBackwardToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_backward_token: Option<String>,
#[serde(rename = "nextForwardToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_forward_token: Option<String>,
#[serde(rename = "resourceLogEvents")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_log_events: Option<Vec<LogEvent>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseLogStreamsRequest {
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseLogStreamsResult {
#[serde(rename = "logStreams")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_streams: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseMasterUserPasswordRequest {
#[serde(rename = "passwordVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password_version: Option<String>,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseMasterUserPasswordResult {
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "masterUserPassword")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_user_password: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseMetricDataRequest {
#[serde(rename = "endTime")]
pub end_time: f64,
#[serde(rename = "metricName")]
pub metric_name: String,
#[serde(rename = "period")]
pub period: i64,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
#[serde(rename = "startTime")]
pub start_time: f64,
#[serde(rename = "statistics")]
pub statistics: Vec<String>,
#[serde(rename = "unit")]
pub unit: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseMetricDataResult {
#[serde(rename = "metricData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_data: Option<Vec<MetricDatapoint>>,
#[serde(rename = "metricName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseParametersRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseParametersResult {
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "parameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameters: Option<Vec<RelationalDatabaseParameter>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseRequest {
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseResult {
#[serde(rename = "relationalDatabase")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database: Option<RelationalDatabase>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseSnapshotRequest {
#[serde(rename = "relationalDatabaseSnapshotName")]
pub relational_database_snapshot_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseSnapshotResult {
#[serde(rename = "relationalDatabaseSnapshot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_snapshot: Option<RelationalDatabaseSnapshot>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabaseSnapshotsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabaseSnapshotsResult {
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "relationalDatabaseSnapshots")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_snapshots: Option<Vec<RelationalDatabaseSnapshot>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRelationalDatabasesRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRelationalDatabasesResult {
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "relationalDatabases")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_databases: Option<Vec<RelationalDatabase>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetStaticIpRequest {
#[serde(rename = "staticIpName")]
pub static_ip_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetStaticIpResult {
#[serde(rename = "staticIp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub static_ip: Option<StaticIp>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetStaticIpsRequest {
#[serde(rename = "pageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetStaticIpsResult {
#[serde(rename = "nextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "staticIps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub static_ips: Option<Vec<StaticIp>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ImportKeyPairRequest {
#[serde(rename = "keyPairName")]
pub key_pair_name: String,
#[serde(rename = "publicKeyBase64")]
pub public_key_base_64: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ImportKeyPairResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Instance {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "blueprintId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blueprint_id: Option<String>,
#[serde(rename = "blueprintName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blueprint_name: Option<String>,
#[serde(rename = "bundleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bundle_id: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "hardware")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hardware: Option<InstanceHardware>,
#[serde(rename = "ipv6Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv_6_address: Option<String>,
#[serde(rename = "isStaticIp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_static_ip: Option<bool>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "networking")]
#[serde(skip_serializing_if = "Option::is_none")]
pub networking: Option<InstanceNetworking>,
#[serde(rename = "privateIpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_ip_address: Option<String>,
#[serde(rename = "publicIpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_ip_address: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "sshKeyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_key_name: Option<String>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<InstanceState>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceAccessDetails {
#[serde(rename = "certKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cert_key: Option<String>,
#[serde(rename = "expiresAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<f64>,
#[serde(rename = "instanceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_name: Option<String>,
#[serde(rename = "ipAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
#[serde(rename = "password")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "passwordData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password_data: Option<PasswordData>,
#[serde(rename = "privateKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_key: Option<String>,
#[serde(rename = "protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InstanceEntry {
#[serde(rename = "availabilityZone")]
pub availability_zone: String,
#[serde(rename = "instanceType")]
pub instance_type: String,
#[serde(rename = "portInfoSource")]
pub port_info_source: String,
#[serde(rename = "sourceName")]
pub source_name: String,
#[serde(rename = "userData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_data: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceHardware {
#[serde(rename = "cpuCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_count: Option<i64>,
#[serde(rename = "disks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disks: Option<Vec<Disk>>,
#[serde(rename = "ramSizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ram_size_in_gb: Option<f32>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceHealthSummary {
#[serde(rename = "instanceHealth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_health: Option<String>,
#[serde(rename = "instanceHealthReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_health_reason: Option<String>,
#[serde(rename = "instanceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceNetworking {
#[serde(rename = "monthlyTransfer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monthly_transfer: Option<MonthlyTransfer>,
#[serde(rename = "ports")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ports: Option<Vec<InstancePortInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstancePortInfo {
#[serde(rename = "accessDirection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_direction: Option<String>,
#[serde(rename = "accessFrom")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_from: Option<String>,
#[serde(rename = "accessType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_type: Option<String>,
#[serde(rename = "commonName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub common_name: Option<String>,
#[serde(rename = "fromPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_port: Option<i64>,
#[serde(rename = "protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "toPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub to_port: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstancePortState {
#[serde(rename = "fromPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_port: Option<i64>,
#[serde(rename = "protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "toPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub to_port: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceSnapshot {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "fromAttachedDisks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_attached_disks: Option<Vec<Disk>>,
#[serde(rename = "fromBlueprintId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_blueprint_id: Option<String>,
#[serde(rename = "fromBundleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_bundle_id: Option<String>,
#[serde(rename = "fromInstanceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_instance_arn: Option<String>,
#[serde(rename = "fromInstanceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_instance_name: Option<String>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "progress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "sizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_in_gb: Option<i64>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceSnapshotInfo {
#[serde(rename = "fromBlueprintId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_blueprint_id: Option<String>,
#[serde(rename = "fromBundleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_bundle_id: Option<String>,
#[serde(rename = "fromDiskInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_disk_info: Option<Vec<DiskInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceState {
#[serde(rename = "code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<i64>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct IsVpcPeeredRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct IsVpcPeeredResult {
#[serde(rename = "isPeered")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_peered: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct KeyPair {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "fingerprint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fingerprint: Option<String>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LoadBalancer {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "configurationOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_options: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "dnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dns_name: Option<String>,
#[serde(rename = "healthCheckPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_path: Option<String>,
#[serde(rename = "instanceHealthSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_health_summary: Option<Vec<InstanceHealthSummary>>,
#[serde(rename = "instancePort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_port: Option<i64>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "publicPorts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_ports: Option<Vec<i64>>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "tlsCertificateSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tls_certificate_summaries: Option<Vec<LoadBalancerTlsCertificateSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LoadBalancerTlsCertificate {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "domainName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_name: Option<String>,
#[serde(rename = "domainValidationRecords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_validation_records: Option<Vec<LoadBalancerTlsCertificateDomainValidationRecord>>,
#[serde(rename = "failureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "isAttached")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_attached: Option<bool>,
#[serde(rename = "issuedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub issued_at: Option<f64>,
#[serde(rename = "issuer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub issuer: Option<String>,
#[serde(rename = "keyAlgorithm")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_algorithm: Option<String>,
#[serde(rename = "loadBalancerName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub load_balancer_name: Option<String>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "notAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub not_after: Option<f64>,
#[serde(rename = "notBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub not_before: Option<f64>,
#[serde(rename = "renewalSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub renewal_summary: Option<LoadBalancerTlsCertificateRenewalSummary>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "revocationReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revocation_reason: Option<String>,
#[serde(rename = "revokedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revoked_at: Option<f64>,
#[serde(rename = "serial")]
#[serde(skip_serializing_if = "Option::is_none")]
pub serial: Option<String>,
#[serde(rename = "signatureAlgorithm")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signature_algorithm: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "subject")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subject: Option<String>,
#[serde(rename = "subjectAlternativeNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_alternative_names: Option<Vec<String>>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LoadBalancerTlsCertificateDomainValidationOption {
#[serde(rename = "domainName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_name: Option<String>,
#[serde(rename = "validationStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LoadBalancerTlsCertificateDomainValidationRecord {
#[serde(rename = "domainName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_name: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "validationStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_status: Option<String>,
#[serde(rename = "value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LoadBalancerTlsCertificateRenewalSummary {
#[serde(rename = "domainValidationOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_validation_options: Option<Vec<LoadBalancerTlsCertificateDomainValidationOption>>,
#[serde(rename = "renewalStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub renewal_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LoadBalancerTlsCertificateSummary {
#[serde(rename = "isAttached")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_attached: Option<bool>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LogEvent {
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MetricDatapoint {
#[serde(rename = "average")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average: Option<f64>,
#[serde(rename = "maximum")]
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum: Option<f64>,
#[serde(rename = "minimum")]
#[serde(skip_serializing_if = "Option::is_none")]
pub minimum: Option<f64>,
#[serde(rename = "sampleCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sample_count: Option<f64>,
#[serde(rename = "sum")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sum: Option<f64>,
#[serde(rename = "timestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<f64>,
#[serde(rename = "unit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MonthlyTransfer {
#[serde(rename = "gbPerMonthAllocated")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gb_per_month_allocated: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct OpenInstancePublicPortsRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
#[serde(rename = "portInfo")]
pub port_info: PortInfo,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct OpenInstancePublicPortsResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Operation {
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "errorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
#[serde(rename = "errorDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_details: Option<String>,
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "isTerminal")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_terminal: Option<bool>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "operationDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation_details: Option<String>,
#[serde(rename = "operationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation_type: Option<String>,
#[serde(rename = "resourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "statusChangedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_changed_at: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PasswordData {
#[serde(rename = "ciphertext")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ciphertext: Option<String>,
#[serde(rename = "keyPairName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_pair_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PeerVpcRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PeerVpcResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PendingMaintenanceAction {
#[serde(rename = "action")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<String>,
#[serde(rename = "currentApplyDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_apply_date: Option<f64>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PendingModifiedRelationalDatabaseValues {
#[serde(rename = "backupRetentionEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub backup_retention_enabled: Option<bool>,
#[serde(rename = "engineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "masterUserPassword")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_user_password: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PortInfo {
#[serde(rename = "fromPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_port: Option<i64>,
#[serde(rename = "protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "toPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub to_port: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutInstancePublicPortsRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
#[serde(rename = "portInfos")]
pub port_infos: Vec<PortInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutInstancePublicPortsResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RebootInstanceRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RebootInstanceResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RebootRelationalDatabaseRequest {
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RebootRelationalDatabaseResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Region {
#[serde(rename = "availabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zones: Option<Vec<AvailabilityZone>>,
#[serde(rename = "continentCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub continent_code: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "displayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "relationalDatabaseAvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_availability_zones: Option<Vec<AvailabilityZone>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RelationalDatabase {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "backupRetentionEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub backup_retention_enabled: Option<bool>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "engine")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine: Option<String>,
#[serde(rename = "engineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "hardware")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hardware: Option<RelationalDatabaseHardware>,
#[serde(rename = "latestRestorableTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub latest_restorable_time: Option<f64>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "masterDatabaseName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_database_name: Option<String>,
#[serde(rename = "masterEndpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_endpoint: Option<RelationalDatabaseEndpoint>,
#[serde(rename = "masterUsername")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_username: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "parameterApplyStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_apply_status: Option<String>,
#[serde(rename = "pendingMaintenanceActions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending_maintenance_actions: Option<Vec<PendingMaintenanceAction>>,
#[serde(rename = "pendingModifiedValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending_modified_values: Option<PendingModifiedRelationalDatabaseValues>,
#[serde(rename = "preferredBackupWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_backup_window: Option<String>,
#[serde(rename = "preferredMaintenanceWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_maintenance_window: Option<String>,
#[serde(rename = "publiclyAccessible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publicly_accessible: Option<bool>,
#[serde(rename = "relationalDatabaseBlueprintId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_blueprint_id: Option<String>,
#[serde(rename = "relationalDatabaseBundleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_bundle_id: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "secondaryAvailabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secondary_availability_zone: Option<String>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RelationalDatabaseBlueprint {
#[serde(rename = "blueprintId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blueprint_id: Option<String>,
#[serde(rename = "engine")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine: Option<String>,
#[serde(rename = "engineDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_description: Option<String>,
#[serde(rename = "engineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "engineVersionDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version_description: Option<String>,
#[serde(rename = "isEngineDefault")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_engine_default: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RelationalDatabaseBundle {
#[serde(rename = "bundleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bundle_id: Option<String>,
#[serde(rename = "cpuCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_count: Option<i64>,
#[serde(rename = "diskSizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_size_in_gb: Option<i64>,
#[serde(rename = "isActive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[serde(rename = "isEncrypted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_encrypted: Option<bool>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "price")]
#[serde(skip_serializing_if = "Option::is_none")]
pub price: Option<f32>,
#[serde(rename = "ramSizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ram_size_in_gb: Option<f32>,
#[serde(rename = "transferPerMonthInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transfer_per_month_in_gb: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RelationalDatabaseEndpoint {
#[serde(rename = "address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
#[serde(rename = "port")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RelationalDatabaseEvent {
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "eventCategories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_categories: Option<Vec<String>>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "resource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RelationalDatabaseHardware {
#[serde(rename = "cpuCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_count: Option<i64>,
#[serde(rename = "diskSizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disk_size_in_gb: Option<i64>,
#[serde(rename = "ramSizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ram_size_in_gb: Option<f32>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RelationalDatabaseParameter {
#[serde(rename = "allowedValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allowed_values: Option<String>,
#[serde(rename = "applyMethod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub apply_method: Option<String>,
#[serde(rename = "applyType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub apply_type: Option<String>,
#[serde(rename = "dataType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_type: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "isModifiable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_modifiable: Option<bool>,
#[serde(rename = "parameterName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_name: Option<String>,
#[serde(rename = "parameterValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RelationalDatabaseSnapshot {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "engine")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine: Option<String>,
#[serde(rename = "engineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "fromRelationalDatabaseArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_relational_database_arn: Option<String>,
#[serde(rename = "fromRelationalDatabaseBlueprintId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_relational_database_blueprint_id: Option<String>,
#[serde(rename = "fromRelationalDatabaseBundleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_relational_database_bundle_id: Option<String>,
#[serde(rename = "fromRelationalDatabaseName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_relational_database_name: Option<String>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "sizeInGb")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_in_gb: Option<i64>,
#[serde(rename = "state")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: 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 ReleaseStaticIpRequest {
#[serde(rename = "staticIpName")]
pub static_ip_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ReleaseStaticIpResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceLocation {
#[serde(rename = "availabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "regionName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartInstanceRequest {
#[serde(rename = "instanceName")]
pub instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartInstanceResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartRelationalDatabaseRequest {
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartRelationalDatabaseResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StaticIp {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "attachedTo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attached_to: Option<String>,
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "ipAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
#[serde(rename = "isAttached")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_attached: Option<bool>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<ResourceLocation>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "supportCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_code: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopInstanceRequest {
#[serde(rename = "force")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force: Option<bool>,
#[serde(rename = "instanceName")]
pub instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopInstanceResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopRelationalDatabaseRequest {
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
#[serde(rename = "relationalDatabaseSnapshotName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relational_database_snapshot_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopRelationalDatabaseResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceRequest {
#[serde(rename = "resourceName")]
pub resource_name: String,
#[serde(rename = "tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagResourceResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UnpeerVpcRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UnpeerVpcResult {
#[serde(rename = "operation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation: Option<Operation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceRequest {
#[serde(rename = "resourceName")]
pub resource_name: String,
#[serde(rename = "tagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UntagResourceResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateDomainEntryRequest {
#[serde(rename = "domainEntry")]
pub domain_entry: DomainEntry,
#[serde(rename = "domainName")]
pub domain_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateDomainEntryResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateLoadBalancerAttributeRequest {
#[serde(rename = "attributeName")]
pub attribute_name: String,
#[serde(rename = "attributeValue")]
pub attribute_value: String,
#[serde(rename = "loadBalancerName")]
pub load_balancer_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateLoadBalancerAttributeResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateRelationalDatabaseParametersRequest {
#[serde(rename = "parameters")]
pub parameters: Vec<RelationalDatabaseParameter>,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateRelationalDatabaseParametersResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateRelationalDatabaseRequest {
#[serde(rename = "applyImmediately")]
#[serde(skip_serializing_if = "Option::is_none")]
pub apply_immediately: Option<bool>,
#[serde(rename = "disableBackupRetention")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disable_backup_retention: Option<bool>,
#[serde(rename = "enableBackupRetention")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_backup_retention: Option<bool>,
#[serde(rename = "masterUserPassword")]
#[serde(skip_serializing_if = "Option::is_none")]
pub master_user_password: Option<String>,
#[serde(rename = "preferredBackupWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_backup_window: Option<String>,
#[serde(rename = "preferredMaintenanceWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_maintenance_window: Option<String>,
#[serde(rename = "publiclyAccessible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publicly_accessible: Option<bool>,
#[serde(rename = "relationalDatabaseName")]
pub relational_database_name: String,
#[serde(rename = "rotateMasterUserPassword")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rotate_master_user_password: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateRelationalDatabaseResult {
#[serde(rename = "operations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operations: Option<Vec<Operation>>,
}
#[derive(Debug, PartialEq)]
pub enum AllocateStaticIpError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AllocateStaticIpError {
pub fn from_response(res: BufferedHttpResponse) -> AllocateStaticIpError {
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 {
"AccessDeniedException" => {
return AllocateStaticIpError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return AllocateStaticIpError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return AllocateStaticIpError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return AllocateStaticIpError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return AllocateStaticIpError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return AllocateStaticIpError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return AllocateStaticIpError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return AllocateStaticIpError::Validation(error_message.to_string());
}
_ => {}
}
}
return AllocateStaticIpError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AllocateStaticIpError {
fn from(err: serde_json::error::Error) -> AllocateStaticIpError {
AllocateStaticIpError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AllocateStaticIpError {
fn from(err: CredentialsError) -> AllocateStaticIpError {
AllocateStaticIpError::Credentials(err)
}
}
impl From<HttpDispatchError> for AllocateStaticIpError {
fn from(err: HttpDispatchError) -> AllocateStaticIpError {
AllocateStaticIpError::HttpDispatch(err)
}
}
impl From<io::Error> for AllocateStaticIpError {
fn from(err: io::Error) -> AllocateStaticIpError {
AllocateStaticIpError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AllocateStaticIpError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AllocateStaticIpError {
fn description(&self) -> &str {
match *self {
AllocateStaticIpError::AccessDenied(ref cause) => cause,
AllocateStaticIpError::AccountSetupInProgress(ref cause) => cause,
AllocateStaticIpError::InvalidInput(ref cause) => cause,
AllocateStaticIpError::NotFound(ref cause) => cause,
AllocateStaticIpError::OperationFailure(ref cause) => cause,
AllocateStaticIpError::Service(ref cause) => cause,
AllocateStaticIpError::Unauthenticated(ref cause) => cause,
AllocateStaticIpError::Validation(ref cause) => cause,
AllocateStaticIpError::Credentials(ref err) => err.description(),
AllocateStaticIpError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AllocateStaticIpError::ParseError(ref cause) => cause,
AllocateStaticIpError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AttachDiskError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AttachDiskError {
pub fn from_response(res: BufferedHttpResponse) -> AttachDiskError {
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 {
"AccessDeniedException" => {
return AttachDiskError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return AttachDiskError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return AttachDiskError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return AttachDiskError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return AttachDiskError::OperationFailure(String::from(error_message));
}
"ServiceException" => return AttachDiskError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return AttachDiskError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return AttachDiskError::Validation(error_message.to_string());
}
_ => {}
}
}
return AttachDiskError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AttachDiskError {
fn from(err: serde_json::error::Error) -> AttachDiskError {
AttachDiskError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AttachDiskError {
fn from(err: CredentialsError) -> AttachDiskError {
AttachDiskError::Credentials(err)
}
}
impl From<HttpDispatchError> for AttachDiskError {
fn from(err: HttpDispatchError) -> AttachDiskError {
AttachDiskError::HttpDispatch(err)
}
}
impl From<io::Error> for AttachDiskError {
fn from(err: io::Error) -> AttachDiskError {
AttachDiskError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AttachDiskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AttachDiskError {
fn description(&self) -> &str {
match *self {
AttachDiskError::AccessDenied(ref cause) => cause,
AttachDiskError::AccountSetupInProgress(ref cause) => cause,
AttachDiskError::InvalidInput(ref cause) => cause,
AttachDiskError::NotFound(ref cause) => cause,
AttachDiskError::OperationFailure(ref cause) => cause,
AttachDiskError::Service(ref cause) => cause,
AttachDiskError::Unauthenticated(ref cause) => cause,
AttachDiskError::Validation(ref cause) => cause,
AttachDiskError::Credentials(ref err) => err.description(),
AttachDiskError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AttachDiskError::ParseError(ref cause) => cause,
AttachDiskError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AttachInstancesToLoadBalancerError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AttachInstancesToLoadBalancerError {
pub fn from_response(res: BufferedHttpResponse) -> AttachInstancesToLoadBalancerError {
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 {
"AccessDeniedException" => {
return AttachInstancesToLoadBalancerError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return AttachInstancesToLoadBalancerError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return AttachInstancesToLoadBalancerError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return AttachInstancesToLoadBalancerError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return AttachInstancesToLoadBalancerError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return AttachInstancesToLoadBalancerError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return AttachInstancesToLoadBalancerError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return AttachInstancesToLoadBalancerError::Validation(error_message.to_string());
}
_ => {}
}
}
return AttachInstancesToLoadBalancerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AttachInstancesToLoadBalancerError {
fn from(err: serde_json::error::Error) -> AttachInstancesToLoadBalancerError {
AttachInstancesToLoadBalancerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AttachInstancesToLoadBalancerError {
fn from(err: CredentialsError) -> AttachInstancesToLoadBalancerError {
AttachInstancesToLoadBalancerError::Credentials(err)
}
}
impl From<HttpDispatchError> for AttachInstancesToLoadBalancerError {
fn from(err: HttpDispatchError) -> AttachInstancesToLoadBalancerError {
AttachInstancesToLoadBalancerError::HttpDispatch(err)
}
}
impl From<io::Error> for AttachInstancesToLoadBalancerError {
fn from(err: io::Error) -> AttachInstancesToLoadBalancerError {
AttachInstancesToLoadBalancerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AttachInstancesToLoadBalancerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AttachInstancesToLoadBalancerError {
fn description(&self) -> &str {
match *self {
AttachInstancesToLoadBalancerError::AccessDenied(ref cause) => cause,
AttachInstancesToLoadBalancerError::AccountSetupInProgress(ref cause) => cause,
AttachInstancesToLoadBalancerError::InvalidInput(ref cause) => cause,
AttachInstancesToLoadBalancerError::NotFound(ref cause) => cause,
AttachInstancesToLoadBalancerError::OperationFailure(ref cause) => cause,
AttachInstancesToLoadBalancerError::Service(ref cause) => cause,
AttachInstancesToLoadBalancerError::Unauthenticated(ref cause) => cause,
AttachInstancesToLoadBalancerError::Validation(ref cause) => cause,
AttachInstancesToLoadBalancerError::Credentials(ref err) => err.description(),
AttachInstancesToLoadBalancerError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AttachInstancesToLoadBalancerError::ParseError(ref cause) => cause,
AttachInstancesToLoadBalancerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AttachLoadBalancerTlsCertificateError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AttachLoadBalancerTlsCertificateError {
pub fn from_response(res: BufferedHttpResponse) -> AttachLoadBalancerTlsCertificateError {
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 {
"AccessDeniedException" => {
return AttachLoadBalancerTlsCertificateError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return AttachLoadBalancerTlsCertificateError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return AttachLoadBalancerTlsCertificateError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return AttachLoadBalancerTlsCertificateError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return AttachLoadBalancerTlsCertificateError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return AttachLoadBalancerTlsCertificateError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return AttachLoadBalancerTlsCertificateError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return AttachLoadBalancerTlsCertificateError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return AttachLoadBalancerTlsCertificateError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AttachLoadBalancerTlsCertificateError {
fn from(err: serde_json::error::Error) -> AttachLoadBalancerTlsCertificateError {
AttachLoadBalancerTlsCertificateError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AttachLoadBalancerTlsCertificateError {
fn from(err: CredentialsError) -> AttachLoadBalancerTlsCertificateError {
AttachLoadBalancerTlsCertificateError::Credentials(err)
}
}
impl From<HttpDispatchError> for AttachLoadBalancerTlsCertificateError {
fn from(err: HttpDispatchError) -> AttachLoadBalancerTlsCertificateError {
AttachLoadBalancerTlsCertificateError::HttpDispatch(err)
}
}
impl From<io::Error> for AttachLoadBalancerTlsCertificateError {
fn from(err: io::Error) -> AttachLoadBalancerTlsCertificateError {
AttachLoadBalancerTlsCertificateError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AttachLoadBalancerTlsCertificateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AttachLoadBalancerTlsCertificateError {
fn description(&self) -> &str {
match *self {
AttachLoadBalancerTlsCertificateError::AccessDenied(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::AccountSetupInProgress(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::InvalidInput(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::NotFound(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::OperationFailure(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::Service(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::Unauthenticated(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::Validation(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::Credentials(ref err) => err.description(),
AttachLoadBalancerTlsCertificateError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AttachLoadBalancerTlsCertificateError::ParseError(ref cause) => cause,
AttachLoadBalancerTlsCertificateError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AttachStaticIpError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AttachStaticIpError {
pub fn from_response(res: BufferedHttpResponse) -> AttachStaticIpError {
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 {
"AccessDeniedException" => {
return AttachStaticIpError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return AttachStaticIpError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return AttachStaticIpError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return AttachStaticIpError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return AttachStaticIpError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return AttachStaticIpError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return AttachStaticIpError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return AttachStaticIpError::Validation(error_message.to_string());
}
_ => {}
}
}
return AttachStaticIpError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AttachStaticIpError {
fn from(err: serde_json::error::Error) -> AttachStaticIpError {
AttachStaticIpError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AttachStaticIpError {
fn from(err: CredentialsError) -> AttachStaticIpError {
AttachStaticIpError::Credentials(err)
}
}
impl From<HttpDispatchError> for AttachStaticIpError {
fn from(err: HttpDispatchError) -> AttachStaticIpError {
AttachStaticIpError::HttpDispatch(err)
}
}
impl From<io::Error> for AttachStaticIpError {
fn from(err: io::Error) -> AttachStaticIpError {
AttachStaticIpError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AttachStaticIpError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AttachStaticIpError {
fn description(&self) -> &str {
match *self {
AttachStaticIpError::AccessDenied(ref cause) => cause,
AttachStaticIpError::AccountSetupInProgress(ref cause) => cause,
AttachStaticIpError::InvalidInput(ref cause) => cause,
AttachStaticIpError::NotFound(ref cause) => cause,
AttachStaticIpError::OperationFailure(ref cause) => cause,
AttachStaticIpError::Service(ref cause) => cause,
AttachStaticIpError::Unauthenticated(ref cause) => cause,
AttachStaticIpError::Validation(ref cause) => cause,
AttachStaticIpError::Credentials(ref err) => err.description(),
AttachStaticIpError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AttachStaticIpError::ParseError(ref cause) => cause,
AttachStaticIpError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CloseInstancePublicPortsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CloseInstancePublicPortsError {
pub fn from_response(res: BufferedHttpResponse) -> CloseInstancePublicPortsError {
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 {
"AccessDeniedException" => {
return CloseInstancePublicPortsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CloseInstancePublicPortsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CloseInstancePublicPortsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CloseInstancePublicPortsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CloseInstancePublicPortsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return CloseInstancePublicPortsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CloseInstancePublicPortsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return CloseInstancePublicPortsError::Validation(error_message.to_string());
}
_ => {}
}
}
return CloseInstancePublicPortsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CloseInstancePublicPortsError {
fn from(err: serde_json::error::Error) -> CloseInstancePublicPortsError {
CloseInstancePublicPortsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CloseInstancePublicPortsError {
fn from(err: CredentialsError) -> CloseInstancePublicPortsError {
CloseInstancePublicPortsError::Credentials(err)
}
}
impl From<HttpDispatchError> for CloseInstancePublicPortsError {
fn from(err: HttpDispatchError) -> CloseInstancePublicPortsError {
CloseInstancePublicPortsError::HttpDispatch(err)
}
}
impl From<io::Error> for CloseInstancePublicPortsError {
fn from(err: io::Error) -> CloseInstancePublicPortsError {
CloseInstancePublicPortsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CloseInstancePublicPortsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CloseInstancePublicPortsError {
fn description(&self) -> &str {
match *self {
CloseInstancePublicPortsError::AccessDenied(ref cause) => cause,
CloseInstancePublicPortsError::AccountSetupInProgress(ref cause) => cause,
CloseInstancePublicPortsError::InvalidInput(ref cause) => cause,
CloseInstancePublicPortsError::NotFound(ref cause) => cause,
CloseInstancePublicPortsError::OperationFailure(ref cause) => cause,
CloseInstancePublicPortsError::Service(ref cause) => cause,
CloseInstancePublicPortsError::Unauthenticated(ref cause) => cause,
CloseInstancePublicPortsError::Validation(ref cause) => cause,
CloseInstancePublicPortsError::Credentials(ref err) => err.description(),
CloseInstancePublicPortsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CloseInstancePublicPortsError::ParseError(ref cause) => cause,
CloseInstancePublicPortsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CopySnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CopySnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> CopySnapshotError {
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 {
"AccessDeniedException" => {
return CopySnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CopySnapshotError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return CopySnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CopySnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CopySnapshotError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return CopySnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CopySnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CopySnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return CopySnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CopySnapshotError {
fn from(err: serde_json::error::Error) -> CopySnapshotError {
CopySnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CopySnapshotError {
fn from(err: CredentialsError) -> CopySnapshotError {
CopySnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for CopySnapshotError {
fn from(err: HttpDispatchError) -> CopySnapshotError {
CopySnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for CopySnapshotError {
fn from(err: io::Error) -> CopySnapshotError {
CopySnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CopySnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CopySnapshotError {
fn description(&self) -> &str {
match *self {
CopySnapshotError::AccessDenied(ref cause) => cause,
CopySnapshotError::AccountSetupInProgress(ref cause) => cause,
CopySnapshotError::InvalidInput(ref cause) => cause,
CopySnapshotError::NotFound(ref cause) => cause,
CopySnapshotError::OperationFailure(ref cause) => cause,
CopySnapshotError::Service(ref cause) => cause,
CopySnapshotError::Unauthenticated(ref cause) => cause,
CopySnapshotError::Validation(ref cause) => cause,
CopySnapshotError::Credentials(ref err) => err.description(),
CopySnapshotError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CopySnapshotError::ParseError(ref cause) => cause,
CopySnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCloudFormationStackError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateCloudFormationStackError {
pub fn from_response(res: BufferedHttpResponse) -> CreateCloudFormationStackError {
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 {
"AccessDeniedException" => {
return CreateCloudFormationStackError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateCloudFormationStackError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CreateCloudFormationStackError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateCloudFormationStackError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateCloudFormationStackError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return CreateCloudFormationStackError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateCloudFormationStackError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return CreateCloudFormationStackError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateCloudFormationStackError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateCloudFormationStackError {
fn from(err: serde_json::error::Error) -> CreateCloudFormationStackError {
CreateCloudFormationStackError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateCloudFormationStackError {
fn from(err: CredentialsError) -> CreateCloudFormationStackError {
CreateCloudFormationStackError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateCloudFormationStackError {
fn from(err: HttpDispatchError) -> CreateCloudFormationStackError {
CreateCloudFormationStackError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateCloudFormationStackError {
fn from(err: io::Error) -> CreateCloudFormationStackError {
CreateCloudFormationStackError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateCloudFormationStackError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCloudFormationStackError {
fn description(&self) -> &str {
match *self {
CreateCloudFormationStackError::AccessDenied(ref cause) => cause,
CreateCloudFormationStackError::AccountSetupInProgress(ref cause) => cause,
CreateCloudFormationStackError::InvalidInput(ref cause) => cause,
CreateCloudFormationStackError::NotFound(ref cause) => cause,
CreateCloudFormationStackError::OperationFailure(ref cause) => cause,
CreateCloudFormationStackError::Service(ref cause) => cause,
CreateCloudFormationStackError::Unauthenticated(ref cause) => cause,
CreateCloudFormationStackError::Validation(ref cause) => cause,
CreateCloudFormationStackError::Credentials(ref err) => err.description(),
CreateCloudFormationStackError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateCloudFormationStackError::ParseError(ref cause) => cause,
CreateCloudFormationStackError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDiskError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateDiskError {
pub fn from_response(res: BufferedHttpResponse) -> CreateDiskError {
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 {
"AccessDeniedException" => {
return CreateDiskError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateDiskError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return CreateDiskError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateDiskError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateDiskError::OperationFailure(String::from(error_message));
}
"ServiceException" => return CreateDiskError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return CreateDiskError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateDiskError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateDiskError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateDiskError {
fn from(err: serde_json::error::Error) -> CreateDiskError {
CreateDiskError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateDiskError {
fn from(err: CredentialsError) -> CreateDiskError {
CreateDiskError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateDiskError {
fn from(err: HttpDispatchError) -> CreateDiskError {
CreateDiskError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateDiskError {
fn from(err: io::Error) -> CreateDiskError {
CreateDiskError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateDiskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDiskError {
fn description(&self) -> &str {
match *self {
CreateDiskError::AccessDenied(ref cause) => cause,
CreateDiskError::AccountSetupInProgress(ref cause) => cause,
CreateDiskError::InvalidInput(ref cause) => cause,
CreateDiskError::NotFound(ref cause) => cause,
CreateDiskError::OperationFailure(ref cause) => cause,
CreateDiskError::Service(ref cause) => cause,
CreateDiskError::Unauthenticated(ref cause) => cause,
CreateDiskError::Validation(ref cause) => cause,
CreateDiskError::Credentials(ref err) => err.description(),
CreateDiskError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateDiskError::ParseError(ref cause) => cause,
CreateDiskError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDiskFromSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateDiskFromSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> CreateDiskFromSnapshotError {
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 {
"AccessDeniedException" => {
return CreateDiskFromSnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateDiskFromSnapshotError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CreateDiskFromSnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateDiskFromSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateDiskFromSnapshotError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return CreateDiskFromSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateDiskFromSnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateDiskFromSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateDiskFromSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateDiskFromSnapshotError {
fn from(err: serde_json::error::Error) -> CreateDiskFromSnapshotError {
CreateDiskFromSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateDiskFromSnapshotError {
fn from(err: CredentialsError) -> CreateDiskFromSnapshotError {
CreateDiskFromSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateDiskFromSnapshotError {
fn from(err: HttpDispatchError) -> CreateDiskFromSnapshotError {
CreateDiskFromSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateDiskFromSnapshotError {
fn from(err: io::Error) -> CreateDiskFromSnapshotError {
CreateDiskFromSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateDiskFromSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDiskFromSnapshotError {
fn description(&self) -> &str {
match *self {
CreateDiskFromSnapshotError::AccessDenied(ref cause) => cause,
CreateDiskFromSnapshotError::AccountSetupInProgress(ref cause) => cause,
CreateDiskFromSnapshotError::InvalidInput(ref cause) => cause,
CreateDiskFromSnapshotError::NotFound(ref cause) => cause,
CreateDiskFromSnapshotError::OperationFailure(ref cause) => cause,
CreateDiskFromSnapshotError::Service(ref cause) => cause,
CreateDiskFromSnapshotError::Unauthenticated(ref cause) => cause,
CreateDiskFromSnapshotError::Validation(ref cause) => cause,
CreateDiskFromSnapshotError::Credentials(ref err) => err.description(),
CreateDiskFromSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateDiskFromSnapshotError::ParseError(ref cause) => cause,
CreateDiskFromSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDiskSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateDiskSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> CreateDiskSnapshotError {
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 {
"AccessDeniedException" => {
return CreateDiskSnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateDiskSnapshotError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CreateDiskSnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateDiskSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateDiskSnapshotError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return CreateDiskSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateDiskSnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateDiskSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateDiskSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateDiskSnapshotError {
fn from(err: serde_json::error::Error) -> CreateDiskSnapshotError {
CreateDiskSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateDiskSnapshotError {
fn from(err: CredentialsError) -> CreateDiskSnapshotError {
CreateDiskSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateDiskSnapshotError {
fn from(err: HttpDispatchError) -> CreateDiskSnapshotError {
CreateDiskSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateDiskSnapshotError {
fn from(err: io::Error) -> CreateDiskSnapshotError {
CreateDiskSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateDiskSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDiskSnapshotError {
fn description(&self) -> &str {
match *self {
CreateDiskSnapshotError::AccessDenied(ref cause) => cause,
CreateDiskSnapshotError::AccountSetupInProgress(ref cause) => cause,
CreateDiskSnapshotError::InvalidInput(ref cause) => cause,
CreateDiskSnapshotError::NotFound(ref cause) => cause,
CreateDiskSnapshotError::OperationFailure(ref cause) => cause,
CreateDiskSnapshotError::Service(ref cause) => cause,
CreateDiskSnapshotError::Unauthenticated(ref cause) => cause,
CreateDiskSnapshotError::Validation(ref cause) => cause,
CreateDiskSnapshotError::Credentials(ref err) => err.description(),
CreateDiskSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateDiskSnapshotError::ParseError(ref cause) => cause,
CreateDiskSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDomainError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateDomainError {
pub fn from_response(res: BufferedHttpResponse) -> CreateDomainError {
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 {
"AccessDeniedException" => {
return CreateDomainError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateDomainError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return CreateDomainError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateDomainError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateDomainError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return CreateDomainError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateDomainError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateDomainError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateDomainError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateDomainError {
fn from(err: serde_json::error::Error) -> CreateDomainError {
CreateDomainError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateDomainError {
fn from(err: CredentialsError) -> CreateDomainError {
CreateDomainError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateDomainError {
fn from(err: HttpDispatchError) -> CreateDomainError {
CreateDomainError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateDomainError {
fn from(err: io::Error) -> CreateDomainError {
CreateDomainError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateDomainError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDomainError {
fn description(&self) -> &str {
match *self {
CreateDomainError::AccessDenied(ref cause) => cause,
CreateDomainError::AccountSetupInProgress(ref cause) => cause,
CreateDomainError::InvalidInput(ref cause) => cause,
CreateDomainError::NotFound(ref cause) => cause,
CreateDomainError::OperationFailure(ref cause) => cause,
CreateDomainError::Service(ref cause) => cause,
CreateDomainError::Unauthenticated(ref cause) => cause,
CreateDomainError::Validation(ref cause) => cause,
CreateDomainError::Credentials(ref err) => err.description(),
CreateDomainError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateDomainError::ParseError(ref cause) => cause,
CreateDomainError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDomainEntryError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateDomainEntryError {
pub fn from_response(res: BufferedHttpResponse) -> CreateDomainEntryError {
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 {
"AccessDeniedException" => {
return CreateDomainEntryError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateDomainEntryError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CreateDomainEntryError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateDomainEntryError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateDomainEntryError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return CreateDomainEntryError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateDomainEntryError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateDomainEntryError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateDomainEntryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateDomainEntryError {
fn from(err: serde_json::error::Error) -> CreateDomainEntryError {
CreateDomainEntryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateDomainEntryError {
fn from(err: CredentialsError) -> CreateDomainEntryError {
CreateDomainEntryError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateDomainEntryError {
fn from(err: HttpDispatchError) -> CreateDomainEntryError {
CreateDomainEntryError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateDomainEntryError {
fn from(err: io::Error) -> CreateDomainEntryError {
CreateDomainEntryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateDomainEntryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDomainEntryError {
fn description(&self) -> &str {
match *self {
CreateDomainEntryError::AccessDenied(ref cause) => cause,
CreateDomainEntryError::AccountSetupInProgress(ref cause) => cause,
CreateDomainEntryError::InvalidInput(ref cause) => cause,
CreateDomainEntryError::NotFound(ref cause) => cause,
CreateDomainEntryError::OperationFailure(ref cause) => cause,
CreateDomainEntryError::Service(ref cause) => cause,
CreateDomainEntryError::Unauthenticated(ref cause) => cause,
CreateDomainEntryError::Validation(ref cause) => cause,
CreateDomainEntryError::Credentials(ref err) => err.description(),
CreateDomainEntryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateDomainEntryError::ParseError(ref cause) => cause,
CreateDomainEntryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateInstanceSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateInstanceSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> CreateInstanceSnapshotError {
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 {
"AccessDeniedException" => {
return CreateInstanceSnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateInstanceSnapshotError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CreateInstanceSnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateInstanceSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateInstanceSnapshotError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return CreateInstanceSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateInstanceSnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateInstanceSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateInstanceSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateInstanceSnapshotError {
fn from(err: serde_json::error::Error) -> CreateInstanceSnapshotError {
CreateInstanceSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateInstanceSnapshotError {
fn from(err: CredentialsError) -> CreateInstanceSnapshotError {
CreateInstanceSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateInstanceSnapshotError {
fn from(err: HttpDispatchError) -> CreateInstanceSnapshotError {
CreateInstanceSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateInstanceSnapshotError {
fn from(err: io::Error) -> CreateInstanceSnapshotError {
CreateInstanceSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateInstanceSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateInstanceSnapshotError {
fn description(&self) -> &str {
match *self {
CreateInstanceSnapshotError::AccessDenied(ref cause) => cause,
CreateInstanceSnapshotError::AccountSetupInProgress(ref cause) => cause,
CreateInstanceSnapshotError::InvalidInput(ref cause) => cause,
CreateInstanceSnapshotError::NotFound(ref cause) => cause,
CreateInstanceSnapshotError::OperationFailure(ref cause) => cause,
CreateInstanceSnapshotError::Service(ref cause) => cause,
CreateInstanceSnapshotError::Unauthenticated(ref cause) => cause,
CreateInstanceSnapshotError::Validation(ref cause) => cause,
CreateInstanceSnapshotError::Credentials(ref err) => err.description(),
CreateInstanceSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateInstanceSnapshotError::ParseError(ref cause) => cause,
CreateInstanceSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateInstancesError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateInstancesError {
pub fn from_response(res: BufferedHttpResponse) -> CreateInstancesError {
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 {
"AccessDeniedException" => {
return CreateInstancesError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateInstancesError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return CreateInstancesError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateInstancesError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateInstancesError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return CreateInstancesError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateInstancesError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateInstancesError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateInstancesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateInstancesError {
fn from(err: serde_json::error::Error) -> CreateInstancesError {
CreateInstancesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateInstancesError {
fn from(err: CredentialsError) -> CreateInstancesError {
CreateInstancesError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateInstancesError {
fn from(err: HttpDispatchError) -> CreateInstancesError {
CreateInstancesError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateInstancesError {
fn from(err: io::Error) -> CreateInstancesError {
CreateInstancesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateInstancesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateInstancesError {
fn description(&self) -> &str {
match *self {
CreateInstancesError::AccessDenied(ref cause) => cause,
CreateInstancesError::AccountSetupInProgress(ref cause) => cause,
CreateInstancesError::InvalidInput(ref cause) => cause,
CreateInstancesError::NotFound(ref cause) => cause,
CreateInstancesError::OperationFailure(ref cause) => cause,
CreateInstancesError::Service(ref cause) => cause,
CreateInstancesError::Unauthenticated(ref cause) => cause,
CreateInstancesError::Validation(ref cause) => cause,
CreateInstancesError::Credentials(ref err) => err.description(),
CreateInstancesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateInstancesError::ParseError(ref cause) => cause,
CreateInstancesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateInstancesFromSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateInstancesFromSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> CreateInstancesFromSnapshotError {
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 {
"AccessDeniedException" => {
return CreateInstancesFromSnapshotError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return CreateInstancesFromSnapshotError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CreateInstancesFromSnapshotError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return CreateInstancesFromSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateInstancesFromSnapshotError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return CreateInstancesFromSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateInstancesFromSnapshotError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return CreateInstancesFromSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateInstancesFromSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateInstancesFromSnapshotError {
fn from(err: serde_json::error::Error) -> CreateInstancesFromSnapshotError {
CreateInstancesFromSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateInstancesFromSnapshotError {
fn from(err: CredentialsError) -> CreateInstancesFromSnapshotError {
CreateInstancesFromSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateInstancesFromSnapshotError {
fn from(err: HttpDispatchError) -> CreateInstancesFromSnapshotError {
CreateInstancesFromSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateInstancesFromSnapshotError {
fn from(err: io::Error) -> CreateInstancesFromSnapshotError {
CreateInstancesFromSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateInstancesFromSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateInstancesFromSnapshotError {
fn description(&self) -> &str {
match *self {
CreateInstancesFromSnapshotError::AccessDenied(ref cause) => cause,
CreateInstancesFromSnapshotError::AccountSetupInProgress(ref cause) => cause,
CreateInstancesFromSnapshotError::InvalidInput(ref cause) => cause,
CreateInstancesFromSnapshotError::NotFound(ref cause) => cause,
CreateInstancesFromSnapshotError::OperationFailure(ref cause) => cause,
CreateInstancesFromSnapshotError::Service(ref cause) => cause,
CreateInstancesFromSnapshotError::Unauthenticated(ref cause) => cause,
CreateInstancesFromSnapshotError::Validation(ref cause) => cause,
CreateInstancesFromSnapshotError::Credentials(ref err) => err.description(),
CreateInstancesFromSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateInstancesFromSnapshotError::ParseError(ref cause) => cause,
CreateInstancesFromSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateKeyPairError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateKeyPairError {
pub fn from_response(res: BufferedHttpResponse) -> CreateKeyPairError {
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 {
"AccessDeniedException" => {
return CreateKeyPairError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateKeyPairError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return CreateKeyPairError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateKeyPairError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateKeyPairError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return CreateKeyPairError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateKeyPairError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateKeyPairError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateKeyPairError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateKeyPairError {
fn from(err: serde_json::error::Error) -> CreateKeyPairError {
CreateKeyPairError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateKeyPairError {
fn from(err: CredentialsError) -> CreateKeyPairError {
CreateKeyPairError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateKeyPairError {
fn from(err: HttpDispatchError) -> CreateKeyPairError {
CreateKeyPairError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateKeyPairError {
fn from(err: io::Error) -> CreateKeyPairError {
CreateKeyPairError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateKeyPairError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateKeyPairError {
fn description(&self) -> &str {
match *self {
CreateKeyPairError::AccessDenied(ref cause) => cause,
CreateKeyPairError::AccountSetupInProgress(ref cause) => cause,
CreateKeyPairError::InvalidInput(ref cause) => cause,
CreateKeyPairError::NotFound(ref cause) => cause,
CreateKeyPairError::OperationFailure(ref cause) => cause,
CreateKeyPairError::Service(ref cause) => cause,
CreateKeyPairError::Unauthenticated(ref cause) => cause,
CreateKeyPairError::Validation(ref cause) => cause,
CreateKeyPairError::Credentials(ref err) => err.description(),
CreateKeyPairError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateKeyPairError::ParseError(ref cause) => cause,
CreateKeyPairError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateLoadBalancerError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateLoadBalancerError {
pub fn from_response(res: BufferedHttpResponse) -> CreateLoadBalancerError {
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 {
"AccessDeniedException" => {
return CreateLoadBalancerError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateLoadBalancerError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CreateLoadBalancerError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateLoadBalancerError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateLoadBalancerError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return CreateLoadBalancerError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateLoadBalancerError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return CreateLoadBalancerError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateLoadBalancerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateLoadBalancerError {
fn from(err: serde_json::error::Error) -> CreateLoadBalancerError {
CreateLoadBalancerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateLoadBalancerError {
fn from(err: CredentialsError) -> CreateLoadBalancerError {
CreateLoadBalancerError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateLoadBalancerError {
fn from(err: HttpDispatchError) -> CreateLoadBalancerError {
CreateLoadBalancerError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateLoadBalancerError {
fn from(err: io::Error) -> CreateLoadBalancerError {
CreateLoadBalancerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateLoadBalancerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateLoadBalancerError {
fn description(&self) -> &str {
match *self {
CreateLoadBalancerError::AccessDenied(ref cause) => cause,
CreateLoadBalancerError::AccountSetupInProgress(ref cause) => cause,
CreateLoadBalancerError::InvalidInput(ref cause) => cause,
CreateLoadBalancerError::NotFound(ref cause) => cause,
CreateLoadBalancerError::OperationFailure(ref cause) => cause,
CreateLoadBalancerError::Service(ref cause) => cause,
CreateLoadBalancerError::Unauthenticated(ref cause) => cause,
CreateLoadBalancerError::Validation(ref cause) => cause,
CreateLoadBalancerError::Credentials(ref err) => err.description(),
CreateLoadBalancerError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateLoadBalancerError::ParseError(ref cause) => cause,
CreateLoadBalancerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateLoadBalancerTlsCertificateError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateLoadBalancerTlsCertificateError {
pub fn from_response(res: BufferedHttpResponse) -> CreateLoadBalancerTlsCertificateError {
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 {
"AccessDeniedException" => {
return CreateLoadBalancerTlsCertificateError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return CreateLoadBalancerTlsCertificateError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return CreateLoadBalancerTlsCertificateError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return CreateLoadBalancerTlsCertificateError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return CreateLoadBalancerTlsCertificateError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return CreateLoadBalancerTlsCertificateError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return CreateLoadBalancerTlsCertificateError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return CreateLoadBalancerTlsCertificateError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return CreateLoadBalancerTlsCertificateError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateLoadBalancerTlsCertificateError {
fn from(err: serde_json::error::Error) -> CreateLoadBalancerTlsCertificateError {
CreateLoadBalancerTlsCertificateError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateLoadBalancerTlsCertificateError {
fn from(err: CredentialsError) -> CreateLoadBalancerTlsCertificateError {
CreateLoadBalancerTlsCertificateError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateLoadBalancerTlsCertificateError {
fn from(err: HttpDispatchError) -> CreateLoadBalancerTlsCertificateError {
CreateLoadBalancerTlsCertificateError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateLoadBalancerTlsCertificateError {
fn from(err: io::Error) -> CreateLoadBalancerTlsCertificateError {
CreateLoadBalancerTlsCertificateError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateLoadBalancerTlsCertificateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateLoadBalancerTlsCertificateError {
fn description(&self) -> &str {
match *self {
CreateLoadBalancerTlsCertificateError::AccessDenied(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::AccountSetupInProgress(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::InvalidInput(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::NotFound(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::OperationFailure(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::Service(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::Unauthenticated(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::Validation(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::Credentials(ref err) => err.description(),
CreateLoadBalancerTlsCertificateError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateLoadBalancerTlsCertificateError::ParseError(ref cause) => cause,
CreateLoadBalancerTlsCertificateError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateRelationalDatabaseError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateRelationalDatabaseError {
pub fn from_response(res: BufferedHttpResponse) -> CreateRelationalDatabaseError {
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 {
"AccessDeniedException" => {
return CreateRelationalDatabaseError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return CreateRelationalDatabaseError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return CreateRelationalDatabaseError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return CreateRelationalDatabaseError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return CreateRelationalDatabaseError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return CreateRelationalDatabaseError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return CreateRelationalDatabaseError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return CreateRelationalDatabaseError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateRelationalDatabaseError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateRelationalDatabaseError {
fn from(err: serde_json::error::Error) -> CreateRelationalDatabaseError {
CreateRelationalDatabaseError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateRelationalDatabaseError {
fn from(err: CredentialsError) -> CreateRelationalDatabaseError {
CreateRelationalDatabaseError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateRelationalDatabaseError {
fn from(err: HttpDispatchError) -> CreateRelationalDatabaseError {
CreateRelationalDatabaseError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateRelationalDatabaseError {
fn from(err: io::Error) -> CreateRelationalDatabaseError {
CreateRelationalDatabaseError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateRelationalDatabaseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateRelationalDatabaseError {
fn description(&self) -> &str {
match *self {
CreateRelationalDatabaseError::AccessDenied(ref cause) => cause,
CreateRelationalDatabaseError::AccountSetupInProgress(ref cause) => cause,
CreateRelationalDatabaseError::InvalidInput(ref cause) => cause,
CreateRelationalDatabaseError::NotFound(ref cause) => cause,
CreateRelationalDatabaseError::OperationFailure(ref cause) => cause,
CreateRelationalDatabaseError::Service(ref cause) => cause,
CreateRelationalDatabaseError::Unauthenticated(ref cause) => cause,
CreateRelationalDatabaseError::Validation(ref cause) => cause,
CreateRelationalDatabaseError::Credentials(ref err) => err.description(),
CreateRelationalDatabaseError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateRelationalDatabaseError::ParseError(ref cause) => cause,
CreateRelationalDatabaseError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateRelationalDatabaseFromSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateRelationalDatabaseFromSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> CreateRelationalDatabaseFromSnapshotError {
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 {
"AccessDeniedException" => {
return CreateRelationalDatabaseFromSnapshotError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return CreateRelationalDatabaseFromSnapshotError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return CreateRelationalDatabaseFromSnapshotError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return CreateRelationalDatabaseFromSnapshotError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return CreateRelationalDatabaseFromSnapshotError::OperationFailure(
String::from(error_message),
);
}
"ServiceException" => {
return CreateRelationalDatabaseFromSnapshotError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return CreateRelationalDatabaseFromSnapshotError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return CreateRelationalDatabaseFromSnapshotError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return CreateRelationalDatabaseFromSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateRelationalDatabaseFromSnapshotError {
fn from(err: serde_json::error::Error) -> CreateRelationalDatabaseFromSnapshotError {
CreateRelationalDatabaseFromSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateRelationalDatabaseFromSnapshotError {
fn from(err: CredentialsError) -> CreateRelationalDatabaseFromSnapshotError {
CreateRelationalDatabaseFromSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateRelationalDatabaseFromSnapshotError {
fn from(err: HttpDispatchError) -> CreateRelationalDatabaseFromSnapshotError {
CreateRelationalDatabaseFromSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateRelationalDatabaseFromSnapshotError {
fn from(err: io::Error) -> CreateRelationalDatabaseFromSnapshotError {
CreateRelationalDatabaseFromSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateRelationalDatabaseFromSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateRelationalDatabaseFromSnapshotError {
fn description(&self) -> &str {
match *self {
CreateRelationalDatabaseFromSnapshotError::AccessDenied(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::AccountSetupInProgress(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::InvalidInput(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::NotFound(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::OperationFailure(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::Service(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::Unauthenticated(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::Validation(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::Credentials(ref err) => err.description(),
CreateRelationalDatabaseFromSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateRelationalDatabaseFromSnapshotError::ParseError(ref cause) => cause,
CreateRelationalDatabaseFromSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateRelationalDatabaseSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateRelationalDatabaseSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> CreateRelationalDatabaseSnapshotError {
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 {
"AccessDeniedException" => {
return CreateRelationalDatabaseSnapshotError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return CreateRelationalDatabaseSnapshotError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return CreateRelationalDatabaseSnapshotError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return CreateRelationalDatabaseSnapshotError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return CreateRelationalDatabaseSnapshotError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return CreateRelationalDatabaseSnapshotError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return CreateRelationalDatabaseSnapshotError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return CreateRelationalDatabaseSnapshotError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return CreateRelationalDatabaseSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateRelationalDatabaseSnapshotError {
fn from(err: serde_json::error::Error) -> CreateRelationalDatabaseSnapshotError {
CreateRelationalDatabaseSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateRelationalDatabaseSnapshotError {
fn from(err: CredentialsError) -> CreateRelationalDatabaseSnapshotError {
CreateRelationalDatabaseSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateRelationalDatabaseSnapshotError {
fn from(err: HttpDispatchError) -> CreateRelationalDatabaseSnapshotError {
CreateRelationalDatabaseSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateRelationalDatabaseSnapshotError {
fn from(err: io::Error) -> CreateRelationalDatabaseSnapshotError {
CreateRelationalDatabaseSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateRelationalDatabaseSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateRelationalDatabaseSnapshotError {
fn description(&self) -> &str {
match *self {
CreateRelationalDatabaseSnapshotError::AccessDenied(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::AccountSetupInProgress(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::InvalidInput(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::NotFound(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::OperationFailure(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::Service(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::Unauthenticated(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::Validation(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::Credentials(ref err) => err.description(),
CreateRelationalDatabaseSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateRelationalDatabaseSnapshotError::ParseError(ref cause) => cause,
CreateRelationalDatabaseSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDiskError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteDiskError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteDiskError {
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 {
"AccessDeniedException" => {
return DeleteDiskError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteDiskError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return DeleteDiskError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteDiskError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteDiskError::OperationFailure(String::from(error_message));
}
"ServiceException" => return DeleteDiskError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return DeleteDiskError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DeleteDiskError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteDiskError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteDiskError {
fn from(err: serde_json::error::Error) -> DeleteDiskError {
DeleteDiskError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteDiskError {
fn from(err: CredentialsError) -> DeleteDiskError {
DeleteDiskError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteDiskError {
fn from(err: HttpDispatchError) -> DeleteDiskError {
DeleteDiskError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteDiskError {
fn from(err: io::Error) -> DeleteDiskError {
DeleteDiskError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteDiskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDiskError {
fn description(&self) -> &str {
match *self {
DeleteDiskError::AccessDenied(ref cause) => cause,
DeleteDiskError::AccountSetupInProgress(ref cause) => cause,
DeleteDiskError::InvalidInput(ref cause) => cause,
DeleteDiskError::NotFound(ref cause) => cause,
DeleteDiskError::OperationFailure(ref cause) => cause,
DeleteDiskError::Service(ref cause) => cause,
DeleteDiskError::Unauthenticated(ref cause) => cause,
DeleteDiskError::Validation(ref cause) => cause,
DeleteDiskError::Credentials(ref err) => err.description(),
DeleteDiskError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteDiskError::ParseError(ref cause) => cause,
DeleteDiskError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDiskSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteDiskSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteDiskSnapshotError {
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 {
"AccessDeniedException" => {
return DeleteDiskSnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteDiskSnapshotError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return DeleteDiskSnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteDiskSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteDiskSnapshotError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return DeleteDiskSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DeleteDiskSnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DeleteDiskSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteDiskSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteDiskSnapshotError {
fn from(err: serde_json::error::Error) -> DeleteDiskSnapshotError {
DeleteDiskSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteDiskSnapshotError {
fn from(err: CredentialsError) -> DeleteDiskSnapshotError {
DeleteDiskSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteDiskSnapshotError {
fn from(err: HttpDispatchError) -> DeleteDiskSnapshotError {
DeleteDiskSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteDiskSnapshotError {
fn from(err: io::Error) -> DeleteDiskSnapshotError {
DeleteDiskSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteDiskSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDiskSnapshotError {
fn description(&self) -> &str {
match *self {
DeleteDiskSnapshotError::AccessDenied(ref cause) => cause,
DeleteDiskSnapshotError::AccountSetupInProgress(ref cause) => cause,
DeleteDiskSnapshotError::InvalidInput(ref cause) => cause,
DeleteDiskSnapshotError::NotFound(ref cause) => cause,
DeleteDiskSnapshotError::OperationFailure(ref cause) => cause,
DeleteDiskSnapshotError::Service(ref cause) => cause,
DeleteDiskSnapshotError::Unauthenticated(ref cause) => cause,
DeleteDiskSnapshotError::Validation(ref cause) => cause,
DeleteDiskSnapshotError::Credentials(ref err) => err.description(),
DeleteDiskSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteDiskSnapshotError::ParseError(ref cause) => cause,
DeleteDiskSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDomainError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteDomainError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteDomainError {
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 {
"AccessDeniedException" => {
return DeleteDomainError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteDomainError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return DeleteDomainError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteDomainError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteDomainError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return DeleteDomainError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DeleteDomainError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DeleteDomainError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteDomainError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteDomainError {
fn from(err: serde_json::error::Error) -> DeleteDomainError {
DeleteDomainError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteDomainError {
fn from(err: CredentialsError) -> DeleteDomainError {
DeleteDomainError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteDomainError {
fn from(err: HttpDispatchError) -> DeleteDomainError {
DeleteDomainError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteDomainError {
fn from(err: io::Error) -> DeleteDomainError {
DeleteDomainError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteDomainError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDomainError {
fn description(&self) -> &str {
match *self {
DeleteDomainError::AccessDenied(ref cause) => cause,
DeleteDomainError::AccountSetupInProgress(ref cause) => cause,
DeleteDomainError::InvalidInput(ref cause) => cause,
DeleteDomainError::NotFound(ref cause) => cause,
DeleteDomainError::OperationFailure(ref cause) => cause,
DeleteDomainError::Service(ref cause) => cause,
DeleteDomainError::Unauthenticated(ref cause) => cause,
DeleteDomainError::Validation(ref cause) => cause,
DeleteDomainError::Credentials(ref err) => err.description(),
DeleteDomainError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteDomainError::ParseError(ref cause) => cause,
DeleteDomainError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDomainEntryError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteDomainEntryError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteDomainEntryError {
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 {
"AccessDeniedException" => {
return DeleteDomainEntryError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteDomainEntryError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return DeleteDomainEntryError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteDomainEntryError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteDomainEntryError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return DeleteDomainEntryError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DeleteDomainEntryError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DeleteDomainEntryError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteDomainEntryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteDomainEntryError {
fn from(err: serde_json::error::Error) -> DeleteDomainEntryError {
DeleteDomainEntryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteDomainEntryError {
fn from(err: CredentialsError) -> DeleteDomainEntryError {
DeleteDomainEntryError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteDomainEntryError {
fn from(err: HttpDispatchError) -> DeleteDomainEntryError {
DeleteDomainEntryError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteDomainEntryError {
fn from(err: io::Error) -> DeleteDomainEntryError {
DeleteDomainEntryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteDomainEntryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDomainEntryError {
fn description(&self) -> &str {
match *self {
DeleteDomainEntryError::AccessDenied(ref cause) => cause,
DeleteDomainEntryError::AccountSetupInProgress(ref cause) => cause,
DeleteDomainEntryError::InvalidInput(ref cause) => cause,
DeleteDomainEntryError::NotFound(ref cause) => cause,
DeleteDomainEntryError::OperationFailure(ref cause) => cause,
DeleteDomainEntryError::Service(ref cause) => cause,
DeleteDomainEntryError::Unauthenticated(ref cause) => cause,
DeleteDomainEntryError::Validation(ref cause) => cause,
DeleteDomainEntryError::Credentials(ref err) => err.description(),
DeleteDomainEntryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteDomainEntryError::ParseError(ref cause) => cause,
DeleteDomainEntryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteInstanceError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteInstanceError {
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 {
"AccessDeniedException" => {
return DeleteInstanceError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteInstanceError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return DeleteInstanceError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteInstanceError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteInstanceError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return DeleteInstanceError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DeleteInstanceError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DeleteInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteInstanceError {
fn from(err: serde_json::error::Error) -> DeleteInstanceError {
DeleteInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteInstanceError {
fn from(err: CredentialsError) -> DeleteInstanceError {
DeleteInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteInstanceError {
fn from(err: HttpDispatchError) -> DeleteInstanceError {
DeleteInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteInstanceError {
fn from(err: io::Error) -> DeleteInstanceError {
DeleteInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteInstanceError {
fn description(&self) -> &str {
match *self {
DeleteInstanceError::AccessDenied(ref cause) => cause,
DeleteInstanceError::AccountSetupInProgress(ref cause) => cause,
DeleteInstanceError::InvalidInput(ref cause) => cause,
DeleteInstanceError::NotFound(ref cause) => cause,
DeleteInstanceError::OperationFailure(ref cause) => cause,
DeleteInstanceError::Service(ref cause) => cause,
DeleteInstanceError::Unauthenticated(ref cause) => cause,
DeleteInstanceError::Validation(ref cause) => cause,
DeleteInstanceError::Credentials(ref err) => err.description(),
DeleteInstanceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteInstanceError::ParseError(ref cause) => cause,
DeleteInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteInstanceSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteInstanceSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteInstanceSnapshotError {
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 {
"AccessDeniedException" => {
return DeleteInstanceSnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteInstanceSnapshotError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return DeleteInstanceSnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteInstanceSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteInstanceSnapshotError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return DeleteInstanceSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DeleteInstanceSnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DeleteInstanceSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteInstanceSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteInstanceSnapshotError {
fn from(err: serde_json::error::Error) -> DeleteInstanceSnapshotError {
DeleteInstanceSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteInstanceSnapshotError {
fn from(err: CredentialsError) -> DeleteInstanceSnapshotError {
DeleteInstanceSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteInstanceSnapshotError {
fn from(err: HttpDispatchError) -> DeleteInstanceSnapshotError {
DeleteInstanceSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteInstanceSnapshotError {
fn from(err: io::Error) -> DeleteInstanceSnapshotError {
DeleteInstanceSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteInstanceSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteInstanceSnapshotError {
fn description(&self) -> &str {
match *self {
DeleteInstanceSnapshotError::AccessDenied(ref cause) => cause,
DeleteInstanceSnapshotError::AccountSetupInProgress(ref cause) => cause,
DeleteInstanceSnapshotError::InvalidInput(ref cause) => cause,
DeleteInstanceSnapshotError::NotFound(ref cause) => cause,
DeleteInstanceSnapshotError::OperationFailure(ref cause) => cause,
DeleteInstanceSnapshotError::Service(ref cause) => cause,
DeleteInstanceSnapshotError::Unauthenticated(ref cause) => cause,
DeleteInstanceSnapshotError::Validation(ref cause) => cause,
DeleteInstanceSnapshotError::Credentials(ref err) => err.description(),
DeleteInstanceSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteInstanceSnapshotError::ParseError(ref cause) => cause,
DeleteInstanceSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteKeyPairError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteKeyPairError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteKeyPairError {
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 {
"AccessDeniedException" => {
return DeleteKeyPairError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteKeyPairError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return DeleteKeyPairError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteKeyPairError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteKeyPairError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return DeleteKeyPairError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DeleteKeyPairError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DeleteKeyPairError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteKeyPairError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteKeyPairError {
fn from(err: serde_json::error::Error) -> DeleteKeyPairError {
DeleteKeyPairError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteKeyPairError {
fn from(err: CredentialsError) -> DeleteKeyPairError {
DeleteKeyPairError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteKeyPairError {
fn from(err: HttpDispatchError) -> DeleteKeyPairError {
DeleteKeyPairError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteKeyPairError {
fn from(err: io::Error) -> DeleteKeyPairError {
DeleteKeyPairError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteKeyPairError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteKeyPairError {
fn description(&self) -> &str {
match *self {
DeleteKeyPairError::AccessDenied(ref cause) => cause,
DeleteKeyPairError::AccountSetupInProgress(ref cause) => cause,
DeleteKeyPairError::InvalidInput(ref cause) => cause,
DeleteKeyPairError::NotFound(ref cause) => cause,
DeleteKeyPairError::OperationFailure(ref cause) => cause,
DeleteKeyPairError::Service(ref cause) => cause,
DeleteKeyPairError::Unauthenticated(ref cause) => cause,
DeleteKeyPairError::Validation(ref cause) => cause,
DeleteKeyPairError::Credentials(ref err) => err.description(),
DeleteKeyPairError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteKeyPairError::ParseError(ref cause) => cause,
DeleteKeyPairError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLoadBalancerError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteLoadBalancerError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteLoadBalancerError {
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 {
"AccessDeniedException" => {
return DeleteLoadBalancerError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteLoadBalancerError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return DeleteLoadBalancerError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteLoadBalancerError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteLoadBalancerError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return DeleteLoadBalancerError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DeleteLoadBalancerError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DeleteLoadBalancerError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteLoadBalancerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteLoadBalancerError {
fn from(err: serde_json::error::Error) -> DeleteLoadBalancerError {
DeleteLoadBalancerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteLoadBalancerError {
fn from(err: CredentialsError) -> DeleteLoadBalancerError {
DeleteLoadBalancerError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteLoadBalancerError {
fn from(err: HttpDispatchError) -> DeleteLoadBalancerError {
DeleteLoadBalancerError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteLoadBalancerError {
fn from(err: io::Error) -> DeleteLoadBalancerError {
DeleteLoadBalancerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteLoadBalancerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLoadBalancerError {
fn description(&self) -> &str {
match *self {
DeleteLoadBalancerError::AccessDenied(ref cause) => cause,
DeleteLoadBalancerError::AccountSetupInProgress(ref cause) => cause,
DeleteLoadBalancerError::InvalidInput(ref cause) => cause,
DeleteLoadBalancerError::NotFound(ref cause) => cause,
DeleteLoadBalancerError::OperationFailure(ref cause) => cause,
DeleteLoadBalancerError::Service(ref cause) => cause,
DeleteLoadBalancerError::Unauthenticated(ref cause) => cause,
DeleteLoadBalancerError::Validation(ref cause) => cause,
DeleteLoadBalancerError::Credentials(ref err) => err.description(),
DeleteLoadBalancerError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteLoadBalancerError::ParseError(ref cause) => cause,
DeleteLoadBalancerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLoadBalancerTlsCertificateError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteLoadBalancerTlsCertificateError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteLoadBalancerTlsCertificateError {
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 {
"AccessDeniedException" => {
return DeleteLoadBalancerTlsCertificateError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return DeleteLoadBalancerTlsCertificateError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return DeleteLoadBalancerTlsCertificateError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return DeleteLoadBalancerTlsCertificateError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return DeleteLoadBalancerTlsCertificateError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return DeleteLoadBalancerTlsCertificateError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return DeleteLoadBalancerTlsCertificateError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteLoadBalancerTlsCertificateError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DeleteLoadBalancerTlsCertificateError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteLoadBalancerTlsCertificateError {
fn from(err: serde_json::error::Error) -> DeleteLoadBalancerTlsCertificateError {
DeleteLoadBalancerTlsCertificateError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteLoadBalancerTlsCertificateError {
fn from(err: CredentialsError) -> DeleteLoadBalancerTlsCertificateError {
DeleteLoadBalancerTlsCertificateError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteLoadBalancerTlsCertificateError {
fn from(err: HttpDispatchError) -> DeleteLoadBalancerTlsCertificateError {
DeleteLoadBalancerTlsCertificateError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteLoadBalancerTlsCertificateError {
fn from(err: io::Error) -> DeleteLoadBalancerTlsCertificateError {
DeleteLoadBalancerTlsCertificateError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteLoadBalancerTlsCertificateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLoadBalancerTlsCertificateError {
fn description(&self) -> &str {
match *self {
DeleteLoadBalancerTlsCertificateError::AccessDenied(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::AccountSetupInProgress(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::InvalidInput(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::NotFound(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::OperationFailure(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::Service(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::Unauthenticated(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::Validation(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::Credentials(ref err) => err.description(),
DeleteLoadBalancerTlsCertificateError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteLoadBalancerTlsCertificateError::ParseError(ref cause) => cause,
DeleteLoadBalancerTlsCertificateError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteRelationalDatabaseError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteRelationalDatabaseError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteRelationalDatabaseError {
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 {
"AccessDeniedException" => {
return DeleteRelationalDatabaseError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DeleteRelationalDatabaseError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return DeleteRelationalDatabaseError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DeleteRelationalDatabaseError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DeleteRelationalDatabaseError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return DeleteRelationalDatabaseError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DeleteRelationalDatabaseError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteRelationalDatabaseError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteRelationalDatabaseError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteRelationalDatabaseError {
fn from(err: serde_json::error::Error) -> DeleteRelationalDatabaseError {
DeleteRelationalDatabaseError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteRelationalDatabaseError {
fn from(err: CredentialsError) -> DeleteRelationalDatabaseError {
DeleteRelationalDatabaseError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteRelationalDatabaseError {
fn from(err: HttpDispatchError) -> DeleteRelationalDatabaseError {
DeleteRelationalDatabaseError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteRelationalDatabaseError {
fn from(err: io::Error) -> DeleteRelationalDatabaseError {
DeleteRelationalDatabaseError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteRelationalDatabaseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteRelationalDatabaseError {
fn description(&self) -> &str {
match *self {
DeleteRelationalDatabaseError::AccessDenied(ref cause) => cause,
DeleteRelationalDatabaseError::AccountSetupInProgress(ref cause) => cause,
DeleteRelationalDatabaseError::InvalidInput(ref cause) => cause,
DeleteRelationalDatabaseError::NotFound(ref cause) => cause,
DeleteRelationalDatabaseError::OperationFailure(ref cause) => cause,
DeleteRelationalDatabaseError::Service(ref cause) => cause,
DeleteRelationalDatabaseError::Unauthenticated(ref cause) => cause,
DeleteRelationalDatabaseError::Validation(ref cause) => cause,
DeleteRelationalDatabaseError::Credentials(ref err) => err.description(),
DeleteRelationalDatabaseError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteRelationalDatabaseError::ParseError(ref cause) => cause,
DeleteRelationalDatabaseError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteRelationalDatabaseSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteRelationalDatabaseSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteRelationalDatabaseSnapshotError {
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 {
"AccessDeniedException" => {
return DeleteRelationalDatabaseSnapshotError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return DeleteRelationalDatabaseSnapshotError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return DeleteRelationalDatabaseSnapshotError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return DeleteRelationalDatabaseSnapshotError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return DeleteRelationalDatabaseSnapshotError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return DeleteRelationalDatabaseSnapshotError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return DeleteRelationalDatabaseSnapshotError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteRelationalDatabaseSnapshotError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DeleteRelationalDatabaseSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteRelationalDatabaseSnapshotError {
fn from(err: serde_json::error::Error) -> DeleteRelationalDatabaseSnapshotError {
DeleteRelationalDatabaseSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteRelationalDatabaseSnapshotError {
fn from(err: CredentialsError) -> DeleteRelationalDatabaseSnapshotError {
DeleteRelationalDatabaseSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteRelationalDatabaseSnapshotError {
fn from(err: HttpDispatchError) -> DeleteRelationalDatabaseSnapshotError {
DeleteRelationalDatabaseSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteRelationalDatabaseSnapshotError {
fn from(err: io::Error) -> DeleteRelationalDatabaseSnapshotError {
DeleteRelationalDatabaseSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteRelationalDatabaseSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteRelationalDatabaseSnapshotError {
fn description(&self) -> &str {
match *self {
DeleteRelationalDatabaseSnapshotError::AccessDenied(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::AccountSetupInProgress(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::InvalidInput(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::NotFound(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::OperationFailure(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::Service(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::Unauthenticated(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::Validation(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::Credentials(ref err) => err.description(),
DeleteRelationalDatabaseSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteRelationalDatabaseSnapshotError::ParseError(ref cause) => cause,
DeleteRelationalDatabaseSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DetachDiskError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DetachDiskError {
pub fn from_response(res: BufferedHttpResponse) -> DetachDiskError {
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 {
"AccessDeniedException" => {
return DetachDiskError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DetachDiskError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return DetachDiskError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DetachDiskError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DetachDiskError::OperationFailure(String::from(error_message));
}
"ServiceException" => return DetachDiskError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return DetachDiskError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DetachDiskError::Validation(error_message.to_string());
}
_ => {}
}
}
return DetachDiskError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DetachDiskError {
fn from(err: serde_json::error::Error) -> DetachDiskError {
DetachDiskError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DetachDiskError {
fn from(err: CredentialsError) -> DetachDiskError {
DetachDiskError::Credentials(err)
}
}
impl From<HttpDispatchError> for DetachDiskError {
fn from(err: HttpDispatchError) -> DetachDiskError {
DetachDiskError::HttpDispatch(err)
}
}
impl From<io::Error> for DetachDiskError {
fn from(err: io::Error) -> DetachDiskError {
DetachDiskError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DetachDiskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetachDiskError {
fn description(&self) -> &str {
match *self {
DetachDiskError::AccessDenied(ref cause) => cause,
DetachDiskError::AccountSetupInProgress(ref cause) => cause,
DetachDiskError::InvalidInput(ref cause) => cause,
DetachDiskError::NotFound(ref cause) => cause,
DetachDiskError::OperationFailure(ref cause) => cause,
DetachDiskError::Service(ref cause) => cause,
DetachDiskError::Unauthenticated(ref cause) => cause,
DetachDiskError::Validation(ref cause) => cause,
DetachDiskError::Credentials(ref err) => err.description(),
DetachDiskError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DetachDiskError::ParseError(ref cause) => cause,
DetachDiskError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DetachInstancesFromLoadBalancerError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DetachInstancesFromLoadBalancerError {
pub fn from_response(res: BufferedHttpResponse) -> DetachInstancesFromLoadBalancerError {
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 {
"AccessDeniedException" => {
return DetachInstancesFromLoadBalancerError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return DetachInstancesFromLoadBalancerError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return DetachInstancesFromLoadBalancerError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return DetachInstancesFromLoadBalancerError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return DetachInstancesFromLoadBalancerError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return DetachInstancesFromLoadBalancerError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return DetachInstancesFromLoadBalancerError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return DetachInstancesFromLoadBalancerError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DetachInstancesFromLoadBalancerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DetachInstancesFromLoadBalancerError {
fn from(err: serde_json::error::Error) -> DetachInstancesFromLoadBalancerError {
DetachInstancesFromLoadBalancerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DetachInstancesFromLoadBalancerError {
fn from(err: CredentialsError) -> DetachInstancesFromLoadBalancerError {
DetachInstancesFromLoadBalancerError::Credentials(err)
}
}
impl From<HttpDispatchError> for DetachInstancesFromLoadBalancerError {
fn from(err: HttpDispatchError) -> DetachInstancesFromLoadBalancerError {
DetachInstancesFromLoadBalancerError::HttpDispatch(err)
}
}
impl From<io::Error> for DetachInstancesFromLoadBalancerError {
fn from(err: io::Error) -> DetachInstancesFromLoadBalancerError {
DetachInstancesFromLoadBalancerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DetachInstancesFromLoadBalancerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetachInstancesFromLoadBalancerError {
fn description(&self) -> &str {
match *self {
DetachInstancesFromLoadBalancerError::AccessDenied(ref cause) => cause,
DetachInstancesFromLoadBalancerError::AccountSetupInProgress(ref cause) => cause,
DetachInstancesFromLoadBalancerError::InvalidInput(ref cause) => cause,
DetachInstancesFromLoadBalancerError::NotFound(ref cause) => cause,
DetachInstancesFromLoadBalancerError::OperationFailure(ref cause) => cause,
DetachInstancesFromLoadBalancerError::Service(ref cause) => cause,
DetachInstancesFromLoadBalancerError::Unauthenticated(ref cause) => cause,
DetachInstancesFromLoadBalancerError::Validation(ref cause) => cause,
DetachInstancesFromLoadBalancerError::Credentials(ref err) => err.description(),
DetachInstancesFromLoadBalancerError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DetachInstancesFromLoadBalancerError::ParseError(ref cause) => cause,
DetachInstancesFromLoadBalancerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DetachStaticIpError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DetachStaticIpError {
pub fn from_response(res: BufferedHttpResponse) -> DetachStaticIpError {
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 {
"AccessDeniedException" => {
return DetachStaticIpError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DetachStaticIpError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return DetachStaticIpError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DetachStaticIpError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DetachStaticIpError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return DetachStaticIpError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DetachStaticIpError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DetachStaticIpError::Validation(error_message.to_string());
}
_ => {}
}
}
return DetachStaticIpError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DetachStaticIpError {
fn from(err: serde_json::error::Error) -> DetachStaticIpError {
DetachStaticIpError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DetachStaticIpError {
fn from(err: CredentialsError) -> DetachStaticIpError {
DetachStaticIpError::Credentials(err)
}
}
impl From<HttpDispatchError> for DetachStaticIpError {
fn from(err: HttpDispatchError) -> DetachStaticIpError {
DetachStaticIpError::HttpDispatch(err)
}
}
impl From<io::Error> for DetachStaticIpError {
fn from(err: io::Error) -> DetachStaticIpError {
DetachStaticIpError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DetachStaticIpError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DetachStaticIpError {
fn description(&self) -> &str {
match *self {
DetachStaticIpError::AccessDenied(ref cause) => cause,
DetachStaticIpError::AccountSetupInProgress(ref cause) => cause,
DetachStaticIpError::InvalidInput(ref cause) => cause,
DetachStaticIpError::NotFound(ref cause) => cause,
DetachStaticIpError::OperationFailure(ref cause) => cause,
DetachStaticIpError::Service(ref cause) => cause,
DetachStaticIpError::Unauthenticated(ref cause) => cause,
DetachStaticIpError::Validation(ref cause) => cause,
DetachStaticIpError::Credentials(ref err) => err.description(),
DetachStaticIpError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DetachStaticIpError::ParseError(ref cause) => cause,
DetachStaticIpError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DownloadDefaultKeyPairError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DownloadDefaultKeyPairError {
pub fn from_response(res: BufferedHttpResponse) -> DownloadDefaultKeyPairError {
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 {
"AccessDeniedException" => {
return DownloadDefaultKeyPairError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return DownloadDefaultKeyPairError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return DownloadDefaultKeyPairError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return DownloadDefaultKeyPairError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return DownloadDefaultKeyPairError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return DownloadDefaultKeyPairError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return DownloadDefaultKeyPairError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return DownloadDefaultKeyPairError::Validation(error_message.to_string());
}
_ => {}
}
}
return DownloadDefaultKeyPairError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DownloadDefaultKeyPairError {
fn from(err: serde_json::error::Error) -> DownloadDefaultKeyPairError {
DownloadDefaultKeyPairError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DownloadDefaultKeyPairError {
fn from(err: CredentialsError) -> DownloadDefaultKeyPairError {
DownloadDefaultKeyPairError::Credentials(err)
}
}
impl From<HttpDispatchError> for DownloadDefaultKeyPairError {
fn from(err: HttpDispatchError) -> DownloadDefaultKeyPairError {
DownloadDefaultKeyPairError::HttpDispatch(err)
}
}
impl From<io::Error> for DownloadDefaultKeyPairError {
fn from(err: io::Error) -> DownloadDefaultKeyPairError {
DownloadDefaultKeyPairError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DownloadDefaultKeyPairError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DownloadDefaultKeyPairError {
fn description(&self) -> &str {
match *self {
DownloadDefaultKeyPairError::AccessDenied(ref cause) => cause,
DownloadDefaultKeyPairError::AccountSetupInProgress(ref cause) => cause,
DownloadDefaultKeyPairError::InvalidInput(ref cause) => cause,
DownloadDefaultKeyPairError::NotFound(ref cause) => cause,
DownloadDefaultKeyPairError::OperationFailure(ref cause) => cause,
DownloadDefaultKeyPairError::Service(ref cause) => cause,
DownloadDefaultKeyPairError::Unauthenticated(ref cause) => cause,
DownloadDefaultKeyPairError::Validation(ref cause) => cause,
DownloadDefaultKeyPairError::Credentials(ref err) => err.description(),
DownloadDefaultKeyPairError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DownloadDefaultKeyPairError::ParseError(ref cause) => cause,
DownloadDefaultKeyPairError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ExportSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ExportSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> ExportSnapshotError {
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 {
"AccessDeniedException" => {
return ExportSnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return ExportSnapshotError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return ExportSnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return ExportSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return ExportSnapshotError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return ExportSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return ExportSnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return ExportSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return ExportSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ExportSnapshotError {
fn from(err: serde_json::error::Error) -> ExportSnapshotError {
ExportSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ExportSnapshotError {
fn from(err: CredentialsError) -> ExportSnapshotError {
ExportSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for ExportSnapshotError {
fn from(err: HttpDispatchError) -> ExportSnapshotError {
ExportSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for ExportSnapshotError {
fn from(err: io::Error) -> ExportSnapshotError {
ExportSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ExportSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ExportSnapshotError {
fn description(&self) -> &str {
match *self {
ExportSnapshotError::AccessDenied(ref cause) => cause,
ExportSnapshotError::AccountSetupInProgress(ref cause) => cause,
ExportSnapshotError::InvalidInput(ref cause) => cause,
ExportSnapshotError::NotFound(ref cause) => cause,
ExportSnapshotError::OperationFailure(ref cause) => cause,
ExportSnapshotError::Service(ref cause) => cause,
ExportSnapshotError::Unauthenticated(ref cause) => cause,
ExportSnapshotError::Validation(ref cause) => cause,
ExportSnapshotError::Credentials(ref err) => err.description(),
ExportSnapshotError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ExportSnapshotError::ParseError(ref cause) => cause,
ExportSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetActiveNamesError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetActiveNamesError {
pub fn from_response(res: BufferedHttpResponse) -> GetActiveNamesError {
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 {
"AccessDeniedException" => {
return GetActiveNamesError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetActiveNamesError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetActiveNamesError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetActiveNamesError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetActiveNamesError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetActiveNamesError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetActiveNamesError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetActiveNamesError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetActiveNamesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetActiveNamesError {
fn from(err: serde_json::error::Error) -> GetActiveNamesError {
GetActiveNamesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetActiveNamesError {
fn from(err: CredentialsError) -> GetActiveNamesError {
GetActiveNamesError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetActiveNamesError {
fn from(err: HttpDispatchError) -> GetActiveNamesError {
GetActiveNamesError::HttpDispatch(err)
}
}
impl From<io::Error> for GetActiveNamesError {
fn from(err: io::Error) -> GetActiveNamesError {
GetActiveNamesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetActiveNamesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetActiveNamesError {
fn description(&self) -> &str {
match *self {
GetActiveNamesError::AccessDenied(ref cause) => cause,
GetActiveNamesError::AccountSetupInProgress(ref cause) => cause,
GetActiveNamesError::InvalidInput(ref cause) => cause,
GetActiveNamesError::NotFound(ref cause) => cause,
GetActiveNamesError::OperationFailure(ref cause) => cause,
GetActiveNamesError::Service(ref cause) => cause,
GetActiveNamesError::Unauthenticated(ref cause) => cause,
GetActiveNamesError::Validation(ref cause) => cause,
GetActiveNamesError::Credentials(ref err) => err.description(),
GetActiveNamesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetActiveNamesError::ParseError(ref cause) => cause,
GetActiveNamesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetBlueprintsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetBlueprintsError {
pub fn from_response(res: BufferedHttpResponse) -> GetBlueprintsError {
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 {
"AccessDeniedException" => {
return GetBlueprintsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetBlueprintsError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetBlueprintsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetBlueprintsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetBlueprintsError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetBlueprintsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetBlueprintsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetBlueprintsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetBlueprintsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetBlueprintsError {
fn from(err: serde_json::error::Error) -> GetBlueprintsError {
GetBlueprintsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetBlueprintsError {
fn from(err: CredentialsError) -> GetBlueprintsError {
GetBlueprintsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetBlueprintsError {
fn from(err: HttpDispatchError) -> GetBlueprintsError {
GetBlueprintsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetBlueprintsError {
fn from(err: io::Error) -> GetBlueprintsError {
GetBlueprintsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetBlueprintsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetBlueprintsError {
fn description(&self) -> &str {
match *self {
GetBlueprintsError::AccessDenied(ref cause) => cause,
GetBlueprintsError::AccountSetupInProgress(ref cause) => cause,
GetBlueprintsError::InvalidInput(ref cause) => cause,
GetBlueprintsError::NotFound(ref cause) => cause,
GetBlueprintsError::OperationFailure(ref cause) => cause,
GetBlueprintsError::Service(ref cause) => cause,
GetBlueprintsError::Unauthenticated(ref cause) => cause,
GetBlueprintsError::Validation(ref cause) => cause,
GetBlueprintsError::Credentials(ref err) => err.description(),
GetBlueprintsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetBlueprintsError::ParseError(ref cause) => cause,
GetBlueprintsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetBundlesError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetBundlesError {
pub fn from_response(res: BufferedHttpResponse) -> GetBundlesError {
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 {
"AccessDeniedException" => {
return GetBundlesError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetBundlesError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetBundlesError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetBundlesError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetBundlesError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetBundlesError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetBundlesError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetBundlesError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetBundlesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetBundlesError {
fn from(err: serde_json::error::Error) -> GetBundlesError {
GetBundlesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetBundlesError {
fn from(err: CredentialsError) -> GetBundlesError {
GetBundlesError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetBundlesError {
fn from(err: HttpDispatchError) -> GetBundlesError {
GetBundlesError::HttpDispatch(err)
}
}
impl From<io::Error> for GetBundlesError {
fn from(err: io::Error) -> GetBundlesError {
GetBundlesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetBundlesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetBundlesError {
fn description(&self) -> &str {
match *self {
GetBundlesError::AccessDenied(ref cause) => cause,
GetBundlesError::AccountSetupInProgress(ref cause) => cause,
GetBundlesError::InvalidInput(ref cause) => cause,
GetBundlesError::NotFound(ref cause) => cause,
GetBundlesError::OperationFailure(ref cause) => cause,
GetBundlesError::Service(ref cause) => cause,
GetBundlesError::Unauthenticated(ref cause) => cause,
GetBundlesError::Validation(ref cause) => cause,
GetBundlesError::Credentials(ref err) => err.description(),
GetBundlesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetBundlesError::ParseError(ref cause) => cause,
GetBundlesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetCloudFormationStackRecordsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetCloudFormationStackRecordsError {
pub fn from_response(res: BufferedHttpResponse) -> GetCloudFormationStackRecordsError {
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 {
"AccessDeniedException" => {
return GetCloudFormationStackRecordsError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetCloudFormationStackRecordsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetCloudFormationStackRecordsError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetCloudFormationStackRecordsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetCloudFormationStackRecordsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetCloudFormationStackRecordsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetCloudFormationStackRecordsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetCloudFormationStackRecordsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetCloudFormationStackRecordsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetCloudFormationStackRecordsError {
fn from(err: serde_json::error::Error) -> GetCloudFormationStackRecordsError {
GetCloudFormationStackRecordsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetCloudFormationStackRecordsError {
fn from(err: CredentialsError) -> GetCloudFormationStackRecordsError {
GetCloudFormationStackRecordsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetCloudFormationStackRecordsError {
fn from(err: HttpDispatchError) -> GetCloudFormationStackRecordsError {
GetCloudFormationStackRecordsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetCloudFormationStackRecordsError {
fn from(err: io::Error) -> GetCloudFormationStackRecordsError {
GetCloudFormationStackRecordsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetCloudFormationStackRecordsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetCloudFormationStackRecordsError {
fn description(&self) -> &str {
match *self {
GetCloudFormationStackRecordsError::AccessDenied(ref cause) => cause,
GetCloudFormationStackRecordsError::AccountSetupInProgress(ref cause) => cause,
GetCloudFormationStackRecordsError::InvalidInput(ref cause) => cause,
GetCloudFormationStackRecordsError::NotFound(ref cause) => cause,
GetCloudFormationStackRecordsError::OperationFailure(ref cause) => cause,
GetCloudFormationStackRecordsError::Service(ref cause) => cause,
GetCloudFormationStackRecordsError::Unauthenticated(ref cause) => cause,
GetCloudFormationStackRecordsError::Validation(ref cause) => cause,
GetCloudFormationStackRecordsError::Credentials(ref err) => err.description(),
GetCloudFormationStackRecordsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetCloudFormationStackRecordsError::ParseError(ref cause) => cause,
GetCloudFormationStackRecordsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDiskError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDiskError {
pub fn from_response(res: BufferedHttpResponse) -> GetDiskError {
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 {
"AccessDeniedException" => {
return GetDiskError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetDiskError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetDiskError::InvalidInput(String::from(error_message));
}
"NotFoundException" => return GetDiskError::NotFound(String::from(error_message)),
"OperationFailureException" => {
return GetDiskError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetDiskError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetDiskError::Unauthenticated(String::from(error_message));
}
"ValidationException" => return GetDiskError::Validation(error_message.to_string()),
_ => {}
}
}
return GetDiskError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDiskError {
fn from(err: serde_json::error::Error) -> GetDiskError {
GetDiskError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDiskError {
fn from(err: CredentialsError) -> GetDiskError {
GetDiskError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDiskError {
fn from(err: HttpDispatchError) -> GetDiskError {
GetDiskError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDiskError {
fn from(err: io::Error) -> GetDiskError {
GetDiskError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDiskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDiskError {
fn description(&self) -> &str {
match *self {
GetDiskError::AccessDenied(ref cause) => cause,
GetDiskError::AccountSetupInProgress(ref cause) => cause,
GetDiskError::InvalidInput(ref cause) => cause,
GetDiskError::NotFound(ref cause) => cause,
GetDiskError::OperationFailure(ref cause) => cause,
GetDiskError::Service(ref cause) => cause,
GetDiskError::Unauthenticated(ref cause) => cause,
GetDiskError::Validation(ref cause) => cause,
GetDiskError::Credentials(ref err) => err.description(),
GetDiskError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetDiskError::ParseError(ref cause) => cause,
GetDiskError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDiskSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDiskSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> GetDiskSnapshotError {
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 {
"AccessDeniedException" => {
return GetDiskSnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetDiskSnapshotError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetDiskSnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetDiskSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetDiskSnapshotError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetDiskSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetDiskSnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetDiskSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetDiskSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDiskSnapshotError {
fn from(err: serde_json::error::Error) -> GetDiskSnapshotError {
GetDiskSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDiskSnapshotError {
fn from(err: CredentialsError) -> GetDiskSnapshotError {
GetDiskSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDiskSnapshotError {
fn from(err: HttpDispatchError) -> GetDiskSnapshotError {
GetDiskSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDiskSnapshotError {
fn from(err: io::Error) -> GetDiskSnapshotError {
GetDiskSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDiskSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDiskSnapshotError {
fn description(&self) -> &str {
match *self {
GetDiskSnapshotError::AccessDenied(ref cause) => cause,
GetDiskSnapshotError::AccountSetupInProgress(ref cause) => cause,
GetDiskSnapshotError::InvalidInput(ref cause) => cause,
GetDiskSnapshotError::NotFound(ref cause) => cause,
GetDiskSnapshotError::OperationFailure(ref cause) => cause,
GetDiskSnapshotError::Service(ref cause) => cause,
GetDiskSnapshotError::Unauthenticated(ref cause) => cause,
GetDiskSnapshotError::Validation(ref cause) => cause,
GetDiskSnapshotError::Credentials(ref err) => err.description(),
GetDiskSnapshotError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetDiskSnapshotError::ParseError(ref cause) => cause,
GetDiskSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDiskSnapshotsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDiskSnapshotsError {
pub fn from_response(res: BufferedHttpResponse) -> GetDiskSnapshotsError {
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 {
"AccessDeniedException" => {
return GetDiskSnapshotsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetDiskSnapshotsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetDiskSnapshotsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetDiskSnapshotsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetDiskSnapshotsError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetDiskSnapshotsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetDiskSnapshotsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetDiskSnapshotsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetDiskSnapshotsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDiskSnapshotsError {
fn from(err: serde_json::error::Error) -> GetDiskSnapshotsError {
GetDiskSnapshotsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDiskSnapshotsError {
fn from(err: CredentialsError) -> GetDiskSnapshotsError {
GetDiskSnapshotsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDiskSnapshotsError {
fn from(err: HttpDispatchError) -> GetDiskSnapshotsError {
GetDiskSnapshotsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDiskSnapshotsError {
fn from(err: io::Error) -> GetDiskSnapshotsError {
GetDiskSnapshotsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDiskSnapshotsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDiskSnapshotsError {
fn description(&self) -> &str {
match *self {
GetDiskSnapshotsError::AccessDenied(ref cause) => cause,
GetDiskSnapshotsError::AccountSetupInProgress(ref cause) => cause,
GetDiskSnapshotsError::InvalidInput(ref cause) => cause,
GetDiskSnapshotsError::NotFound(ref cause) => cause,
GetDiskSnapshotsError::OperationFailure(ref cause) => cause,
GetDiskSnapshotsError::Service(ref cause) => cause,
GetDiskSnapshotsError::Unauthenticated(ref cause) => cause,
GetDiskSnapshotsError::Validation(ref cause) => cause,
GetDiskSnapshotsError::Credentials(ref err) => err.description(),
GetDiskSnapshotsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetDiskSnapshotsError::ParseError(ref cause) => cause,
GetDiskSnapshotsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDisksError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDisksError {
pub fn from_response(res: BufferedHttpResponse) -> GetDisksError {
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 {
"AccessDeniedException" => {
return GetDisksError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetDisksError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetDisksError::InvalidInput(String::from(error_message));
}
"NotFoundException" => return GetDisksError::NotFound(String::from(error_message)),
"OperationFailureException" => {
return GetDisksError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetDisksError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetDisksError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetDisksError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetDisksError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDisksError {
fn from(err: serde_json::error::Error) -> GetDisksError {
GetDisksError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDisksError {
fn from(err: CredentialsError) -> GetDisksError {
GetDisksError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDisksError {
fn from(err: HttpDispatchError) -> GetDisksError {
GetDisksError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDisksError {
fn from(err: io::Error) -> GetDisksError {
GetDisksError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDisksError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDisksError {
fn description(&self) -> &str {
match *self {
GetDisksError::AccessDenied(ref cause) => cause,
GetDisksError::AccountSetupInProgress(ref cause) => cause,
GetDisksError::InvalidInput(ref cause) => cause,
GetDisksError::NotFound(ref cause) => cause,
GetDisksError::OperationFailure(ref cause) => cause,
GetDisksError::Service(ref cause) => cause,
GetDisksError::Unauthenticated(ref cause) => cause,
GetDisksError::Validation(ref cause) => cause,
GetDisksError::Credentials(ref err) => err.description(),
GetDisksError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetDisksError::ParseError(ref cause) => cause,
GetDisksError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDomainError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDomainError {
pub fn from_response(res: BufferedHttpResponse) -> GetDomainError {
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 {
"AccessDeniedException" => {
return GetDomainError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetDomainError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetDomainError::InvalidInput(String::from(error_message));
}
"NotFoundException" => return GetDomainError::NotFound(String::from(error_message)),
"OperationFailureException" => {
return GetDomainError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetDomainError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetDomainError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetDomainError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetDomainError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDomainError {
fn from(err: serde_json::error::Error) -> GetDomainError {
GetDomainError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDomainError {
fn from(err: CredentialsError) -> GetDomainError {
GetDomainError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDomainError {
fn from(err: HttpDispatchError) -> GetDomainError {
GetDomainError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDomainError {
fn from(err: io::Error) -> GetDomainError {
GetDomainError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDomainError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDomainError {
fn description(&self) -> &str {
match *self {
GetDomainError::AccessDenied(ref cause) => cause,
GetDomainError::AccountSetupInProgress(ref cause) => cause,
GetDomainError::InvalidInput(ref cause) => cause,
GetDomainError::NotFound(ref cause) => cause,
GetDomainError::OperationFailure(ref cause) => cause,
GetDomainError::Service(ref cause) => cause,
GetDomainError::Unauthenticated(ref cause) => cause,
GetDomainError::Validation(ref cause) => cause,
GetDomainError::Credentials(ref err) => err.description(),
GetDomainError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetDomainError::ParseError(ref cause) => cause,
GetDomainError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDomainsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDomainsError {
pub fn from_response(res: BufferedHttpResponse) -> GetDomainsError {
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 {
"AccessDeniedException" => {
return GetDomainsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetDomainsError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetDomainsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetDomainsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetDomainsError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetDomainsError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetDomainsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetDomainsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetDomainsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDomainsError {
fn from(err: serde_json::error::Error) -> GetDomainsError {
GetDomainsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDomainsError {
fn from(err: CredentialsError) -> GetDomainsError {
GetDomainsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDomainsError {
fn from(err: HttpDispatchError) -> GetDomainsError {
GetDomainsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDomainsError {
fn from(err: io::Error) -> GetDomainsError {
GetDomainsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDomainsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDomainsError {
fn description(&self) -> &str {
match *self {
GetDomainsError::AccessDenied(ref cause) => cause,
GetDomainsError::AccountSetupInProgress(ref cause) => cause,
GetDomainsError::InvalidInput(ref cause) => cause,
GetDomainsError::NotFound(ref cause) => cause,
GetDomainsError::OperationFailure(ref cause) => cause,
GetDomainsError::Service(ref cause) => cause,
GetDomainsError::Unauthenticated(ref cause) => cause,
GetDomainsError::Validation(ref cause) => cause,
GetDomainsError::Credentials(ref err) => err.description(),
GetDomainsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetDomainsError::ParseError(ref cause) => cause,
GetDomainsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetExportSnapshotRecordsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetExportSnapshotRecordsError {
pub fn from_response(res: BufferedHttpResponse) -> GetExportSnapshotRecordsError {
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 {
"AccessDeniedException" => {
return GetExportSnapshotRecordsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetExportSnapshotRecordsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetExportSnapshotRecordsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetExportSnapshotRecordsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetExportSnapshotRecordsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetExportSnapshotRecordsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetExportSnapshotRecordsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetExportSnapshotRecordsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetExportSnapshotRecordsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetExportSnapshotRecordsError {
fn from(err: serde_json::error::Error) -> GetExportSnapshotRecordsError {
GetExportSnapshotRecordsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetExportSnapshotRecordsError {
fn from(err: CredentialsError) -> GetExportSnapshotRecordsError {
GetExportSnapshotRecordsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetExportSnapshotRecordsError {
fn from(err: HttpDispatchError) -> GetExportSnapshotRecordsError {
GetExportSnapshotRecordsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetExportSnapshotRecordsError {
fn from(err: io::Error) -> GetExportSnapshotRecordsError {
GetExportSnapshotRecordsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetExportSnapshotRecordsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetExportSnapshotRecordsError {
fn description(&self) -> &str {
match *self {
GetExportSnapshotRecordsError::AccessDenied(ref cause) => cause,
GetExportSnapshotRecordsError::AccountSetupInProgress(ref cause) => cause,
GetExportSnapshotRecordsError::InvalidInput(ref cause) => cause,
GetExportSnapshotRecordsError::NotFound(ref cause) => cause,
GetExportSnapshotRecordsError::OperationFailure(ref cause) => cause,
GetExportSnapshotRecordsError::Service(ref cause) => cause,
GetExportSnapshotRecordsError::Unauthenticated(ref cause) => cause,
GetExportSnapshotRecordsError::Validation(ref cause) => cause,
GetExportSnapshotRecordsError::Credentials(ref err) => err.description(),
GetExportSnapshotRecordsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetExportSnapshotRecordsError::ParseError(ref cause) => cause,
GetExportSnapshotRecordsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstanceError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstanceError {
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 {
"AccessDeniedException" => {
return GetInstanceError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetInstanceError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetInstanceError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetInstanceError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetInstanceError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetInstanceError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetInstanceError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstanceError {
fn from(err: serde_json::error::Error) -> GetInstanceError {
GetInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstanceError {
fn from(err: CredentialsError) -> GetInstanceError {
GetInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstanceError {
fn from(err: HttpDispatchError) -> GetInstanceError {
GetInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstanceError {
fn from(err: io::Error) -> GetInstanceError {
GetInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstanceError {
fn description(&self) -> &str {
match *self {
GetInstanceError::AccessDenied(ref cause) => cause,
GetInstanceError::AccountSetupInProgress(ref cause) => cause,
GetInstanceError::InvalidInput(ref cause) => cause,
GetInstanceError::NotFound(ref cause) => cause,
GetInstanceError::OperationFailure(ref cause) => cause,
GetInstanceError::Service(ref cause) => cause,
GetInstanceError::Unauthenticated(ref cause) => cause,
GetInstanceError::Validation(ref cause) => cause,
GetInstanceError::Credentials(ref err) => err.description(),
GetInstanceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetInstanceError::ParseError(ref cause) => cause,
GetInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstanceAccessDetailsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstanceAccessDetailsError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstanceAccessDetailsError {
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 {
"AccessDeniedException" => {
return GetInstanceAccessDetailsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetInstanceAccessDetailsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetInstanceAccessDetailsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetInstanceAccessDetailsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetInstanceAccessDetailsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetInstanceAccessDetailsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetInstanceAccessDetailsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetInstanceAccessDetailsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetInstanceAccessDetailsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstanceAccessDetailsError {
fn from(err: serde_json::error::Error) -> GetInstanceAccessDetailsError {
GetInstanceAccessDetailsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstanceAccessDetailsError {
fn from(err: CredentialsError) -> GetInstanceAccessDetailsError {
GetInstanceAccessDetailsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstanceAccessDetailsError {
fn from(err: HttpDispatchError) -> GetInstanceAccessDetailsError {
GetInstanceAccessDetailsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstanceAccessDetailsError {
fn from(err: io::Error) -> GetInstanceAccessDetailsError {
GetInstanceAccessDetailsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstanceAccessDetailsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstanceAccessDetailsError {
fn description(&self) -> &str {
match *self {
GetInstanceAccessDetailsError::AccessDenied(ref cause) => cause,
GetInstanceAccessDetailsError::AccountSetupInProgress(ref cause) => cause,
GetInstanceAccessDetailsError::InvalidInput(ref cause) => cause,
GetInstanceAccessDetailsError::NotFound(ref cause) => cause,
GetInstanceAccessDetailsError::OperationFailure(ref cause) => cause,
GetInstanceAccessDetailsError::Service(ref cause) => cause,
GetInstanceAccessDetailsError::Unauthenticated(ref cause) => cause,
GetInstanceAccessDetailsError::Validation(ref cause) => cause,
GetInstanceAccessDetailsError::Credentials(ref err) => err.description(),
GetInstanceAccessDetailsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetInstanceAccessDetailsError::ParseError(ref cause) => cause,
GetInstanceAccessDetailsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstanceMetricDataError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstanceMetricDataError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstanceMetricDataError {
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 {
"AccessDeniedException" => {
return GetInstanceMetricDataError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetInstanceMetricDataError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetInstanceMetricDataError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetInstanceMetricDataError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetInstanceMetricDataError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetInstanceMetricDataError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetInstanceMetricDataError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetInstanceMetricDataError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetInstanceMetricDataError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstanceMetricDataError {
fn from(err: serde_json::error::Error) -> GetInstanceMetricDataError {
GetInstanceMetricDataError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstanceMetricDataError {
fn from(err: CredentialsError) -> GetInstanceMetricDataError {
GetInstanceMetricDataError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstanceMetricDataError {
fn from(err: HttpDispatchError) -> GetInstanceMetricDataError {
GetInstanceMetricDataError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstanceMetricDataError {
fn from(err: io::Error) -> GetInstanceMetricDataError {
GetInstanceMetricDataError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstanceMetricDataError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstanceMetricDataError {
fn description(&self) -> &str {
match *self {
GetInstanceMetricDataError::AccessDenied(ref cause) => cause,
GetInstanceMetricDataError::AccountSetupInProgress(ref cause) => cause,
GetInstanceMetricDataError::InvalidInput(ref cause) => cause,
GetInstanceMetricDataError::NotFound(ref cause) => cause,
GetInstanceMetricDataError::OperationFailure(ref cause) => cause,
GetInstanceMetricDataError::Service(ref cause) => cause,
GetInstanceMetricDataError::Unauthenticated(ref cause) => cause,
GetInstanceMetricDataError::Validation(ref cause) => cause,
GetInstanceMetricDataError::Credentials(ref err) => err.description(),
GetInstanceMetricDataError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetInstanceMetricDataError::ParseError(ref cause) => cause,
GetInstanceMetricDataError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstancePortStatesError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstancePortStatesError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstancePortStatesError {
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 {
"AccessDeniedException" => {
return GetInstancePortStatesError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetInstancePortStatesError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetInstancePortStatesError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetInstancePortStatesError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetInstancePortStatesError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetInstancePortStatesError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetInstancePortStatesError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetInstancePortStatesError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetInstancePortStatesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstancePortStatesError {
fn from(err: serde_json::error::Error) -> GetInstancePortStatesError {
GetInstancePortStatesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstancePortStatesError {
fn from(err: CredentialsError) -> GetInstancePortStatesError {
GetInstancePortStatesError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstancePortStatesError {
fn from(err: HttpDispatchError) -> GetInstancePortStatesError {
GetInstancePortStatesError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstancePortStatesError {
fn from(err: io::Error) -> GetInstancePortStatesError {
GetInstancePortStatesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstancePortStatesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstancePortStatesError {
fn description(&self) -> &str {
match *self {
GetInstancePortStatesError::AccessDenied(ref cause) => cause,
GetInstancePortStatesError::AccountSetupInProgress(ref cause) => cause,
GetInstancePortStatesError::InvalidInput(ref cause) => cause,
GetInstancePortStatesError::NotFound(ref cause) => cause,
GetInstancePortStatesError::OperationFailure(ref cause) => cause,
GetInstancePortStatesError::Service(ref cause) => cause,
GetInstancePortStatesError::Unauthenticated(ref cause) => cause,
GetInstancePortStatesError::Validation(ref cause) => cause,
GetInstancePortStatesError::Credentials(ref err) => err.description(),
GetInstancePortStatesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetInstancePortStatesError::ParseError(ref cause) => cause,
GetInstancePortStatesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstanceSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstanceSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstanceSnapshotError {
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 {
"AccessDeniedException" => {
return GetInstanceSnapshotError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetInstanceSnapshotError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetInstanceSnapshotError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetInstanceSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetInstanceSnapshotError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetInstanceSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetInstanceSnapshotError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetInstanceSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetInstanceSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstanceSnapshotError {
fn from(err: serde_json::error::Error) -> GetInstanceSnapshotError {
GetInstanceSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstanceSnapshotError {
fn from(err: CredentialsError) -> GetInstanceSnapshotError {
GetInstanceSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstanceSnapshotError {
fn from(err: HttpDispatchError) -> GetInstanceSnapshotError {
GetInstanceSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstanceSnapshotError {
fn from(err: io::Error) -> GetInstanceSnapshotError {
GetInstanceSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstanceSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstanceSnapshotError {
fn description(&self) -> &str {
match *self {
GetInstanceSnapshotError::AccessDenied(ref cause) => cause,
GetInstanceSnapshotError::AccountSetupInProgress(ref cause) => cause,
GetInstanceSnapshotError::InvalidInput(ref cause) => cause,
GetInstanceSnapshotError::NotFound(ref cause) => cause,
GetInstanceSnapshotError::OperationFailure(ref cause) => cause,
GetInstanceSnapshotError::Service(ref cause) => cause,
GetInstanceSnapshotError::Unauthenticated(ref cause) => cause,
GetInstanceSnapshotError::Validation(ref cause) => cause,
GetInstanceSnapshotError::Credentials(ref err) => err.description(),
GetInstanceSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetInstanceSnapshotError::ParseError(ref cause) => cause,
GetInstanceSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstanceSnapshotsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstanceSnapshotsError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstanceSnapshotsError {
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 {
"AccessDeniedException" => {
return GetInstanceSnapshotsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetInstanceSnapshotsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetInstanceSnapshotsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetInstanceSnapshotsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetInstanceSnapshotsError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetInstanceSnapshotsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetInstanceSnapshotsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetInstanceSnapshotsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetInstanceSnapshotsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstanceSnapshotsError {
fn from(err: serde_json::error::Error) -> GetInstanceSnapshotsError {
GetInstanceSnapshotsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstanceSnapshotsError {
fn from(err: CredentialsError) -> GetInstanceSnapshotsError {
GetInstanceSnapshotsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstanceSnapshotsError {
fn from(err: HttpDispatchError) -> GetInstanceSnapshotsError {
GetInstanceSnapshotsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstanceSnapshotsError {
fn from(err: io::Error) -> GetInstanceSnapshotsError {
GetInstanceSnapshotsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstanceSnapshotsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstanceSnapshotsError {
fn description(&self) -> &str {
match *self {
GetInstanceSnapshotsError::AccessDenied(ref cause) => cause,
GetInstanceSnapshotsError::AccountSetupInProgress(ref cause) => cause,
GetInstanceSnapshotsError::InvalidInput(ref cause) => cause,
GetInstanceSnapshotsError::NotFound(ref cause) => cause,
GetInstanceSnapshotsError::OperationFailure(ref cause) => cause,
GetInstanceSnapshotsError::Service(ref cause) => cause,
GetInstanceSnapshotsError::Unauthenticated(ref cause) => cause,
GetInstanceSnapshotsError::Validation(ref cause) => cause,
GetInstanceSnapshotsError::Credentials(ref err) => err.description(),
GetInstanceSnapshotsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetInstanceSnapshotsError::ParseError(ref cause) => cause,
GetInstanceSnapshotsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstanceStateError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstanceStateError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstanceStateError {
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 {
"AccessDeniedException" => {
return GetInstanceStateError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetInstanceStateError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetInstanceStateError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetInstanceStateError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetInstanceStateError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetInstanceStateError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetInstanceStateError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetInstanceStateError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetInstanceStateError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstanceStateError {
fn from(err: serde_json::error::Error) -> GetInstanceStateError {
GetInstanceStateError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstanceStateError {
fn from(err: CredentialsError) -> GetInstanceStateError {
GetInstanceStateError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstanceStateError {
fn from(err: HttpDispatchError) -> GetInstanceStateError {
GetInstanceStateError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstanceStateError {
fn from(err: io::Error) -> GetInstanceStateError {
GetInstanceStateError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstanceStateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstanceStateError {
fn description(&self) -> &str {
match *self {
GetInstanceStateError::AccessDenied(ref cause) => cause,
GetInstanceStateError::AccountSetupInProgress(ref cause) => cause,
GetInstanceStateError::InvalidInput(ref cause) => cause,
GetInstanceStateError::NotFound(ref cause) => cause,
GetInstanceStateError::OperationFailure(ref cause) => cause,
GetInstanceStateError::Service(ref cause) => cause,
GetInstanceStateError::Unauthenticated(ref cause) => cause,
GetInstanceStateError::Validation(ref cause) => cause,
GetInstanceStateError::Credentials(ref err) => err.description(),
GetInstanceStateError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetInstanceStateError::ParseError(ref cause) => cause,
GetInstanceStateError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstancesError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstancesError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstancesError {
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 {
"AccessDeniedException" => {
return GetInstancesError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetInstancesError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetInstancesError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetInstancesError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetInstancesError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetInstancesError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetInstancesError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetInstancesError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetInstancesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstancesError {
fn from(err: serde_json::error::Error) -> GetInstancesError {
GetInstancesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstancesError {
fn from(err: CredentialsError) -> GetInstancesError {
GetInstancesError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstancesError {
fn from(err: HttpDispatchError) -> GetInstancesError {
GetInstancesError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstancesError {
fn from(err: io::Error) -> GetInstancesError {
GetInstancesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstancesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstancesError {
fn description(&self) -> &str {
match *self {
GetInstancesError::AccessDenied(ref cause) => cause,
GetInstancesError::AccountSetupInProgress(ref cause) => cause,
GetInstancesError::InvalidInput(ref cause) => cause,
GetInstancesError::NotFound(ref cause) => cause,
GetInstancesError::OperationFailure(ref cause) => cause,
GetInstancesError::Service(ref cause) => cause,
GetInstancesError::Unauthenticated(ref cause) => cause,
GetInstancesError::Validation(ref cause) => cause,
GetInstancesError::Credentials(ref err) => err.description(),
GetInstancesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetInstancesError::ParseError(ref cause) => cause,
GetInstancesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetKeyPairError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetKeyPairError {
pub fn from_response(res: BufferedHttpResponse) -> GetKeyPairError {
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 {
"AccessDeniedException" => {
return GetKeyPairError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetKeyPairError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetKeyPairError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetKeyPairError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetKeyPairError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetKeyPairError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetKeyPairError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetKeyPairError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetKeyPairError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetKeyPairError {
fn from(err: serde_json::error::Error) -> GetKeyPairError {
GetKeyPairError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetKeyPairError {
fn from(err: CredentialsError) -> GetKeyPairError {
GetKeyPairError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetKeyPairError {
fn from(err: HttpDispatchError) -> GetKeyPairError {
GetKeyPairError::HttpDispatch(err)
}
}
impl From<io::Error> for GetKeyPairError {
fn from(err: io::Error) -> GetKeyPairError {
GetKeyPairError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetKeyPairError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetKeyPairError {
fn description(&self) -> &str {
match *self {
GetKeyPairError::AccessDenied(ref cause) => cause,
GetKeyPairError::AccountSetupInProgress(ref cause) => cause,
GetKeyPairError::InvalidInput(ref cause) => cause,
GetKeyPairError::NotFound(ref cause) => cause,
GetKeyPairError::OperationFailure(ref cause) => cause,
GetKeyPairError::Service(ref cause) => cause,
GetKeyPairError::Unauthenticated(ref cause) => cause,
GetKeyPairError::Validation(ref cause) => cause,
GetKeyPairError::Credentials(ref err) => err.description(),
GetKeyPairError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetKeyPairError::ParseError(ref cause) => cause,
GetKeyPairError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetKeyPairsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetKeyPairsError {
pub fn from_response(res: BufferedHttpResponse) -> GetKeyPairsError {
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 {
"AccessDeniedException" => {
return GetKeyPairsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetKeyPairsError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetKeyPairsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetKeyPairsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetKeyPairsError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetKeyPairsError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetKeyPairsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetKeyPairsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetKeyPairsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetKeyPairsError {
fn from(err: serde_json::error::Error) -> GetKeyPairsError {
GetKeyPairsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetKeyPairsError {
fn from(err: CredentialsError) -> GetKeyPairsError {
GetKeyPairsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetKeyPairsError {
fn from(err: HttpDispatchError) -> GetKeyPairsError {
GetKeyPairsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetKeyPairsError {
fn from(err: io::Error) -> GetKeyPairsError {
GetKeyPairsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetKeyPairsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetKeyPairsError {
fn description(&self) -> &str {
match *self {
GetKeyPairsError::AccessDenied(ref cause) => cause,
GetKeyPairsError::AccountSetupInProgress(ref cause) => cause,
GetKeyPairsError::InvalidInput(ref cause) => cause,
GetKeyPairsError::NotFound(ref cause) => cause,
GetKeyPairsError::OperationFailure(ref cause) => cause,
GetKeyPairsError::Service(ref cause) => cause,
GetKeyPairsError::Unauthenticated(ref cause) => cause,
GetKeyPairsError::Validation(ref cause) => cause,
GetKeyPairsError::Credentials(ref err) => err.description(),
GetKeyPairsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetKeyPairsError::ParseError(ref cause) => cause,
GetKeyPairsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLoadBalancerError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetLoadBalancerError {
pub fn from_response(res: BufferedHttpResponse) -> GetLoadBalancerError {
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 {
"AccessDeniedException" => {
return GetLoadBalancerError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetLoadBalancerError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetLoadBalancerError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetLoadBalancerError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetLoadBalancerError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetLoadBalancerError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetLoadBalancerError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetLoadBalancerError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetLoadBalancerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetLoadBalancerError {
fn from(err: serde_json::error::Error) -> GetLoadBalancerError {
GetLoadBalancerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetLoadBalancerError {
fn from(err: CredentialsError) -> GetLoadBalancerError {
GetLoadBalancerError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetLoadBalancerError {
fn from(err: HttpDispatchError) -> GetLoadBalancerError {
GetLoadBalancerError::HttpDispatch(err)
}
}
impl From<io::Error> for GetLoadBalancerError {
fn from(err: io::Error) -> GetLoadBalancerError {
GetLoadBalancerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetLoadBalancerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLoadBalancerError {
fn description(&self) -> &str {
match *self {
GetLoadBalancerError::AccessDenied(ref cause) => cause,
GetLoadBalancerError::AccountSetupInProgress(ref cause) => cause,
GetLoadBalancerError::InvalidInput(ref cause) => cause,
GetLoadBalancerError::NotFound(ref cause) => cause,
GetLoadBalancerError::OperationFailure(ref cause) => cause,
GetLoadBalancerError::Service(ref cause) => cause,
GetLoadBalancerError::Unauthenticated(ref cause) => cause,
GetLoadBalancerError::Validation(ref cause) => cause,
GetLoadBalancerError::Credentials(ref err) => err.description(),
GetLoadBalancerError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetLoadBalancerError::ParseError(ref cause) => cause,
GetLoadBalancerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLoadBalancerMetricDataError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetLoadBalancerMetricDataError {
pub fn from_response(res: BufferedHttpResponse) -> GetLoadBalancerMetricDataError {
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 {
"AccessDeniedException" => {
return GetLoadBalancerMetricDataError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetLoadBalancerMetricDataError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetLoadBalancerMetricDataError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetLoadBalancerMetricDataError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetLoadBalancerMetricDataError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetLoadBalancerMetricDataError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetLoadBalancerMetricDataError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetLoadBalancerMetricDataError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetLoadBalancerMetricDataError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetLoadBalancerMetricDataError {
fn from(err: serde_json::error::Error) -> GetLoadBalancerMetricDataError {
GetLoadBalancerMetricDataError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetLoadBalancerMetricDataError {
fn from(err: CredentialsError) -> GetLoadBalancerMetricDataError {
GetLoadBalancerMetricDataError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetLoadBalancerMetricDataError {
fn from(err: HttpDispatchError) -> GetLoadBalancerMetricDataError {
GetLoadBalancerMetricDataError::HttpDispatch(err)
}
}
impl From<io::Error> for GetLoadBalancerMetricDataError {
fn from(err: io::Error) -> GetLoadBalancerMetricDataError {
GetLoadBalancerMetricDataError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetLoadBalancerMetricDataError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLoadBalancerMetricDataError {
fn description(&self) -> &str {
match *self {
GetLoadBalancerMetricDataError::AccessDenied(ref cause) => cause,
GetLoadBalancerMetricDataError::AccountSetupInProgress(ref cause) => cause,
GetLoadBalancerMetricDataError::InvalidInput(ref cause) => cause,
GetLoadBalancerMetricDataError::NotFound(ref cause) => cause,
GetLoadBalancerMetricDataError::OperationFailure(ref cause) => cause,
GetLoadBalancerMetricDataError::Service(ref cause) => cause,
GetLoadBalancerMetricDataError::Unauthenticated(ref cause) => cause,
GetLoadBalancerMetricDataError::Validation(ref cause) => cause,
GetLoadBalancerMetricDataError::Credentials(ref err) => err.description(),
GetLoadBalancerMetricDataError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetLoadBalancerMetricDataError::ParseError(ref cause) => cause,
GetLoadBalancerMetricDataError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLoadBalancerTlsCertificatesError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetLoadBalancerTlsCertificatesError {
pub fn from_response(res: BufferedHttpResponse) -> GetLoadBalancerTlsCertificatesError {
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 {
"AccessDeniedException" => {
return GetLoadBalancerTlsCertificatesError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetLoadBalancerTlsCertificatesError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return GetLoadBalancerTlsCertificatesError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetLoadBalancerTlsCertificatesError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return GetLoadBalancerTlsCertificatesError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetLoadBalancerTlsCertificatesError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetLoadBalancerTlsCertificatesError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetLoadBalancerTlsCertificatesError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetLoadBalancerTlsCertificatesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetLoadBalancerTlsCertificatesError {
fn from(err: serde_json::error::Error) -> GetLoadBalancerTlsCertificatesError {
GetLoadBalancerTlsCertificatesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetLoadBalancerTlsCertificatesError {
fn from(err: CredentialsError) -> GetLoadBalancerTlsCertificatesError {
GetLoadBalancerTlsCertificatesError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetLoadBalancerTlsCertificatesError {
fn from(err: HttpDispatchError) -> GetLoadBalancerTlsCertificatesError {
GetLoadBalancerTlsCertificatesError::HttpDispatch(err)
}
}
impl From<io::Error> for GetLoadBalancerTlsCertificatesError {
fn from(err: io::Error) -> GetLoadBalancerTlsCertificatesError {
GetLoadBalancerTlsCertificatesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetLoadBalancerTlsCertificatesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLoadBalancerTlsCertificatesError {
fn description(&self) -> &str {
match *self {
GetLoadBalancerTlsCertificatesError::AccessDenied(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::AccountSetupInProgress(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::InvalidInput(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::NotFound(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::OperationFailure(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::Service(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::Unauthenticated(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::Validation(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::Credentials(ref err) => err.description(),
GetLoadBalancerTlsCertificatesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetLoadBalancerTlsCertificatesError::ParseError(ref cause) => cause,
GetLoadBalancerTlsCertificatesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLoadBalancersError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetLoadBalancersError {
pub fn from_response(res: BufferedHttpResponse) -> GetLoadBalancersError {
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 {
"AccessDeniedException" => {
return GetLoadBalancersError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetLoadBalancersError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetLoadBalancersError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetLoadBalancersError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetLoadBalancersError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetLoadBalancersError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetLoadBalancersError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetLoadBalancersError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetLoadBalancersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetLoadBalancersError {
fn from(err: serde_json::error::Error) -> GetLoadBalancersError {
GetLoadBalancersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetLoadBalancersError {
fn from(err: CredentialsError) -> GetLoadBalancersError {
GetLoadBalancersError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetLoadBalancersError {
fn from(err: HttpDispatchError) -> GetLoadBalancersError {
GetLoadBalancersError::HttpDispatch(err)
}
}
impl From<io::Error> for GetLoadBalancersError {
fn from(err: io::Error) -> GetLoadBalancersError {
GetLoadBalancersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetLoadBalancersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLoadBalancersError {
fn description(&self) -> &str {
match *self {
GetLoadBalancersError::AccessDenied(ref cause) => cause,
GetLoadBalancersError::AccountSetupInProgress(ref cause) => cause,
GetLoadBalancersError::InvalidInput(ref cause) => cause,
GetLoadBalancersError::NotFound(ref cause) => cause,
GetLoadBalancersError::OperationFailure(ref cause) => cause,
GetLoadBalancersError::Service(ref cause) => cause,
GetLoadBalancersError::Unauthenticated(ref cause) => cause,
GetLoadBalancersError::Validation(ref cause) => cause,
GetLoadBalancersError::Credentials(ref err) => err.description(),
GetLoadBalancersError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetLoadBalancersError::ParseError(ref cause) => cause,
GetLoadBalancersError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetOperationError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetOperationError {
pub fn from_response(res: BufferedHttpResponse) -> GetOperationError {
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 {
"AccessDeniedException" => {
return GetOperationError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetOperationError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetOperationError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetOperationError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetOperationError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetOperationError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetOperationError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetOperationError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetOperationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetOperationError {
fn from(err: serde_json::error::Error) -> GetOperationError {
GetOperationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetOperationError {
fn from(err: CredentialsError) -> GetOperationError {
GetOperationError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetOperationError {
fn from(err: HttpDispatchError) -> GetOperationError {
GetOperationError::HttpDispatch(err)
}
}
impl From<io::Error> for GetOperationError {
fn from(err: io::Error) -> GetOperationError {
GetOperationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetOperationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetOperationError {
fn description(&self) -> &str {
match *self {
GetOperationError::AccessDenied(ref cause) => cause,
GetOperationError::AccountSetupInProgress(ref cause) => cause,
GetOperationError::InvalidInput(ref cause) => cause,
GetOperationError::NotFound(ref cause) => cause,
GetOperationError::OperationFailure(ref cause) => cause,
GetOperationError::Service(ref cause) => cause,
GetOperationError::Unauthenticated(ref cause) => cause,
GetOperationError::Validation(ref cause) => cause,
GetOperationError::Credentials(ref err) => err.description(),
GetOperationError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetOperationError::ParseError(ref cause) => cause,
GetOperationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetOperationsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetOperationsError {
pub fn from_response(res: BufferedHttpResponse) -> GetOperationsError {
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 {
"AccessDeniedException" => {
return GetOperationsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetOperationsError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetOperationsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetOperationsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetOperationsError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetOperationsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetOperationsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetOperationsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetOperationsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetOperationsError {
fn from(err: serde_json::error::Error) -> GetOperationsError {
GetOperationsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetOperationsError {
fn from(err: CredentialsError) -> GetOperationsError {
GetOperationsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetOperationsError {
fn from(err: HttpDispatchError) -> GetOperationsError {
GetOperationsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetOperationsError {
fn from(err: io::Error) -> GetOperationsError {
GetOperationsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetOperationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetOperationsError {
fn description(&self) -> &str {
match *self {
GetOperationsError::AccessDenied(ref cause) => cause,
GetOperationsError::AccountSetupInProgress(ref cause) => cause,
GetOperationsError::InvalidInput(ref cause) => cause,
GetOperationsError::NotFound(ref cause) => cause,
GetOperationsError::OperationFailure(ref cause) => cause,
GetOperationsError::Service(ref cause) => cause,
GetOperationsError::Unauthenticated(ref cause) => cause,
GetOperationsError::Validation(ref cause) => cause,
GetOperationsError::Credentials(ref err) => err.description(),
GetOperationsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetOperationsError::ParseError(ref cause) => cause,
GetOperationsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetOperationsForResourceError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetOperationsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> GetOperationsForResourceError {
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 {
"AccessDeniedException" => {
return GetOperationsForResourceError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetOperationsForResourceError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetOperationsForResourceError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetOperationsForResourceError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetOperationsForResourceError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetOperationsForResourceError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetOperationsForResourceError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetOperationsForResourceError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetOperationsForResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetOperationsForResourceError {
fn from(err: serde_json::error::Error) -> GetOperationsForResourceError {
GetOperationsForResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetOperationsForResourceError {
fn from(err: CredentialsError) -> GetOperationsForResourceError {
GetOperationsForResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetOperationsForResourceError {
fn from(err: HttpDispatchError) -> GetOperationsForResourceError {
GetOperationsForResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for GetOperationsForResourceError {
fn from(err: io::Error) -> GetOperationsForResourceError {
GetOperationsForResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetOperationsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetOperationsForResourceError {
fn description(&self) -> &str {
match *self {
GetOperationsForResourceError::AccessDenied(ref cause) => cause,
GetOperationsForResourceError::AccountSetupInProgress(ref cause) => cause,
GetOperationsForResourceError::InvalidInput(ref cause) => cause,
GetOperationsForResourceError::NotFound(ref cause) => cause,
GetOperationsForResourceError::OperationFailure(ref cause) => cause,
GetOperationsForResourceError::Service(ref cause) => cause,
GetOperationsForResourceError::Unauthenticated(ref cause) => cause,
GetOperationsForResourceError::Validation(ref cause) => cause,
GetOperationsForResourceError::Credentials(ref err) => err.description(),
GetOperationsForResourceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetOperationsForResourceError::ParseError(ref cause) => cause,
GetOperationsForResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRegionsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRegionsError {
pub fn from_response(res: BufferedHttpResponse) -> GetRegionsError {
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 {
"AccessDeniedException" => {
return GetRegionsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetRegionsError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetRegionsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetRegionsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetRegionsError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetRegionsError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetRegionsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetRegionsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetRegionsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRegionsError {
fn from(err: serde_json::error::Error) -> GetRegionsError {
GetRegionsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRegionsError {
fn from(err: CredentialsError) -> GetRegionsError {
GetRegionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRegionsError {
fn from(err: HttpDispatchError) -> GetRegionsError {
GetRegionsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRegionsError {
fn from(err: io::Error) -> GetRegionsError {
GetRegionsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRegionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRegionsError {
fn description(&self) -> &str {
match *self {
GetRegionsError::AccessDenied(ref cause) => cause,
GetRegionsError::AccountSetupInProgress(ref cause) => cause,
GetRegionsError::InvalidInput(ref cause) => cause,
GetRegionsError::NotFound(ref cause) => cause,
GetRegionsError::OperationFailure(ref cause) => cause,
GetRegionsError::Service(ref cause) => cause,
GetRegionsError::Unauthenticated(ref cause) => cause,
GetRegionsError::Validation(ref cause) => cause,
GetRegionsError::Credentials(ref err) => err.description(),
GetRegionsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetRegionsError::ParseError(ref cause) => cause,
GetRegionsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetRelationalDatabaseError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetRelationalDatabaseError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetRelationalDatabaseError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetRelationalDatabaseError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetRelationalDatabaseError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetRelationalDatabaseError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseError {
GetRelationalDatabaseError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseError {
fn from(err: CredentialsError) -> GetRelationalDatabaseError {
GetRelationalDatabaseError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseError {
GetRelationalDatabaseError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseError {
fn from(err: io::Error) -> GetRelationalDatabaseError {
GetRelationalDatabaseError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseError::NotFound(ref cause) => cause,
GetRelationalDatabaseError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseError::Service(ref cause) => cause,
GetRelationalDatabaseError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseError::Validation(ref cause) => cause,
GetRelationalDatabaseError::Credentials(ref err) => err.description(),
GetRelationalDatabaseError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseError::ParseError(ref cause) => cause,
GetRelationalDatabaseError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseBlueprintsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseBlueprintsError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseBlueprintsError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseBlueprintsError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseBlueprintsError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return GetRelationalDatabaseBlueprintsError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseBlueprintsError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return GetRelationalDatabaseBlueprintsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseBlueprintsError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseBlueprintsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseBlueprintsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetRelationalDatabaseBlueprintsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseBlueprintsError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseBlueprintsError {
GetRelationalDatabaseBlueprintsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseBlueprintsError {
fn from(err: CredentialsError) -> GetRelationalDatabaseBlueprintsError {
GetRelationalDatabaseBlueprintsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseBlueprintsError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseBlueprintsError {
GetRelationalDatabaseBlueprintsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseBlueprintsError {
fn from(err: io::Error) -> GetRelationalDatabaseBlueprintsError {
GetRelationalDatabaseBlueprintsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseBlueprintsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseBlueprintsError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseBlueprintsError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::NotFound(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::Service(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::Validation(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::Credentials(ref err) => err.description(),
GetRelationalDatabaseBlueprintsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseBlueprintsError::ParseError(ref cause) => cause,
GetRelationalDatabaseBlueprintsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseBundlesError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseBundlesError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseBundlesError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseBundlesError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseBundlesError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetRelationalDatabaseBundlesError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseBundlesError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetRelationalDatabaseBundlesError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseBundlesError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseBundlesError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseBundlesError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetRelationalDatabaseBundlesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseBundlesError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseBundlesError {
GetRelationalDatabaseBundlesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseBundlesError {
fn from(err: CredentialsError) -> GetRelationalDatabaseBundlesError {
GetRelationalDatabaseBundlesError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseBundlesError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseBundlesError {
GetRelationalDatabaseBundlesError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseBundlesError {
fn from(err: io::Error) -> GetRelationalDatabaseBundlesError {
GetRelationalDatabaseBundlesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseBundlesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseBundlesError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseBundlesError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseBundlesError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseBundlesError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseBundlesError::NotFound(ref cause) => cause,
GetRelationalDatabaseBundlesError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseBundlesError::Service(ref cause) => cause,
GetRelationalDatabaseBundlesError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseBundlesError::Validation(ref cause) => cause,
GetRelationalDatabaseBundlesError::Credentials(ref err) => err.description(),
GetRelationalDatabaseBundlesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseBundlesError::ParseError(ref cause) => cause,
GetRelationalDatabaseBundlesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseEventsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseEventsError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseEventsError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseEventsError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseEventsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetRelationalDatabaseEventsError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseEventsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetRelationalDatabaseEventsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseEventsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseEventsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseEventsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetRelationalDatabaseEventsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseEventsError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseEventsError {
GetRelationalDatabaseEventsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseEventsError {
fn from(err: CredentialsError) -> GetRelationalDatabaseEventsError {
GetRelationalDatabaseEventsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseEventsError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseEventsError {
GetRelationalDatabaseEventsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseEventsError {
fn from(err: io::Error) -> GetRelationalDatabaseEventsError {
GetRelationalDatabaseEventsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseEventsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseEventsError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseEventsError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseEventsError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseEventsError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseEventsError::NotFound(ref cause) => cause,
GetRelationalDatabaseEventsError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseEventsError::Service(ref cause) => cause,
GetRelationalDatabaseEventsError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseEventsError::Validation(ref cause) => cause,
GetRelationalDatabaseEventsError::Credentials(ref err) => err.description(),
GetRelationalDatabaseEventsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseEventsError::ParseError(ref cause) => cause,
GetRelationalDatabaseEventsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseLogEventsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseLogEventsError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseLogEventsError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseLogEventsError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseLogEventsError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return GetRelationalDatabaseLogEventsError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseLogEventsError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return GetRelationalDatabaseLogEventsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseLogEventsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseLogEventsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseLogEventsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetRelationalDatabaseLogEventsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseLogEventsError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseLogEventsError {
GetRelationalDatabaseLogEventsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseLogEventsError {
fn from(err: CredentialsError) -> GetRelationalDatabaseLogEventsError {
GetRelationalDatabaseLogEventsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseLogEventsError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseLogEventsError {
GetRelationalDatabaseLogEventsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseLogEventsError {
fn from(err: io::Error) -> GetRelationalDatabaseLogEventsError {
GetRelationalDatabaseLogEventsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseLogEventsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseLogEventsError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseLogEventsError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseLogEventsError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseLogEventsError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseLogEventsError::NotFound(ref cause) => cause,
GetRelationalDatabaseLogEventsError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseLogEventsError::Service(ref cause) => cause,
GetRelationalDatabaseLogEventsError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseLogEventsError::Validation(ref cause) => cause,
GetRelationalDatabaseLogEventsError::Credentials(ref err) => err.description(),
GetRelationalDatabaseLogEventsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseLogEventsError::ParseError(ref cause) => cause,
GetRelationalDatabaseLogEventsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseLogStreamsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseLogStreamsError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseLogStreamsError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseLogStreamsError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseLogStreamsError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return GetRelationalDatabaseLogStreamsError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseLogStreamsError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return GetRelationalDatabaseLogStreamsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseLogStreamsError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseLogStreamsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseLogStreamsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetRelationalDatabaseLogStreamsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseLogStreamsError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseLogStreamsError {
GetRelationalDatabaseLogStreamsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseLogStreamsError {
fn from(err: CredentialsError) -> GetRelationalDatabaseLogStreamsError {
GetRelationalDatabaseLogStreamsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseLogStreamsError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseLogStreamsError {
GetRelationalDatabaseLogStreamsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseLogStreamsError {
fn from(err: io::Error) -> GetRelationalDatabaseLogStreamsError {
GetRelationalDatabaseLogStreamsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseLogStreamsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseLogStreamsError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseLogStreamsError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::NotFound(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::Service(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::Validation(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::Credentials(ref err) => err.description(),
GetRelationalDatabaseLogStreamsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseLogStreamsError::ParseError(ref cause) => cause,
GetRelationalDatabaseLogStreamsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseMasterUserPasswordError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseMasterUserPasswordError {
pub fn from_response(
res: BufferedHttpResponse,
) -> GetRelationalDatabaseMasterUserPasswordError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseMasterUserPasswordError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseMasterUserPasswordError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return GetRelationalDatabaseMasterUserPasswordError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseMasterUserPasswordError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return GetRelationalDatabaseMasterUserPasswordError::OperationFailure(
String::from(error_message),
);
}
"ServiceException" => {
return GetRelationalDatabaseMasterUserPasswordError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseMasterUserPasswordError::Unauthenticated(
String::from(error_message),
);
}
"ValidationException" => {
return GetRelationalDatabaseMasterUserPasswordError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetRelationalDatabaseMasterUserPasswordError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseMasterUserPasswordError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseMasterUserPasswordError {
GetRelationalDatabaseMasterUserPasswordError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseMasterUserPasswordError {
fn from(err: CredentialsError) -> GetRelationalDatabaseMasterUserPasswordError {
GetRelationalDatabaseMasterUserPasswordError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseMasterUserPasswordError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseMasterUserPasswordError {
GetRelationalDatabaseMasterUserPasswordError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseMasterUserPasswordError {
fn from(err: io::Error) -> GetRelationalDatabaseMasterUserPasswordError {
GetRelationalDatabaseMasterUserPasswordError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseMasterUserPasswordError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseMasterUserPasswordError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseMasterUserPasswordError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseMasterUserPasswordError::AccountSetupInProgress(ref cause) => {
cause
}
GetRelationalDatabaseMasterUserPasswordError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseMasterUserPasswordError::NotFound(ref cause) => cause,
GetRelationalDatabaseMasterUserPasswordError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseMasterUserPasswordError::Service(ref cause) => cause,
GetRelationalDatabaseMasterUserPasswordError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseMasterUserPasswordError::Validation(ref cause) => cause,
GetRelationalDatabaseMasterUserPasswordError::Credentials(ref err) => err.description(),
GetRelationalDatabaseMasterUserPasswordError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseMasterUserPasswordError::ParseError(ref cause) => cause,
GetRelationalDatabaseMasterUserPasswordError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseMetricDataError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseMetricDataError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseMetricDataError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseMetricDataError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseMetricDataError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return GetRelationalDatabaseMetricDataError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseMetricDataError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return GetRelationalDatabaseMetricDataError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseMetricDataError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseMetricDataError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseMetricDataError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetRelationalDatabaseMetricDataError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseMetricDataError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseMetricDataError {
GetRelationalDatabaseMetricDataError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseMetricDataError {
fn from(err: CredentialsError) -> GetRelationalDatabaseMetricDataError {
GetRelationalDatabaseMetricDataError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseMetricDataError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseMetricDataError {
GetRelationalDatabaseMetricDataError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseMetricDataError {
fn from(err: io::Error) -> GetRelationalDatabaseMetricDataError {
GetRelationalDatabaseMetricDataError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseMetricDataError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseMetricDataError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseMetricDataError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseMetricDataError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseMetricDataError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseMetricDataError::NotFound(ref cause) => cause,
GetRelationalDatabaseMetricDataError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseMetricDataError::Service(ref cause) => cause,
GetRelationalDatabaseMetricDataError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseMetricDataError::Validation(ref cause) => cause,
GetRelationalDatabaseMetricDataError::Credentials(ref err) => err.description(),
GetRelationalDatabaseMetricDataError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseMetricDataError::ParseError(ref cause) => cause,
GetRelationalDatabaseMetricDataError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseParametersError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseParametersError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseParametersError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseParametersError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseParametersError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return GetRelationalDatabaseParametersError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseParametersError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return GetRelationalDatabaseParametersError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseParametersError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseParametersError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseParametersError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetRelationalDatabaseParametersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseParametersError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseParametersError {
GetRelationalDatabaseParametersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseParametersError {
fn from(err: CredentialsError) -> GetRelationalDatabaseParametersError {
GetRelationalDatabaseParametersError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseParametersError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseParametersError {
GetRelationalDatabaseParametersError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseParametersError {
fn from(err: io::Error) -> GetRelationalDatabaseParametersError {
GetRelationalDatabaseParametersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseParametersError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseParametersError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseParametersError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseParametersError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseParametersError::NotFound(ref cause) => cause,
GetRelationalDatabaseParametersError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseParametersError::Service(ref cause) => cause,
GetRelationalDatabaseParametersError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseParametersError::Validation(ref cause) => cause,
GetRelationalDatabaseParametersError::Credentials(ref err) => err.description(),
GetRelationalDatabaseParametersError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseParametersError::ParseError(ref cause) => cause,
GetRelationalDatabaseParametersError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseSnapshotError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseSnapshotError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseSnapshotError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseSnapshotError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetRelationalDatabaseSnapshotError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseSnapshotError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetRelationalDatabaseSnapshotError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseSnapshotError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseSnapshotError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetRelationalDatabaseSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseSnapshotError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseSnapshotError {
GetRelationalDatabaseSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseSnapshotError {
fn from(err: CredentialsError) -> GetRelationalDatabaseSnapshotError {
GetRelationalDatabaseSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseSnapshotError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseSnapshotError {
GetRelationalDatabaseSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseSnapshotError {
fn from(err: io::Error) -> GetRelationalDatabaseSnapshotError {
GetRelationalDatabaseSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseSnapshotError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseSnapshotError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseSnapshotError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseSnapshotError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseSnapshotError::NotFound(ref cause) => cause,
GetRelationalDatabaseSnapshotError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseSnapshotError::Service(ref cause) => cause,
GetRelationalDatabaseSnapshotError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseSnapshotError::Validation(ref cause) => cause,
GetRelationalDatabaseSnapshotError::Credentials(ref err) => err.description(),
GetRelationalDatabaseSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseSnapshotError::ParseError(ref cause) => cause,
GetRelationalDatabaseSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabaseSnapshotsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabaseSnapshotsError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabaseSnapshotsError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabaseSnapshotsError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabaseSnapshotsError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return GetRelationalDatabaseSnapshotsError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return GetRelationalDatabaseSnapshotsError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return GetRelationalDatabaseSnapshotsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabaseSnapshotsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetRelationalDatabaseSnapshotsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return GetRelationalDatabaseSnapshotsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetRelationalDatabaseSnapshotsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabaseSnapshotsError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabaseSnapshotsError {
GetRelationalDatabaseSnapshotsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabaseSnapshotsError {
fn from(err: CredentialsError) -> GetRelationalDatabaseSnapshotsError {
GetRelationalDatabaseSnapshotsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabaseSnapshotsError {
fn from(err: HttpDispatchError) -> GetRelationalDatabaseSnapshotsError {
GetRelationalDatabaseSnapshotsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabaseSnapshotsError {
fn from(err: io::Error) -> GetRelationalDatabaseSnapshotsError {
GetRelationalDatabaseSnapshotsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabaseSnapshotsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabaseSnapshotsError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabaseSnapshotsError::AccessDenied(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::InvalidInput(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::NotFound(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::OperationFailure(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::Service(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::Unauthenticated(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::Validation(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::Credentials(ref err) => err.description(),
GetRelationalDatabaseSnapshotsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabaseSnapshotsError::ParseError(ref cause) => cause,
GetRelationalDatabaseSnapshotsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRelationalDatabasesError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRelationalDatabasesError {
pub fn from_response(res: BufferedHttpResponse) -> GetRelationalDatabasesError {
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 {
"AccessDeniedException" => {
return GetRelationalDatabasesError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetRelationalDatabasesError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return GetRelationalDatabasesError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetRelationalDatabasesError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetRelationalDatabasesError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return GetRelationalDatabasesError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetRelationalDatabasesError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetRelationalDatabasesError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetRelationalDatabasesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRelationalDatabasesError {
fn from(err: serde_json::error::Error) -> GetRelationalDatabasesError {
GetRelationalDatabasesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRelationalDatabasesError {
fn from(err: CredentialsError) -> GetRelationalDatabasesError {
GetRelationalDatabasesError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRelationalDatabasesError {
fn from(err: HttpDispatchError) -> GetRelationalDatabasesError {
GetRelationalDatabasesError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRelationalDatabasesError {
fn from(err: io::Error) -> GetRelationalDatabasesError {
GetRelationalDatabasesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRelationalDatabasesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRelationalDatabasesError {
fn description(&self) -> &str {
match *self {
GetRelationalDatabasesError::AccessDenied(ref cause) => cause,
GetRelationalDatabasesError::AccountSetupInProgress(ref cause) => cause,
GetRelationalDatabasesError::InvalidInput(ref cause) => cause,
GetRelationalDatabasesError::NotFound(ref cause) => cause,
GetRelationalDatabasesError::OperationFailure(ref cause) => cause,
GetRelationalDatabasesError::Service(ref cause) => cause,
GetRelationalDatabasesError::Unauthenticated(ref cause) => cause,
GetRelationalDatabasesError::Validation(ref cause) => cause,
GetRelationalDatabasesError::Credentials(ref err) => err.description(),
GetRelationalDatabasesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRelationalDatabasesError::ParseError(ref cause) => cause,
GetRelationalDatabasesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetStaticIpError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetStaticIpError {
pub fn from_response(res: BufferedHttpResponse) -> GetStaticIpError {
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 {
"AccessDeniedException" => {
return GetStaticIpError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetStaticIpError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetStaticIpError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetStaticIpError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetStaticIpError::OperationFailure(String::from(error_message));
}
"ServiceException" => return GetStaticIpError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return GetStaticIpError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetStaticIpError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetStaticIpError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetStaticIpError {
fn from(err: serde_json::error::Error) -> GetStaticIpError {
GetStaticIpError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetStaticIpError {
fn from(err: CredentialsError) -> GetStaticIpError {
GetStaticIpError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetStaticIpError {
fn from(err: HttpDispatchError) -> GetStaticIpError {
GetStaticIpError::HttpDispatch(err)
}
}
impl From<io::Error> for GetStaticIpError {
fn from(err: io::Error) -> GetStaticIpError {
GetStaticIpError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetStaticIpError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetStaticIpError {
fn description(&self) -> &str {
match *self {
GetStaticIpError::AccessDenied(ref cause) => cause,
GetStaticIpError::AccountSetupInProgress(ref cause) => cause,
GetStaticIpError::InvalidInput(ref cause) => cause,
GetStaticIpError::NotFound(ref cause) => cause,
GetStaticIpError::OperationFailure(ref cause) => cause,
GetStaticIpError::Service(ref cause) => cause,
GetStaticIpError::Unauthenticated(ref cause) => cause,
GetStaticIpError::Validation(ref cause) => cause,
GetStaticIpError::Credentials(ref err) => err.description(),
GetStaticIpError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetStaticIpError::ParseError(ref cause) => cause,
GetStaticIpError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetStaticIpsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetStaticIpsError {
pub fn from_response(res: BufferedHttpResponse) -> GetStaticIpsError {
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 {
"AccessDeniedException" => {
return GetStaticIpsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return GetStaticIpsError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return GetStaticIpsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return GetStaticIpsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return GetStaticIpsError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return GetStaticIpsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return GetStaticIpsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return GetStaticIpsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetStaticIpsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetStaticIpsError {
fn from(err: serde_json::error::Error) -> GetStaticIpsError {
GetStaticIpsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetStaticIpsError {
fn from(err: CredentialsError) -> GetStaticIpsError {
GetStaticIpsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetStaticIpsError {
fn from(err: HttpDispatchError) -> GetStaticIpsError {
GetStaticIpsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetStaticIpsError {
fn from(err: io::Error) -> GetStaticIpsError {
GetStaticIpsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetStaticIpsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetStaticIpsError {
fn description(&self) -> &str {
match *self {
GetStaticIpsError::AccessDenied(ref cause) => cause,
GetStaticIpsError::AccountSetupInProgress(ref cause) => cause,
GetStaticIpsError::InvalidInput(ref cause) => cause,
GetStaticIpsError::NotFound(ref cause) => cause,
GetStaticIpsError::OperationFailure(ref cause) => cause,
GetStaticIpsError::Service(ref cause) => cause,
GetStaticIpsError::Unauthenticated(ref cause) => cause,
GetStaticIpsError::Validation(ref cause) => cause,
GetStaticIpsError::Credentials(ref err) => err.description(),
GetStaticIpsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetStaticIpsError::ParseError(ref cause) => cause,
GetStaticIpsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ImportKeyPairError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ImportKeyPairError {
pub fn from_response(res: BufferedHttpResponse) -> ImportKeyPairError {
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 {
"AccessDeniedException" => {
return ImportKeyPairError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return ImportKeyPairError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return ImportKeyPairError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return ImportKeyPairError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return ImportKeyPairError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return ImportKeyPairError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return ImportKeyPairError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return ImportKeyPairError::Validation(error_message.to_string());
}
_ => {}
}
}
return ImportKeyPairError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ImportKeyPairError {
fn from(err: serde_json::error::Error) -> ImportKeyPairError {
ImportKeyPairError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ImportKeyPairError {
fn from(err: CredentialsError) -> ImportKeyPairError {
ImportKeyPairError::Credentials(err)
}
}
impl From<HttpDispatchError> for ImportKeyPairError {
fn from(err: HttpDispatchError) -> ImportKeyPairError {
ImportKeyPairError::HttpDispatch(err)
}
}
impl From<io::Error> for ImportKeyPairError {
fn from(err: io::Error) -> ImportKeyPairError {
ImportKeyPairError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ImportKeyPairError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ImportKeyPairError {
fn description(&self) -> &str {
match *self {
ImportKeyPairError::AccessDenied(ref cause) => cause,
ImportKeyPairError::AccountSetupInProgress(ref cause) => cause,
ImportKeyPairError::InvalidInput(ref cause) => cause,
ImportKeyPairError::NotFound(ref cause) => cause,
ImportKeyPairError::OperationFailure(ref cause) => cause,
ImportKeyPairError::Service(ref cause) => cause,
ImportKeyPairError::Unauthenticated(ref cause) => cause,
ImportKeyPairError::Validation(ref cause) => cause,
ImportKeyPairError::Credentials(ref err) => err.description(),
ImportKeyPairError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ImportKeyPairError::ParseError(ref cause) => cause,
ImportKeyPairError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum IsVpcPeeredError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl IsVpcPeeredError {
pub fn from_response(res: BufferedHttpResponse) -> IsVpcPeeredError {
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 {
"AccessDeniedException" => {
return IsVpcPeeredError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return IsVpcPeeredError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return IsVpcPeeredError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return IsVpcPeeredError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return IsVpcPeeredError::OperationFailure(String::from(error_message));
}
"ServiceException" => return IsVpcPeeredError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return IsVpcPeeredError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return IsVpcPeeredError::Validation(error_message.to_string());
}
_ => {}
}
}
return IsVpcPeeredError::Unknown(res);
}
}
impl From<serde_json::error::Error> for IsVpcPeeredError {
fn from(err: serde_json::error::Error) -> IsVpcPeeredError {
IsVpcPeeredError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for IsVpcPeeredError {
fn from(err: CredentialsError) -> IsVpcPeeredError {
IsVpcPeeredError::Credentials(err)
}
}
impl From<HttpDispatchError> for IsVpcPeeredError {
fn from(err: HttpDispatchError) -> IsVpcPeeredError {
IsVpcPeeredError::HttpDispatch(err)
}
}
impl From<io::Error> for IsVpcPeeredError {
fn from(err: io::Error) -> IsVpcPeeredError {
IsVpcPeeredError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for IsVpcPeeredError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for IsVpcPeeredError {
fn description(&self) -> &str {
match *self {
IsVpcPeeredError::AccessDenied(ref cause) => cause,
IsVpcPeeredError::AccountSetupInProgress(ref cause) => cause,
IsVpcPeeredError::InvalidInput(ref cause) => cause,
IsVpcPeeredError::NotFound(ref cause) => cause,
IsVpcPeeredError::OperationFailure(ref cause) => cause,
IsVpcPeeredError::Service(ref cause) => cause,
IsVpcPeeredError::Unauthenticated(ref cause) => cause,
IsVpcPeeredError::Validation(ref cause) => cause,
IsVpcPeeredError::Credentials(ref err) => err.description(),
IsVpcPeeredError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
IsVpcPeeredError::ParseError(ref cause) => cause,
IsVpcPeeredError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum OpenInstancePublicPortsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl OpenInstancePublicPortsError {
pub fn from_response(res: BufferedHttpResponse) -> OpenInstancePublicPortsError {
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 {
"AccessDeniedException" => {
return OpenInstancePublicPortsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return OpenInstancePublicPortsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return OpenInstancePublicPortsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return OpenInstancePublicPortsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return OpenInstancePublicPortsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return OpenInstancePublicPortsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return OpenInstancePublicPortsError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return OpenInstancePublicPortsError::Validation(error_message.to_string());
}
_ => {}
}
}
return OpenInstancePublicPortsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for OpenInstancePublicPortsError {
fn from(err: serde_json::error::Error) -> OpenInstancePublicPortsError {
OpenInstancePublicPortsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for OpenInstancePublicPortsError {
fn from(err: CredentialsError) -> OpenInstancePublicPortsError {
OpenInstancePublicPortsError::Credentials(err)
}
}
impl From<HttpDispatchError> for OpenInstancePublicPortsError {
fn from(err: HttpDispatchError) -> OpenInstancePublicPortsError {
OpenInstancePublicPortsError::HttpDispatch(err)
}
}
impl From<io::Error> for OpenInstancePublicPortsError {
fn from(err: io::Error) -> OpenInstancePublicPortsError {
OpenInstancePublicPortsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for OpenInstancePublicPortsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for OpenInstancePublicPortsError {
fn description(&self) -> &str {
match *self {
OpenInstancePublicPortsError::AccessDenied(ref cause) => cause,
OpenInstancePublicPortsError::AccountSetupInProgress(ref cause) => cause,
OpenInstancePublicPortsError::InvalidInput(ref cause) => cause,
OpenInstancePublicPortsError::NotFound(ref cause) => cause,
OpenInstancePublicPortsError::OperationFailure(ref cause) => cause,
OpenInstancePublicPortsError::Service(ref cause) => cause,
OpenInstancePublicPortsError::Unauthenticated(ref cause) => cause,
OpenInstancePublicPortsError::Validation(ref cause) => cause,
OpenInstancePublicPortsError::Credentials(ref err) => err.description(),
OpenInstancePublicPortsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
OpenInstancePublicPortsError::ParseError(ref cause) => cause,
OpenInstancePublicPortsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PeerVpcError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PeerVpcError {
pub fn from_response(res: BufferedHttpResponse) -> PeerVpcError {
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 {
"AccessDeniedException" => {
return PeerVpcError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return PeerVpcError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return PeerVpcError::InvalidInput(String::from(error_message));
}
"NotFoundException" => return PeerVpcError::NotFound(String::from(error_message)),
"OperationFailureException" => {
return PeerVpcError::OperationFailure(String::from(error_message));
}
"ServiceException" => return PeerVpcError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return PeerVpcError::Unauthenticated(String::from(error_message));
}
"ValidationException" => return PeerVpcError::Validation(error_message.to_string()),
_ => {}
}
}
return PeerVpcError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PeerVpcError {
fn from(err: serde_json::error::Error) -> PeerVpcError {
PeerVpcError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PeerVpcError {
fn from(err: CredentialsError) -> PeerVpcError {
PeerVpcError::Credentials(err)
}
}
impl From<HttpDispatchError> for PeerVpcError {
fn from(err: HttpDispatchError) -> PeerVpcError {
PeerVpcError::HttpDispatch(err)
}
}
impl From<io::Error> for PeerVpcError {
fn from(err: io::Error) -> PeerVpcError {
PeerVpcError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PeerVpcError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PeerVpcError {
fn description(&self) -> &str {
match *self {
PeerVpcError::AccessDenied(ref cause) => cause,
PeerVpcError::AccountSetupInProgress(ref cause) => cause,
PeerVpcError::InvalidInput(ref cause) => cause,
PeerVpcError::NotFound(ref cause) => cause,
PeerVpcError::OperationFailure(ref cause) => cause,
PeerVpcError::Service(ref cause) => cause,
PeerVpcError::Unauthenticated(ref cause) => cause,
PeerVpcError::Validation(ref cause) => cause,
PeerVpcError::Credentials(ref err) => err.description(),
PeerVpcError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
PeerVpcError::ParseError(ref cause) => cause,
PeerVpcError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutInstancePublicPortsError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutInstancePublicPortsError {
pub fn from_response(res: BufferedHttpResponse) -> PutInstancePublicPortsError {
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 {
"AccessDeniedException" => {
return PutInstancePublicPortsError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return PutInstancePublicPortsError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return PutInstancePublicPortsError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return PutInstancePublicPortsError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return PutInstancePublicPortsError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return PutInstancePublicPortsError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return PutInstancePublicPortsError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return PutInstancePublicPortsError::Validation(error_message.to_string());
}
_ => {}
}
}
return PutInstancePublicPortsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutInstancePublicPortsError {
fn from(err: serde_json::error::Error) -> PutInstancePublicPortsError {
PutInstancePublicPortsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutInstancePublicPortsError {
fn from(err: CredentialsError) -> PutInstancePublicPortsError {
PutInstancePublicPortsError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutInstancePublicPortsError {
fn from(err: HttpDispatchError) -> PutInstancePublicPortsError {
PutInstancePublicPortsError::HttpDispatch(err)
}
}
impl From<io::Error> for PutInstancePublicPortsError {
fn from(err: io::Error) -> PutInstancePublicPortsError {
PutInstancePublicPortsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutInstancePublicPortsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutInstancePublicPortsError {
fn description(&self) -> &str {
match *self {
PutInstancePublicPortsError::AccessDenied(ref cause) => cause,
PutInstancePublicPortsError::AccountSetupInProgress(ref cause) => cause,
PutInstancePublicPortsError::InvalidInput(ref cause) => cause,
PutInstancePublicPortsError::NotFound(ref cause) => cause,
PutInstancePublicPortsError::OperationFailure(ref cause) => cause,
PutInstancePublicPortsError::Service(ref cause) => cause,
PutInstancePublicPortsError::Unauthenticated(ref cause) => cause,
PutInstancePublicPortsError::Validation(ref cause) => cause,
PutInstancePublicPortsError::Credentials(ref err) => err.description(),
PutInstancePublicPortsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
PutInstancePublicPortsError::ParseError(ref cause) => cause,
PutInstancePublicPortsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RebootInstanceError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RebootInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> RebootInstanceError {
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 {
"AccessDeniedException" => {
return RebootInstanceError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return RebootInstanceError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return RebootInstanceError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return RebootInstanceError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return RebootInstanceError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return RebootInstanceError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return RebootInstanceError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return RebootInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return RebootInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RebootInstanceError {
fn from(err: serde_json::error::Error) -> RebootInstanceError {
RebootInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RebootInstanceError {
fn from(err: CredentialsError) -> RebootInstanceError {
RebootInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for RebootInstanceError {
fn from(err: HttpDispatchError) -> RebootInstanceError {
RebootInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for RebootInstanceError {
fn from(err: io::Error) -> RebootInstanceError {
RebootInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RebootInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RebootInstanceError {
fn description(&self) -> &str {
match *self {
RebootInstanceError::AccessDenied(ref cause) => cause,
RebootInstanceError::AccountSetupInProgress(ref cause) => cause,
RebootInstanceError::InvalidInput(ref cause) => cause,
RebootInstanceError::NotFound(ref cause) => cause,
RebootInstanceError::OperationFailure(ref cause) => cause,
RebootInstanceError::Service(ref cause) => cause,
RebootInstanceError::Unauthenticated(ref cause) => cause,
RebootInstanceError::Validation(ref cause) => cause,
RebootInstanceError::Credentials(ref err) => err.description(),
RebootInstanceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
RebootInstanceError::ParseError(ref cause) => cause,
RebootInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RebootRelationalDatabaseError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RebootRelationalDatabaseError {
pub fn from_response(res: BufferedHttpResponse) -> RebootRelationalDatabaseError {
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 {
"AccessDeniedException" => {
return RebootRelationalDatabaseError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return RebootRelationalDatabaseError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return RebootRelationalDatabaseError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return RebootRelationalDatabaseError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return RebootRelationalDatabaseError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return RebootRelationalDatabaseError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return RebootRelationalDatabaseError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return RebootRelationalDatabaseError::Validation(error_message.to_string());
}
_ => {}
}
}
return RebootRelationalDatabaseError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RebootRelationalDatabaseError {
fn from(err: serde_json::error::Error) -> RebootRelationalDatabaseError {
RebootRelationalDatabaseError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RebootRelationalDatabaseError {
fn from(err: CredentialsError) -> RebootRelationalDatabaseError {
RebootRelationalDatabaseError::Credentials(err)
}
}
impl From<HttpDispatchError> for RebootRelationalDatabaseError {
fn from(err: HttpDispatchError) -> RebootRelationalDatabaseError {
RebootRelationalDatabaseError::HttpDispatch(err)
}
}
impl From<io::Error> for RebootRelationalDatabaseError {
fn from(err: io::Error) -> RebootRelationalDatabaseError {
RebootRelationalDatabaseError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RebootRelationalDatabaseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RebootRelationalDatabaseError {
fn description(&self) -> &str {
match *self {
RebootRelationalDatabaseError::AccessDenied(ref cause) => cause,
RebootRelationalDatabaseError::AccountSetupInProgress(ref cause) => cause,
RebootRelationalDatabaseError::InvalidInput(ref cause) => cause,
RebootRelationalDatabaseError::NotFound(ref cause) => cause,
RebootRelationalDatabaseError::OperationFailure(ref cause) => cause,
RebootRelationalDatabaseError::Service(ref cause) => cause,
RebootRelationalDatabaseError::Unauthenticated(ref cause) => cause,
RebootRelationalDatabaseError::Validation(ref cause) => cause,
RebootRelationalDatabaseError::Credentials(ref err) => err.description(),
RebootRelationalDatabaseError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
RebootRelationalDatabaseError::ParseError(ref cause) => cause,
RebootRelationalDatabaseError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ReleaseStaticIpError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ReleaseStaticIpError {
pub fn from_response(res: BufferedHttpResponse) -> ReleaseStaticIpError {
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 {
"AccessDeniedException" => {
return ReleaseStaticIpError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return ReleaseStaticIpError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return ReleaseStaticIpError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return ReleaseStaticIpError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return ReleaseStaticIpError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return ReleaseStaticIpError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return ReleaseStaticIpError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return ReleaseStaticIpError::Validation(error_message.to_string());
}
_ => {}
}
}
return ReleaseStaticIpError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ReleaseStaticIpError {
fn from(err: serde_json::error::Error) -> ReleaseStaticIpError {
ReleaseStaticIpError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ReleaseStaticIpError {
fn from(err: CredentialsError) -> ReleaseStaticIpError {
ReleaseStaticIpError::Credentials(err)
}
}
impl From<HttpDispatchError> for ReleaseStaticIpError {
fn from(err: HttpDispatchError) -> ReleaseStaticIpError {
ReleaseStaticIpError::HttpDispatch(err)
}
}
impl From<io::Error> for ReleaseStaticIpError {
fn from(err: io::Error) -> ReleaseStaticIpError {
ReleaseStaticIpError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ReleaseStaticIpError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ReleaseStaticIpError {
fn description(&self) -> &str {
match *self {
ReleaseStaticIpError::AccessDenied(ref cause) => cause,
ReleaseStaticIpError::AccountSetupInProgress(ref cause) => cause,
ReleaseStaticIpError::InvalidInput(ref cause) => cause,
ReleaseStaticIpError::NotFound(ref cause) => cause,
ReleaseStaticIpError::OperationFailure(ref cause) => cause,
ReleaseStaticIpError::Service(ref cause) => cause,
ReleaseStaticIpError::Unauthenticated(ref cause) => cause,
ReleaseStaticIpError::Validation(ref cause) => cause,
ReleaseStaticIpError::Credentials(ref err) => err.description(),
ReleaseStaticIpError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ReleaseStaticIpError::ParseError(ref cause) => cause,
ReleaseStaticIpError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartInstanceError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StartInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> StartInstanceError {
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 {
"AccessDeniedException" => {
return StartInstanceError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return StartInstanceError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return StartInstanceError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return StartInstanceError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return StartInstanceError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return StartInstanceError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return StartInstanceError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return StartInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return StartInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StartInstanceError {
fn from(err: serde_json::error::Error) -> StartInstanceError {
StartInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StartInstanceError {
fn from(err: CredentialsError) -> StartInstanceError {
StartInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for StartInstanceError {
fn from(err: HttpDispatchError) -> StartInstanceError {
StartInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for StartInstanceError {
fn from(err: io::Error) -> StartInstanceError {
StartInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StartInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartInstanceError {
fn description(&self) -> &str {
match *self {
StartInstanceError::AccessDenied(ref cause) => cause,
StartInstanceError::AccountSetupInProgress(ref cause) => cause,
StartInstanceError::InvalidInput(ref cause) => cause,
StartInstanceError::NotFound(ref cause) => cause,
StartInstanceError::OperationFailure(ref cause) => cause,
StartInstanceError::Service(ref cause) => cause,
StartInstanceError::Unauthenticated(ref cause) => cause,
StartInstanceError::Validation(ref cause) => cause,
StartInstanceError::Credentials(ref err) => err.description(),
StartInstanceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
StartInstanceError::ParseError(ref cause) => cause,
StartInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartRelationalDatabaseError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StartRelationalDatabaseError {
pub fn from_response(res: BufferedHttpResponse) -> StartRelationalDatabaseError {
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 {
"AccessDeniedException" => {
return StartRelationalDatabaseError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return StartRelationalDatabaseError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return StartRelationalDatabaseError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return StartRelationalDatabaseError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return StartRelationalDatabaseError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return StartRelationalDatabaseError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return StartRelationalDatabaseError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return StartRelationalDatabaseError::Validation(error_message.to_string());
}
_ => {}
}
}
return StartRelationalDatabaseError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StartRelationalDatabaseError {
fn from(err: serde_json::error::Error) -> StartRelationalDatabaseError {
StartRelationalDatabaseError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StartRelationalDatabaseError {
fn from(err: CredentialsError) -> StartRelationalDatabaseError {
StartRelationalDatabaseError::Credentials(err)
}
}
impl From<HttpDispatchError> for StartRelationalDatabaseError {
fn from(err: HttpDispatchError) -> StartRelationalDatabaseError {
StartRelationalDatabaseError::HttpDispatch(err)
}
}
impl From<io::Error> for StartRelationalDatabaseError {
fn from(err: io::Error) -> StartRelationalDatabaseError {
StartRelationalDatabaseError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StartRelationalDatabaseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartRelationalDatabaseError {
fn description(&self) -> &str {
match *self {
StartRelationalDatabaseError::AccessDenied(ref cause) => cause,
StartRelationalDatabaseError::AccountSetupInProgress(ref cause) => cause,
StartRelationalDatabaseError::InvalidInput(ref cause) => cause,
StartRelationalDatabaseError::NotFound(ref cause) => cause,
StartRelationalDatabaseError::OperationFailure(ref cause) => cause,
StartRelationalDatabaseError::Service(ref cause) => cause,
StartRelationalDatabaseError::Unauthenticated(ref cause) => cause,
StartRelationalDatabaseError::Validation(ref cause) => cause,
StartRelationalDatabaseError::Credentials(ref err) => err.description(),
StartRelationalDatabaseError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StartRelationalDatabaseError::ParseError(ref cause) => cause,
StartRelationalDatabaseError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopInstanceError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> StopInstanceError {
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 {
"AccessDeniedException" => {
return StopInstanceError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return StopInstanceError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return StopInstanceError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return StopInstanceError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return StopInstanceError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return StopInstanceError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return StopInstanceError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return StopInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopInstanceError {
fn from(err: serde_json::error::Error) -> StopInstanceError {
StopInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopInstanceError {
fn from(err: CredentialsError) -> StopInstanceError {
StopInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopInstanceError {
fn from(err: HttpDispatchError) -> StopInstanceError {
StopInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for StopInstanceError {
fn from(err: io::Error) -> StopInstanceError {
StopInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopInstanceError {
fn description(&self) -> &str {
match *self {
StopInstanceError::AccessDenied(ref cause) => cause,
StopInstanceError::AccountSetupInProgress(ref cause) => cause,
StopInstanceError::InvalidInput(ref cause) => cause,
StopInstanceError::NotFound(ref cause) => cause,
StopInstanceError::OperationFailure(ref cause) => cause,
StopInstanceError::Service(ref cause) => cause,
StopInstanceError::Unauthenticated(ref cause) => cause,
StopInstanceError::Validation(ref cause) => cause,
StopInstanceError::Credentials(ref err) => err.description(),
StopInstanceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
StopInstanceError::ParseError(ref cause) => cause,
StopInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopRelationalDatabaseError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopRelationalDatabaseError {
pub fn from_response(res: BufferedHttpResponse) -> StopRelationalDatabaseError {
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 {
"AccessDeniedException" => {
return StopRelationalDatabaseError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return StopRelationalDatabaseError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return StopRelationalDatabaseError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return StopRelationalDatabaseError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return StopRelationalDatabaseError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return StopRelationalDatabaseError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return StopRelationalDatabaseError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return StopRelationalDatabaseError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopRelationalDatabaseError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopRelationalDatabaseError {
fn from(err: serde_json::error::Error) -> StopRelationalDatabaseError {
StopRelationalDatabaseError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopRelationalDatabaseError {
fn from(err: CredentialsError) -> StopRelationalDatabaseError {
StopRelationalDatabaseError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopRelationalDatabaseError {
fn from(err: HttpDispatchError) -> StopRelationalDatabaseError {
StopRelationalDatabaseError::HttpDispatch(err)
}
}
impl From<io::Error> for StopRelationalDatabaseError {
fn from(err: io::Error) -> StopRelationalDatabaseError {
StopRelationalDatabaseError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopRelationalDatabaseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopRelationalDatabaseError {
fn description(&self) -> &str {
match *self {
StopRelationalDatabaseError::AccessDenied(ref cause) => cause,
StopRelationalDatabaseError::AccountSetupInProgress(ref cause) => cause,
StopRelationalDatabaseError::InvalidInput(ref cause) => cause,
StopRelationalDatabaseError::NotFound(ref cause) => cause,
StopRelationalDatabaseError::OperationFailure(ref cause) => cause,
StopRelationalDatabaseError::Service(ref cause) => cause,
StopRelationalDatabaseError::Unauthenticated(ref cause) => cause,
StopRelationalDatabaseError::Validation(ref cause) => cause,
StopRelationalDatabaseError::Credentials(ref err) => err.description(),
StopRelationalDatabaseError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StopRelationalDatabaseError::ParseError(ref cause) => cause,
StopRelationalDatabaseError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> TagResourceError {
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 {
"AccessDeniedException" => {
return TagResourceError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return TagResourceError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return TagResourceError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return TagResourceError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return TagResourceError::OperationFailure(String::from(error_message));
}
"ServiceException" => return TagResourceError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return TagResourceError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return TagResourceError::Validation(error_message.to_string());
}
_ => {}
}
}
return TagResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for TagResourceError {
fn from(err: serde_json::error::Error) -> TagResourceError {
TagResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for TagResourceError {
fn from(err: CredentialsError) -> TagResourceError {
TagResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for TagResourceError {
fn from(err: HttpDispatchError) -> TagResourceError {
TagResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for TagResourceError {
fn from(err: io::Error) -> TagResourceError {
TagResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::AccessDenied(ref cause) => cause,
TagResourceError::AccountSetupInProgress(ref cause) => cause,
TagResourceError::InvalidInput(ref cause) => cause,
TagResourceError::NotFound(ref cause) => cause,
TagResourceError::OperationFailure(ref cause) => cause,
TagResourceError::Service(ref cause) => cause,
TagResourceError::Unauthenticated(ref cause) => cause,
TagResourceError::Validation(ref cause) => cause,
TagResourceError::Credentials(ref err) => err.description(),
TagResourceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
TagResourceError::ParseError(ref cause) => cause,
TagResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UnpeerVpcError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UnpeerVpcError {
pub fn from_response(res: BufferedHttpResponse) -> UnpeerVpcError {
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 {
"AccessDeniedException" => {
return UnpeerVpcError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return UnpeerVpcError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return UnpeerVpcError::InvalidInput(String::from(error_message));
}
"NotFoundException" => return UnpeerVpcError::NotFound(String::from(error_message)),
"OperationFailureException" => {
return UnpeerVpcError::OperationFailure(String::from(error_message));
}
"ServiceException" => return UnpeerVpcError::Service(String::from(error_message)),
"UnauthenticatedException" => {
return UnpeerVpcError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return UnpeerVpcError::Validation(error_message.to_string());
}
_ => {}
}
}
return UnpeerVpcError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UnpeerVpcError {
fn from(err: serde_json::error::Error) -> UnpeerVpcError {
UnpeerVpcError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UnpeerVpcError {
fn from(err: CredentialsError) -> UnpeerVpcError {
UnpeerVpcError::Credentials(err)
}
}
impl From<HttpDispatchError> for UnpeerVpcError {
fn from(err: HttpDispatchError) -> UnpeerVpcError {
UnpeerVpcError::HttpDispatch(err)
}
}
impl From<io::Error> for UnpeerVpcError {
fn from(err: io::Error) -> UnpeerVpcError {
UnpeerVpcError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UnpeerVpcError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UnpeerVpcError {
fn description(&self) -> &str {
match *self {
UnpeerVpcError::AccessDenied(ref cause) => cause,
UnpeerVpcError::AccountSetupInProgress(ref cause) => cause,
UnpeerVpcError::InvalidInput(ref cause) => cause,
UnpeerVpcError::NotFound(ref cause) => cause,
UnpeerVpcError::OperationFailure(ref cause) => cause,
UnpeerVpcError::Service(ref cause) => cause,
UnpeerVpcError::Unauthenticated(ref cause) => cause,
UnpeerVpcError::Validation(ref cause) => cause,
UnpeerVpcError::Credentials(ref err) => err.description(),
UnpeerVpcError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UnpeerVpcError::ParseError(ref cause) => cause,
UnpeerVpcError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> UntagResourceError {
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 {
"AccessDeniedException" => {
return UntagResourceError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return UntagResourceError::AccountSetupInProgress(String::from(error_message));
}
"InvalidInputException" => {
return UntagResourceError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return UntagResourceError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return UntagResourceError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return UntagResourceError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return UntagResourceError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return UntagResourceError::Validation(error_message.to_string());
}
_ => {}
}
}
return UntagResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UntagResourceError {
fn from(err: serde_json::error::Error) -> UntagResourceError {
UntagResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UntagResourceError {
fn from(err: CredentialsError) -> UntagResourceError {
UntagResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for UntagResourceError {
fn from(err: HttpDispatchError) -> UntagResourceError {
UntagResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for UntagResourceError {
fn from(err: io::Error) -> UntagResourceError {
UntagResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::AccessDenied(ref cause) => cause,
UntagResourceError::AccountSetupInProgress(ref cause) => cause,
UntagResourceError::InvalidInput(ref cause) => cause,
UntagResourceError::NotFound(ref cause) => cause,
UntagResourceError::OperationFailure(ref cause) => cause,
UntagResourceError::Service(ref cause) => cause,
UntagResourceError::Unauthenticated(ref cause) => cause,
UntagResourceError::Validation(ref cause) => cause,
UntagResourceError::Credentials(ref err) => err.description(),
UntagResourceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UntagResourceError::ParseError(ref cause) => cause,
UntagResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDomainEntryError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateDomainEntryError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateDomainEntryError {
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 {
"AccessDeniedException" => {
return UpdateDomainEntryError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return UpdateDomainEntryError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return UpdateDomainEntryError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return UpdateDomainEntryError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return UpdateDomainEntryError::OperationFailure(String::from(error_message));
}
"ServiceException" => {
return UpdateDomainEntryError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return UpdateDomainEntryError::Unauthenticated(String::from(error_message));
}
"ValidationException" => {
return UpdateDomainEntryError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateDomainEntryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateDomainEntryError {
fn from(err: serde_json::error::Error) -> UpdateDomainEntryError {
UpdateDomainEntryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateDomainEntryError {
fn from(err: CredentialsError) -> UpdateDomainEntryError {
UpdateDomainEntryError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateDomainEntryError {
fn from(err: HttpDispatchError) -> UpdateDomainEntryError {
UpdateDomainEntryError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateDomainEntryError {
fn from(err: io::Error) -> UpdateDomainEntryError {
UpdateDomainEntryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateDomainEntryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDomainEntryError {
fn description(&self) -> &str {
match *self {
UpdateDomainEntryError::AccessDenied(ref cause) => cause,
UpdateDomainEntryError::AccountSetupInProgress(ref cause) => cause,
UpdateDomainEntryError::InvalidInput(ref cause) => cause,
UpdateDomainEntryError::NotFound(ref cause) => cause,
UpdateDomainEntryError::OperationFailure(ref cause) => cause,
UpdateDomainEntryError::Service(ref cause) => cause,
UpdateDomainEntryError::Unauthenticated(ref cause) => cause,
UpdateDomainEntryError::Validation(ref cause) => cause,
UpdateDomainEntryError::Credentials(ref err) => err.description(),
UpdateDomainEntryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateDomainEntryError::ParseError(ref cause) => cause,
UpdateDomainEntryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateLoadBalancerAttributeError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateLoadBalancerAttributeError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateLoadBalancerAttributeError {
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 {
"AccessDeniedException" => {
return UpdateLoadBalancerAttributeError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return UpdateLoadBalancerAttributeError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return UpdateLoadBalancerAttributeError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return UpdateLoadBalancerAttributeError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return UpdateLoadBalancerAttributeError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return UpdateLoadBalancerAttributeError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return UpdateLoadBalancerAttributeError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateLoadBalancerAttributeError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateLoadBalancerAttributeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateLoadBalancerAttributeError {
fn from(err: serde_json::error::Error) -> UpdateLoadBalancerAttributeError {
UpdateLoadBalancerAttributeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateLoadBalancerAttributeError {
fn from(err: CredentialsError) -> UpdateLoadBalancerAttributeError {
UpdateLoadBalancerAttributeError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateLoadBalancerAttributeError {
fn from(err: HttpDispatchError) -> UpdateLoadBalancerAttributeError {
UpdateLoadBalancerAttributeError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateLoadBalancerAttributeError {
fn from(err: io::Error) -> UpdateLoadBalancerAttributeError {
UpdateLoadBalancerAttributeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateLoadBalancerAttributeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateLoadBalancerAttributeError {
fn description(&self) -> &str {
match *self {
UpdateLoadBalancerAttributeError::AccessDenied(ref cause) => cause,
UpdateLoadBalancerAttributeError::AccountSetupInProgress(ref cause) => cause,
UpdateLoadBalancerAttributeError::InvalidInput(ref cause) => cause,
UpdateLoadBalancerAttributeError::NotFound(ref cause) => cause,
UpdateLoadBalancerAttributeError::OperationFailure(ref cause) => cause,
UpdateLoadBalancerAttributeError::Service(ref cause) => cause,
UpdateLoadBalancerAttributeError::Unauthenticated(ref cause) => cause,
UpdateLoadBalancerAttributeError::Validation(ref cause) => cause,
UpdateLoadBalancerAttributeError::Credentials(ref err) => err.description(),
UpdateLoadBalancerAttributeError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateLoadBalancerAttributeError::ParseError(ref cause) => cause,
UpdateLoadBalancerAttributeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateRelationalDatabaseError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateRelationalDatabaseError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateRelationalDatabaseError {
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 {
"AccessDeniedException" => {
return UpdateRelationalDatabaseError::AccessDenied(String::from(error_message));
}
"AccountSetupInProgressException" => {
return UpdateRelationalDatabaseError::AccountSetupInProgress(String::from(
error_message,
));
}
"InvalidInputException" => {
return UpdateRelationalDatabaseError::InvalidInput(String::from(error_message));
}
"NotFoundException" => {
return UpdateRelationalDatabaseError::NotFound(String::from(error_message));
}
"OperationFailureException" => {
return UpdateRelationalDatabaseError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return UpdateRelationalDatabaseError::Service(String::from(error_message));
}
"UnauthenticatedException" => {
return UpdateRelationalDatabaseError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateRelationalDatabaseError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateRelationalDatabaseError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateRelationalDatabaseError {
fn from(err: serde_json::error::Error) -> UpdateRelationalDatabaseError {
UpdateRelationalDatabaseError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateRelationalDatabaseError {
fn from(err: CredentialsError) -> UpdateRelationalDatabaseError {
UpdateRelationalDatabaseError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateRelationalDatabaseError {
fn from(err: HttpDispatchError) -> UpdateRelationalDatabaseError {
UpdateRelationalDatabaseError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateRelationalDatabaseError {
fn from(err: io::Error) -> UpdateRelationalDatabaseError {
UpdateRelationalDatabaseError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateRelationalDatabaseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateRelationalDatabaseError {
fn description(&self) -> &str {
match *self {
UpdateRelationalDatabaseError::AccessDenied(ref cause) => cause,
UpdateRelationalDatabaseError::AccountSetupInProgress(ref cause) => cause,
UpdateRelationalDatabaseError::InvalidInput(ref cause) => cause,
UpdateRelationalDatabaseError::NotFound(ref cause) => cause,
UpdateRelationalDatabaseError::OperationFailure(ref cause) => cause,
UpdateRelationalDatabaseError::Service(ref cause) => cause,
UpdateRelationalDatabaseError::Unauthenticated(ref cause) => cause,
UpdateRelationalDatabaseError::Validation(ref cause) => cause,
UpdateRelationalDatabaseError::Credentials(ref err) => err.description(),
UpdateRelationalDatabaseError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateRelationalDatabaseError::ParseError(ref cause) => cause,
UpdateRelationalDatabaseError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateRelationalDatabaseParametersError {
AccessDenied(String),
AccountSetupInProgress(String),
InvalidInput(String),
NotFound(String),
OperationFailure(String),
Service(String),
Unauthenticated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateRelationalDatabaseParametersError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateRelationalDatabaseParametersError {
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 {
"AccessDeniedException" => {
return UpdateRelationalDatabaseParametersError::AccessDenied(String::from(
error_message,
));
}
"AccountSetupInProgressException" => {
return UpdateRelationalDatabaseParametersError::AccountSetupInProgress(
String::from(error_message),
);
}
"InvalidInputException" => {
return UpdateRelationalDatabaseParametersError::InvalidInput(String::from(
error_message,
));
}
"NotFoundException" => {
return UpdateRelationalDatabaseParametersError::NotFound(String::from(
error_message,
));
}
"OperationFailureException" => {
return UpdateRelationalDatabaseParametersError::OperationFailure(String::from(
error_message,
));
}
"ServiceException" => {
return UpdateRelationalDatabaseParametersError::Service(String::from(
error_message,
));
}
"UnauthenticatedException" => {
return UpdateRelationalDatabaseParametersError::Unauthenticated(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateRelationalDatabaseParametersError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return UpdateRelationalDatabaseParametersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateRelationalDatabaseParametersError {
fn from(err: serde_json::error::Error) -> UpdateRelationalDatabaseParametersError {
UpdateRelationalDatabaseParametersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateRelationalDatabaseParametersError {
fn from(err: CredentialsError) -> UpdateRelationalDatabaseParametersError {
UpdateRelationalDatabaseParametersError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateRelationalDatabaseParametersError {
fn from(err: HttpDispatchError) -> UpdateRelationalDatabaseParametersError {
UpdateRelationalDatabaseParametersError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateRelationalDatabaseParametersError {
fn from(err: io::Error) -> UpdateRelationalDatabaseParametersError {
UpdateRelationalDatabaseParametersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateRelationalDatabaseParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateRelationalDatabaseParametersError {
fn description(&self) -> &str {
match *self {
UpdateRelationalDatabaseParametersError::AccessDenied(ref cause) => cause,
UpdateRelationalDatabaseParametersError::AccountSetupInProgress(ref cause) => cause,
UpdateRelationalDatabaseParametersError::InvalidInput(ref cause) => cause,
UpdateRelationalDatabaseParametersError::NotFound(ref cause) => cause,
UpdateRelationalDatabaseParametersError::OperationFailure(ref cause) => cause,
UpdateRelationalDatabaseParametersError::Service(ref cause) => cause,
UpdateRelationalDatabaseParametersError::Unauthenticated(ref cause) => cause,
UpdateRelationalDatabaseParametersError::Validation(ref cause) => cause,
UpdateRelationalDatabaseParametersError::Credentials(ref err) => err.description(),
UpdateRelationalDatabaseParametersError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateRelationalDatabaseParametersError::ParseError(ref cause) => cause,
UpdateRelationalDatabaseParametersError::Unknown(_) => "unknown error",
}
}
}
pub trait Lightsail {
fn allocate_static_ip(
&self,
input: AllocateStaticIpRequest,
) -> RusotoFuture<AllocateStaticIpResult, AllocateStaticIpError>;
fn attach_disk(
&self,
input: AttachDiskRequest,
) -> RusotoFuture<AttachDiskResult, AttachDiskError>;
fn attach_instances_to_load_balancer(
&self,
input: AttachInstancesToLoadBalancerRequest,
) -> RusotoFuture<AttachInstancesToLoadBalancerResult, AttachInstancesToLoadBalancerError>;
fn attach_load_balancer_tls_certificate(
&self,
input: AttachLoadBalancerTlsCertificateRequest,
) -> RusotoFuture<AttachLoadBalancerTlsCertificateResult, AttachLoadBalancerTlsCertificateError>;
fn attach_static_ip(
&self,
input: AttachStaticIpRequest,
) -> RusotoFuture<AttachStaticIpResult, AttachStaticIpError>;
fn close_instance_public_ports(
&self,
input: CloseInstancePublicPortsRequest,
) -> RusotoFuture<CloseInstancePublicPortsResult, CloseInstancePublicPortsError>;
fn copy_snapshot(
&self,
input: CopySnapshotRequest,
) -> RusotoFuture<CopySnapshotResult, CopySnapshotError>;
fn create_cloud_formation_stack(
&self,
input: CreateCloudFormationStackRequest,
) -> RusotoFuture<CreateCloudFormationStackResult, CreateCloudFormationStackError>;
fn create_disk(
&self,
input: CreateDiskRequest,
) -> RusotoFuture<CreateDiskResult, CreateDiskError>;
fn create_disk_from_snapshot(
&self,
input: CreateDiskFromSnapshotRequest,
) -> RusotoFuture<CreateDiskFromSnapshotResult, CreateDiskFromSnapshotError>;
fn create_disk_snapshot(
&self,
input: CreateDiskSnapshotRequest,
) -> RusotoFuture<CreateDiskSnapshotResult, CreateDiskSnapshotError>;
fn create_domain(
&self,
input: CreateDomainRequest,
) -> RusotoFuture<CreateDomainResult, CreateDomainError>;
fn create_domain_entry(
&self,
input: CreateDomainEntryRequest,
) -> RusotoFuture<CreateDomainEntryResult, CreateDomainEntryError>;
fn create_instance_snapshot(
&self,
input: CreateInstanceSnapshotRequest,
) -> RusotoFuture<CreateInstanceSnapshotResult, CreateInstanceSnapshotError>;
fn create_instances(
&self,
input: CreateInstancesRequest,
) -> RusotoFuture<CreateInstancesResult, CreateInstancesError>;
fn create_instances_from_snapshot(
&self,
input: CreateInstancesFromSnapshotRequest,
) -> RusotoFuture<CreateInstancesFromSnapshotResult, CreateInstancesFromSnapshotError>;
fn create_key_pair(
&self,
input: CreateKeyPairRequest,
) -> RusotoFuture<CreateKeyPairResult, CreateKeyPairError>;
fn create_load_balancer(
&self,
input: CreateLoadBalancerRequest,
) -> RusotoFuture<CreateLoadBalancerResult, CreateLoadBalancerError>;
fn create_load_balancer_tls_certificate(
&self,
input: CreateLoadBalancerTlsCertificateRequest,
) -> RusotoFuture<CreateLoadBalancerTlsCertificateResult, CreateLoadBalancerTlsCertificateError>;
fn create_relational_database(
&self,
input: CreateRelationalDatabaseRequest,
) -> RusotoFuture<CreateRelationalDatabaseResult, CreateRelationalDatabaseError>;
fn create_relational_database_from_snapshot(
&self,
input: CreateRelationalDatabaseFromSnapshotRequest,
) -> RusotoFuture<
CreateRelationalDatabaseFromSnapshotResult,
CreateRelationalDatabaseFromSnapshotError,
>;
fn create_relational_database_snapshot(
&self,
input: CreateRelationalDatabaseSnapshotRequest,
) -> RusotoFuture<CreateRelationalDatabaseSnapshotResult, CreateRelationalDatabaseSnapshotError>;
fn delete_disk(
&self,
input: DeleteDiskRequest,
) -> RusotoFuture<DeleteDiskResult, DeleteDiskError>;
fn delete_disk_snapshot(
&self,
input: DeleteDiskSnapshotRequest,
) -> RusotoFuture<DeleteDiskSnapshotResult, DeleteDiskSnapshotError>;
fn delete_domain(
&self,
input: DeleteDomainRequest,
) -> RusotoFuture<DeleteDomainResult, DeleteDomainError>;
fn delete_domain_entry(
&self,
input: DeleteDomainEntryRequest,
) -> RusotoFuture<DeleteDomainEntryResult, DeleteDomainEntryError>;
fn delete_instance(
&self,
input: DeleteInstanceRequest,
) -> RusotoFuture<DeleteInstanceResult, DeleteInstanceError>;
fn delete_instance_snapshot(
&self,
input: DeleteInstanceSnapshotRequest,
) -> RusotoFuture<DeleteInstanceSnapshotResult, DeleteInstanceSnapshotError>;
fn delete_key_pair(
&self,
input: DeleteKeyPairRequest,
) -> RusotoFuture<DeleteKeyPairResult, DeleteKeyPairError>;
fn delete_load_balancer(
&self,
input: DeleteLoadBalancerRequest,
) -> RusotoFuture<DeleteLoadBalancerResult, DeleteLoadBalancerError>;
fn delete_load_balancer_tls_certificate(
&self,
input: DeleteLoadBalancerTlsCertificateRequest,
) -> RusotoFuture<DeleteLoadBalancerTlsCertificateResult, DeleteLoadBalancerTlsCertificateError>;
fn delete_relational_database(
&self,
input: DeleteRelationalDatabaseRequest,
) -> RusotoFuture<DeleteRelationalDatabaseResult, DeleteRelationalDatabaseError>;
fn delete_relational_database_snapshot(
&self,
input: DeleteRelationalDatabaseSnapshotRequest,
) -> RusotoFuture<DeleteRelationalDatabaseSnapshotResult, DeleteRelationalDatabaseSnapshotError>;
fn detach_disk(
&self,
input: DetachDiskRequest,
) -> RusotoFuture<DetachDiskResult, DetachDiskError>;
fn detach_instances_from_load_balancer(
&self,
input: DetachInstancesFromLoadBalancerRequest,
) -> RusotoFuture<DetachInstancesFromLoadBalancerResult, DetachInstancesFromLoadBalancerError>;
fn detach_static_ip(
&self,
input: DetachStaticIpRequest,
) -> RusotoFuture<DetachStaticIpResult, DetachStaticIpError>;
fn download_default_key_pair(
&self,
) -> RusotoFuture<DownloadDefaultKeyPairResult, DownloadDefaultKeyPairError>;
fn export_snapshot(
&self,
input: ExportSnapshotRequest,
) -> RusotoFuture<ExportSnapshotResult, ExportSnapshotError>;
fn get_active_names(
&self,
input: GetActiveNamesRequest,
) -> RusotoFuture<GetActiveNamesResult, GetActiveNamesError>;
fn get_blueprints(
&self,
input: GetBlueprintsRequest,
) -> RusotoFuture<GetBlueprintsResult, GetBlueprintsError>;
fn get_bundles(
&self,
input: GetBundlesRequest,
) -> RusotoFuture<GetBundlesResult, GetBundlesError>;
fn get_cloud_formation_stack_records(
&self,
input: GetCloudFormationStackRecordsRequest,
) -> RusotoFuture<GetCloudFormationStackRecordsResult, GetCloudFormationStackRecordsError>;
fn get_disk(&self, input: GetDiskRequest) -> RusotoFuture<GetDiskResult, GetDiskError>;
fn get_disk_snapshot(
&self,
input: GetDiskSnapshotRequest,
) -> RusotoFuture<GetDiskSnapshotResult, GetDiskSnapshotError>;
fn get_disk_snapshots(
&self,
input: GetDiskSnapshotsRequest,
) -> RusotoFuture<GetDiskSnapshotsResult, GetDiskSnapshotsError>;
fn get_disks(&self, input: GetDisksRequest) -> RusotoFuture<GetDisksResult, GetDisksError>;
fn get_domain(&self, input: GetDomainRequest) -> RusotoFuture<GetDomainResult, GetDomainError>;
fn get_domains(
&self,
input: GetDomainsRequest,
) -> RusotoFuture<GetDomainsResult, GetDomainsError>;
fn get_export_snapshot_records(
&self,
input: GetExportSnapshotRecordsRequest,
) -> RusotoFuture<GetExportSnapshotRecordsResult, GetExportSnapshotRecordsError>;
fn get_instance(
&self,
input: GetInstanceRequest,
) -> RusotoFuture<GetInstanceResult, GetInstanceError>;
fn get_instance_access_details(
&self,
input: GetInstanceAccessDetailsRequest,
) -> RusotoFuture<GetInstanceAccessDetailsResult, GetInstanceAccessDetailsError>;
fn get_instance_metric_data(
&self,
input: GetInstanceMetricDataRequest,
) -> RusotoFuture<GetInstanceMetricDataResult, GetInstanceMetricDataError>;
fn get_instance_port_states(
&self,
input: GetInstancePortStatesRequest,
) -> RusotoFuture<GetInstancePortStatesResult, GetInstancePortStatesError>;
fn get_instance_snapshot(
&self,
input: GetInstanceSnapshotRequest,
) -> RusotoFuture<GetInstanceSnapshotResult, GetInstanceSnapshotError>;
fn get_instance_snapshots(
&self,
input: GetInstanceSnapshotsRequest,
) -> RusotoFuture<GetInstanceSnapshotsResult, GetInstanceSnapshotsError>;
fn get_instance_state(
&self,
input: GetInstanceStateRequest,
) -> RusotoFuture<GetInstanceStateResult, GetInstanceStateError>;
fn get_instances(
&self,
input: GetInstancesRequest,
) -> RusotoFuture<GetInstancesResult, GetInstancesError>;
fn get_key_pair(
&self,
input: GetKeyPairRequest,
) -> RusotoFuture<GetKeyPairResult, GetKeyPairError>;
fn get_key_pairs(
&self,
input: GetKeyPairsRequest,
) -> RusotoFuture<GetKeyPairsResult, GetKeyPairsError>;
fn get_load_balancer(
&self,
input: GetLoadBalancerRequest,
) -> RusotoFuture<GetLoadBalancerResult, GetLoadBalancerError>;
fn get_load_balancer_metric_data(
&self,
input: GetLoadBalancerMetricDataRequest,
) -> RusotoFuture<GetLoadBalancerMetricDataResult, GetLoadBalancerMetricDataError>;
fn get_load_balancer_tls_certificates(
&self,
input: GetLoadBalancerTlsCertificatesRequest,
) -> RusotoFuture<GetLoadBalancerTlsCertificatesResult, GetLoadBalancerTlsCertificatesError>;
fn get_load_balancers(
&self,
input: GetLoadBalancersRequest,
) -> RusotoFuture<GetLoadBalancersResult, GetLoadBalancersError>;
fn get_operation(
&self,
input: GetOperationRequest,
) -> RusotoFuture<GetOperationResult, GetOperationError>;
fn get_operations(
&self,
input: GetOperationsRequest,
) -> RusotoFuture<GetOperationsResult, GetOperationsError>;
fn get_operations_for_resource(
&self,
input: GetOperationsForResourceRequest,
) -> RusotoFuture<GetOperationsForResourceResult, GetOperationsForResourceError>;
fn get_regions(
&self,
input: GetRegionsRequest,
) -> RusotoFuture<GetRegionsResult, GetRegionsError>;
fn get_relational_database(
&self,
input: GetRelationalDatabaseRequest,
) -> RusotoFuture<GetRelationalDatabaseResult, GetRelationalDatabaseError>;
fn get_relational_database_blueprints(
&self,
input: GetRelationalDatabaseBlueprintsRequest,
) -> RusotoFuture<GetRelationalDatabaseBlueprintsResult, GetRelationalDatabaseBlueprintsError>;
fn get_relational_database_bundles(
&self,
input: GetRelationalDatabaseBundlesRequest,
) -> RusotoFuture<GetRelationalDatabaseBundlesResult, GetRelationalDatabaseBundlesError>;
fn get_relational_database_events(
&self,
input: GetRelationalDatabaseEventsRequest,
) -> RusotoFuture<GetRelationalDatabaseEventsResult, GetRelationalDatabaseEventsError>;
fn get_relational_database_log_events(
&self,
input: GetRelationalDatabaseLogEventsRequest,
) -> RusotoFuture<GetRelationalDatabaseLogEventsResult, GetRelationalDatabaseLogEventsError>;
fn get_relational_database_log_streams(
&self,
input: GetRelationalDatabaseLogStreamsRequest,
) -> RusotoFuture<GetRelationalDatabaseLogStreamsResult, GetRelationalDatabaseLogStreamsError>;
fn get_relational_database_master_user_password(
&self,
input: GetRelationalDatabaseMasterUserPasswordRequest,
) -> RusotoFuture<
GetRelationalDatabaseMasterUserPasswordResult,
GetRelationalDatabaseMasterUserPasswordError,
>;
fn get_relational_database_metric_data(
&self,
input: GetRelationalDatabaseMetricDataRequest,
) -> RusotoFuture<GetRelationalDatabaseMetricDataResult, GetRelationalDatabaseMetricDataError>;
fn get_relational_database_parameters(
&self,
input: GetRelationalDatabaseParametersRequest,
) -> RusotoFuture<GetRelationalDatabaseParametersResult, GetRelationalDatabaseParametersError>;
fn get_relational_database_snapshot(
&self,
input: GetRelationalDatabaseSnapshotRequest,
) -> RusotoFuture<GetRelationalDatabaseSnapshotResult, GetRelationalDatabaseSnapshotError>;
fn get_relational_database_snapshots(
&self,
input: GetRelationalDatabaseSnapshotsRequest,
) -> RusotoFuture<GetRelationalDatabaseSnapshotsResult, GetRelationalDatabaseSnapshotsError>;
fn get_relational_databases(
&self,
input: GetRelationalDatabasesRequest,
) -> RusotoFuture<GetRelationalDatabasesResult, GetRelationalDatabasesError>;
fn get_static_ip(
&self,
input: GetStaticIpRequest,
) -> RusotoFuture<GetStaticIpResult, GetStaticIpError>;
fn get_static_ips(
&self,
input: GetStaticIpsRequest,
) -> RusotoFuture<GetStaticIpsResult, GetStaticIpsError>;
fn import_key_pair(
&self,
input: ImportKeyPairRequest,
) -> RusotoFuture<ImportKeyPairResult, ImportKeyPairError>;
fn is_vpc_peered(&self) -> RusotoFuture<IsVpcPeeredResult, IsVpcPeeredError>;
fn open_instance_public_ports(
&self,
input: OpenInstancePublicPortsRequest,
) -> RusotoFuture<OpenInstancePublicPortsResult, OpenInstancePublicPortsError>;
fn peer_vpc(&self) -> RusotoFuture<PeerVpcResult, PeerVpcError>;
fn put_instance_public_ports(
&self,
input: PutInstancePublicPortsRequest,
) -> RusotoFuture<PutInstancePublicPortsResult, PutInstancePublicPortsError>;
fn reboot_instance(
&self,
input: RebootInstanceRequest,
) -> RusotoFuture<RebootInstanceResult, RebootInstanceError>;
fn reboot_relational_database(
&self,
input: RebootRelationalDatabaseRequest,
) -> RusotoFuture<RebootRelationalDatabaseResult, RebootRelationalDatabaseError>;
fn release_static_ip(
&self,
input: ReleaseStaticIpRequest,
) -> RusotoFuture<ReleaseStaticIpResult, ReleaseStaticIpError>;
fn start_instance(
&self,
input: StartInstanceRequest,
) -> RusotoFuture<StartInstanceResult, StartInstanceError>;
fn start_relational_database(
&self,
input: StartRelationalDatabaseRequest,
) -> RusotoFuture<StartRelationalDatabaseResult, StartRelationalDatabaseError>;
fn stop_instance(
&self,
input: StopInstanceRequest,
) -> RusotoFuture<StopInstanceResult, StopInstanceError>;
fn stop_relational_database(
&self,
input: StopRelationalDatabaseRequest,
) -> RusotoFuture<StopRelationalDatabaseResult, StopRelationalDatabaseError>;
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResult, TagResourceError>;
fn unpeer_vpc(&self) -> RusotoFuture<UnpeerVpcResult, UnpeerVpcError>;
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResult, UntagResourceError>;
fn update_domain_entry(
&self,
input: UpdateDomainEntryRequest,
) -> RusotoFuture<UpdateDomainEntryResult, UpdateDomainEntryError>;
fn update_load_balancer_attribute(
&self,
input: UpdateLoadBalancerAttributeRequest,
) -> RusotoFuture<UpdateLoadBalancerAttributeResult, UpdateLoadBalancerAttributeError>;
fn update_relational_database(
&self,
input: UpdateRelationalDatabaseRequest,
) -> RusotoFuture<UpdateRelationalDatabaseResult, UpdateRelationalDatabaseError>;
fn update_relational_database_parameters(
&self,
input: UpdateRelationalDatabaseParametersRequest,
) -> RusotoFuture<
UpdateRelationalDatabaseParametersResult,
UpdateRelationalDatabaseParametersError,
>;
}
#[derive(Clone)]
pub struct LightsailClient {
client: Client,
region: region::Region,
}
impl LightsailClient {
pub fn new(region: region::Region) -> LightsailClient {
LightsailClient {
client: Client::shared(),
region: region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> LightsailClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
LightsailClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region: region,
}
}
}
impl Lightsail for LightsailClient {
fn allocate_static_ip(
&self,
input: AllocateStaticIpRequest,
) -> RusotoFuture<AllocateStaticIpResult, AllocateStaticIpError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.AllocateStaticIp");
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::<AllocateStaticIpResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AllocateStaticIpError::from_response(response))),
)
}
})
}
fn attach_disk(
&self,
input: AttachDiskRequest,
) -> RusotoFuture<AttachDiskResult, AttachDiskError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.AttachDisk");
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::<AttachDiskResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AttachDiskError::from_response(response))),
)
}
})
}
fn attach_instances_to_load_balancer(
&self,
input: AttachInstancesToLoadBalancerRequest,
) -> RusotoFuture<AttachInstancesToLoadBalancerResult, AttachInstancesToLoadBalancerError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.AttachInstancesToLoadBalancer",
);
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::<AttachInstancesToLoadBalancerResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AttachInstancesToLoadBalancerError::from_response(response))
}))
}
})
}
fn attach_load_balancer_tls_certificate(
&self,
input: AttachLoadBalancerTlsCertificateRequest,
) -> RusotoFuture<AttachLoadBalancerTlsCertificateResult, AttachLoadBalancerTlsCertificateError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.AttachLoadBalancerTlsCertificate",
);
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::<AttachLoadBalancerTlsCertificateResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AttachLoadBalancerTlsCertificateError::from_response(
response,
))
}))
}
})
}
fn attach_static_ip(
&self,
input: AttachStaticIpRequest,
) -> RusotoFuture<AttachStaticIpResult, AttachStaticIpError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.AttachStaticIp");
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::<AttachStaticIpResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AttachStaticIpError::from_response(response))),
)
}
})
}
fn close_instance_public_ports(
&self,
input: CloseInstancePublicPortsRequest,
) -> RusotoFuture<CloseInstancePublicPortsResult, CloseInstancePublicPortsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.CloseInstancePublicPorts",
);
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::<CloseInstancePublicPortsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CloseInstancePublicPortsError::from_response(response))
}))
}
})
}
fn copy_snapshot(
&self,
input: CopySnapshotRequest,
) -> RusotoFuture<CopySnapshotResult, CopySnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CopySnapshot");
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::<CopySnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CopySnapshotError::from_response(response))),
)
}
})
}
fn create_cloud_formation_stack(
&self,
input: CreateCloudFormationStackRequest,
) -> RusotoFuture<CreateCloudFormationStackResult, CreateCloudFormationStackError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.CreateCloudFormationStack",
);
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::<CreateCloudFormationStackResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateCloudFormationStackError::from_response(response))
}))
}
})
}
fn create_disk(
&self,
input: CreateDiskRequest,
) -> RusotoFuture<CreateDiskResult, CreateDiskError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateDisk");
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::<CreateDiskResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDiskError::from_response(response))),
)
}
})
}
fn create_disk_from_snapshot(
&self,
input: CreateDiskFromSnapshotRequest,
) -> RusotoFuture<CreateDiskFromSnapshotResult, CreateDiskFromSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateDiskFromSnapshot");
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::<CreateDiskFromSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateDiskFromSnapshotError::from_response(response))
}),
)
}
})
}
fn create_disk_snapshot(
&self,
input: CreateDiskSnapshotRequest,
) -> RusotoFuture<CreateDiskSnapshotResult, CreateDiskSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateDiskSnapshot");
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::<CreateDiskSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDiskSnapshotError::from_response(response))),
)
}
})
}
fn create_domain(
&self,
input: CreateDomainRequest,
) -> RusotoFuture<CreateDomainResult, CreateDomainError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateDomain");
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::<CreateDomainResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDomainError::from_response(response))),
)
}
})
}
fn create_domain_entry(
&self,
input: CreateDomainEntryRequest,
) -> RusotoFuture<CreateDomainEntryResult, CreateDomainEntryError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateDomainEntry");
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::<CreateDomainEntryResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDomainEntryError::from_response(response))),
)
}
})
}
fn create_instance_snapshot(
&self,
input: CreateInstanceSnapshotRequest,
) -> RusotoFuture<CreateInstanceSnapshotResult, CreateInstanceSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateInstanceSnapshot");
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::<CreateInstanceSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateInstanceSnapshotError::from_response(response))
}),
)
}
})
}
fn create_instances(
&self,
input: CreateInstancesRequest,
) -> RusotoFuture<CreateInstancesResult, CreateInstancesError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateInstances");
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::<CreateInstancesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateInstancesError::from_response(response))),
)
}
})
}
fn create_instances_from_snapshot(
&self,
input: CreateInstancesFromSnapshotRequest,
) -> RusotoFuture<CreateInstancesFromSnapshotResult, CreateInstancesFromSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.CreateInstancesFromSnapshot",
);
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::<CreateInstancesFromSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateInstancesFromSnapshotError::from_response(response))
}))
}
})
}
fn create_key_pair(
&self,
input: CreateKeyPairRequest,
) -> RusotoFuture<CreateKeyPairResult, CreateKeyPairError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateKeyPair");
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::<CreateKeyPairResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateKeyPairError::from_response(response))),
)
}
})
}
fn create_load_balancer(
&self,
input: CreateLoadBalancerRequest,
) -> RusotoFuture<CreateLoadBalancerResult, CreateLoadBalancerError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.CreateLoadBalancer");
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::<CreateLoadBalancerResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateLoadBalancerError::from_response(response))),
)
}
})
}
fn create_load_balancer_tls_certificate(
&self,
input: CreateLoadBalancerTlsCertificateRequest,
) -> RusotoFuture<CreateLoadBalancerTlsCertificateResult, CreateLoadBalancerTlsCertificateError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.CreateLoadBalancerTlsCertificate",
);
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::<CreateLoadBalancerTlsCertificateResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateLoadBalancerTlsCertificateError::from_response(
response,
))
}))
}
})
}
fn create_relational_database(
&self,
input: CreateRelationalDatabaseRequest,
) -> RusotoFuture<CreateRelationalDatabaseResult, CreateRelationalDatabaseError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.CreateRelationalDatabase",
);
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::<CreateRelationalDatabaseResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateRelationalDatabaseError::from_response(response))
}))
}
})
}
fn create_relational_database_from_snapshot(
&self,
input: CreateRelationalDatabaseFromSnapshotRequest,
) -> RusotoFuture<
CreateRelationalDatabaseFromSnapshotResult,
CreateRelationalDatabaseFromSnapshotError,
> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.CreateRelationalDatabaseFromSnapshot",
);
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::<CreateRelationalDatabaseFromSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateRelationalDatabaseFromSnapshotError::from_response(
response,
))
}))
}
})
}
fn create_relational_database_snapshot(
&self,
input: CreateRelationalDatabaseSnapshotRequest,
) -> RusotoFuture<CreateRelationalDatabaseSnapshotResult, CreateRelationalDatabaseSnapshotError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.CreateRelationalDatabaseSnapshot",
);
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::<CreateRelationalDatabaseSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateRelationalDatabaseSnapshotError::from_response(
response,
))
}))
}
})
}
fn delete_disk(
&self,
input: DeleteDiskRequest,
) -> RusotoFuture<DeleteDiskResult, DeleteDiskError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DeleteDisk");
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::<DeleteDiskResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDiskError::from_response(response))),
)
}
})
}
fn delete_disk_snapshot(
&self,
input: DeleteDiskSnapshotRequest,
) -> RusotoFuture<DeleteDiskSnapshotResult, DeleteDiskSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DeleteDiskSnapshot");
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::<DeleteDiskSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDiskSnapshotError::from_response(response))),
)
}
})
}
fn delete_domain(
&self,
input: DeleteDomainRequest,
) -> RusotoFuture<DeleteDomainResult, DeleteDomainError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DeleteDomain");
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::<DeleteDomainResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDomainError::from_response(response))),
)
}
})
}
fn delete_domain_entry(
&self,
input: DeleteDomainEntryRequest,
) -> RusotoFuture<DeleteDomainEntryResult, DeleteDomainEntryError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DeleteDomainEntry");
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::<DeleteDomainEntryResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDomainEntryError::from_response(response))),
)
}
})
}
fn delete_instance(
&self,
input: DeleteInstanceRequest,
) -> RusotoFuture<DeleteInstanceResult, DeleteInstanceError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DeleteInstance");
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::<DeleteInstanceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteInstanceError::from_response(response))),
)
}
})
}
fn delete_instance_snapshot(
&self,
input: DeleteInstanceSnapshotRequest,
) -> RusotoFuture<DeleteInstanceSnapshotResult, DeleteInstanceSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DeleteInstanceSnapshot");
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::<DeleteInstanceSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteInstanceSnapshotError::from_response(response))
}),
)
}
})
}
fn delete_key_pair(
&self,
input: DeleteKeyPairRequest,
) -> RusotoFuture<DeleteKeyPairResult, DeleteKeyPairError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DeleteKeyPair");
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::<DeleteKeyPairResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteKeyPairError::from_response(response))),
)
}
})
}
fn delete_load_balancer(
&self,
input: DeleteLoadBalancerRequest,
) -> RusotoFuture<DeleteLoadBalancerResult, DeleteLoadBalancerError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DeleteLoadBalancer");
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::<DeleteLoadBalancerResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteLoadBalancerError::from_response(response))),
)
}
})
}
fn delete_load_balancer_tls_certificate(
&self,
input: DeleteLoadBalancerTlsCertificateRequest,
) -> RusotoFuture<DeleteLoadBalancerTlsCertificateResult, DeleteLoadBalancerTlsCertificateError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.DeleteLoadBalancerTlsCertificate",
);
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::<DeleteLoadBalancerTlsCertificateResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteLoadBalancerTlsCertificateError::from_response(
response,
))
}))
}
})
}
fn delete_relational_database(
&self,
input: DeleteRelationalDatabaseRequest,
) -> RusotoFuture<DeleteRelationalDatabaseResult, DeleteRelationalDatabaseError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.DeleteRelationalDatabase",
);
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::<DeleteRelationalDatabaseResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteRelationalDatabaseError::from_response(response))
}))
}
})
}
fn delete_relational_database_snapshot(
&self,
input: DeleteRelationalDatabaseSnapshotRequest,
) -> RusotoFuture<DeleteRelationalDatabaseSnapshotResult, DeleteRelationalDatabaseSnapshotError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.DeleteRelationalDatabaseSnapshot",
);
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::<DeleteRelationalDatabaseSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteRelationalDatabaseSnapshotError::from_response(
response,
))
}))
}
})
}
fn detach_disk(
&self,
input: DetachDiskRequest,
) -> RusotoFuture<DetachDiskResult, DetachDiskError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DetachDisk");
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::<DetachDiskResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DetachDiskError::from_response(response))),
)
}
})
}
fn detach_instances_from_load_balancer(
&self,
input: DetachInstancesFromLoadBalancerRequest,
) -> RusotoFuture<DetachInstancesFromLoadBalancerResult, DetachInstancesFromLoadBalancerError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.DetachInstancesFromLoadBalancer",
);
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::<DetachInstancesFromLoadBalancerResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DetachInstancesFromLoadBalancerError::from_response(
response,
))
}))
}
})
}
fn detach_static_ip(
&self,
input: DetachStaticIpRequest,
) -> RusotoFuture<DetachStaticIpResult, DetachStaticIpError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DetachStaticIp");
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::<DetachStaticIpResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DetachStaticIpError::from_response(response))),
)
}
})
}
fn download_default_key_pair(
&self,
) -> RusotoFuture<DownloadDefaultKeyPairResult, DownloadDefaultKeyPairError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.DownloadDefaultKeyPair");
request.set_payload(Some(b"{}".to_vec()));
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::<DownloadDefaultKeyPairResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DownloadDefaultKeyPairError::from_response(response))
}),
)
}
})
}
fn export_snapshot(
&self,
input: ExportSnapshotRequest,
) -> RusotoFuture<ExportSnapshotResult, ExportSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.ExportSnapshot");
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::<ExportSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ExportSnapshotError::from_response(response))),
)
}
})
}
fn get_active_names(
&self,
input: GetActiveNamesRequest,
) -> RusotoFuture<GetActiveNamesResult, GetActiveNamesError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetActiveNames");
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::<GetActiveNamesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetActiveNamesError::from_response(response))),
)
}
})
}
fn get_blueprints(
&self,
input: GetBlueprintsRequest,
) -> RusotoFuture<GetBlueprintsResult, GetBlueprintsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetBlueprints");
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::<GetBlueprintsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetBlueprintsError::from_response(response))),
)
}
})
}
fn get_bundles(
&self,
input: GetBundlesRequest,
) -> RusotoFuture<GetBundlesResult, GetBundlesError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetBundles");
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::<GetBundlesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetBundlesError::from_response(response))),
)
}
})
}
fn get_cloud_formation_stack_records(
&self,
input: GetCloudFormationStackRecordsRequest,
) -> RusotoFuture<GetCloudFormationStackRecordsResult, GetCloudFormationStackRecordsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetCloudFormationStackRecords",
);
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::<GetCloudFormationStackRecordsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetCloudFormationStackRecordsError::from_response(response))
}))
}
})
}
fn get_disk(&self, input: GetDiskRequest) -> RusotoFuture<GetDiskResult, GetDiskError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetDisk");
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::<GetDiskResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDiskError::from_response(response))),
)
}
})
}
fn get_disk_snapshot(
&self,
input: GetDiskSnapshotRequest,
) -> RusotoFuture<GetDiskSnapshotResult, GetDiskSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetDiskSnapshot");
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::<GetDiskSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDiskSnapshotError::from_response(response))),
)
}
})
}
fn get_disk_snapshots(
&self,
input: GetDiskSnapshotsRequest,
) -> RusotoFuture<GetDiskSnapshotsResult, GetDiskSnapshotsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetDiskSnapshots");
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::<GetDiskSnapshotsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDiskSnapshotsError::from_response(response))),
)
}
})
}
fn get_disks(&self, input: GetDisksRequest) -> RusotoFuture<GetDisksResult, GetDisksError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetDisks");
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::<GetDisksResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDisksError::from_response(response))),
)
}
})
}
fn get_domain(&self, input: GetDomainRequest) -> RusotoFuture<GetDomainResult, GetDomainError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetDomain");
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::<GetDomainResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDomainError::from_response(response))),
)
}
})
}
fn get_domains(
&self,
input: GetDomainsRequest,
) -> RusotoFuture<GetDomainsResult, GetDomainsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetDomains");
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::<GetDomainsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDomainsError::from_response(response))),
)
}
})
}
fn get_export_snapshot_records(
&self,
input: GetExportSnapshotRecordsRequest,
) -> RusotoFuture<GetExportSnapshotRecordsResult, GetExportSnapshotRecordsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetExportSnapshotRecords",
);
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::<GetExportSnapshotRecordsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetExportSnapshotRecordsError::from_response(response))
}))
}
})
}
fn get_instance(
&self,
input: GetInstanceRequest,
) -> RusotoFuture<GetInstanceResult, GetInstanceError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetInstance");
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::<GetInstanceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetInstanceError::from_response(response))),
)
}
})
}
fn get_instance_access_details(
&self,
input: GetInstanceAccessDetailsRequest,
) -> RusotoFuture<GetInstanceAccessDetailsResult, GetInstanceAccessDetailsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetInstanceAccessDetails",
);
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::<GetInstanceAccessDetailsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetInstanceAccessDetailsError::from_response(response))
}))
}
})
}
fn get_instance_metric_data(
&self,
input: GetInstanceMetricDataRequest,
) -> RusotoFuture<GetInstanceMetricDataResult, GetInstanceMetricDataError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetInstanceMetricData");
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::<GetInstanceMetricDataResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetInstanceMetricDataError::from_response(response))
}),
)
}
})
}
fn get_instance_port_states(
&self,
input: GetInstancePortStatesRequest,
) -> RusotoFuture<GetInstancePortStatesResult, GetInstancePortStatesError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetInstancePortStates");
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::<GetInstancePortStatesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetInstancePortStatesError::from_response(response))
}),
)
}
})
}
fn get_instance_snapshot(
&self,
input: GetInstanceSnapshotRequest,
) -> RusotoFuture<GetInstanceSnapshotResult, GetInstanceSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetInstanceSnapshot");
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::<GetInstanceSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetInstanceSnapshotError::from_response(response))
}),
)
}
})
}
fn get_instance_snapshots(
&self,
input: GetInstanceSnapshotsRequest,
) -> RusotoFuture<GetInstanceSnapshotsResult, GetInstanceSnapshotsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetInstanceSnapshots");
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::<GetInstanceSnapshotsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetInstanceSnapshotsError::from_response(response))
}),
)
}
})
}
fn get_instance_state(
&self,
input: GetInstanceStateRequest,
) -> RusotoFuture<GetInstanceStateResult, GetInstanceStateError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetInstanceState");
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::<GetInstanceStateResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetInstanceStateError::from_response(response))),
)
}
})
}
fn get_instances(
&self,
input: GetInstancesRequest,
) -> RusotoFuture<GetInstancesResult, GetInstancesError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetInstances");
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::<GetInstancesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetInstancesError::from_response(response))),
)
}
})
}
fn get_key_pair(
&self,
input: GetKeyPairRequest,
) -> RusotoFuture<GetKeyPairResult, GetKeyPairError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetKeyPair");
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::<GetKeyPairResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetKeyPairError::from_response(response))),
)
}
})
}
fn get_key_pairs(
&self,
input: GetKeyPairsRequest,
) -> RusotoFuture<GetKeyPairsResult, GetKeyPairsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetKeyPairs");
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::<GetKeyPairsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetKeyPairsError::from_response(response))),
)
}
})
}
fn get_load_balancer(
&self,
input: GetLoadBalancerRequest,
) -> RusotoFuture<GetLoadBalancerResult, GetLoadBalancerError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetLoadBalancer");
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::<GetLoadBalancerResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetLoadBalancerError::from_response(response))),
)
}
})
}
fn get_load_balancer_metric_data(
&self,
input: GetLoadBalancerMetricDataRequest,
) -> RusotoFuture<GetLoadBalancerMetricDataResult, GetLoadBalancerMetricDataError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetLoadBalancerMetricData",
);
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::<GetLoadBalancerMetricDataResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetLoadBalancerMetricDataError::from_response(response))
}))
}
})
}
fn get_load_balancer_tls_certificates(
&self,
input: GetLoadBalancerTlsCertificatesRequest,
) -> RusotoFuture<GetLoadBalancerTlsCertificatesResult, GetLoadBalancerTlsCertificatesError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetLoadBalancerTlsCertificates",
);
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::<GetLoadBalancerTlsCertificatesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetLoadBalancerTlsCertificatesError::from_response(response))
}))
}
})
}
fn get_load_balancers(
&self,
input: GetLoadBalancersRequest,
) -> RusotoFuture<GetLoadBalancersResult, GetLoadBalancersError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetLoadBalancers");
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::<GetLoadBalancersResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetLoadBalancersError::from_response(response))),
)
}
})
}
fn get_operation(
&self,
input: GetOperationRequest,
) -> RusotoFuture<GetOperationResult, GetOperationError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetOperation");
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::<GetOperationResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetOperationError::from_response(response))),
)
}
})
}
fn get_operations(
&self,
input: GetOperationsRequest,
) -> RusotoFuture<GetOperationsResult, GetOperationsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetOperations");
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::<GetOperationsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetOperationsError::from_response(response))),
)
}
})
}
fn get_operations_for_resource(
&self,
input: GetOperationsForResourceRequest,
) -> RusotoFuture<GetOperationsForResourceResult, GetOperationsForResourceError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetOperationsForResource",
);
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::<GetOperationsForResourceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetOperationsForResourceError::from_response(response))
}))
}
})
}
fn get_regions(
&self,
input: GetRegionsRequest,
) -> RusotoFuture<GetRegionsResult, GetRegionsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetRegions");
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::<GetRegionsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetRegionsError::from_response(response))),
)
}
})
}
fn get_relational_database(
&self,
input: GetRelationalDatabaseRequest,
) -> RusotoFuture<GetRelationalDatabaseResult, GetRelationalDatabaseError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetRelationalDatabase");
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::<GetRelationalDatabaseResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseError::from_response(response))
}),
)
}
})
}
fn get_relational_database_blueprints(
&self,
input: GetRelationalDatabaseBlueprintsRequest,
) -> RusotoFuture<GetRelationalDatabaseBlueprintsResult, GetRelationalDatabaseBlueprintsError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseBlueprints",
);
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::<GetRelationalDatabaseBlueprintsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseBlueprintsError::from_response(
response,
))
}))
}
})
}
fn get_relational_database_bundles(
&self,
input: GetRelationalDatabaseBundlesRequest,
) -> RusotoFuture<GetRelationalDatabaseBundlesResult, GetRelationalDatabaseBundlesError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseBundles",
);
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::<GetRelationalDatabaseBundlesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseBundlesError::from_response(response))
}))
}
})
}
fn get_relational_database_events(
&self,
input: GetRelationalDatabaseEventsRequest,
) -> RusotoFuture<GetRelationalDatabaseEventsResult, GetRelationalDatabaseEventsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseEvents",
);
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::<GetRelationalDatabaseEventsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseEventsError::from_response(response))
}))
}
})
}
fn get_relational_database_log_events(
&self,
input: GetRelationalDatabaseLogEventsRequest,
) -> RusotoFuture<GetRelationalDatabaseLogEventsResult, GetRelationalDatabaseLogEventsError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseLogEvents",
);
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::<GetRelationalDatabaseLogEventsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseLogEventsError::from_response(response))
}))
}
})
}
fn get_relational_database_log_streams(
&self,
input: GetRelationalDatabaseLogStreamsRequest,
) -> RusotoFuture<GetRelationalDatabaseLogStreamsResult, GetRelationalDatabaseLogStreamsError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseLogStreams",
);
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::<GetRelationalDatabaseLogStreamsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseLogStreamsError::from_response(
response,
))
}))
}
})
}
fn get_relational_database_master_user_password(
&self,
input: GetRelationalDatabaseMasterUserPasswordRequest,
) -> RusotoFuture<
GetRelationalDatabaseMasterUserPasswordResult,
GetRelationalDatabaseMasterUserPasswordError,
> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseMasterUserPassword",
);
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::<GetRelationalDatabaseMasterUserPasswordResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseMasterUserPasswordError::from_response(
response,
))
}))
}
})
}
fn get_relational_database_metric_data(
&self,
input: GetRelationalDatabaseMetricDataRequest,
) -> RusotoFuture<GetRelationalDatabaseMetricDataResult, GetRelationalDatabaseMetricDataError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseMetricData",
);
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::<GetRelationalDatabaseMetricDataResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseMetricDataError::from_response(
response,
))
}))
}
})
}
fn get_relational_database_parameters(
&self,
input: GetRelationalDatabaseParametersRequest,
) -> RusotoFuture<GetRelationalDatabaseParametersResult, GetRelationalDatabaseParametersError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseParameters",
);
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::<GetRelationalDatabaseParametersResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseParametersError::from_response(
response,
))
}))
}
})
}
fn get_relational_database_snapshot(
&self,
input: GetRelationalDatabaseSnapshotRequest,
) -> RusotoFuture<GetRelationalDatabaseSnapshotResult, GetRelationalDatabaseSnapshotError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseSnapshot",
);
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::<GetRelationalDatabaseSnapshotResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseSnapshotError::from_response(response))
}))
}
})
}
fn get_relational_database_snapshots(
&self,
input: GetRelationalDatabaseSnapshotsRequest,
) -> RusotoFuture<GetRelationalDatabaseSnapshotsResult, GetRelationalDatabaseSnapshotsError>
{
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.GetRelationalDatabaseSnapshots",
);
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::<GetRelationalDatabaseSnapshotsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabaseSnapshotsError::from_response(response))
}))
}
})
}
fn get_relational_databases(
&self,
input: GetRelationalDatabasesRequest,
) -> RusotoFuture<GetRelationalDatabasesResult, GetRelationalDatabasesError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetRelationalDatabases");
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::<GetRelationalDatabasesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetRelationalDatabasesError::from_response(response))
}),
)
}
})
}
fn get_static_ip(
&self,
input: GetStaticIpRequest,
) -> RusotoFuture<GetStaticIpResult, GetStaticIpError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetStaticIp");
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::<GetStaticIpResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetStaticIpError::from_response(response))),
)
}
})
}
fn get_static_ips(
&self,
input: GetStaticIpsRequest,
) -> RusotoFuture<GetStaticIpsResult, GetStaticIpsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.GetStaticIps");
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::<GetStaticIpsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetStaticIpsError::from_response(response))),
)
}
})
}
fn import_key_pair(
&self,
input: ImportKeyPairRequest,
) -> RusotoFuture<ImportKeyPairResult, ImportKeyPairError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.ImportKeyPair");
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::<ImportKeyPairResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ImportKeyPairError::from_response(response))),
)
}
})
}
fn is_vpc_peered(&self) -> RusotoFuture<IsVpcPeeredResult, IsVpcPeeredError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.IsVpcPeered");
request.set_payload(Some(b"{}".to_vec()));
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::<IsVpcPeeredResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(IsVpcPeeredError::from_response(response))),
)
}
})
}
fn open_instance_public_ports(
&self,
input: OpenInstancePublicPortsRequest,
) -> RusotoFuture<OpenInstancePublicPortsResult, OpenInstancePublicPortsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.OpenInstancePublicPorts");
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::<OpenInstancePublicPortsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(OpenInstancePublicPortsError::from_response(response))
}))
}
})
}
fn peer_vpc(&self) -> RusotoFuture<PeerVpcResult, PeerVpcError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.PeerVpc");
request.set_payload(Some(b"{}".to_vec()));
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::<PeerVpcResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PeerVpcError::from_response(response))),
)
}
})
}
fn put_instance_public_ports(
&self,
input: PutInstancePublicPortsRequest,
) -> RusotoFuture<PutInstancePublicPortsResult, PutInstancePublicPortsError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.PutInstancePublicPorts");
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::<PutInstancePublicPortsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutInstancePublicPortsError::from_response(response))
}),
)
}
})
}
fn reboot_instance(
&self,
input: RebootInstanceRequest,
) -> RusotoFuture<RebootInstanceResult, RebootInstanceError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.RebootInstance");
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::<RebootInstanceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RebootInstanceError::from_response(response))),
)
}
})
}
fn reboot_relational_database(
&self,
input: RebootRelationalDatabaseRequest,
) -> RusotoFuture<RebootRelationalDatabaseResult, RebootRelationalDatabaseError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.RebootRelationalDatabase",
);
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::<RebootRelationalDatabaseResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RebootRelationalDatabaseError::from_response(response))
}))
}
})
}
fn release_static_ip(
&self,
input: ReleaseStaticIpRequest,
) -> RusotoFuture<ReleaseStaticIpResult, ReleaseStaticIpError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.ReleaseStaticIp");
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::<ReleaseStaticIpResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ReleaseStaticIpError::from_response(response))),
)
}
})
}
fn start_instance(
&self,
input: StartInstanceRequest,
) -> RusotoFuture<StartInstanceResult, StartInstanceError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.StartInstance");
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::<StartInstanceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StartInstanceError::from_response(response))),
)
}
})
}
fn start_relational_database(
&self,
input: StartRelationalDatabaseRequest,
) -> RusotoFuture<StartRelationalDatabaseResult, StartRelationalDatabaseError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.StartRelationalDatabase");
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::<StartRelationalDatabaseResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartRelationalDatabaseError::from_response(response))
}))
}
})
}
fn stop_instance(
&self,
input: StopInstanceRequest,
) -> RusotoFuture<StopInstanceResult, StopInstanceError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.StopInstance");
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::<StopInstanceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopInstanceError::from_response(response))),
)
}
})
}
fn stop_relational_database(
&self,
input: StopRelationalDatabaseRequest,
) -> RusotoFuture<StopRelationalDatabaseResult, StopRelationalDatabaseError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.StopRelationalDatabase");
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::<StopRelationalDatabaseResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(StopRelationalDatabaseError::from_response(response))
}),
)
}
})
}
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResult, TagResourceError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.TagResource");
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::<TagResourceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn unpeer_vpc(&self) -> RusotoFuture<UnpeerVpcResult, UnpeerVpcError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.UnpeerVpc");
request.set_payload(Some(b"{}".to_vec()));
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::<UnpeerVpcResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UnpeerVpcError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResult, UntagResourceError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.UntagResource");
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::<UntagResourceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_domain_entry(
&self,
input: UpdateDomainEntryRequest,
) -> RusotoFuture<UpdateDomainEntryResult, UpdateDomainEntryError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Lightsail_20161128.UpdateDomainEntry");
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::<UpdateDomainEntryResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateDomainEntryError::from_response(response))),
)
}
})
}
fn update_load_balancer_attribute(
&self,
input: UpdateLoadBalancerAttributeRequest,
) -> RusotoFuture<UpdateLoadBalancerAttributeResult, UpdateLoadBalancerAttributeError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.UpdateLoadBalancerAttribute",
);
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::<UpdateLoadBalancerAttributeResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateLoadBalancerAttributeError::from_response(response))
}))
}
})
}
fn update_relational_database(
&self,
input: UpdateRelationalDatabaseRequest,
) -> RusotoFuture<UpdateRelationalDatabaseResult, UpdateRelationalDatabaseError> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.UpdateRelationalDatabase",
);
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::<UpdateRelationalDatabaseResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateRelationalDatabaseError::from_response(response))
}))
}
})
}
fn update_relational_database_parameters(
&self,
input: UpdateRelationalDatabaseParametersRequest,
) -> RusotoFuture<
UpdateRelationalDatabaseParametersResult,
UpdateRelationalDatabaseParametersError,
> {
let mut request = SignedRequest::new("POST", "lightsail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"Lightsail_20161128.UpdateRelationalDatabaseParameters",
);
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::<UpdateRelationalDatabaseParametersResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateRelationalDatabaseParametersError::from_response(
response,
))
}))
}
})
}
}
#[cfg(test)]
mod protocol_tests {}