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, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AccountSettings {
#[serde(rename = "awsAccountNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_account_number: Option<String>,
#[serde(rename = "defaultJobTimeoutMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_job_timeout_minutes: Option<i64>,
#[serde(rename = "maxJobTimeoutMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_job_timeout_minutes: Option<i64>,
#[serde(rename = "maxSlots")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_slots: Option<::std::collections::HashMap<String, i64>>,
#[serde(rename = "skipAppResign")]
#[serde(skip_serializing_if = "Option::is_none")]
pub skip_app_resign: Option<bool>,
#[serde(rename = "trialMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub trial_minutes: Option<TrialMinutes>,
#[serde(rename = "unmeteredDevices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unmetered_devices: Option<::std::collections::HashMap<String, i64>>,
#[serde(rename = "unmeteredRemoteAccessDevices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unmetered_remote_access_devices: Option<::std::collections::HashMap<String, i64>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Artifact {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "extension")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extension: 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 = "url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CPU {
#[serde(rename = "architecture")]
#[serde(skip_serializing_if = "Option::is_none")]
pub architecture: Option<String>,
#[serde(rename = "clock")]
#[serde(skip_serializing_if = "Option::is_none")]
pub clock: Option<f64>,
#[serde(rename = "frequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub frequency: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Counters {
#[serde(rename = "errored")]
#[serde(skip_serializing_if = "Option::is_none")]
pub errored: Option<i64>,
#[serde(rename = "failed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failed: Option<i64>,
#[serde(rename = "passed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub passed: Option<i64>,
#[serde(rename = "skipped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub skipped: Option<i64>,
#[serde(rename = "stopped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopped: Option<i64>,
#[serde(rename = "total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<i64>,
#[serde(rename = "warned")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warned: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDevicePoolRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "projectArn")]
pub project_arn: String,
#[serde(rename = "rules")]
pub rules: Vec<Rule>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDevicePoolResult {
#[serde(rename = "devicePool")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_pool: Option<DevicePool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateInstanceProfileRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "excludeAppPackagesFromCleanup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exclude_app_packages_from_cleanup: Option<Vec<String>>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "packageCleanup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub package_cleanup: Option<bool>,
#[serde(rename = "rebootAfterUse")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reboot_after_use: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateInstanceProfileResult {
#[serde(rename = "instanceProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_profile: Option<InstanceProfile>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateNetworkProfileRequest {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "downlinkBandwidthBits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_bandwidth_bits: Option<i64>,
#[serde(rename = "downlinkDelayMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_delay_ms: Option<i64>,
#[serde(rename = "downlinkJitterMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_jitter_ms: Option<i64>,
#[serde(rename = "downlinkLossPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_loss_percent: Option<i64>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "projectArn")]
pub project_arn: String,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "uplinkBandwidthBits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_bandwidth_bits: Option<i64>,
#[serde(rename = "uplinkDelayMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_delay_ms: Option<i64>,
#[serde(rename = "uplinkJitterMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_jitter_ms: Option<i64>,
#[serde(rename = "uplinkLossPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_loss_percent: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateNetworkProfileResult {
#[serde(rename = "networkProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_profile: Option<NetworkProfile>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateProjectRequest {
#[serde(rename = "defaultJobTimeoutMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_job_timeout_minutes: Option<i64>,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateProjectResult {
#[serde(rename = "project")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project: Option<Project>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateRemoteAccessSessionConfiguration {
#[serde(rename = "billingMethod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_method: Option<String>,
#[serde(rename = "vpceConfigurationArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration_arns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateRemoteAccessSessionRequest {
#[serde(rename = "clientId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_id: Option<String>,
#[serde(rename = "configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<CreateRemoteAccessSessionConfiguration>,
#[serde(rename = "deviceArn")]
pub device_arn: String,
#[serde(rename = "instanceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_arn: Option<String>,
#[serde(rename = "interactionMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub interaction_mode: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "projectArn")]
pub project_arn: String,
#[serde(rename = "remoteDebugEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_debug_enabled: Option<bool>,
#[serde(rename = "remoteRecordAppArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_record_app_arn: Option<String>,
#[serde(rename = "remoteRecordEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_record_enabled: Option<bool>,
#[serde(rename = "skipAppResign")]
#[serde(skip_serializing_if = "Option::is_none")]
pub skip_app_resign: Option<bool>,
#[serde(rename = "sshPublicKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_public_key: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateRemoteAccessSessionResult {
#[serde(rename = "remoteAccessSession")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_session: Option<RemoteAccessSession>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateUploadRequest {
#[serde(rename = "contentType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "projectArn")]
pub project_arn: String,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateUploadResult {
#[serde(rename = "upload")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload: Option<Upload>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateVPCEConfigurationRequest {
#[serde(rename = "serviceDnsName")]
pub service_dns_name: String,
#[serde(rename = "vpceConfigurationDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration_description: Option<String>,
#[serde(rename = "vpceConfigurationName")]
pub vpce_configuration_name: String,
#[serde(rename = "vpceServiceName")]
pub vpce_service_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateVPCEConfigurationResult {
#[serde(rename = "vpceConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration: Option<VPCEConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CustomerArtifactPaths {
#[serde(rename = "androidPaths")]
#[serde(skip_serializing_if = "Option::is_none")]
pub android_paths: Option<Vec<String>>,
#[serde(rename = "deviceHostPaths")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_host_paths: Option<Vec<String>>,
#[serde(rename = "iosPaths")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ios_paths: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDevicePoolRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDevicePoolResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteInstanceProfileRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteInstanceProfileResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteNetworkProfileRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteNetworkProfileResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteProjectRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteProjectResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteRemoteAccessSessionRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteRemoteAccessSessionResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteRunRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteRunResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteUploadRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteUploadResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteVPCEConfigurationRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteVPCEConfigurationResult {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Device {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "carrier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub carrier: Option<String>,
#[serde(rename = "cpu")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu: Option<CPU>,
#[serde(rename = "fleetName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fleet_name: Option<String>,
#[serde(rename = "fleetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fleet_type: Option<String>,
#[serde(rename = "formFactor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub form_factor: Option<String>,
#[serde(rename = "heapSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub heap_size: Option<i64>,
#[serde(rename = "image")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
#[serde(rename = "instances")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instances: Option<Vec<DeviceInstance>>,
#[serde(rename = "manufacturer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manufacturer: Option<String>,
#[serde(rename = "memory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory: Option<i64>,
#[serde(rename = "model")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model: Option<String>,
#[serde(rename = "modelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_id: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "os")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os: Option<String>,
#[serde(rename = "platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "radio")]
#[serde(skip_serializing_if = "Option::is_none")]
pub radio: Option<String>,
#[serde(rename = "remoteAccessEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_enabled: Option<bool>,
#[serde(rename = "remoteDebugEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_debug_enabled: Option<bool>,
#[serde(rename = "resolution")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<Resolution>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeviceInstance {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "deviceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_arn: Option<String>,
#[serde(rename = "instanceProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_profile: Option<InstanceProfile>,
#[serde(rename = "labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "udid")]
#[serde(skip_serializing_if = "Option::is_none")]
pub udid: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeviceMinutes {
#[serde(rename = "metered")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metered: Option<f64>,
#[serde(rename = "total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
#[serde(rename = "unmetered")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unmetered: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DevicePool {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "rules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules: Option<Vec<Rule>>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DevicePoolCompatibilityResult {
#[serde(rename = "compatible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible: Option<bool>,
#[serde(rename = "device")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device: Option<Device>,
#[serde(rename = "incompatibilityMessages")]
#[serde(skip_serializing_if = "Option::is_none")]
pub incompatibility_messages: Option<Vec<IncompatibilityMessage>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ExecutionConfiguration {
#[serde(rename = "accountsCleanup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accounts_cleanup: Option<bool>,
#[serde(rename = "appPackagesCleanup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub app_packages_cleanup: Option<bool>,
#[serde(rename = "jobTimeoutMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_timeout_minutes: Option<i64>,
#[serde(rename = "skipAppResign")]
#[serde(skip_serializing_if = "Option::is_none")]
pub skip_app_resign: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAccountSettingsRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetAccountSettingsResult {
#[serde(rename = "accountSettings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_settings: Option<AccountSettings>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDeviceInstanceRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDeviceInstanceResult {
#[serde(rename = "deviceInstance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_instance: Option<DeviceInstance>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDevicePoolCompatibilityRequest {
#[serde(rename = "appArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub app_arn: Option<String>,
#[serde(rename = "configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<ScheduleRunConfiguration>,
#[serde(rename = "devicePoolArn")]
pub device_pool_arn: String,
#[serde(rename = "test")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test: Option<ScheduleRunTest>,
#[serde(rename = "testType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDevicePoolCompatibilityResult {
#[serde(rename = "compatibleDevices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compatible_devices: Option<Vec<DevicePoolCompatibilityResult>>,
#[serde(rename = "incompatibleDevices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub incompatible_devices: Option<Vec<DevicePoolCompatibilityResult>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDevicePoolRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDevicePoolResult {
#[serde(rename = "devicePool")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_pool: Option<DevicePool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDeviceRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDeviceResult {
#[serde(rename = "device")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device: Option<Device>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInstanceProfileRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInstanceProfileResult {
#[serde(rename = "instanceProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_profile: Option<InstanceProfile>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetJobRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetJobResult {
#[serde(rename = "job")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job: Option<Job>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetNetworkProfileRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetNetworkProfileResult {
#[serde(rename = "networkProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_profile: Option<NetworkProfile>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetOfferingStatusRequest {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetOfferingStatusResult {
#[serde(rename = "current")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current: Option<::std::collections::HashMap<String, OfferingStatus>>,
#[serde(rename = "nextPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_period: Option<::std::collections::HashMap<String, OfferingStatus>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetProjectRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetProjectResult {
#[serde(rename = "project")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project: Option<Project>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRemoteAccessSessionRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRemoteAccessSessionResult {
#[serde(rename = "remoteAccessSession")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_session: Option<RemoteAccessSession>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRunRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRunResult {
#[serde(rename = "run")]
#[serde(skip_serializing_if = "Option::is_none")]
pub run: Option<Run>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetSuiteRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetSuiteResult {
#[serde(rename = "suite")]
#[serde(skip_serializing_if = "Option::is_none")]
pub suite: Option<Suite>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetTestRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetTestResult {
#[serde(rename = "test")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test: Option<Test>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetUploadRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetUploadResult {
#[serde(rename = "upload")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload: Option<Upload>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetVPCEConfigurationRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetVPCEConfigurationResult {
#[serde(rename = "vpceConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration: Option<VPCEConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct IncompatibilityMessage {
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InstallToRemoteAccessSessionRequest {
#[serde(rename = "appArn")]
pub app_arn: String,
#[serde(rename = "remoteAccessSessionArn")]
pub remote_access_session_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstallToRemoteAccessSessionResult {
#[serde(rename = "appUpload")]
#[serde(skip_serializing_if = "Option::is_none")]
pub app_upload: Option<Upload>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceProfile {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "excludeAppPackagesFromCleanup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exclude_app_packages_from_cleanup: Option<Vec<String>>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "packageCleanup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub package_cleanup: Option<bool>,
#[serde(rename = "rebootAfterUse")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reboot_after_use: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Job {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "counters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub counters: Option<Counters>,
#[serde(rename = "created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "device")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device: Option<Device>,
#[serde(rename = "deviceMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_minutes: Option<DeviceMinutes>,
#[serde(rename = "instanceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_arn: Option<String>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "result")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<String>,
#[serde(rename = "started")]
#[serde(skip_serializing_if = "Option::is_none")]
pub started: Option<f64>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "stopped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopped: Option<f64>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListArtifactsRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListArtifactsResult {
#[serde(rename = "artifacts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub artifacts: Option<Vec<Artifact>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListDeviceInstancesRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListDeviceInstancesResult {
#[serde(rename = "deviceInstances")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_instances: Option<Vec<DeviceInstance>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListDevicePoolsRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListDevicePoolsResult {
#[serde(rename = "devicePools")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_pools: Option<Vec<DevicePool>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListDevicesRequest {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListDevicesResult {
#[serde(rename = "devices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub devices: Option<Vec<Device>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListInstanceProfilesRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListInstanceProfilesResult {
#[serde(rename = "instanceProfiles")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_profiles: Option<Vec<InstanceProfile>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListJobsRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListJobsResult {
#[serde(rename = "jobs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub jobs: Option<Vec<Job>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListNetworkProfilesRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListNetworkProfilesResult {
#[serde(rename = "networkProfiles")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_profiles: Option<Vec<NetworkProfile>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListOfferingPromotionsRequest {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListOfferingPromotionsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "offeringPromotions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_promotions: Option<Vec<OfferingPromotion>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListOfferingTransactionsRequest {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListOfferingTransactionsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "offeringTransactions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_transactions: Option<Vec<OfferingTransaction>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListOfferingsRequest {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListOfferingsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "offerings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offerings: Option<Vec<Offering>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListProjectsRequest {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListProjectsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "projects")]
#[serde(skip_serializing_if = "Option::is_none")]
pub projects: Option<Vec<Project>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListRemoteAccessSessionsRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListRemoteAccessSessionsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "remoteAccessSessions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_sessions: Option<Vec<RemoteAccessSession>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListRunsRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListRunsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "runs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runs: Option<Vec<Run>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListSamplesRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListSamplesResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "samples")]
#[serde(skip_serializing_if = "Option::is_none")]
pub samples: Option<Vec<Sample>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListSuitesRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListSuitesResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "suites")]
#[serde(skip_serializing_if = "Option::is_none")]
pub suites: Option<Vec<Suite>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTestsRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTestsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "tests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tests: Option<Vec<Test>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListUniqueProblemsRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListUniqueProblemsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "uniqueProblems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_problems: Option<::std::collections::HashMap<String, Vec<UniqueProblem>>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListUploadsRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListUploadsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "uploads")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uploads: Option<Vec<Upload>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListVPCEConfigurationsRequest {
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListVPCEConfigurationsResult {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "vpceConfigurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configurations: Option<Vec<VPCEConfiguration>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Location {
#[serde(rename = "latitude")]
pub latitude: f64,
#[serde(rename = "longitude")]
pub longitude: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MonetaryAmount {
#[serde(rename = "amount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<f64>,
#[serde(rename = "currencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NetworkProfile {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "downlinkBandwidthBits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_bandwidth_bits: Option<i64>,
#[serde(rename = "downlinkDelayMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_delay_ms: Option<i64>,
#[serde(rename = "downlinkJitterMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_jitter_ms: Option<i64>,
#[serde(rename = "downlinkLossPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_loss_percent: Option<i64>,
#[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 = "uplinkBandwidthBits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_bandwidth_bits: Option<i64>,
#[serde(rename = "uplinkDelayMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_delay_ms: Option<i64>,
#[serde(rename = "uplinkJitterMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_jitter_ms: Option<i64>,
#[serde(rename = "uplinkLossPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_loss_percent: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Offering {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "recurringCharges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recurring_charges: Option<Vec<RecurringCharge>>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct OfferingPromotion {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct OfferingStatus {
#[serde(rename = "effectiveOn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_on: Option<f64>,
#[serde(rename = "offering")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering: Option<Offering>,
#[serde(rename = "quantity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub quantity: Option<i64>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct OfferingTransaction {
#[serde(rename = "cost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost: Option<MonetaryAmount>,
#[serde(rename = "createdOn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_on: Option<f64>,
#[serde(rename = "offeringPromotionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_promotion_id: Option<String>,
#[serde(rename = "offeringStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_status: Option<OfferingStatus>,
#[serde(rename = "transactionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Problem {
#[serde(rename = "device")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device: Option<Device>,
#[serde(rename = "job")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job: Option<ProblemDetail>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "result")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<String>,
#[serde(rename = "run")]
#[serde(skip_serializing_if = "Option::is_none")]
pub run: Option<ProblemDetail>,
#[serde(rename = "suite")]
#[serde(skip_serializing_if = "Option::is_none")]
pub suite: Option<ProblemDetail>,
#[serde(rename = "test")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test: Option<ProblemDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProblemDetail {
#[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>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Project {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "defaultJobTimeoutMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_job_timeout_minutes: Option<i64>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PurchaseOfferingRequest {
#[serde(rename = "offeringId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_id: Option<String>,
#[serde(rename = "offeringPromotionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_promotion_id: Option<String>,
#[serde(rename = "quantity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub quantity: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PurchaseOfferingResult {
#[serde(rename = "offeringTransaction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_transaction: Option<OfferingTransaction>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Radios {
#[serde(rename = "bluetooth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bluetooth: Option<bool>,
#[serde(rename = "gps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gps: Option<bool>,
#[serde(rename = "nfc")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nfc: Option<bool>,
#[serde(rename = "wifi")]
#[serde(skip_serializing_if = "Option::is_none")]
pub wifi: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RecurringCharge {
#[serde(rename = "cost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost: Option<MonetaryAmount>,
#[serde(rename = "frequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub frequency: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RemoteAccessSession {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "billingMethod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_method: Option<String>,
#[serde(rename = "clientId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_id: Option<String>,
#[serde(rename = "created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "device")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device: Option<Device>,
#[serde(rename = "deviceMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_minutes: Option<DeviceMinutes>,
#[serde(rename = "deviceUdid")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_udid: Option<String>,
#[serde(rename = "endpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint: Option<String>,
#[serde(rename = "hostAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_address: Option<String>,
#[serde(rename = "instanceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_arn: Option<String>,
#[serde(rename = "interactionMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub interaction_mode: Option<String>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "remoteDebugEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_debug_enabled: Option<bool>,
#[serde(rename = "remoteRecordAppArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_record_app_arn: Option<String>,
#[serde(rename = "remoteRecordEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_record_enabled: Option<bool>,
#[serde(rename = "result")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<String>,
#[serde(rename = "skipAppResign")]
#[serde(skip_serializing_if = "Option::is_none")]
pub skip_app_resign: Option<bool>,
#[serde(rename = "started")]
#[serde(skip_serializing_if = "Option::is_none")]
pub started: Option<f64>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "stopped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopped: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RenewOfferingRequest {
#[serde(rename = "offeringId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_id: Option<String>,
#[serde(rename = "quantity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub quantity: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RenewOfferingResult {
#[serde(rename = "offeringTransaction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_transaction: Option<OfferingTransaction>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Resolution {
#[serde(rename = "height")]
#[serde(skip_serializing_if = "Option::is_none")]
pub height: Option<i64>,
#[serde(rename = "width")]
#[serde(skip_serializing_if = "Option::is_none")]
pub width: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Rule {
#[serde(rename = "attribute")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attribute: Option<String>,
#[serde(rename = "operator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operator: 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 Run {
#[serde(rename = "appUpload")]
#[serde(skip_serializing_if = "Option::is_none")]
pub app_upload: Option<String>,
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "billingMethod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_method: Option<String>,
#[serde(rename = "completedJobs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completed_jobs: Option<i64>,
#[serde(rename = "counters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub counters: Option<Counters>,
#[serde(rename = "created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "customerArtifactPaths")]
#[serde(skip_serializing_if = "Option::is_none")]
pub customer_artifact_paths: Option<CustomerArtifactPaths>,
#[serde(rename = "deviceMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_minutes: Option<DeviceMinutes>,
#[serde(rename = "devicePoolArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_pool_arn: Option<String>,
#[serde(rename = "eventCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_count: Option<i64>,
#[serde(rename = "jobTimeoutMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_timeout_minutes: Option<i64>,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<Location>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "networkProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_profile: Option<NetworkProfile>,
#[serde(rename = "parsingResultUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parsing_result_url: Option<String>,
#[serde(rename = "platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "radios")]
#[serde(skip_serializing_if = "Option::is_none")]
pub radios: Option<Radios>,
#[serde(rename = "result")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<String>,
#[serde(rename = "resultCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_code: Option<String>,
#[serde(rename = "seed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
#[serde(rename = "skipAppResign")]
#[serde(skip_serializing_if = "Option::is_none")]
pub skip_app_resign: Option<bool>,
#[serde(rename = "started")]
#[serde(skip_serializing_if = "Option::is_none")]
pub started: Option<f64>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "stopped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopped: Option<f64>,
#[serde(rename = "totalJobs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_jobs: Option<i64>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "webUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub web_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Sample {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ScheduleRunConfiguration {
#[serde(rename = "auxiliaryApps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auxiliary_apps: Option<Vec<String>>,
#[serde(rename = "billingMethod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_method: Option<String>,
#[serde(rename = "customerArtifactPaths")]
#[serde(skip_serializing_if = "Option::is_none")]
pub customer_artifact_paths: Option<CustomerArtifactPaths>,
#[serde(rename = "extraDataPackageArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extra_data_package_arn: Option<String>,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<Location>,
#[serde(rename = "networkProfileArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_profile_arn: Option<String>,
#[serde(rename = "radios")]
#[serde(skip_serializing_if = "Option::is_none")]
pub radios: Option<Radios>,
#[serde(rename = "vpceConfigurationArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration_arns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ScheduleRunRequest {
#[serde(rename = "appArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub app_arn: Option<String>,
#[serde(rename = "configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<ScheduleRunConfiguration>,
#[serde(rename = "devicePoolArn")]
pub device_pool_arn: String,
#[serde(rename = "executionConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub execution_configuration: Option<ExecutionConfiguration>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "projectArn")]
pub project_arn: String,
#[serde(rename = "test")]
pub test: ScheduleRunTest,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ScheduleRunResult {
#[serde(rename = "run")]
#[serde(skip_serializing_if = "Option::is_none")]
pub run: Option<Run>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ScheduleRunTest {
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<String>,
#[serde(rename = "parameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameters: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "testPackageArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test_package_arn: Option<String>,
#[serde(rename = "type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopRemoteAccessSessionRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopRemoteAccessSessionResult {
#[serde(rename = "remoteAccessSession")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_access_session: Option<RemoteAccessSession>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopRunRequest {
#[serde(rename = "arn")]
pub arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopRunResult {
#[serde(rename = "run")]
#[serde(skip_serializing_if = "Option::is_none")]
pub run: Option<Run>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Suite {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "counters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub counters: Option<Counters>,
#[serde(rename = "created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "deviceMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_minutes: Option<DeviceMinutes>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "result")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<String>,
#[serde(rename = "started")]
#[serde(skip_serializing_if = "Option::is_none")]
pub started: Option<f64>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "stopped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopped: Option<f64>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Test {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "counters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub counters: Option<Counters>,
#[serde(rename = "created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "deviceMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_minutes: Option<DeviceMinutes>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "result")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<String>,
#[serde(rename = "started")]
#[serde(skip_serializing_if = "Option::is_none")]
pub started: Option<f64>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "stopped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopped: Option<f64>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TrialMinutes {
#[serde(rename = "remaining")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remaining: Option<f64>,
#[serde(rename = "total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UniqueProblem {
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "problems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub problems: Option<Vec<Problem>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateDeviceInstanceRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "profileArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub profile_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateDeviceInstanceResult {
#[serde(rename = "deviceInstance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_instance: Option<DeviceInstance>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateDevicePoolRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "rules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules: Option<Vec<Rule>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateDevicePoolResult {
#[serde(rename = "devicePool")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_pool: Option<DevicePool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateInstanceProfileRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "excludeAppPackagesFromCleanup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exclude_app_packages_from_cleanup: Option<Vec<String>>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "packageCleanup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub package_cleanup: Option<bool>,
#[serde(rename = "rebootAfterUse")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reboot_after_use: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateInstanceProfileResult {
#[serde(rename = "instanceProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_profile: Option<InstanceProfile>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateNetworkProfileRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "downlinkBandwidthBits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_bandwidth_bits: Option<i64>,
#[serde(rename = "downlinkDelayMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_delay_ms: Option<i64>,
#[serde(rename = "downlinkJitterMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_jitter_ms: Option<i64>,
#[serde(rename = "downlinkLossPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub downlink_loss_percent: Option<i64>,
#[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 = "uplinkBandwidthBits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_bandwidth_bits: Option<i64>,
#[serde(rename = "uplinkDelayMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_delay_ms: Option<i64>,
#[serde(rename = "uplinkJitterMs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_jitter_ms: Option<i64>,
#[serde(rename = "uplinkLossPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uplink_loss_percent: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateNetworkProfileResult {
#[serde(rename = "networkProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_profile: Option<NetworkProfile>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateProjectRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "defaultJobTimeoutMinutes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_job_timeout_minutes: Option<i64>,
#[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 UpdateProjectResult {
#[serde(rename = "project")]
#[serde(skip_serializing_if = "Option::is_none")]
pub project: Option<Project>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateVPCEConfigurationRequest {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "serviceDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_dns_name: Option<String>,
#[serde(rename = "vpceConfigurationDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration_description: Option<String>,
#[serde(rename = "vpceConfigurationName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration_name: Option<String>,
#[serde(rename = "vpceServiceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_service_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateVPCEConfigurationResult {
#[serde(rename = "vpceConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration: Option<VPCEConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Upload {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "contentType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<String>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct VPCEConfiguration {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "serviceDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_dns_name: Option<String>,
#[serde(rename = "vpceConfigurationDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration_description: Option<String>,
#[serde(rename = "vpceConfigurationName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_configuration_name: Option<String>,
#[serde(rename = "vpceServiceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpce_service_name: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum CreateDevicePoolError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateDevicePoolError {
pub fn from_response(res: BufferedHttpResponse) -> CreateDevicePoolError {
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 {
"ArgumentException" => {
return CreateDevicePoolError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return CreateDevicePoolError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return CreateDevicePoolError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return CreateDevicePoolError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return CreateDevicePoolError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateDevicePoolError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateDevicePoolError {
fn from(err: serde_json::error::Error) -> CreateDevicePoolError {
CreateDevicePoolError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateDevicePoolError {
fn from(err: CredentialsError) -> CreateDevicePoolError {
CreateDevicePoolError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateDevicePoolError {
fn from(err: HttpDispatchError) -> CreateDevicePoolError {
CreateDevicePoolError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateDevicePoolError {
fn from(err: io::Error) -> CreateDevicePoolError {
CreateDevicePoolError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateDevicePoolError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDevicePoolError {
fn description(&self) -> &str {
match *self {
CreateDevicePoolError::Argument(ref cause) => cause,
CreateDevicePoolError::LimitExceeded(ref cause) => cause,
CreateDevicePoolError::NotFound(ref cause) => cause,
CreateDevicePoolError::ServiceAccount(ref cause) => cause,
CreateDevicePoolError::Validation(ref cause) => cause,
CreateDevicePoolError::Credentials(ref err) => err.description(),
CreateDevicePoolError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateDevicePoolError::ParseError(ref cause) => cause,
CreateDevicePoolError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateInstanceProfileError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateInstanceProfileError {
pub fn from_response(res: BufferedHttpResponse) -> CreateInstanceProfileError {
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 {
"ArgumentException" => {
return CreateInstanceProfileError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return CreateInstanceProfileError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return CreateInstanceProfileError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return CreateInstanceProfileError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return CreateInstanceProfileError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateInstanceProfileError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateInstanceProfileError {
fn from(err: serde_json::error::Error) -> CreateInstanceProfileError {
CreateInstanceProfileError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateInstanceProfileError {
fn from(err: CredentialsError) -> CreateInstanceProfileError {
CreateInstanceProfileError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateInstanceProfileError {
fn from(err: HttpDispatchError) -> CreateInstanceProfileError {
CreateInstanceProfileError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateInstanceProfileError {
fn from(err: io::Error) -> CreateInstanceProfileError {
CreateInstanceProfileError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateInstanceProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateInstanceProfileError {
fn description(&self) -> &str {
match *self {
CreateInstanceProfileError::Argument(ref cause) => cause,
CreateInstanceProfileError::LimitExceeded(ref cause) => cause,
CreateInstanceProfileError::NotFound(ref cause) => cause,
CreateInstanceProfileError::ServiceAccount(ref cause) => cause,
CreateInstanceProfileError::Validation(ref cause) => cause,
CreateInstanceProfileError::Credentials(ref err) => err.description(),
CreateInstanceProfileError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateInstanceProfileError::ParseError(ref cause) => cause,
CreateInstanceProfileError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateNetworkProfileError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateNetworkProfileError {
pub fn from_response(res: BufferedHttpResponse) -> CreateNetworkProfileError {
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 {
"ArgumentException" => {
return CreateNetworkProfileError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return CreateNetworkProfileError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return CreateNetworkProfileError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return CreateNetworkProfileError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return CreateNetworkProfileError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateNetworkProfileError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateNetworkProfileError {
fn from(err: serde_json::error::Error) -> CreateNetworkProfileError {
CreateNetworkProfileError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateNetworkProfileError {
fn from(err: CredentialsError) -> CreateNetworkProfileError {
CreateNetworkProfileError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateNetworkProfileError {
fn from(err: HttpDispatchError) -> CreateNetworkProfileError {
CreateNetworkProfileError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateNetworkProfileError {
fn from(err: io::Error) -> CreateNetworkProfileError {
CreateNetworkProfileError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateNetworkProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateNetworkProfileError {
fn description(&self) -> &str {
match *self {
CreateNetworkProfileError::Argument(ref cause) => cause,
CreateNetworkProfileError::LimitExceeded(ref cause) => cause,
CreateNetworkProfileError::NotFound(ref cause) => cause,
CreateNetworkProfileError::ServiceAccount(ref cause) => cause,
CreateNetworkProfileError::Validation(ref cause) => cause,
CreateNetworkProfileError::Credentials(ref err) => err.description(),
CreateNetworkProfileError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateNetworkProfileError::ParseError(ref cause) => cause,
CreateNetworkProfileError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateProjectError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateProjectError {
pub fn from_response(res: BufferedHttpResponse) -> CreateProjectError {
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 {
"ArgumentException" => {
return CreateProjectError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return CreateProjectError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return CreateProjectError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return CreateProjectError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return CreateProjectError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateProjectError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateProjectError {
fn from(err: serde_json::error::Error) -> CreateProjectError {
CreateProjectError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateProjectError {
fn from(err: CredentialsError) -> CreateProjectError {
CreateProjectError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateProjectError {
fn from(err: HttpDispatchError) -> CreateProjectError {
CreateProjectError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateProjectError {
fn from(err: io::Error) -> CreateProjectError {
CreateProjectError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateProjectError {
fn description(&self) -> &str {
match *self {
CreateProjectError::Argument(ref cause) => cause,
CreateProjectError::LimitExceeded(ref cause) => cause,
CreateProjectError::NotFound(ref cause) => cause,
CreateProjectError::ServiceAccount(ref cause) => cause,
CreateProjectError::Validation(ref cause) => cause,
CreateProjectError::Credentials(ref err) => err.description(),
CreateProjectError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateProjectError::ParseError(ref cause) => cause,
CreateProjectError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateRemoteAccessSessionError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateRemoteAccessSessionError {
pub fn from_response(res: BufferedHttpResponse) -> CreateRemoteAccessSessionError {
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 {
"ArgumentException" => {
return CreateRemoteAccessSessionError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return CreateRemoteAccessSessionError::LimitExceeded(String::from(
error_message,
))
}
"NotFoundException" => {
return CreateRemoteAccessSessionError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return CreateRemoteAccessSessionError::ServiceAccount(String::from(
error_message,
))
}
"ValidationException" => {
return CreateRemoteAccessSessionError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateRemoteAccessSessionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateRemoteAccessSessionError {
fn from(err: serde_json::error::Error) -> CreateRemoteAccessSessionError {
CreateRemoteAccessSessionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateRemoteAccessSessionError {
fn from(err: CredentialsError) -> CreateRemoteAccessSessionError {
CreateRemoteAccessSessionError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateRemoteAccessSessionError {
fn from(err: HttpDispatchError) -> CreateRemoteAccessSessionError {
CreateRemoteAccessSessionError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateRemoteAccessSessionError {
fn from(err: io::Error) -> CreateRemoteAccessSessionError {
CreateRemoteAccessSessionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateRemoteAccessSessionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateRemoteAccessSessionError {
fn description(&self) -> &str {
match *self {
CreateRemoteAccessSessionError::Argument(ref cause) => cause,
CreateRemoteAccessSessionError::LimitExceeded(ref cause) => cause,
CreateRemoteAccessSessionError::NotFound(ref cause) => cause,
CreateRemoteAccessSessionError::ServiceAccount(ref cause) => cause,
CreateRemoteAccessSessionError::Validation(ref cause) => cause,
CreateRemoteAccessSessionError::Credentials(ref err) => err.description(),
CreateRemoteAccessSessionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateRemoteAccessSessionError::ParseError(ref cause) => cause,
CreateRemoteAccessSessionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateUploadError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateUploadError {
pub fn from_response(res: BufferedHttpResponse) -> CreateUploadError {
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 {
"ArgumentException" => {
return CreateUploadError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return CreateUploadError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return CreateUploadError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return CreateUploadError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return CreateUploadError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateUploadError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateUploadError {
fn from(err: serde_json::error::Error) -> CreateUploadError {
CreateUploadError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateUploadError {
fn from(err: CredentialsError) -> CreateUploadError {
CreateUploadError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateUploadError {
fn from(err: HttpDispatchError) -> CreateUploadError {
CreateUploadError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateUploadError {
fn from(err: io::Error) -> CreateUploadError {
CreateUploadError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateUploadError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateUploadError {
fn description(&self) -> &str {
match *self {
CreateUploadError::Argument(ref cause) => cause,
CreateUploadError::LimitExceeded(ref cause) => cause,
CreateUploadError::NotFound(ref cause) => cause,
CreateUploadError::ServiceAccount(ref cause) => cause,
CreateUploadError::Validation(ref cause) => cause,
CreateUploadError::Credentials(ref err) => err.description(),
CreateUploadError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateUploadError::ParseError(ref cause) => cause,
CreateUploadError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateVPCEConfigurationError {
Argument(String),
LimitExceeded(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateVPCEConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> CreateVPCEConfigurationError {
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 {
"ArgumentException" => {
return CreateVPCEConfigurationError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return CreateVPCEConfigurationError::LimitExceeded(String::from(error_message))
}
"ServiceAccountException" => {
return CreateVPCEConfigurationError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return CreateVPCEConfigurationError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateVPCEConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateVPCEConfigurationError {
fn from(err: serde_json::error::Error) -> CreateVPCEConfigurationError {
CreateVPCEConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateVPCEConfigurationError {
fn from(err: CredentialsError) -> CreateVPCEConfigurationError {
CreateVPCEConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateVPCEConfigurationError {
fn from(err: HttpDispatchError) -> CreateVPCEConfigurationError {
CreateVPCEConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateVPCEConfigurationError {
fn from(err: io::Error) -> CreateVPCEConfigurationError {
CreateVPCEConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateVPCEConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateVPCEConfigurationError {
fn description(&self) -> &str {
match *self {
CreateVPCEConfigurationError::Argument(ref cause) => cause,
CreateVPCEConfigurationError::LimitExceeded(ref cause) => cause,
CreateVPCEConfigurationError::ServiceAccount(ref cause) => cause,
CreateVPCEConfigurationError::Validation(ref cause) => cause,
CreateVPCEConfigurationError::Credentials(ref err) => err.description(),
CreateVPCEConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateVPCEConfigurationError::ParseError(ref cause) => cause,
CreateVPCEConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDevicePoolError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteDevicePoolError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteDevicePoolError {
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 {
"ArgumentException" => {
return DeleteDevicePoolError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return DeleteDevicePoolError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return DeleteDevicePoolError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return DeleteDevicePoolError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return DeleteDevicePoolError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteDevicePoolError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteDevicePoolError {
fn from(err: serde_json::error::Error) -> DeleteDevicePoolError {
DeleteDevicePoolError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteDevicePoolError {
fn from(err: CredentialsError) -> DeleteDevicePoolError {
DeleteDevicePoolError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteDevicePoolError {
fn from(err: HttpDispatchError) -> DeleteDevicePoolError {
DeleteDevicePoolError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteDevicePoolError {
fn from(err: io::Error) -> DeleteDevicePoolError {
DeleteDevicePoolError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteDevicePoolError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDevicePoolError {
fn description(&self) -> &str {
match *self {
DeleteDevicePoolError::Argument(ref cause) => cause,
DeleteDevicePoolError::LimitExceeded(ref cause) => cause,
DeleteDevicePoolError::NotFound(ref cause) => cause,
DeleteDevicePoolError::ServiceAccount(ref cause) => cause,
DeleteDevicePoolError::Validation(ref cause) => cause,
DeleteDevicePoolError::Credentials(ref err) => err.description(),
DeleteDevicePoolError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteDevicePoolError::ParseError(ref cause) => cause,
DeleteDevicePoolError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteInstanceProfileError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteInstanceProfileError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteInstanceProfileError {
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 {
"ArgumentException" => {
return DeleteInstanceProfileError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return DeleteInstanceProfileError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return DeleteInstanceProfileError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return DeleteInstanceProfileError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return DeleteInstanceProfileError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteInstanceProfileError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteInstanceProfileError {
fn from(err: serde_json::error::Error) -> DeleteInstanceProfileError {
DeleteInstanceProfileError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteInstanceProfileError {
fn from(err: CredentialsError) -> DeleteInstanceProfileError {
DeleteInstanceProfileError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteInstanceProfileError {
fn from(err: HttpDispatchError) -> DeleteInstanceProfileError {
DeleteInstanceProfileError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteInstanceProfileError {
fn from(err: io::Error) -> DeleteInstanceProfileError {
DeleteInstanceProfileError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteInstanceProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteInstanceProfileError {
fn description(&self) -> &str {
match *self {
DeleteInstanceProfileError::Argument(ref cause) => cause,
DeleteInstanceProfileError::LimitExceeded(ref cause) => cause,
DeleteInstanceProfileError::NotFound(ref cause) => cause,
DeleteInstanceProfileError::ServiceAccount(ref cause) => cause,
DeleteInstanceProfileError::Validation(ref cause) => cause,
DeleteInstanceProfileError::Credentials(ref err) => err.description(),
DeleteInstanceProfileError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteInstanceProfileError::ParseError(ref cause) => cause,
DeleteInstanceProfileError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteNetworkProfileError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteNetworkProfileError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteNetworkProfileError {
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 {
"ArgumentException" => {
return DeleteNetworkProfileError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return DeleteNetworkProfileError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return DeleteNetworkProfileError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return DeleteNetworkProfileError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return DeleteNetworkProfileError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteNetworkProfileError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteNetworkProfileError {
fn from(err: serde_json::error::Error) -> DeleteNetworkProfileError {
DeleteNetworkProfileError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteNetworkProfileError {
fn from(err: CredentialsError) -> DeleteNetworkProfileError {
DeleteNetworkProfileError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteNetworkProfileError {
fn from(err: HttpDispatchError) -> DeleteNetworkProfileError {
DeleteNetworkProfileError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteNetworkProfileError {
fn from(err: io::Error) -> DeleteNetworkProfileError {
DeleteNetworkProfileError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteNetworkProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteNetworkProfileError {
fn description(&self) -> &str {
match *self {
DeleteNetworkProfileError::Argument(ref cause) => cause,
DeleteNetworkProfileError::LimitExceeded(ref cause) => cause,
DeleteNetworkProfileError::NotFound(ref cause) => cause,
DeleteNetworkProfileError::ServiceAccount(ref cause) => cause,
DeleteNetworkProfileError::Validation(ref cause) => cause,
DeleteNetworkProfileError::Credentials(ref err) => err.description(),
DeleteNetworkProfileError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteNetworkProfileError::ParseError(ref cause) => cause,
DeleteNetworkProfileError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteProjectError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteProjectError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteProjectError {
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 {
"ArgumentException" => {
return DeleteProjectError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return DeleteProjectError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return DeleteProjectError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return DeleteProjectError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return DeleteProjectError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteProjectError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteProjectError {
fn from(err: serde_json::error::Error) -> DeleteProjectError {
DeleteProjectError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteProjectError {
fn from(err: CredentialsError) -> DeleteProjectError {
DeleteProjectError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteProjectError {
fn from(err: HttpDispatchError) -> DeleteProjectError {
DeleteProjectError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteProjectError {
fn from(err: io::Error) -> DeleteProjectError {
DeleteProjectError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteProjectError {
fn description(&self) -> &str {
match *self {
DeleteProjectError::Argument(ref cause) => cause,
DeleteProjectError::LimitExceeded(ref cause) => cause,
DeleteProjectError::NotFound(ref cause) => cause,
DeleteProjectError::ServiceAccount(ref cause) => cause,
DeleteProjectError::Validation(ref cause) => cause,
DeleteProjectError::Credentials(ref err) => err.description(),
DeleteProjectError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteProjectError::ParseError(ref cause) => cause,
DeleteProjectError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteRemoteAccessSessionError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteRemoteAccessSessionError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteRemoteAccessSessionError {
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 {
"ArgumentException" => {
return DeleteRemoteAccessSessionError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return DeleteRemoteAccessSessionError::LimitExceeded(String::from(
error_message,
))
}
"NotFoundException" => {
return DeleteRemoteAccessSessionError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return DeleteRemoteAccessSessionError::ServiceAccount(String::from(
error_message,
))
}
"ValidationException" => {
return DeleteRemoteAccessSessionError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteRemoteAccessSessionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteRemoteAccessSessionError {
fn from(err: serde_json::error::Error) -> DeleteRemoteAccessSessionError {
DeleteRemoteAccessSessionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteRemoteAccessSessionError {
fn from(err: CredentialsError) -> DeleteRemoteAccessSessionError {
DeleteRemoteAccessSessionError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteRemoteAccessSessionError {
fn from(err: HttpDispatchError) -> DeleteRemoteAccessSessionError {
DeleteRemoteAccessSessionError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteRemoteAccessSessionError {
fn from(err: io::Error) -> DeleteRemoteAccessSessionError {
DeleteRemoteAccessSessionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteRemoteAccessSessionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteRemoteAccessSessionError {
fn description(&self) -> &str {
match *self {
DeleteRemoteAccessSessionError::Argument(ref cause) => cause,
DeleteRemoteAccessSessionError::LimitExceeded(ref cause) => cause,
DeleteRemoteAccessSessionError::NotFound(ref cause) => cause,
DeleteRemoteAccessSessionError::ServiceAccount(ref cause) => cause,
DeleteRemoteAccessSessionError::Validation(ref cause) => cause,
DeleteRemoteAccessSessionError::Credentials(ref err) => err.description(),
DeleteRemoteAccessSessionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteRemoteAccessSessionError::ParseError(ref cause) => cause,
DeleteRemoteAccessSessionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteRunError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteRunError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteRunError {
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 {
"ArgumentException" => return DeleteRunError::Argument(String::from(error_message)),
"LimitExceededException" => {
return DeleteRunError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return DeleteRunError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return DeleteRunError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return DeleteRunError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteRunError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteRunError {
fn from(err: serde_json::error::Error) -> DeleteRunError {
DeleteRunError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteRunError {
fn from(err: CredentialsError) -> DeleteRunError {
DeleteRunError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteRunError {
fn from(err: HttpDispatchError) -> DeleteRunError {
DeleteRunError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteRunError {
fn from(err: io::Error) -> DeleteRunError {
DeleteRunError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteRunError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteRunError {
fn description(&self) -> &str {
match *self {
DeleteRunError::Argument(ref cause) => cause,
DeleteRunError::LimitExceeded(ref cause) => cause,
DeleteRunError::NotFound(ref cause) => cause,
DeleteRunError::ServiceAccount(ref cause) => cause,
DeleteRunError::Validation(ref cause) => cause,
DeleteRunError::Credentials(ref err) => err.description(),
DeleteRunError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteRunError::ParseError(ref cause) => cause,
DeleteRunError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteUploadError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteUploadError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteUploadError {
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 {
"ArgumentException" => {
return DeleteUploadError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return DeleteUploadError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return DeleteUploadError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return DeleteUploadError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return DeleteUploadError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteUploadError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteUploadError {
fn from(err: serde_json::error::Error) -> DeleteUploadError {
DeleteUploadError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteUploadError {
fn from(err: CredentialsError) -> DeleteUploadError {
DeleteUploadError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteUploadError {
fn from(err: HttpDispatchError) -> DeleteUploadError {
DeleteUploadError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteUploadError {
fn from(err: io::Error) -> DeleteUploadError {
DeleteUploadError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteUploadError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteUploadError {
fn description(&self) -> &str {
match *self {
DeleteUploadError::Argument(ref cause) => cause,
DeleteUploadError::LimitExceeded(ref cause) => cause,
DeleteUploadError::NotFound(ref cause) => cause,
DeleteUploadError::ServiceAccount(ref cause) => cause,
DeleteUploadError::Validation(ref cause) => cause,
DeleteUploadError::Credentials(ref err) => err.description(),
DeleteUploadError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteUploadError::ParseError(ref cause) => cause,
DeleteUploadError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteVPCEConfigurationError {
Argument(String),
InvalidOperation(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteVPCEConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteVPCEConfigurationError {
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 {
"ArgumentException" => {
return DeleteVPCEConfigurationError::Argument(String::from(error_message))
}
"InvalidOperationException" => {
return DeleteVPCEConfigurationError::InvalidOperation(String::from(
error_message,
))
}
"NotFoundException" => {
return DeleteVPCEConfigurationError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return DeleteVPCEConfigurationError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return DeleteVPCEConfigurationError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteVPCEConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteVPCEConfigurationError {
fn from(err: serde_json::error::Error) -> DeleteVPCEConfigurationError {
DeleteVPCEConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteVPCEConfigurationError {
fn from(err: CredentialsError) -> DeleteVPCEConfigurationError {
DeleteVPCEConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteVPCEConfigurationError {
fn from(err: HttpDispatchError) -> DeleteVPCEConfigurationError {
DeleteVPCEConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteVPCEConfigurationError {
fn from(err: io::Error) -> DeleteVPCEConfigurationError {
DeleteVPCEConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteVPCEConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteVPCEConfigurationError {
fn description(&self) -> &str {
match *self {
DeleteVPCEConfigurationError::Argument(ref cause) => cause,
DeleteVPCEConfigurationError::InvalidOperation(ref cause) => cause,
DeleteVPCEConfigurationError::NotFound(ref cause) => cause,
DeleteVPCEConfigurationError::ServiceAccount(ref cause) => cause,
DeleteVPCEConfigurationError::Validation(ref cause) => cause,
DeleteVPCEConfigurationError::Credentials(ref err) => err.description(),
DeleteVPCEConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteVPCEConfigurationError::ParseError(ref cause) => cause,
DeleteVPCEConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAccountSettingsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetAccountSettingsError {
pub fn from_response(res: BufferedHttpResponse) -> GetAccountSettingsError {
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 {
"ArgumentException" => {
return GetAccountSettingsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetAccountSettingsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return GetAccountSettingsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetAccountSettingsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetAccountSettingsError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetAccountSettingsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetAccountSettingsError {
fn from(err: serde_json::error::Error) -> GetAccountSettingsError {
GetAccountSettingsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetAccountSettingsError {
fn from(err: CredentialsError) -> GetAccountSettingsError {
GetAccountSettingsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetAccountSettingsError {
fn from(err: HttpDispatchError) -> GetAccountSettingsError {
GetAccountSettingsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetAccountSettingsError {
fn from(err: io::Error) -> GetAccountSettingsError {
GetAccountSettingsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetAccountSettingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAccountSettingsError {
fn description(&self) -> &str {
match *self {
GetAccountSettingsError::Argument(ref cause) => cause,
GetAccountSettingsError::LimitExceeded(ref cause) => cause,
GetAccountSettingsError::NotFound(ref cause) => cause,
GetAccountSettingsError::ServiceAccount(ref cause) => cause,
GetAccountSettingsError::Validation(ref cause) => cause,
GetAccountSettingsError::Credentials(ref err) => err.description(),
GetAccountSettingsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetAccountSettingsError::ParseError(ref cause) => cause,
GetAccountSettingsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDeviceError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDeviceError {
pub fn from_response(res: BufferedHttpResponse) -> GetDeviceError {
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 {
"ArgumentException" => return GetDeviceError::Argument(String::from(error_message)),
"LimitExceededException" => {
return GetDeviceError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return GetDeviceError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return GetDeviceError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetDeviceError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetDeviceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDeviceError {
fn from(err: serde_json::error::Error) -> GetDeviceError {
GetDeviceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDeviceError {
fn from(err: CredentialsError) -> GetDeviceError {
GetDeviceError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDeviceError {
fn from(err: HttpDispatchError) -> GetDeviceError {
GetDeviceError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDeviceError {
fn from(err: io::Error) -> GetDeviceError {
GetDeviceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDeviceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDeviceError {
fn description(&self) -> &str {
match *self {
GetDeviceError::Argument(ref cause) => cause,
GetDeviceError::LimitExceeded(ref cause) => cause,
GetDeviceError::NotFound(ref cause) => cause,
GetDeviceError::ServiceAccount(ref cause) => cause,
GetDeviceError::Validation(ref cause) => cause,
GetDeviceError::Credentials(ref err) => err.description(),
GetDeviceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetDeviceError::ParseError(ref cause) => cause,
GetDeviceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDeviceInstanceError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDeviceInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> GetDeviceInstanceError {
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 {
"ArgumentException" => {
return GetDeviceInstanceError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetDeviceInstanceError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return GetDeviceInstanceError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetDeviceInstanceError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetDeviceInstanceError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetDeviceInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDeviceInstanceError {
fn from(err: serde_json::error::Error) -> GetDeviceInstanceError {
GetDeviceInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDeviceInstanceError {
fn from(err: CredentialsError) -> GetDeviceInstanceError {
GetDeviceInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDeviceInstanceError {
fn from(err: HttpDispatchError) -> GetDeviceInstanceError {
GetDeviceInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDeviceInstanceError {
fn from(err: io::Error) -> GetDeviceInstanceError {
GetDeviceInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDeviceInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDeviceInstanceError {
fn description(&self) -> &str {
match *self {
GetDeviceInstanceError::Argument(ref cause) => cause,
GetDeviceInstanceError::LimitExceeded(ref cause) => cause,
GetDeviceInstanceError::NotFound(ref cause) => cause,
GetDeviceInstanceError::ServiceAccount(ref cause) => cause,
GetDeviceInstanceError::Validation(ref cause) => cause,
GetDeviceInstanceError::Credentials(ref err) => err.description(),
GetDeviceInstanceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetDeviceInstanceError::ParseError(ref cause) => cause,
GetDeviceInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDevicePoolError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDevicePoolError {
pub fn from_response(res: BufferedHttpResponse) -> GetDevicePoolError {
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 {
"ArgumentException" => {
return GetDevicePoolError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetDevicePoolError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return GetDevicePoolError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetDevicePoolError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetDevicePoolError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetDevicePoolError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDevicePoolError {
fn from(err: serde_json::error::Error) -> GetDevicePoolError {
GetDevicePoolError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDevicePoolError {
fn from(err: CredentialsError) -> GetDevicePoolError {
GetDevicePoolError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDevicePoolError {
fn from(err: HttpDispatchError) -> GetDevicePoolError {
GetDevicePoolError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDevicePoolError {
fn from(err: io::Error) -> GetDevicePoolError {
GetDevicePoolError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDevicePoolError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDevicePoolError {
fn description(&self) -> &str {
match *self {
GetDevicePoolError::Argument(ref cause) => cause,
GetDevicePoolError::LimitExceeded(ref cause) => cause,
GetDevicePoolError::NotFound(ref cause) => cause,
GetDevicePoolError::ServiceAccount(ref cause) => cause,
GetDevicePoolError::Validation(ref cause) => cause,
GetDevicePoolError::Credentials(ref err) => err.description(),
GetDevicePoolError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetDevicePoolError::ParseError(ref cause) => cause,
GetDevicePoolError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDevicePoolCompatibilityError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDevicePoolCompatibilityError {
pub fn from_response(res: BufferedHttpResponse) -> GetDevicePoolCompatibilityError {
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 {
"ArgumentException" => {
return GetDevicePoolCompatibilityError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetDevicePoolCompatibilityError::LimitExceeded(String::from(
error_message,
))
}
"NotFoundException" => {
return GetDevicePoolCompatibilityError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetDevicePoolCompatibilityError::ServiceAccount(String::from(
error_message,
))
}
"ValidationException" => {
return GetDevicePoolCompatibilityError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetDevicePoolCompatibilityError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDevicePoolCompatibilityError {
fn from(err: serde_json::error::Error) -> GetDevicePoolCompatibilityError {
GetDevicePoolCompatibilityError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDevicePoolCompatibilityError {
fn from(err: CredentialsError) -> GetDevicePoolCompatibilityError {
GetDevicePoolCompatibilityError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDevicePoolCompatibilityError {
fn from(err: HttpDispatchError) -> GetDevicePoolCompatibilityError {
GetDevicePoolCompatibilityError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDevicePoolCompatibilityError {
fn from(err: io::Error) -> GetDevicePoolCompatibilityError {
GetDevicePoolCompatibilityError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDevicePoolCompatibilityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDevicePoolCompatibilityError {
fn description(&self) -> &str {
match *self {
GetDevicePoolCompatibilityError::Argument(ref cause) => cause,
GetDevicePoolCompatibilityError::LimitExceeded(ref cause) => cause,
GetDevicePoolCompatibilityError::NotFound(ref cause) => cause,
GetDevicePoolCompatibilityError::ServiceAccount(ref cause) => cause,
GetDevicePoolCompatibilityError::Validation(ref cause) => cause,
GetDevicePoolCompatibilityError::Credentials(ref err) => err.description(),
GetDevicePoolCompatibilityError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetDevicePoolCompatibilityError::ParseError(ref cause) => cause,
GetDevicePoolCompatibilityError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInstanceProfileError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetInstanceProfileError {
pub fn from_response(res: BufferedHttpResponse) -> GetInstanceProfileError {
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 {
"ArgumentException" => {
return GetInstanceProfileError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetInstanceProfileError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return GetInstanceProfileError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetInstanceProfileError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetInstanceProfileError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetInstanceProfileError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetInstanceProfileError {
fn from(err: serde_json::error::Error) -> GetInstanceProfileError {
GetInstanceProfileError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetInstanceProfileError {
fn from(err: CredentialsError) -> GetInstanceProfileError {
GetInstanceProfileError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetInstanceProfileError {
fn from(err: HttpDispatchError) -> GetInstanceProfileError {
GetInstanceProfileError::HttpDispatch(err)
}
}
impl From<io::Error> for GetInstanceProfileError {
fn from(err: io::Error) -> GetInstanceProfileError {
GetInstanceProfileError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetInstanceProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInstanceProfileError {
fn description(&self) -> &str {
match *self {
GetInstanceProfileError::Argument(ref cause) => cause,
GetInstanceProfileError::LimitExceeded(ref cause) => cause,
GetInstanceProfileError::NotFound(ref cause) => cause,
GetInstanceProfileError::ServiceAccount(ref cause) => cause,
GetInstanceProfileError::Validation(ref cause) => cause,
GetInstanceProfileError::Credentials(ref err) => err.description(),
GetInstanceProfileError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetInstanceProfileError::ParseError(ref cause) => cause,
GetInstanceProfileError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetJobError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetJobError {
pub fn from_response(res: BufferedHttpResponse) -> GetJobError {
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 {
"ArgumentException" => return GetJobError::Argument(String::from(error_message)),
"LimitExceededException" => {
return GetJobError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return GetJobError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return GetJobError::ServiceAccount(String::from(error_message))
}
"ValidationException" => return GetJobError::Validation(error_message.to_string()),
_ => {}
}
}
return GetJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetJobError {
fn from(err: serde_json::error::Error) -> GetJobError {
GetJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetJobError {
fn from(err: CredentialsError) -> GetJobError {
GetJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetJobError {
fn from(err: HttpDispatchError) -> GetJobError {
GetJobError::HttpDispatch(err)
}
}
impl From<io::Error> for GetJobError {
fn from(err: io::Error) -> GetJobError {
GetJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetJobError {
fn description(&self) -> &str {
match *self {
GetJobError::Argument(ref cause) => cause,
GetJobError::LimitExceeded(ref cause) => cause,
GetJobError::NotFound(ref cause) => cause,
GetJobError::ServiceAccount(ref cause) => cause,
GetJobError::Validation(ref cause) => cause,
GetJobError::Credentials(ref err) => err.description(),
GetJobError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetJobError::ParseError(ref cause) => cause,
GetJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetNetworkProfileError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetNetworkProfileError {
pub fn from_response(res: BufferedHttpResponse) -> GetNetworkProfileError {
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 {
"ArgumentException" => {
return GetNetworkProfileError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetNetworkProfileError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return GetNetworkProfileError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetNetworkProfileError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetNetworkProfileError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetNetworkProfileError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetNetworkProfileError {
fn from(err: serde_json::error::Error) -> GetNetworkProfileError {
GetNetworkProfileError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetNetworkProfileError {
fn from(err: CredentialsError) -> GetNetworkProfileError {
GetNetworkProfileError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetNetworkProfileError {
fn from(err: HttpDispatchError) -> GetNetworkProfileError {
GetNetworkProfileError::HttpDispatch(err)
}
}
impl From<io::Error> for GetNetworkProfileError {
fn from(err: io::Error) -> GetNetworkProfileError {
GetNetworkProfileError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetNetworkProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetNetworkProfileError {
fn description(&self) -> &str {
match *self {
GetNetworkProfileError::Argument(ref cause) => cause,
GetNetworkProfileError::LimitExceeded(ref cause) => cause,
GetNetworkProfileError::NotFound(ref cause) => cause,
GetNetworkProfileError::ServiceAccount(ref cause) => cause,
GetNetworkProfileError::Validation(ref cause) => cause,
GetNetworkProfileError::Credentials(ref err) => err.description(),
GetNetworkProfileError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetNetworkProfileError::ParseError(ref cause) => cause,
GetNetworkProfileError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetOfferingStatusError {
Argument(String),
LimitExceeded(String),
NotEligible(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetOfferingStatusError {
pub fn from_response(res: BufferedHttpResponse) -> GetOfferingStatusError {
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 {
"ArgumentException" => {
return GetOfferingStatusError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetOfferingStatusError::LimitExceeded(String::from(error_message))
}
"NotEligibleException" => {
return GetOfferingStatusError::NotEligible(String::from(error_message))
}
"NotFoundException" => {
return GetOfferingStatusError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetOfferingStatusError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetOfferingStatusError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetOfferingStatusError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetOfferingStatusError {
fn from(err: serde_json::error::Error) -> GetOfferingStatusError {
GetOfferingStatusError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetOfferingStatusError {
fn from(err: CredentialsError) -> GetOfferingStatusError {
GetOfferingStatusError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetOfferingStatusError {
fn from(err: HttpDispatchError) -> GetOfferingStatusError {
GetOfferingStatusError::HttpDispatch(err)
}
}
impl From<io::Error> for GetOfferingStatusError {
fn from(err: io::Error) -> GetOfferingStatusError {
GetOfferingStatusError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetOfferingStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetOfferingStatusError {
fn description(&self) -> &str {
match *self {
GetOfferingStatusError::Argument(ref cause) => cause,
GetOfferingStatusError::LimitExceeded(ref cause) => cause,
GetOfferingStatusError::NotEligible(ref cause) => cause,
GetOfferingStatusError::NotFound(ref cause) => cause,
GetOfferingStatusError::ServiceAccount(ref cause) => cause,
GetOfferingStatusError::Validation(ref cause) => cause,
GetOfferingStatusError::Credentials(ref err) => err.description(),
GetOfferingStatusError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetOfferingStatusError::ParseError(ref cause) => cause,
GetOfferingStatusError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetProjectError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetProjectError {
pub fn from_response(res: BufferedHttpResponse) -> GetProjectError {
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 {
"ArgumentException" => {
return GetProjectError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetProjectError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return GetProjectError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetProjectError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetProjectError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetProjectError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetProjectError {
fn from(err: serde_json::error::Error) -> GetProjectError {
GetProjectError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetProjectError {
fn from(err: CredentialsError) -> GetProjectError {
GetProjectError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetProjectError {
fn from(err: HttpDispatchError) -> GetProjectError {
GetProjectError::HttpDispatch(err)
}
}
impl From<io::Error> for GetProjectError {
fn from(err: io::Error) -> GetProjectError {
GetProjectError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetProjectError {
fn description(&self) -> &str {
match *self {
GetProjectError::Argument(ref cause) => cause,
GetProjectError::LimitExceeded(ref cause) => cause,
GetProjectError::NotFound(ref cause) => cause,
GetProjectError::ServiceAccount(ref cause) => cause,
GetProjectError::Validation(ref cause) => cause,
GetProjectError::Credentials(ref err) => err.description(),
GetProjectError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetProjectError::ParseError(ref cause) => cause,
GetProjectError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRemoteAccessSessionError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRemoteAccessSessionError {
pub fn from_response(res: BufferedHttpResponse) -> GetRemoteAccessSessionError {
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 {
"ArgumentException" => {
return GetRemoteAccessSessionError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return GetRemoteAccessSessionError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return GetRemoteAccessSessionError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetRemoteAccessSessionError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetRemoteAccessSessionError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetRemoteAccessSessionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRemoteAccessSessionError {
fn from(err: serde_json::error::Error) -> GetRemoteAccessSessionError {
GetRemoteAccessSessionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRemoteAccessSessionError {
fn from(err: CredentialsError) -> GetRemoteAccessSessionError {
GetRemoteAccessSessionError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRemoteAccessSessionError {
fn from(err: HttpDispatchError) -> GetRemoteAccessSessionError {
GetRemoteAccessSessionError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRemoteAccessSessionError {
fn from(err: io::Error) -> GetRemoteAccessSessionError {
GetRemoteAccessSessionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRemoteAccessSessionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRemoteAccessSessionError {
fn description(&self) -> &str {
match *self {
GetRemoteAccessSessionError::Argument(ref cause) => cause,
GetRemoteAccessSessionError::LimitExceeded(ref cause) => cause,
GetRemoteAccessSessionError::NotFound(ref cause) => cause,
GetRemoteAccessSessionError::ServiceAccount(ref cause) => cause,
GetRemoteAccessSessionError::Validation(ref cause) => cause,
GetRemoteAccessSessionError::Credentials(ref err) => err.description(),
GetRemoteAccessSessionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetRemoteAccessSessionError::ParseError(ref cause) => cause,
GetRemoteAccessSessionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRunError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetRunError {
pub fn from_response(res: BufferedHttpResponse) -> GetRunError {
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 {
"ArgumentException" => return GetRunError::Argument(String::from(error_message)),
"LimitExceededException" => {
return GetRunError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return GetRunError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return GetRunError::ServiceAccount(String::from(error_message))
}
"ValidationException" => return GetRunError::Validation(error_message.to_string()),
_ => {}
}
}
return GetRunError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetRunError {
fn from(err: serde_json::error::Error) -> GetRunError {
GetRunError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetRunError {
fn from(err: CredentialsError) -> GetRunError {
GetRunError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetRunError {
fn from(err: HttpDispatchError) -> GetRunError {
GetRunError::HttpDispatch(err)
}
}
impl From<io::Error> for GetRunError {
fn from(err: io::Error) -> GetRunError {
GetRunError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetRunError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRunError {
fn description(&self) -> &str {
match *self {
GetRunError::Argument(ref cause) => cause,
GetRunError::LimitExceeded(ref cause) => cause,
GetRunError::NotFound(ref cause) => cause,
GetRunError::ServiceAccount(ref cause) => cause,
GetRunError::Validation(ref cause) => cause,
GetRunError::Credentials(ref err) => err.description(),
GetRunError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetRunError::ParseError(ref cause) => cause,
GetRunError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetSuiteError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetSuiteError {
pub fn from_response(res: BufferedHttpResponse) -> GetSuiteError {
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 {
"ArgumentException" => return GetSuiteError::Argument(String::from(error_message)),
"LimitExceededException" => {
return GetSuiteError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return GetSuiteError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return GetSuiteError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetSuiteError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetSuiteError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetSuiteError {
fn from(err: serde_json::error::Error) -> GetSuiteError {
GetSuiteError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetSuiteError {
fn from(err: CredentialsError) -> GetSuiteError {
GetSuiteError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetSuiteError {
fn from(err: HttpDispatchError) -> GetSuiteError {
GetSuiteError::HttpDispatch(err)
}
}
impl From<io::Error> for GetSuiteError {
fn from(err: io::Error) -> GetSuiteError {
GetSuiteError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetSuiteError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetSuiteError {
fn description(&self) -> &str {
match *self {
GetSuiteError::Argument(ref cause) => cause,
GetSuiteError::LimitExceeded(ref cause) => cause,
GetSuiteError::NotFound(ref cause) => cause,
GetSuiteError::ServiceAccount(ref cause) => cause,
GetSuiteError::Validation(ref cause) => cause,
GetSuiteError::Credentials(ref err) => err.description(),
GetSuiteError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetSuiteError::ParseError(ref cause) => cause,
GetSuiteError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetTestError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetTestError {
pub fn from_response(res: BufferedHttpResponse) -> GetTestError {
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 {
"ArgumentException" => return GetTestError::Argument(String::from(error_message)),
"LimitExceededException" => {
return GetTestError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return GetTestError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return GetTestError::ServiceAccount(String::from(error_message))
}
"ValidationException" => return GetTestError::Validation(error_message.to_string()),
_ => {}
}
}
return GetTestError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetTestError {
fn from(err: serde_json::error::Error) -> GetTestError {
GetTestError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetTestError {
fn from(err: CredentialsError) -> GetTestError {
GetTestError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetTestError {
fn from(err: HttpDispatchError) -> GetTestError {
GetTestError::HttpDispatch(err)
}
}
impl From<io::Error> for GetTestError {
fn from(err: io::Error) -> GetTestError {
GetTestError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetTestError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetTestError {
fn description(&self) -> &str {
match *self {
GetTestError::Argument(ref cause) => cause,
GetTestError::LimitExceeded(ref cause) => cause,
GetTestError::NotFound(ref cause) => cause,
GetTestError::ServiceAccount(ref cause) => cause,
GetTestError::Validation(ref cause) => cause,
GetTestError::Credentials(ref err) => err.description(),
GetTestError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetTestError::ParseError(ref cause) => cause,
GetTestError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetUploadError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetUploadError {
pub fn from_response(res: BufferedHttpResponse) -> GetUploadError {
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 {
"ArgumentException" => return GetUploadError::Argument(String::from(error_message)),
"LimitExceededException" => {
return GetUploadError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return GetUploadError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return GetUploadError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetUploadError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetUploadError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetUploadError {
fn from(err: serde_json::error::Error) -> GetUploadError {
GetUploadError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetUploadError {
fn from(err: CredentialsError) -> GetUploadError {
GetUploadError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetUploadError {
fn from(err: HttpDispatchError) -> GetUploadError {
GetUploadError::HttpDispatch(err)
}
}
impl From<io::Error> for GetUploadError {
fn from(err: io::Error) -> GetUploadError {
GetUploadError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetUploadError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetUploadError {
fn description(&self) -> &str {
match *self {
GetUploadError::Argument(ref cause) => cause,
GetUploadError::LimitExceeded(ref cause) => cause,
GetUploadError::NotFound(ref cause) => cause,
GetUploadError::ServiceAccount(ref cause) => cause,
GetUploadError::Validation(ref cause) => cause,
GetUploadError::Credentials(ref err) => err.description(),
GetUploadError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
GetUploadError::ParseError(ref cause) => cause,
GetUploadError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetVPCEConfigurationError {
Argument(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetVPCEConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> GetVPCEConfigurationError {
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 {
"ArgumentException" => {
return GetVPCEConfigurationError::Argument(String::from(error_message))
}
"NotFoundException" => {
return GetVPCEConfigurationError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return GetVPCEConfigurationError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return GetVPCEConfigurationError::Validation(error_message.to_string())
}
_ => {}
}
}
return GetVPCEConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetVPCEConfigurationError {
fn from(err: serde_json::error::Error) -> GetVPCEConfigurationError {
GetVPCEConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetVPCEConfigurationError {
fn from(err: CredentialsError) -> GetVPCEConfigurationError {
GetVPCEConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetVPCEConfigurationError {
fn from(err: HttpDispatchError) -> GetVPCEConfigurationError {
GetVPCEConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for GetVPCEConfigurationError {
fn from(err: io::Error) -> GetVPCEConfigurationError {
GetVPCEConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetVPCEConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetVPCEConfigurationError {
fn description(&self) -> &str {
match *self {
GetVPCEConfigurationError::Argument(ref cause) => cause,
GetVPCEConfigurationError::NotFound(ref cause) => cause,
GetVPCEConfigurationError::ServiceAccount(ref cause) => cause,
GetVPCEConfigurationError::Validation(ref cause) => cause,
GetVPCEConfigurationError::Credentials(ref err) => err.description(),
GetVPCEConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetVPCEConfigurationError::ParseError(ref cause) => cause,
GetVPCEConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum InstallToRemoteAccessSessionError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl InstallToRemoteAccessSessionError {
pub fn from_response(res: BufferedHttpResponse) -> InstallToRemoteAccessSessionError {
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 {
"ArgumentException" => {
return InstallToRemoteAccessSessionError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return InstallToRemoteAccessSessionError::LimitExceeded(String::from(
error_message,
))
}
"NotFoundException" => {
return InstallToRemoteAccessSessionError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return InstallToRemoteAccessSessionError::ServiceAccount(String::from(
error_message,
))
}
"ValidationException" => {
return InstallToRemoteAccessSessionError::Validation(error_message.to_string())
}
_ => {}
}
}
return InstallToRemoteAccessSessionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for InstallToRemoteAccessSessionError {
fn from(err: serde_json::error::Error) -> InstallToRemoteAccessSessionError {
InstallToRemoteAccessSessionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for InstallToRemoteAccessSessionError {
fn from(err: CredentialsError) -> InstallToRemoteAccessSessionError {
InstallToRemoteAccessSessionError::Credentials(err)
}
}
impl From<HttpDispatchError> for InstallToRemoteAccessSessionError {
fn from(err: HttpDispatchError) -> InstallToRemoteAccessSessionError {
InstallToRemoteAccessSessionError::HttpDispatch(err)
}
}
impl From<io::Error> for InstallToRemoteAccessSessionError {
fn from(err: io::Error) -> InstallToRemoteAccessSessionError {
InstallToRemoteAccessSessionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for InstallToRemoteAccessSessionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for InstallToRemoteAccessSessionError {
fn description(&self) -> &str {
match *self {
InstallToRemoteAccessSessionError::Argument(ref cause) => cause,
InstallToRemoteAccessSessionError::LimitExceeded(ref cause) => cause,
InstallToRemoteAccessSessionError::NotFound(ref cause) => cause,
InstallToRemoteAccessSessionError::ServiceAccount(ref cause) => cause,
InstallToRemoteAccessSessionError::Validation(ref cause) => cause,
InstallToRemoteAccessSessionError::Credentials(ref err) => err.description(),
InstallToRemoteAccessSessionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
InstallToRemoteAccessSessionError::ParseError(ref cause) => cause,
InstallToRemoteAccessSessionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListArtifactsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListArtifactsError {
pub fn from_response(res: BufferedHttpResponse) -> ListArtifactsError {
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 {
"ArgumentException" => {
return ListArtifactsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListArtifactsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListArtifactsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListArtifactsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListArtifactsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListArtifactsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListArtifactsError {
fn from(err: serde_json::error::Error) -> ListArtifactsError {
ListArtifactsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListArtifactsError {
fn from(err: CredentialsError) -> ListArtifactsError {
ListArtifactsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListArtifactsError {
fn from(err: HttpDispatchError) -> ListArtifactsError {
ListArtifactsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListArtifactsError {
fn from(err: io::Error) -> ListArtifactsError {
ListArtifactsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListArtifactsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListArtifactsError {
fn description(&self) -> &str {
match *self {
ListArtifactsError::Argument(ref cause) => cause,
ListArtifactsError::LimitExceeded(ref cause) => cause,
ListArtifactsError::NotFound(ref cause) => cause,
ListArtifactsError::ServiceAccount(ref cause) => cause,
ListArtifactsError::Validation(ref cause) => cause,
ListArtifactsError::Credentials(ref err) => err.description(),
ListArtifactsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListArtifactsError::ParseError(ref cause) => cause,
ListArtifactsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDeviceInstancesError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListDeviceInstancesError {
pub fn from_response(res: BufferedHttpResponse) -> ListDeviceInstancesError {
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 {
"ArgumentException" => {
return ListDeviceInstancesError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListDeviceInstancesError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListDeviceInstancesError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListDeviceInstancesError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListDeviceInstancesError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListDeviceInstancesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListDeviceInstancesError {
fn from(err: serde_json::error::Error) -> ListDeviceInstancesError {
ListDeviceInstancesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListDeviceInstancesError {
fn from(err: CredentialsError) -> ListDeviceInstancesError {
ListDeviceInstancesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListDeviceInstancesError {
fn from(err: HttpDispatchError) -> ListDeviceInstancesError {
ListDeviceInstancesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListDeviceInstancesError {
fn from(err: io::Error) -> ListDeviceInstancesError {
ListDeviceInstancesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListDeviceInstancesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDeviceInstancesError {
fn description(&self) -> &str {
match *self {
ListDeviceInstancesError::Argument(ref cause) => cause,
ListDeviceInstancesError::LimitExceeded(ref cause) => cause,
ListDeviceInstancesError::NotFound(ref cause) => cause,
ListDeviceInstancesError::ServiceAccount(ref cause) => cause,
ListDeviceInstancesError::Validation(ref cause) => cause,
ListDeviceInstancesError::Credentials(ref err) => err.description(),
ListDeviceInstancesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListDeviceInstancesError::ParseError(ref cause) => cause,
ListDeviceInstancesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDevicePoolsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListDevicePoolsError {
pub fn from_response(res: BufferedHttpResponse) -> ListDevicePoolsError {
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 {
"ArgumentException" => {
return ListDevicePoolsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListDevicePoolsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListDevicePoolsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListDevicePoolsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListDevicePoolsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListDevicePoolsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListDevicePoolsError {
fn from(err: serde_json::error::Error) -> ListDevicePoolsError {
ListDevicePoolsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListDevicePoolsError {
fn from(err: CredentialsError) -> ListDevicePoolsError {
ListDevicePoolsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListDevicePoolsError {
fn from(err: HttpDispatchError) -> ListDevicePoolsError {
ListDevicePoolsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListDevicePoolsError {
fn from(err: io::Error) -> ListDevicePoolsError {
ListDevicePoolsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListDevicePoolsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDevicePoolsError {
fn description(&self) -> &str {
match *self {
ListDevicePoolsError::Argument(ref cause) => cause,
ListDevicePoolsError::LimitExceeded(ref cause) => cause,
ListDevicePoolsError::NotFound(ref cause) => cause,
ListDevicePoolsError::ServiceAccount(ref cause) => cause,
ListDevicePoolsError::Validation(ref cause) => cause,
ListDevicePoolsError::Credentials(ref err) => err.description(),
ListDevicePoolsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListDevicePoolsError::ParseError(ref cause) => cause,
ListDevicePoolsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDevicesError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListDevicesError {
pub fn from_response(res: BufferedHttpResponse) -> ListDevicesError {
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 {
"ArgumentException" => {
return ListDevicesError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListDevicesError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListDevicesError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListDevicesError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListDevicesError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListDevicesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListDevicesError {
fn from(err: serde_json::error::Error) -> ListDevicesError {
ListDevicesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListDevicesError {
fn from(err: CredentialsError) -> ListDevicesError {
ListDevicesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListDevicesError {
fn from(err: HttpDispatchError) -> ListDevicesError {
ListDevicesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListDevicesError {
fn from(err: io::Error) -> ListDevicesError {
ListDevicesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListDevicesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDevicesError {
fn description(&self) -> &str {
match *self {
ListDevicesError::Argument(ref cause) => cause,
ListDevicesError::LimitExceeded(ref cause) => cause,
ListDevicesError::NotFound(ref cause) => cause,
ListDevicesError::ServiceAccount(ref cause) => cause,
ListDevicesError::Validation(ref cause) => cause,
ListDevicesError::Credentials(ref err) => err.description(),
ListDevicesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListDevicesError::ParseError(ref cause) => cause,
ListDevicesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListInstanceProfilesError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListInstanceProfilesError {
pub fn from_response(res: BufferedHttpResponse) -> ListInstanceProfilesError {
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 {
"ArgumentException" => {
return ListInstanceProfilesError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListInstanceProfilesError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListInstanceProfilesError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListInstanceProfilesError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListInstanceProfilesError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListInstanceProfilesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListInstanceProfilesError {
fn from(err: serde_json::error::Error) -> ListInstanceProfilesError {
ListInstanceProfilesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListInstanceProfilesError {
fn from(err: CredentialsError) -> ListInstanceProfilesError {
ListInstanceProfilesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListInstanceProfilesError {
fn from(err: HttpDispatchError) -> ListInstanceProfilesError {
ListInstanceProfilesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListInstanceProfilesError {
fn from(err: io::Error) -> ListInstanceProfilesError {
ListInstanceProfilesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListInstanceProfilesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListInstanceProfilesError {
fn description(&self) -> &str {
match *self {
ListInstanceProfilesError::Argument(ref cause) => cause,
ListInstanceProfilesError::LimitExceeded(ref cause) => cause,
ListInstanceProfilesError::NotFound(ref cause) => cause,
ListInstanceProfilesError::ServiceAccount(ref cause) => cause,
ListInstanceProfilesError::Validation(ref cause) => cause,
ListInstanceProfilesError::Credentials(ref err) => err.description(),
ListInstanceProfilesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListInstanceProfilesError::ParseError(ref cause) => cause,
ListInstanceProfilesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListJobsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListJobsError {
pub fn from_response(res: BufferedHttpResponse) -> ListJobsError {
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 {
"ArgumentException" => return ListJobsError::Argument(String::from(error_message)),
"LimitExceededException" => {
return ListJobsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return ListJobsError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return ListJobsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListJobsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListJobsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListJobsError {
fn from(err: serde_json::error::Error) -> ListJobsError {
ListJobsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListJobsError {
fn from(err: CredentialsError) -> ListJobsError {
ListJobsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListJobsError {
fn from(err: HttpDispatchError) -> ListJobsError {
ListJobsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListJobsError {
fn from(err: io::Error) -> ListJobsError {
ListJobsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListJobsError {
fn description(&self) -> &str {
match *self {
ListJobsError::Argument(ref cause) => cause,
ListJobsError::LimitExceeded(ref cause) => cause,
ListJobsError::NotFound(ref cause) => cause,
ListJobsError::ServiceAccount(ref cause) => cause,
ListJobsError::Validation(ref cause) => cause,
ListJobsError::Credentials(ref err) => err.description(),
ListJobsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListJobsError::ParseError(ref cause) => cause,
ListJobsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListNetworkProfilesError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListNetworkProfilesError {
pub fn from_response(res: BufferedHttpResponse) -> ListNetworkProfilesError {
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 {
"ArgumentException" => {
return ListNetworkProfilesError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListNetworkProfilesError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListNetworkProfilesError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListNetworkProfilesError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListNetworkProfilesError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListNetworkProfilesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListNetworkProfilesError {
fn from(err: serde_json::error::Error) -> ListNetworkProfilesError {
ListNetworkProfilesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListNetworkProfilesError {
fn from(err: CredentialsError) -> ListNetworkProfilesError {
ListNetworkProfilesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListNetworkProfilesError {
fn from(err: HttpDispatchError) -> ListNetworkProfilesError {
ListNetworkProfilesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListNetworkProfilesError {
fn from(err: io::Error) -> ListNetworkProfilesError {
ListNetworkProfilesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListNetworkProfilesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListNetworkProfilesError {
fn description(&self) -> &str {
match *self {
ListNetworkProfilesError::Argument(ref cause) => cause,
ListNetworkProfilesError::LimitExceeded(ref cause) => cause,
ListNetworkProfilesError::NotFound(ref cause) => cause,
ListNetworkProfilesError::ServiceAccount(ref cause) => cause,
ListNetworkProfilesError::Validation(ref cause) => cause,
ListNetworkProfilesError::Credentials(ref err) => err.description(),
ListNetworkProfilesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListNetworkProfilesError::ParseError(ref cause) => cause,
ListNetworkProfilesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListOfferingPromotionsError {
Argument(String),
LimitExceeded(String),
NotEligible(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListOfferingPromotionsError {
pub fn from_response(res: BufferedHttpResponse) -> ListOfferingPromotionsError {
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 {
"ArgumentException" => {
return ListOfferingPromotionsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListOfferingPromotionsError::LimitExceeded(String::from(error_message))
}
"NotEligibleException" => {
return ListOfferingPromotionsError::NotEligible(String::from(error_message))
}
"NotFoundException" => {
return ListOfferingPromotionsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListOfferingPromotionsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListOfferingPromotionsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListOfferingPromotionsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListOfferingPromotionsError {
fn from(err: serde_json::error::Error) -> ListOfferingPromotionsError {
ListOfferingPromotionsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListOfferingPromotionsError {
fn from(err: CredentialsError) -> ListOfferingPromotionsError {
ListOfferingPromotionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListOfferingPromotionsError {
fn from(err: HttpDispatchError) -> ListOfferingPromotionsError {
ListOfferingPromotionsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListOfferingPromotionsError {
fn from(err: io::Error) -> ListOfferingPromotionsError {
ListOfferingPromotionsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListOfferingPromotionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListOfferingPromotionsError {
fn description(&self) -> &str {
match *self {
ListOfferingPromotionsError::Argument(ref cause) => cause,
ListOfferingPromotionsError::LimitExceeded(ref cause) => cause,
ListOfferingPromotionsError::NotEligible(ref cause) => cause,
ListOfferingPromotionsError::NotFound(ref cause) => cause,
ListOfferingPromotionsError::ServiceAccount(ref cause) => cause,
ListOfferingPromotionsError::Validation(ref cause) => cause,
ListOfferingPromotionsError::Credentials(ref err) => err.description(),
ListOfferingPromotionsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListOfferingPromotionsError::ParseError(ref cause) => cause,
ListOfferingPromotionsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListOfferingTransactionsError {
Argument(String),
LimitExceeded(String),
NotEligible(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListOfferingTransactionsError {
pub fn from_response(res: BufferedHttpResponse) -> ListOfferingTransactionsError {
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 {
"ArgumentException" => {
return ListOfferingTransactionsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListOfferingTransactionsError::LimitExceeded(String::from(error_message))
}
"NotEligibleException" => {
return ListOfferingTransactionsError::NotEligible(String::from(error_message))
}
"NotFoundException" => {
return ListOfferingTransactionsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListOfferingTransactionsError::ServiceAccount(String::from(
error_message,
))
}
"ValidationException" => {
return ListOfferingTransactionsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListOfferingTransactionsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListOfferingTransactionsError {
fn from(err: serde_json::error::Error) -> ListOfferingTransactionsError {
ListOfferingTransactionsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListOfferingTransactionsError {
fn from(err: CredentialsError) -> ListOfferingTransactionsError {
ListOfferingTransactionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListOfferingTransactionsError {
fn from(err: HttpDispatchError) -> ListOfferingTransactionsError {
ListOfferingTransactionsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListOfferingTransactionsError {
fn from(err: io::Error) -> ListOfferingTransactionsError {
ListOfferingTransactionsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListOfferingTransactionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListOfferingTransactionsError {
fn description(&self) -> &str {
match *self {
ListOfferingTransactionsError::Argument(ref cause) => cause,
ListOfferingTransactionsError::LimitExceeded(ref cause) => cause,
ListOfferingTransactionsError::NotEligible(ref cause) => cause,
ListOfferingTransactionsError::NotFound(ref cause) => cause,
ListOfferingTransactionsError::ServiceAccount(ref cause) => cause,
ListOfferingTransactionsError::Validation(ref cause) => cause,
ListOfferingTransactionsError::Credentials(ref err) => err.description(),
ListOfferingTransactionsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListOfferingTransactionsError::ParseError(ref cause) => cause,
ListOfferingTransactionsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListOfferingsError {
Argument(String),
LimitExceeded(String),
NotEligible(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListOfferingsError {
pub fn from_response(res: BufferedHttpResponse) -> ListOfferingsError {
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 {
"ArgumentException" => {
return ListOfferingsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListOfferingsError::LimitExceeded(String::from(error_message))
}
"NotEligibleException" => {
return ListOfferingsError::NotEligible(String::from(error_message))
}
"NotFoundException" => {
return ListOfferingsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListOfferingsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListOfferingsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListOfferingsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListOfferingsError {
fn from(err: serde_json::error::Error) -> ListOfferingsError {
ListOfferingsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListOfferingsError {
fn from(err: CredentialsError) -> ListOfferingsError {
ListOfferingsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListOfferingsError {
fn from(err: HttpDispatchError) -> ListOfferingsError {
ListOfferingsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListOfferingsError {
fn from(err: io::Error) -> ListOfferingsError {
ListOfferingsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListOfferingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListOfferingsError {
fn description(&self) -> &str {
match *self {
ListOfferingsError::Argument(ref cause) => cause,
ListOfferingsError::LimitExceeded(ref cause) => cause,
ListOfferingsError::NotEligible(ref cause) => cause,
ListOfferingsError::NotFound(ref cause) => cause,
ListOfferingsError::ServiceAccount(ref cause) => cause,
ListOfferingsError::Validation(ref cause) => cause,
ListOfferingsError::Credentials(ref err) => err.description(),
ListOfferingsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListOfferingsError::ParseError(ref cause) => cause,
ListOfferingsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListProjectsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListProjectsError {
pub fn from_response(res: BufferedHttpResponse) -> ListProjectsError {
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 {
"ArgumentException" => {
return ListProjectsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListProjectsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListProjectsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListProjectsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListProjectsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListProjectsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListProjectsError {
fn from(err: serde_json::error::Error) -> ListProjectsError {
ListProjectsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListProjectsError {
fn from(err: CredentialsError) -> ListProjectsError {
ListProjectsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListProjectsError {
fn from(err: HttpDispatchError) -> ListProjectsError {
ListProjectsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListProjectsError {
fn from(err: io::Error) -> ListProjectsError {
ListProjectsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListProjectsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListProjectsError {
fn description(&self) -> &str {
match *self {
ListProjectsError::Argument(ref cause) => cause,
ListProjectsError::LimitExceeded(ref cause) => cause,
ListProjectsError::NotFound(ref cause) => cause,
ListProjectsError::ServiceAccount(ref cause) => cause,
ListProjectsError::Validation(ref cause) => cause,
ListProjectsError::Credentials(ref err) => err.description(),
ListProjectsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListProjectsError::ParseError(ref cause) => cause,
ListProjectsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListRemoteAccessSessionsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListRemoteAccessSessionsError {
pub fn from_response(res: BufferedHttpResponse) -> ListRemoteAccessSessionsError {
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 {
"ArgumentException" => {
return ListRemoteAccessSessionsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListRemoteAccessSessionsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListRemoteAccessSessionsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListRemoteAccessSessionsError::ServiceAccount(String::from(
error_message,
))
}
"ValidationException" => {
return ListRemoteAccessSessionsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListRemoteAccessSessionsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListRemoteAccessSessionsError {
fn from(err: serde_json::error::Error) -> ListRemoteAccessSessionsError {
ListRemoteAccessSessionsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListRemoteAccessSessionsError {
fn from(err: CredentialsError) -> ListRemoteAccessSessionsError {
ListRemoteAccessSessionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListRemoteAccessSessionsError {
fn from(err: HttpDispatchError) -> ListRemoteAccessSessionsError {
ListRemoteAccessSessionsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListRemoteAccessSessionsError {
fn from(err: io::Error) -> ListRemoteAccessSessionsError {
ListRemoteAccessSessionsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListRemoteAccessSessionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListRemoteAccessSessionsError {
fn description(&self) -> &str {
match *self {
ListRemoteAccessSessionsError::Argument(ref cause) => cause,
ListRemoteAccessSessionsError::LimitExceeded(ref cause) => cause,
ListRemoteAccessSessionsError::NotFound(ref cause) => cause,
ListRemoteAccessSessionsError::ServiceAccount(ref cause) => cause,
ListRemoteAccessSessionsError::Validation(ref cause) => cause,
ListRemoteAccessSessionsError::Credentials(ref err) => err.description(),
ListRemoteAccessSessionsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListRemoteAccessSessionsError::ParseError(ref cause) => cause,
ListRemoteAccessSessionsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListRunsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListRunsError {
pub fn from_response(res: BufferedHttpResponse) -> ListRunsError {
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 {
"ArgumentException" => return ListRunsError::Argument(String::from(error_message)),
"LimitExceededException" => {
return ListRunsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return ListRunsError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return ListRunsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListRunsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListRunsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListRunsError {
fn from(err: serde_json::error::Error) -> ListRunsError {
ListRunsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListRunsError {
fn from(err: CredentialsError) -> ListRunsError {
ListRunsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListRunsError {
fn from(err: HttpDispatchError) -> ListRunsError {
ListRunsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListRunsError {
fn from(err: io::Error) -> ListRunsError {
ListRunsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListRunsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListRunsError {
fn description(&self) -> &str {
match *self {
ListRunsError::Argument(ref cause) => cause,
ListRunsError::LimitExceeded(ref cause) => cause,
ListRunsError::NotFound(ref cause) => cause,
ListRunsError::ServiceAccount(ref cause) => cause,
ListRunsError::Validation(ref cause) => cause,
ListRunsError::Credentials(ref err) => err.description(),
ListRunsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListRunsError::ParseError(ref cause) => cause,
ListRunsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListSamplesError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListSamplesError {
pub fn from_response(res: BufferedHttpResponse) -> ListSamplesError {
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 {
"ArgumentException" => {
return ListSamplesError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListSamplesError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListSamplesError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListSamplesError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListSamplesError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListSamplesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListSamplesError {
fn from(err: serde_json::error::Error) -> ListSamplesError {
ListSamplesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListSamplesError {
fn from(err: CredentialsError) -> ListSamplesError {
ListSamplesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListSamplesError {
fn from(err: HttpDispatchError) -> ListSamplesError {
ListSamplesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListSamplesError {
fn from(err: io::Error) -> ListSamplesError {
ListSamplesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListSamplesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListSamplesError {
fn description(&self) -> &str {
match *self {
ListSamplesError::Argument(ref cause) => cause,
ListSamplesError::LimitExceeded(ref cause) => cause,
ListSamplesError::NotFound(ref cause) => cause,
ListSamplesError::ServiceAccount(ref cause) => cause,
ListSamplesError::Validation(ref cause) => cause,
ListSamplesError::Credentials(ref err) => err.description(),
ListSamplesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListSamplesError::ParseError(ref cause) => cause,
ListSamplesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListSuitesError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListSuitesError {
pub fn from_response(res: BufferedHttpResponse) -> ListSuitesError {
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 {
"ArgumentException" => {
return ListSuitesError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListSuitesError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListSuitesError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListSuitesError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListSuitesError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListSuitesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListSuitesError {
fn from(err: serde_json::error::Error) -> ListSuitesError {
ListSuitesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListSuitesError {
fn from(err: CredentialsError) -> ListSuitesError {
ListSuitesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListSuitesError {
fn from(err: HttpDispatchError) -> ListSuitesError {
ListSuitesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListSuitesError {
fn from(err: io::Error) -> ListSuitesError {
ListSuitesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListSuitesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListSuitesError {
fn description(&self) -> &str {
match *self {
ListSuitesError::Argument(ref cause) => cause,
ListSuitesError::LimitExceeded(ref cause) => cause,
ListSuitesError::NotFound(ref cause) => cause,
ListSuitesError::ServiceAccount(ref cause) => cause,
ListSuitesError::Validation(ref cause) => cause,
ListSuitesError::Credentials(ref err) => err.description(),
ListSuitesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListSuitesError::ParseError(ref cause) => cause,
ListSuitesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTestsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTestsError {
pub fn from_response(res: BufferedHttpResponse) -> ListTestsError {
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 {
"ArgumentException" => return ListTestsError::Argument(String::from(error_message)),
"LimitExceededException" => {
return ListTestsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return ListTestsError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return ListTestsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListTestsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListTestsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTestsError {
fn from(err: serde_json::error::Error) -> ListTestsError {
ListTestsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTestsError {
fn from(err: CredentialsError) -> ListTestsError {
ListTestsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTestsError {
fn from(err: HttpDispatchError) -> ListTestsError {
ListTestsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTestsError {
fn from(err: io::Error) -> ListTestsError {
ListTestsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListTestsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTestsError {
fn description(&self) -> &str {
match *self {
ListTestsError::Argument(ref cause) => cause,
ListTestsError::LimitExceeded(ref cause) => cause,
ListTestsError::NotFound(ref cause) => cause,
ListTestsError::ServiceAccount(ref cause) => cause,
ListTestsError::Validation(ref cause) => cause,
ListTestsError::Credentials(ref err) => err.description(),
ListTestsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListTestsError::ParseError(ref cause) => cause,
ListTestsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUniqueProblemsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListUniqueProblemsError {
pub fn from_response(res: BufferedHttpResponse) -> ListUniqueProblemsError {
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 {
"ArgumentException" => {
return ListUniqueProblemsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListUniqueProblemsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListUniqueProblemsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListUniqueProblemsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListUniqueProblemsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListUniqueProblemsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListUniqueProblemsError {
fn from(err: serde_json::error::Error) -> ListUniqueProblemsError {
ListUniqueProblemsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListUniqueProblemsError {
fn from(err: CredentialsError) -> ListUniqueProblemsError {
ListUniqueProblemsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListUniqueProblemsError {
fn from(err: HttpDispatchError) -> ListUniqueProblemsError {
ListUniqueProblemsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListUniqueProblemsError {
fn from(err: io::Error) -> ListUniqueProblemsError {
ListUniqueProblemsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListUniqueProblemsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListUniqueProblemsError {
fn description(&self) -> &str {
match *self {
ListUniqueProblemsError::Argument(ref cause) => cause,
ListUniqueProblemsError::LimitExceeded(ref cause) => cause,
ListUniqueProblemsError::NotFound(ref cause) => cause,
ListUniqueProblemsError::ServiceAccount(ref cause) => cause,
ListUniqueProblemsError::Validation(ref cause) => cause,
ListUniqueProblemsError::Credentials(ref err) => err.description(),
ListUniqueProblemsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListUniqueProblemsError::ParseError(ref cause) => cause,
ListUniqueProblemsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUploadsError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListUploadsError {
pub fn from_response(res: BufferedHttpResponse) -> ListUploadsError {
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 {
"ArgumentException" => {
return ListUploadsError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return ListUploadsError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ListUploadsError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ListUploadsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListUploadsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListUploadsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListUploadsError {
fn from(err: serde_json::error::Error) -> ListUploadsError {
ListUploadsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListUploadsError {
fn from(err: CredentialsError) -> ListUploadsError {
ListUploadsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListUploadsError {
fn from(err: HttpDispatchError) -> ListUploadsError {
ListUploadsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListUploadsError {
fn from(err: io::Error) -> ListUploadsError {
ListUploadsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListUploadsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListUploadsError {
fn description(&self) -> &str {
match *self {
ListUploadsError::Argument(ref cause) => cause,
ListUploadsError::LimitExceeded(ref cause) => cause,
ListUploadsError::NotFound(ref cause) => cause,
ListUploadsError::ServiceAccount(ref cause) => cause,
ListUploadsError::Validation(ref cause) => cause,
ListUploadsError::Credentials(ref err) => err.description(),
ListUploadsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListUploadsError::ParseError(ref cause) => cause,
ListUploadsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListVPCEConfigurationsError {
Argument(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListVPCEConfigurationsError {
pub fn from_response(res: BufferedHttpResponse) -> ListVPCEConfigurationsError {
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 {
"ArgumentException" => {
return ListVPCEConfigurationsError::Argument(String::from(error_message))
}
"ServiceAccountException" => {
return ListVPCEConfigurationsError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ListVPCEConfigurationsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListVPCEConfigurationsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListVPCEConfigurationsError {
fn from(err: serde_json::error::Error) -> ListVPCEConfigurationsError {
ListVPCEConfigurationsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListVPCEConfigurationsError {
fn from(err: CredentialsError) -> ListVPCEConfigurationsError {
ListVPCEConfigurationsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListVPCEConfigurationsError {
fn from(err: HttpDispatchError) -> ListVPCEConfigurationsError {
ListVPCEConfigurationsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListVPCEConfigurationsError {
fn from(err: io::Error) -> ListVPCEConfigurationsError {
ListVPCEConfigurationsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListVPCEConfigurationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListVPCEConfigurationsError {
fn description(&self) -> &str {
match *self {
ListVPCEConfigurationsError::Argument(ref cause) => cause,
ListVPCEConfigurationsError::ServiceAccount(ref cause) => cause,
ListVPCEConfigurationsError::Validation(ref cause) => cause,
ListVPCEConfigurationsError::Credentials(ref err) => err.description(),
ListVPCEConfigurationsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListVPCEConfigurationsError::ParseError(ref cause) => cause,
ListVPCEConfigurationsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PurchaseOfferingError {
Argument(String),
LimitExceeded(String),
NotEligible(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PurchaseOfferingError {
pub fn from_response(res: BufferedHttpResponse) -> PurchaseOfferingError {
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 {
"ArgumentException" => {
return PurchaseOfferingError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return PurchaseOfferingError::LimitExceeded(String::from(error_message))
}
"NotEligibleException" => {
return PurchaseOfferingError::NotEligible(String::from(error_message))
}
"NotFoundException" => {
return PurchaseOfferingError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return PurchaseOfferingError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return PurchaseOfferingError::Validation(error_message.to_string())
}
_ => {}
}
}
return PurchaseOfferingError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PurchaseOfferingError {
fn from(err: serde_json::error::Error) -> PurchaseOfferingError {
PurchaseOfferingError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PurchaseOfferingError {
fn from(err: CredentialsError) -> PurchaseOfferingError {
PurchaseOfferingError::Credentials(err)
}
}
impl From<HttpDispatchError> for PurchaseOfferingError {
fn from(err: HttpDispatchError) -> PurchaseOfferingError {
PurchaseOfferingError::HttpDispatch(err)
}
}
impl From<io::Error> for PurchaseOfferingError {
fn from(err: io::Error) -> PurchaseOfferingError {
PurchaseOfferingError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PurchaseOfferingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PurchaseOfferingError {
fn description(&self) -> &str {
match *self {
PurchaseOfferingError::Argument(ref cause) => cause,
PurchaseOfferingError::LimitExceeded(ref cause) => cause,
PurchaseOfferingError::NotEligible(ref cause) => cause,
PurchaseOfferingError::NotFound(ref cause) => cause,
PurchaseOfferingError::ServiceAccount(ref cause) => cause,
PurchaseOfferingError::Validation(ref cause) => cause,
PurchaseOfferingError::Credentials(ref err) => err.description(),
PurchaseOfferingError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
PurchaseOfferingError::ParseError(ref cause) => cause,
PurchaseOfferingError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RenewOfferingError {
Argument(String),
LimitExceeded(String),
NotEligible(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RenewOfferingError {
pub fn from_response(res: BufferedHttpResponse) -> RenewOfferingError {
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 {
"ArgumentException" => {
return RenewOfferingError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return RenewOfferingError::LimitExceeded(String::from(error_message))
}
"NotEligibleException" => {
return RenewOfferingError::NotEligible(String::from(error_message))
}
"NotFoundException" => {
return RenewOfferingError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return RenewOfferingError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return RenewOfferingError::Validation(error_message.to_string())
}
_ => {}
}
}
return RenewOfferingError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RenewOfferingError {
fn from(err: serde_json::error::Error) -> RenewOfferingError {
RenewOfferingError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RenewOfferingError {
fn from(err: CredentialsError) -> RenewOfferingError {
RenewOfferingError::Credentials(err)
}
}
impl From<HttpDispatchError> for RenewOfferingError {
fn from(err: HttpDispatchError) -> RenewOfferingError {
RenewOfferingError::HttpDispatch(err)
}
}
impl From<io::Error> for RenewOfferingError {
fn from(err: io::Error) -> RenewOfferingError {
RenewOfferingError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RenewOfferingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RenewOfferingError {
fn description(&self) -> &str {
match *self {
RenewOfferingError::Argument(ref cause) => cause,
RenewOfferingError::LimitExceeded(ref cause) => cause,
RenewOfferingError::NotEligible(ref cause) => cause,
RenewOfferingError::NotFound(ref cause) => cause,
RenewOfferingError::ServiceAccount(ref cause) => cause,
RenewOfferingError::Validation(ref cause) => cause,
RenewOfferingError::Credentials(ref err) => err.description(),
RenewOfferingError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
RenewOfferingError::ParseError(ref cause) => cause,
RenewOfferingError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ScheduleRunError {
Argument(String),
Idempotency(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ScheduleRunError {
pub fn from_response(res: BufferedHttpResponse) -> ScheduleRunError {
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 {
"ArgumentException" => {
return ScheduleRunError::Argument(String::from(error_message))
}
"IdempotencyException" => {
return ScheduleRunError::Idempotency(String::from(error_message))
}
"LimitExceededException" => {
return ScheduleRunError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return ScheduleRunError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return ScheduleRunError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return ScheduleRunError::Validation(error_message.to_string())
}
_ => {}
}
}
return ScheduleRunError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ScheduleRunError {
fn from(err: serde_json::error::Error) -> ScheduleRunError {
ScheduleRunError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ScheduleRunError {
fn from(err: CredentialsError) -> ScheduleRunError {
ScheduleRunError::Credentials(err)
}
}
impl From<HttpDispatchError> for ScheduleRunError {
fn from(err: HttpDispatchError) -> ScheduleRunError {
ScheduleRunError::HttpDispatch(err)
}
}
impl From<io::Error> for ScheduleRunError {
fn from(err: io::Error) -> ScheduleRunError {
ScheduleRunError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ScheduleRunError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ScheduleRunError {
fn description(&self) -> &str {
match *self {
ScheduleRunError::Argument(ref cause) => cause,
ScheduleRunError::Idempotency(ref cause) => cause,
ScheduleRunError::LimitExceeded(ref cause) => cause,
ScheduleRunError::NotFound(ref cause) => cause,
ScheduleRunError::ServiceAccount(ref cause) => cause,
ScheduleRunError::Validation(ref cause) => cause,
ScheduleRunError::Credentials(ref err) => err.description(),
ScheduleRunError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ScheduleRunError::ParseError(ref cause) => cause,
ScheduleRunError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopRemoteAccessSessionError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopRemoteAccessSessionError {
pub fn from_response(res: BufferedHttpResponse) -> StopRemoteAccessSessionError {
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 {
"ArgumentException" => {
return StopRemoteAccessSessionError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return StopRemoteAccessSessionError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return StopRemoteAccessSessionError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return StopRemoteAccessSessionError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return StopRemoteAccessSessionError::Validation(error_message.to_string())
}
_ => {}
}
}
return StopRemoteAccessSessionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopRemoteAccessSessionError {
fn from(err: serde_json::error::Error) -> StopRemoteAccessSessionError {
StopRemoteAccessSessionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopRemoteAccessSessionError {
fn from(err: CredentialsError) -> StopRemoteAccessSessionError {
StopRemoteAccessSessionError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopRemoteAccessSessionError {
fn from(err: HttpDispatchError) -> StopRemoteAccessSessionError {
StopRemoteAccessSessionError::HttpDispatch(err)
}
}
impl From<io::Error> for StopRemoteAccessSessionError {
fn from(err: io::Error) -> StopRemoteAccessSessionError {
StopRemoteAccessSessionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopRemoteAccessSessionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopRemoteAccessSessionError {
fn description(&self) -> &str {
match *self {
StopRemoteAccessSessionError::Argument(ref cause) => cause,
StopRemoteAccessSessionError::LimitExceeded(ref cause) => cause,
StopRemoteAccessSessionError::NotFound(ref cause) => cause,
StopRemoteAccessSessionError::ServiceAccount(ref cause) => cause,
StopRemoteAccessSessionError::Validation(ref cause) => cause,
StopRemoteAccessSessionError::Credentials(ref err) => err.description(),
StopRemoteAccessSessionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StopRemoteAccessSessionError::ParseError(ref cause) => cause,
StopRemoteAccessSessionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopRunError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopRunError {
pub fn from_response(res: BufferedHttpResponse) -> StopRunError {
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 {
"ArgumentException" => return StopRunError::Argument(String::from(error_message)),
"LimitExceededException" => {
return StopRunError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => return StopRunError::NotFound(String::from(error_message)),
"ServiceAccountException" => {
return StopRunError::ServiceAccount(String::from(error_message))
}
"ValidationException" => return StopRunError::Validation(error_message.to_string()),
_ => {}
}
}
return StopRunError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopRunError {
fn from(err: serde_json::error::Error) -> StopRunError {
StopRunError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopRunError {
fn from(err: CredentialsError) -> StopRunError {
StopRunError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopRunError {
fn from(err: HttpDispatchError) -> StopRunError {
StopRunError::HttpDispatch(err)
}
}
impl From<io::Error> for StopRunError {
fn from(err: io::Error) -> StopRunError {
StopRunError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopRunError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopRunError {
fn description(&self) -> &str {
match *self {
StopRunError::Argument(ref cause) => cause,
StopRunError::LimitExceeded(ref cause) => cause,
StopRunError::NotFound(ref cause) => cause,
StopRunError::ServiceAccount(ref cause) => cause,
StopRunError::Validation(ref cause) => cause,
StopRunError::Credentials(ref err) => err.description(),
StopRunError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
StopRunError::ParseError(ref cause) => cause,
StopRunError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDeviceInstanceError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateDeviceInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateDeviceInstanceError {
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 {
"ArgumentException" => {
return UpdateDeviceInstanceError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return UpdateDeviceInstanceError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return UpdateDeviceInstanceError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return UpdateDeviceInstanceError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return UpdateDeviceInstanceError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateDeviceInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateDeviceInstanceError {
fn from(err: serde_json::error::Error) -> UpdateDeviceInstanceError {
UpdateDeviceInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateDeviceInstanceError {
fn from(err: CredentialsError) -> UpdateDeviceInstanceError {
UpdateDeviceInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateDeviceInstanceError {
fn from(err: HttpDispatchError) -> UpdateDeviceInstanceError {
UpdateDeviceInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateDeviceInstanceError {
fn from(err: io::Error) -> UpdateDeviceInstanceError {
UpdateDeviceInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateDeviceInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDeviceInstanceError {
fn description(&self) -> &str {
match *self {
UpdateDeviceInstanceError::Argument(ref cause) => cause,
UpdateDeviceInstanceError::LimitExceeded(ref cause) => cause,
UpdateDeviceInstanceError::NotFound(ref cause) => cause,
UpdateDeviceInstanceError::ServiceAccount(ref cause) => cause,
UpdateDeviceInstanceError::Validation(ref cause) => cause,
UpdateDeviceInstanceError::Credentials(ref err) => err.description(),
UpdateDeviceInstanceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateDeviceInstanceError::ParseError(ref cause) => cause,
UpdateDeviceInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDevicePoolError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateDevicePoolError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateDevicePoolError {
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 {
"ArgumentException" => {
return UpdateDevicePoolError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return UpdateDevicePoolError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return UpdateDevicePoolError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return UpdateDevicePoolError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return UpdateDevicePoolError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateDevicePoolError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateDevicePoolError {
fn from(err: serde_json::error::Error) -> UpdateDevicePoolError {
UpdateDevicePoolError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateDevicePoolError {
fn from(err: CredentialsError) -> UpdateDevicePoolError {
UpdateDevicePoolError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateDevicePoolError {
fn from(err: HttpDispatchError) -> UpdateDevicePoolError {
UpdateDevicePoolError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateDevicePoolError {
fn from(err: io::Error) -> UpdateDevicePoolError {
UpdateDevicePoolError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateDevicePoolError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDevicePoolError {
fn description(&self) -> &str {
match *self {
UpdateDevicePoolError::Argument(ref cause) => cause,
UpdateDevicePoolError::LimitExceeded(ref cause) => cause,
UpdateDevicePoolError::NotFound(ref cause) => cause,
UpdateDevicePoolError::ServiceAccount(ref cause) => cause,
UpdateDevicePoolError::Validation(ref cause) => cause,
UpdateDevicePoolError::Credentials(ref err) => err.description(),
UpdateDevicePoolError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateDevicePoolError::ParseError(ref cause) => cause,
UpdateDevicePoolError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateInstanceProfileError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateInstanceProfileError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateInstanceProfileError {
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 {
"ArgumentException" => {
return UpdateInstanceProfileError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return UpdateInstanceProfileError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return UpdateInstanceProfileError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return UpdateInstanceProfileError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return UpdateInstanceProfileError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateInstanceProfileError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateInstanceProfileError {
fn from(err: serde_json::error::Error) -> UpdateInstanceProfileError {
UpdateInstanceProfileError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateInstanceProfileError {
fn from(err: CredentialsError) -> UpdateInstanceProfileError {
UpdateInstanceProfileError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateInstanceProfileError {
fn from(err: HttpDispatchError) -> UpdateInstanceProfileError {
UpdateInstanceProfileError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateInstanceProfileError {
fn from(err: io::Error) -> UpdateInstanceProfileError {
UpdateInstanceProfileError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateInstanceProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateInstanceProfileError {
fn description(&self) -> &str {
match *self {
UpdateInstanceProfileError::Argument(ref cause) => cause,
UpdateInstanceProfileError::LimitExceeded(ref cause) => cause,
UpdateInstanceProfileError::NotFound(ref cause) => cause,
UpdateInstanceProfileError::ServiceAccount(ref cause) => cause,
UpdateInstanceProfileError::Validation(ref cause) => cause,
UpdateInstanceProfileError::Credentials(ref err) => err.description(),
UpdateInstanceProfileError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateInstanceProfileError::ParseError(ref cause) => cause,
UpdateInstanceProfileError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateNetworkProfileError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateNetworkProfileError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateNetworkProfileError {
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 {
"ArgumentException" => {
return UpdateNetworkProfileError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return UpdateNetworkProfileError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return UpdateNetworkProfileError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return UpdateNetworkProfileError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return UpdateNetworkProfileError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateNetworkProfileError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateNetworkProfileError {
fn from(err: serde_json::error::Error) -> UpdateNetworkProfileError {
UpdateNetworkProfileError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateNetworkProfileError {
fn from(err: CredentialsError) -> UpdateNetworkProfileError {
UpdateNetworkProfileError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateNetworkProfileError {
fn from(err: HttpDispatchError) -> UpdateNetworkProfileError {
UpdateNetworkProfileError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateNetworkProfileError {
fn from(err: io::Error) -> UpdateNetworkProfileError {
UpdateNetworkProfileError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateNetworkProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateNetworkProfileError {
fn description(&self) -> &str {
match *self {
UpdateNetworkProfileError::Argument(ref cause) => cause,
UpdateNetworkProfileError::LimitExceeded(ref cause) => cause,
UpdateNetworkProfileError::NotFound(ref cause) => cause,
UpdateNetworkProfileError::ServiceAccount(ref cause) => cause,
UpdateNetworkProfileError::Validation(ref cause) => cause,
UpdateNetworkProfileError::Credentials(ref err) => err.description(),
UpdateNetworkProfileError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateNetworkProfileError::ParseError(ref cause) => cause,
UpdateNetworkProfileError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateProjectError {
Argument(String),
LimitExceeded(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateProjectError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateProjectError {
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 {
"ArgumentException" => {
return UpdateProjectError::Argument(String::from(error_message))
}
"LimitExceededException" => {
return UpdateProjectError::LimitExceeded(String::from(error_message))
}
"NotFoundException" => {
return UpdateProjectError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return UpdateProjectError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return UpdateProjectError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateProjectError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateProjectError {
fn from(err: serde_json::error::Error) -> UpdateProjectError {
UpdateProjectError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateProjectError {
fn from(err: CredentialsError) -> UpdateProjectError {
UpdateProjectError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateProjectError {
fn from(err: HttpDispatchError) -> UpdateProjectError {
UpdateProjectError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateProjectError {
fn from(err: io::Error) -> UpdateProjectError {
UpdateProjectError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateProjectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateProjectError {
fn description(&self) -> &str {
match *self {
UpdateProjectError::Argument(ref cause) => cause,
UpdateProjectError::LimitExceeded(ref cause) => cause,
UpdateProjectError::NotFound(ref cause) => cause,
UpdateProjectError::ServiceAccount(ref cause) => cause,
UpdateProjectError::Validation(ref cause) => cause,
UpdateProjectError::Credentials(ref err) => err.description(),
UpdateProjectError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateProjectError::ParseError(ref cause) => cause,
UpdateProjectError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateVPCEConfigurationError {
Argument(String),
InvalidOperation(String),
NotFound(String),
ServiceAccount(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateVPCEConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateVPCEConfigurationError {
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 {
"ArgumentException" => {
return UpdateVPCEConfigurationError::Argument(String::from(error_message))
}
"InvalidOperationException" => {
return UpdateVPCEConfigurationError::InvalidOperation(String::from(
error_message,
))
}
"NotFoundException" => {
return UpdateVPCEConfigurationError::NotFound(String::from(error_message))
}
"ServiceAccountException" => {
return UpdateVPCEConfigurationError::ServiceAccount(String::from(error_message))
}
"ValidationException" => {
return UpdateVPCEConfigurationError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateVPCEConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateVPCEConfigurationError {
fn from(err: serde_json::error::Error) -> UpdateVPCEConfigurationError {
UpdateVPCEConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateVPCEConfigurationError {
fn from(err: CredentialsError) -> UpdateVPCEConfigurationError {
UpdateVPCEConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateVPCEConfigurationError {
fn from(err: HttpDispatchError) -> UpdateVPCEConfigurationError {
UpdateVPCEConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateVPCEConfigurationError {
fn from(err: io::Error) -> UpdateVPCEConfigurationError {
UpdateVPCEConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateVPCEConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateVPCEConfigurationError {
fn description(&self) -> &str {
match *self {
UpdateVPCEConfigurationError::Argument(ref cause) => cause,
UpdateVPCEConfigurationError::InvalidOperation(ref cause) => cause,
UpdateVPCEConfigurationError::NotFound(ref cause) => cause,
UpdateVPCEConfigurationError::ServiceAccount(ref cause) => cause,
UpdateVPCEConfigurationError::Validation(ref cause) => cause,
UpdateVPCEConfigurationError::Credentials(ref err) => err.description(),
UpdateVPCEConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateVPCEConfigurationError::ParseError(ref cause) => cause,
UpdateVPCEConfigurationError::Unknown(_) => "unknown error",
}
}
}
pub trait DeviceFarm {
fn create_device_pool(
&self,
input: CreateDevicePoolRequest,
) -> RusotoFuture<CreateDevicePoolResult, CreateDevicePoolError>;
fn create_instance_profile(
&self,
input: CreateInstanceProfileRequest,
) -> RusotoFuture<CreateInstanceProfileResult, CreateInstanceProfileError>;
fn create_network_profile(
&self,
input: CreateNetworkProfileRequest,
) -> RusotoFuture<CreateNetworkProfileResult, CreateNetworkProfileError>;
fn create_project(
&self,
input: CreateProjectRequest,
) -> RusotoFuture<CreateProjectResult, CreateProjectError>;
fn create_remote_access_session(
&self,
input: CreateRemoteAccessSessionRequest,
) -> RusotoFuture<CreateRemoteAccessSessionResult, CreateRemoteAccessSessionError>;
fn create_upload(
&self,
input: CreateUploadRequest,
) -> RusotoFuture<CreateUploadResult, CreateUploadError>;
fn create_vpce_configuration(
&self,
input: CreateVPCEConfigurationRequest,
) -> RusotoFuture<CreateVPCEConfigurationResult, CreateVPCEConfigurationError>;
fn delete_device_pool(
&self,
input: DeleteDevicePoolRequest,
) -> RusotoFuture<DeleteDevicePoolResult, DeleteDevicePoolError>;
fn delete_instance_profile(
&self,
input: DeleteInstanceProfileRequest,
) -> RusotoFuture<DeleteInstanceProfileResult, DeleteInstanceProfileError>;
fn delete_network_profile(
&self,
input: DeleteNetworkProfileRequest,
) -> RusotoFuture<DeleteNetworkProfileResult, DeleteNetworkProfileError>;
fn delete_project(
&self,
input: DeleteProjectRequest,
) -> RusotoFuture<DeleteProjectResult, DeleteProjectError>;
fn delete_remote_access_session(
&self,
input: DeleteRemoteAccessSessionRequest,
) -> RusotoFuture<DeleteRemoteAccessSessionResult, DeleteRemoteAccessSessionError>;
fn delete_run(&self, input: DeleteRunRequest) -> RusotoFuture<DeleteRunResult, DeleteRunError>;
fn delete_upload(
&self,
input: DeleteUploadRequest,
) -> RusotoFuture<DeleteUploadResult, DeleteUploadError>;
fn delete_vpce_configuration(
&self,
input: DeleteVPCEConfigurationRequest,
) -> RusotoFuture<DeleteVPCEConfigurationResult, DeleteVPCEConfigurationError>;
fn get_account_settings(
&self,
) -> RusotoFuture<GetAccountSettingsResult, GetAccountSettingsError>;
fn get_device(&self, input: GetDeviceRequest) -> RusotoFuture<GetDeviceResult, GetDeviceError>;
fn get_device_instance(
&self,
input: GetDeviceInstanceRequest,
) -> RusotoFuture<GetDeviceInstanceResult, GetDeviceInstanceError>;
fn get_device_pool(
&self,
input: GetDevicePoolRequest,
) -> RusotoFuture<GetDevicePoolResult, GetDevicePoolError>;
fn get_device_pool_compatibility(
&self,
input: GetDevicePoolCompatibilityRequest,
) -> RusotoFuture<GetDevicePoolCompatibilityResult, GetDevicePoolCompatibilityError>;
fn get_instance_profile(
&self,
input: GetInstanceProfileRequest,
) -> RusotoFuture<GetInstanceProfileResult, GetInstanceProfileError>;
fn get_job(&self, input: GetJobRequest) -> RusotoFuture<GetJobResult, GetJobError>;
fn get_network_profile(
&self,
input: GetNetworkProfileRequest,
) -> RusotoFuture<GetNetworkProfileResult, GetNetworkProfileError>;
fn get_offering_status(
&self,
input: GetOfferingStatusRequest,
) -> RusotoFuture<GetOfferingStatusResult, GetOfferingStatusError>;
fn get_project(
&self,
input: GetProjectRequest,
) -> RusotoFuture<GetProjectResult, GetProjectError>;
fn get_remote_access_session(
&self,
input: GetRemoteAccessSessionRequest,
) -> RusotoFuture<GetRemoteAccessSessionResult, GetRemoteAccessSessionError>;
fn get_run(&self, input: GetRunRequest) -> RusotoFuture<GetRunResult, GetRunError>;
fn get_suite(&self, input: GetSuiteRequest) -> RusotoFuture<GetSuiteResult, GetSuiteError>;
fn get_test(&self, input: GetTestRequest) -> RusotoFuture<GetTestResult, GetTestError>;
fn get_upload(&self, input: GetUploadRequest) -> RusotoFuture<GetUploadResult, GetUploadError>;
fn get_vpce_configuration(
&self,
input: GetVPCEConfigurationRequest,
) -> RusotoFuture<GetVPCEConfigurationResult, GetVPCEConfigurationError>;
fn install_to_remote_access_session(
&self,
input: InstallToRemoteAccessSessionRequest,
) -> RusotoFuture<InstallToRemoteAccessSessionResult, InstallToRemoteAccessSessionError>;
fn list_artifacts(
&self,
input: ListArtifactsRequest,
) -> RusotoFuture<ListArtifactsResult, ListArtifactsError>;
fn list_device_instances(
&self,
input: ListDeviceInstancesRequest,
) -> RusotoFuture<ListDeviceInstancesResult, ListDeviceInstancesError>;
fn list_device_pools(
&self,
input: ListDevicePoolsRequest,
) -> RusotoFuture<ListDevicePoolsResult, ListDevicePoolsError>;
fn list_devices(
&self,
input: ListDevicesRequest,
) -> RusotoFuture<ListDevicesResult, ListDevicesError>;
fn list_instance_profiles(
&self,
input: ListInstanceProfilesRequest,
) -> RusotoFuture<ListInstanceProfilesResult, ListInstanceProfilesError>;
fn list_jobs(&self, input: ListJobsRequest) -> RusotoFuture<ListJobsResult, ListJobsError>;
fn list_network_profiles(
&self,
input: ListNetworkProfilesRequest,
) -> RusotoFuture<ListNetworkProfilesResult, ListNetworkProfilesError>;
fn list_offering_promotions(
&self,
input: ListOfferingPromotionsRequest,
) -> RusotoFuture<ListOfferingPromotionsResult, ListOfferingPromotionsError>;
fn list_offering_transactions(
&self,
input: ListOfferingTransactionsRequest,
) -> RusotoFuture<ListOfferingTransactionsResult, ListOfferingTransactionsError>;
fn list_offerings(
&self,
input: ListOfferingsRequest,
) -> RusotoFuture<ListOfferingsResult, ListOfferingsError>;
fn list_projects(
&self,
input: ListProjectsRequest,
) -> RusotoFuture<ListProjectsResult, ListProjectsError>;
fn list_remote_access_sessions(
&self,
input: ListRemoteAccessSessionsRequest,
) -> RusotoFuture<ListRemoteAccessSessionsResult, ListRemoteAccessSessionsError>;
fn list_runs(&self, input: ListRunsRequest) -> RusotoFuture<ListRunsResult, ListRunsError>;
fn list_samples(
&self,
input: ListSamplesRequest,
) -> RusotoFuture<ListSamplesResult, ListSamplesError>;
fn list_suites(
&self,
input: ListSuitesRequest,
) -> RusotoFuture<ListSuitesResult, ListSuitesError>;
fn list_tests(&self, input: ListTestsRequest) -> RusotoFuture<ListTestsResult, ListTestsError>;
fn list_unique_problems(
&self,
input: ListUniqueProblemsRequest,
) -> RusotoFuture<ListUniqueProblemsResult, ListUniqueProblemsError>;
fn list_uploads(
&self,
input: ListUploadsRequest,
) -> RusotoFuture<ListUploadsResult, ListUploadsError>;
fn list_vpce_configurations(
&self,
input: ListVPCEConfigurationsRequest,
) -> RusotoFuture<ListVPCEConfigurationsResult, ListVPCEConfigurationsError>;
fn purchase_offering(
&self,
input: PurchaseOfferingRequest,
) -> RusotoFuture<PurchaseOfferingResult, PurchaseOfferingError>;
fn renew_offering(
&self,
input: RenewOfferingRequest,
) -> RusotoFuture<RenewOfferingResult, RenewOfferingError>;
fn schedule_run(
&self,
input: ScheduleRunRequest,
) -> RusotoFuture<ScheduleRunResult, ScheduleRunError>;
fn stop_remote_access_session(
&self,
input: StopRemoteAccessSessionRequest,
) -> RusotoFuture<StopRemoteAccessSessionResult, StopRemoteAccessSessionError>;
fn stop_run(&self, input: StopRunRequest) -> RusotoFuture<StopRunResult, StopRunError>;
fn update_device_instance(
&self,
input: UpdateDeviceInstanceRequest,
) -> RusotoFuture<UpdateDeviceInstanceResult, UpdateDeviceInstanceError>;
fn update_device_pool(
&self,
input: UpdateDevicePoolRequest,
) -> RusotoFuture<UpdateDevicePoolResult, UpdateDevicePoolError>;
fn update_instance_profile(
&self,
input: UpdateInstanceProfileRequest,
) -> RusotoFuture<UpdateInstanceProfileResult, UpdateInstanceProfileError>;
fn update_network_profile(
&self,
input: UpdateNetworkProfileRequest,
) -> RusotoFuture<UpdateNetworkProfileResult, UpdateNetworkProfileError>;
fn update_project(
&self,
input: UpdateProjectRequest,
) -> RusotoFuture<UpdateProjectResult, UpdateProjectError>;
fn update_vpce_configuration(
&self,
input: UpdateVPCEConfigurationRequest,
) -> RusotoFuture<UpdateVPCEConfigurationResult, UpdateVPCEConfigurationError>;
}
pub struct DeviceFarmClient {
client: Client,
region: region::Region,
}
impl DeviceFarmClient {
pub fn new(region: region::Region) -> DeviceFarmClient {
DeviceFarmClient {
client: Client::shared(),
region: region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> DeviceFarmClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
DeviceFarmClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region: region,
}
}
}
impl DeviceFarm for DeviceFarmClient {
fn create_device_pool(
&self,
input: CreateDevicePoolRequest,
) -> RusotoFuture<CreateDevicePoolResult, CreateDevicePoolError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.CreateDevicePool");
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::<CreateDevicePoolResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDevicePoolError::from_response(response))),
)
}
})
}
fn create_instance_profile(
&self,
input: CreateInstanceProfileRequest,
) -> RusotoFuture<CreateInstanceProfileResult, CreateInstanceProfileError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.CreateInstanceProfile");
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::<CreateInstanceProfileResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateInstanceProfileError::from_response(response))
}),
)
}
})
}
fn create_network_profile(
&self,
input: CreateNetworkProfileRequest,
) -> RusotoFuture<CreateNetworkProfileResult, CreateNetworkProfileError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.CreateNetworkProfile");
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::<CreateNetworkProfileResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateNetworkProfileError::from_response(response))
}),
)
}
})
}
fn create_project(
&self,
input: CreateProjectRequest,
) -> RusotoFuture<CreateProjectResult, CreateProjectError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.CreateProject");
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::<CreateProjectResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateProjectError::from_response(response))),
)
}
})
}
fn create_remote_access_session(
&self,
input: CreateRemoteAccessSessionRequest,
) -> RusotoFuture<CreateRemoteAccessSessionResult, CreateRemoteAccessSessionError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.CreateRemoteAccessSession",
);
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::<CreateRemoteAccessSessionResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateRemoteAccessSessionError::from_response(response))
}))
}
})
}
fn create_upload(
&self,
input: CreateUploadRequest,
) -> RusotoFuture<CreateUploadResult, CreateUploadError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.CreateUpload");
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::<CreateUploadResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateUploadError::from_response(response))),
)
}
})
}
fn create_vpce_configuration(
&self,
input: CreateVPCEConfigurationRequest,
) -> RusotoFuture<CreateVPCEConfigurationResult, CreateVPCEConfigurationError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.CreateVPCEConfiguration",
);
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::<CreateVPCEConfigurationResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateVPCEConfigurationError::from_response(response))
}))
}
})
}
fn delete_device_pool(
&self,
input: DeleteDevicePoolRequest,
) -> RusotoFuture<DeleteDevicePoolResult, DeleteDevicePoolError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.DeleteDevicePool");
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::<DeleteDevicePoolResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDevicePoolError::from_response(response))),
)
}
})
}
fn delete_instance_profile(
&self,
input: DeleteInstanceProfileRequest,
) -> RusotoFuture<DeleteInstanceProfileResult, DeleteInstanceProfileError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.DeleteInstanceProfile");
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::<DeleteInstanceProfileResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteInstanceProfileError::from_response(response))
}),
)
}
})
}
fn delete_network_profile(
&self,
input: DeleteNetworkProfileRequest,
) -> RusotoFuture<DeleteNetworkProfileResult, DeleteNetworkProfileError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.DeleteNetworkProfile");
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::<DeleteNetworkProfileResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteNetworkProfileError::from_response(response))
}),
)
}
})
}
fn delete_project(
&self,
input: DeleteProjectRequest,
) -> RusotoFuture<DeleteProjectResult, DeleteProjectError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.DeleteProject");
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::<DeleteProjectResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteProjectError::from_response(response))),
)
}
})
}
fn delete_remote_access_session(
&self,
input: DeleteRemoteAccessSessionRequest,
) -> RusotoFuture<DeleteRemoteAccessSessionResult, DeleteRemoteAccessSessionError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.DeleteRemoteAccessSession",
);
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::<DeleteRemoteAccessSessionResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteRemoteAccessSessionError::from_response(response))
}))
}
})
}
fn delete_run(&self, input: DeleteRunRequest) -> RusotoFuture<DeleteRunResult, DeleteRunError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.DeleteRun");
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::<DeleteRunResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteRunError::from_response(response))),
)
}
})
}
fn delete_upload(
&self,
input: DeleteUploadRequest,
) -> RusotoFuture<DeleteUploadResult, DeleteUploadError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.DeleteUpload");
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::<DeleteUploadResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteUploadError::from_response(response))),
)
}
})
}
fn delete_vpce_configuration(
&self,
input: DeleteVPCEConfigurationRequest,
) -> RusotoFuture<DeleteVPCEConfigurationResult, DeleteVPCEConfigurationError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.DeleteVPCEConfiguration",
);
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::<DeleteVPCEConfigurationResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteVPCEConfigurationError::from_response(response))
}))
}
})
}
fn get_account_settings(
&self,
) -> RusotoFuture<GetAccountSettingsResult, GetAccountSettingsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetAccountSettings");
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::<GetAccountSettingsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetAccountSettingsError::from_response(response))),
)
}
})
}
fn get_device(&self, input: GetDeviceRequest) -> RusotoFuture<GetDeviceResult, GetDeviceError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetDevice");
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::<GetDeviceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDeviceError::from_response(response))),
)
}
})
}
fn get_device_instance(
&self,
input: GetDeviceInstanceRequest,
) -> RusotoFuture<GetDeviceInstanceResult, GetDeviceInstanceError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetDeviceInstance");
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::<GetDeviceInstanceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDeviceInstanceError::from_response(response))),
)
}
})
}
fn get_device_pool(
&self,
input: GetDevicePoolRequest,
) -> RusotoFuture<GetDevicePoolResult, GetDevicePoolError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetDevicePool");
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::<GetDevicePoolResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDevicePoolError::from_response(response))),
)
}
})
}
fn get_device_pool_compatibility(
&self,
input: GetDevicePoolCompatibilityRequest,
) -> RusotoFuture<GetDevicePoolCompatibilityResult, GetDevicePoolCompatibilityError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.GetDevicePoolCompatibility",
);
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::<GetDevicePoolCompatibilityResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetDevicePoolCompatibilityError::from_response(response))
}))
}
})
}
fn get_instance_profile(
&self,
input: GetInstanceProfileRequest,
) -> RusotoFuture<GetInstanceProfileResult, GetInstanceProfileError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetInstanceProfile");
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::<GetInstanceProfileResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetInstanceProfileError::from_response(response))),
)
}
})
}
fn get_job(&self, input: GetJobRequest) -> RusotoFuture<GetJobResult, GetJobError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetJob");
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::<GetJobResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetJobError::from_response(response))),
)
}
})
}
fn get_network_profile(
&self,
input: GetNetworkProfileRequest,
) -> RusotoFuture<GetNetworkProfileResult, GetNetworkProfileError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetNetworkProfile");
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::<GetNetworkProfileResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetNetworkProfileError::from_response(response))),
)
}
})
}
fn get_offering_status(
&self,
input: GetOfferingStatusRequest,
) -> RusotoFuture<GetOfferingStatusResult, GetOfferingStatusError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetOfferingStatus");
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::<GetOfferingStatusResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetOfferingStatusError::from_response(response))),
)
}
})
}
fn get_project(
&self,
input: GetProjectRequest,
) -> RusotoFuture<GetProjectResult, GetProjectError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetProject");
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::<GetProjectResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetProjectError::from_response(response))),
)
}
})
}
fn get_remote_access_session(
&self,
input: GetRemoteAccessSessionRequest,
) -> RusotoFuture<GetRemoteAccessSessionResult, GetRemoteAccessSessionError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetRemoteAccessSession");
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::<GetRemoteAccessSessionResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetRemoteAccessSessionError::from_response(response))
}),
)
}
})
}
fn get_run(&self, input: GetRunRequest) -> RusotoFuture<GetRunResult, GetRunError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetRun");
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::<GetRunResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetRunError::from_response(response))),
)
}
})
}
fn get_suite(&self, input: GetSuiteRequest) -> RusotoFuture<GetSuiteResult, GetSuiteError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetSuite");
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::<GetSuiteResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetSuiteError::from_response(response))),
)
}
})
}
fn get_test(&self, input: GetTestRequest) -> RusotoFuture<GetTestResult, GetTestError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetTest");
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::<GetTestResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetTestError::from_response(response))),
)
}
})
}
fn get_upload(&self, input: GetUploadRequest) -> RusotoFuture<GetUploadResult, GetUploadError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetUpload");
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::<GetUploadResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetUploadError::from_response(response))),
)
}
})
}
fn get_vpce_configuration(
&self,
input: GetVPCEConfigurationRequest,
) -> RusotoFuture<GetVPCEConfigurationResult, GetVPCEConfigurationError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.GetVPCEConfiguration");
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::<GetVPCEConfigurationResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetVPCEConfigurationError::from_response(response))
}),
)
}
})
}
fn install_to_remote_access_session(
&self,
input: InstallToRemoteAccessSessionRequest,
) -> RusotoFuture<InstallToRemoteAccessSessionResult, InstallToRemoteAccessSessionError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.InstallToRemoteAccessSession",
);
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::<InstallToRemoteAccessSessionResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(InstallToRemoteAccessSessionError::from_response(response))
}))
}
})
}
fn list_artifacts(
&self,
input: ListArtifactsRequest,
) -> RusotoFuture<ListArtifactsResult, ListArtifactsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListArtifacts");
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::<ListArtifactsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListArtifactsError::from_response(response))),
)
}
})
}
fn list_device_instances(
&self,
input: ListDeviceInstancesRequest,
) -> RusotoFuture<ListDeviceInstancesResult, ListDeviceInstancesError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListDeviceInstances");
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::<ListDeviceInstancesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListDeviceInstancesError::from_response(response))
}),
)
}
})
}
fn list_device_pools(
&self,
input: ListDevicePoolsRequest,
) -> RusotoFuture<ListDevicePoolsResult, ListDevicePoolsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListDevicePools");
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::<ListDevicePoolsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListDevicePoolsError::from_response(response))),
)
}
})
}
fn list_devices(
&self,
input: ListDevicesRequest,
) -> RusotoFuture<ListDevicesResult, ListDevicesError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListDevices");
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::<ListDevicesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListDevicesError::from_response(response))),
)
}
})
}
fn list_instance_profiles(
&self,
input: ListInstanceProfilesRequest,
) -> RusotoFuture<ListInstanceProfilesResult, ListInstanceProfilesError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListInstanceProfiles");
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::<ListInstanceProfilesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListInstanceProfilesError::from_response(response))
}),
)
}
})
}
fn list_jobs(&self, input: ListJobsRequest) -> RusotoFuture<ListJobsResult, ListJobsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListJobs");
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::<ListJobsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListJobsError::from_response(response))),
)
}
})
}
fn list_network_profiles(
&self,
input: ListNetworkProfilesRequest,
) -> RusotoFuture<ListNetworkProfilesResult, ListNetworkProfilesError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListNetworkProfiles");
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::<ListNetworkProfilesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListNetworkProfilesError::from_response(response))
}),
)
}
})
}
fn list_offering_promotions(
&self,
input: ListOfferingPromotionsRequest,
) -> RusotoFuture<ListOfferingPromotionsResult, ListOfferingPromotionsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListOfferingPromotions");
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::<ListOfferingPromotionsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListOfferingPromotionsError::from_response(response))
}),
)
}
})
}
fn list_offering_transactions(
&self,
input: ListOfferingTransactionsRequest,
) -> RusotoFuture<ListOfferingTransactionsResult, ListOfferingTransactionsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.ListOfferingTransactions",
);
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::<ListOfferingTransactionsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListOfferingTransactionsError::from_response(response))
}))
}
})
}
fn list_offerings(
&self,
input: ListOfferingsRequest,
) -> RusotoFuture<ListOfferingsResult, ListOfferingsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListOfferings");
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::<ListOfferingsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListOfferingsError::from_response(response))),
)
}
})
}
fn list_projects(
&self,
input: ListProjectsRequest,
) -> RusotoFuture<ListProjectsResult, ListProjectsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListProjects");
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::<ListProjectsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListProjectsError::from_response(response))),
)
}
})
}
fn list_remote_access_sessions(
&self,
input: ListRemoteAccessSessionsRequest,
) -> RusotoFuture<ListRemoteAccessSessionsResult, ListRemoteAccessSessionsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.ListRemoteAccessSessions",
);
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::<ListRemoteAccessSessionsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListRemoteAccessSessionsError::from_response(response))
}))
}
})
}
fn list_runs(&self, input: ListRunsRequest) -> RusotoFuture<ListRunsResult, ListRunsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListRuns");
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::<ListRunsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListRunsError::from_response(response))),
)
}
})
}
fn list_samples(
&self,
input: ListSamplesRequest,
) -> RusotoFuture<ListSamplesResult, ListSamplesError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListSamples");
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::<ListSamplesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListSamplesError::from_response(response))),
)
}
})
}
fn list_suites(
&self,
input: ListSuitesRequest,
) -> RusotoFuture<ListSuitesResult, ListSuitesError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListSuites");
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::<ListSuitesResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListSuitesError::from_response(response))),
)
}
})
}
fn list_tests(&self, input: ListTestsRequest) -> RusotoFuture<ListTestsResult, ListTestsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListTests");
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::<ListTestsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTestsError::from_response(response))),
)
}
})
}
fn list_unique_problems(
&self,
input: ListUniqueProblemsRequest,
) -> RusotoFuture<ListUniqueProblemsResult, ListUniqueProblemsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListUniqueProblems");
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::<ListUniqueProblemsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListUniqueProblemsError::from_response(response))),
)
}
})
}
fn list_uploads(
&self,
input: ListUploadsRequest,
) -> RusotoFuture<ListUploadsResult, ListUploadsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListUploads");
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::<ListUploadsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListUploadsError::from_response(response))),
)
}
})
}
fn list_vpce_configurations(
&self,
input: ListVPCEConfigurationsRequest,
) -> RusotoFuture<ListVPCEConfigurationsResult, ListVPCEConfigurationsError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ListVPCEConfigurations");
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::<ListVPCEConfigurationsResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListVPCEConfigurationsError::from_response(response))
}),
)
}
})
}
fn purchase_offering(
&self,
input: PurchaseOfferingRequest,
) -> RusotoFuture<PurchaseOfferingResult, PurchaseOfferingError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.PurchaseOffering");
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::<PurchaseOfferingResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PurchaseOfferingError::from_response(response))),
)
}
})
}
fn renew_offering(
&self,
input: RenewOfferingRequest,
) -> RusotoFuture<RenewOfferingResult, RenewOfferingError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.RenewOffering");
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::<RenewOfferingResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RenewOfferingError::from_response(response))),
)
}
})
}
fn schedule_run(
&self,
input: ScheduleRunRequest,
) -> RusotoFuture<ScheduleRunResult, ScheduleRunError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.ScheduleRun");
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::<ScheduleRunResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ScheduleRunError::from_response(response))),
)
}
})
}
fn stop_remote_access_session(
&self,
input: StopRemoteAccessSessionRequest,
) -> RusotoFuture<StopRemoteAccessSessionResult, StopRemoteAccessSessionError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.StopRemoteAccessSession",
);
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::<StopRemoteAccessSessionResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StopRemoteAccessSessionError::from_response(response))
}))
}
})
}
fn stop_run(&self, input: StopRunRequest) -> RusotoFuture<StopRunResult, StopRunError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.StopRun");
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::<StopRunResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopRunError::from_response(response))),
)
}
})
}
fn update_device_instance(
&self,
input: UpdateDeviceInstanceRequest,
) -> RusotoFuture<UpdateDeviceInstanceResult, UpdateDeviceInstanceError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.UpdateDeviceInstance");
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::<UpdateDeviceInstanceResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateDeviceInstanceError::from_response(response))
}),
)
}
})
}
fn update_device_pool(
&self,
input: UpdateDevicePoolRequest,
) -> RusotoFuture<UpdateDevicePoolResult, UpdateDevicePoolError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.UpdateDevicePool");
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::<UpdateDevicePoolResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateDevicePoolError::from_response(response))),
)
}
})
}
fn update_instance_profile(
&self,
input: UpdateInstanceProfileRequest,
) -> RusotoFuture<UpdateInstanceProfileResult, UpdateInstanceProfileError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.UpdateInstanceProfile");
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::<UpdateInstanceProfileResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateInstanceProfileError::from_response(response))
}),
)
}
})
}
fn update_network_profile(
&self,
input: UpdateNetworkProfileRequest,
) -> RusotoFuture<UpdateNetworkProfileResult, UpdateNetworkProfileError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.UpdateNetworkProfile");
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::<UpdateNetworkProfileResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateNetworkProfileError::from_response(response))
}),
)
}
})
}
fn update_project(
&self,
input: UpdateProjectRequest,
) -> RusotoFuture<UpdateProjectResult, UpdateProjectError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "DeviceFarm_20150623.UpdateProject");
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::<UpdateProjectResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateProjectError::from_response(response))),
)
}
})
}
fn update_vpce_configuration(
&self,
input: UpdateVPCEConfigurationRequest,
) -> RusotoFuture<UpdateVPCEConfigurationResult, UpdateVPCEConfigurationError> {
let mut request = SignedRequest::new("POST", "devicefarm", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"DeviceFarm_20150623.UpdateVPCEConfiguration",
);
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::<UpdateVPCEConfigurationResult>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateVPCEConfigurationError::from_response(response))
}))
}
})
}
}
#[cfg(test)]
mod protocol_tests {}