use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociateCreatedArtifactRequest {
#[serde(rename = "CreatedArtifact")]
pub created_artifact: CreatedArtifact,
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociateCreatedArtifactResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociateDiscoveredResourceRequest {
#[serde(rename = "DiscoveredResource")]
pub discovered_resource: DiscoveredResource,
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociateDiscoveredResourceResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateProgressUpdateStreamRequest {
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "ProgressUpdateStreamName")]
pub progress_update_stream_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateProgressUpdateStreamResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CreatedArtifact {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteProgressUpdateStreamRequest {
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "ProgressUpdateStreamName")]
pub progress_update_stream_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteProgressUpdateStreamResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeApplicationStateRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeApplicationStateResult {
#[serde(rename = "ApplicationStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub application_status: Option<String>,
#[serde(rename = "LastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeMigrationTaskRequest {
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeMigrationTaskResult {
#[serde(rename = "MigrationTask")]
#[serde(skip_serializing_if = "Option::is_none")]
pub migration_task: Option<MigrationTask>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateCreatedArtifactRequest {
#[serde(rename = "CreatedArtifactName")]
pub created_artifact_name: String,
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateCreatedArtifactResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateDiscoveredResourceRequest {
#[serde(rename = "ConfigurationId")]
pub configuration_id: String,
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateDiscoveredResourceResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DiscoveredResource {
#[serde(rename = "ConfigurationId")]
pub configuration_id: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ImportMigrationTaskRequest {
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ImportMigrationTaskResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListCreatedArtifactsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListCreatedArtifactsResult {
#[serde(rename = "CreatedArtifactList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_artifact_list: Option<Vec<CreatedArtifact>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListDiscoveredResourcesRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListDiscoveredResourcesResult {
#[serde(rename = "DiscoveredResourceList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub discovered_resource_list: Option<Vec<DiscoveredResource>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListMigrationTasksRequest {
#[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>,
#[serde(rename = "ResourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListMigrationTasksResult {
#[serde(rename = "MigrationTaskSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub migration_task_summary_list: Option<Vec<MigrationTaskSummary>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListProgressUpdateStreamsRequest {
#[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 ListProgressUpdateStreamsResult {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ProgressUpdateStreamSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_update_stream_summary_list: Option<Vec<ProgressUpdateStreamSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MigrationTask {
#[serde(rename = "MigrationTaskName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub migration_task_name: Option<String>,
#[serde(rename = "ProgressUpdateStream")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_update_stream: Option<String>,
#[serde(rename = "ResourceAttributeList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_attribute_list: Option<Vec<ResourceAttribute>>,
#[serde(rename = "Task")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task: Option<Task>,
#[serde(rename = "UpdateDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub update_date_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MigrationTaskSummary {
#[serde(rename = "MigrationTaskName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub migration_task_name: Option<String>,
#[serde(rename = "ProgressPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_percent: Option<i64>,
#[serde(rename = "ProgressUpdateStream")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_update_stream: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "StatusDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_detail: Option<String>,
#[serde(rename = "UpdateDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub update_date_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct NotifyApplicationStateRequest {
#[serde(rename = "ApplicationId")]
pub application_id: String,
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "Status")]
pub status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NotifyApplicationStateResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct NotifyMigrationTaskStateRequest {
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "NextUpdateSeconds")]
pub next_update_seconds: i64,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
#[serde(rename = "Task")]
pub task: Task,
#[serde(rename = "UpdateDateTime")]
pub update_date_time: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NotifyMigrationTaskStateResult {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProgressUpdateStreamSummary {
#[serde(rename = "ProgressUpdateStreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_update_stream_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutResourceAttributesRequest {
#[serde(rename = "DryRun")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dry_run: Option<bool>,
#[serde(rename = "MigrationTaskName")]
pub migration_task_name: String,
#[serde(rename = "ProgressUpdateStream")]
pub progress_update_stream: String,
#[serde(rename = "ResourceAttributeList")]
pub resource_attribute_list: Vec<ResourceAttribute>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutResourceAttributesResult {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResourceAttribute {
#[serde(rename = "Type")]
pub type_: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Task {
#[serde(rename = "ProgressPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_percent: Option<i64>,
#[serde(rename = "Status")]
pub status: String,
#[serde(rename = "StatusDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_detail: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum AssociateCreatedArtifactError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl AssociateCreatedArtifactError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateCreatedArtifactError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(AssociateCreatedArtifactError::AccessDenied(
err.msg,
))
}
"DryRunOperation" => {
return RusotoError::Service(AssociateCreatedArtifactError::DryRunOperation(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(
AssociateCreatedArtifactError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(AssociateCreatedArtifactError::InvalidInput(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(AssociateCreatedArtifactError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(AssociateCreatedArtifactError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperation" => {
return RusotoError::Service(
AssociateCreatedArtifactError::UnauthorizedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AssociateCreatedArtifactError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateCreatedArtifactError {
fn description(&self) -> &str {
match *self {
AssociateCreatedArtifactError::AccessDenied(ref cause) => cause,
AssociateCreatedArtifactError::DryRunOperation(ref cause) => cause,
AssociateCreatedArtifactError::InternalServerError(ref cause) => cause,
AssociateCreatedArtifactError::InvalidInput(ref cause) => cause,
AssociateCreatedArtifactError::ResourceNotFound(ref cause) => cause,
AssociateCreatedArtifactError::ServiceUnavailable(ref cause) => cause,
AssociateCreatedArtifactError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AssociateDiscoveredResourceError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
PolicyError(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl AssociateDiscoveredResourceError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<AssociateDiscoveredResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(AssociateDiscoveredResourceError::AccessDenied(
err.msg,
))
}
"DryRunOperation" => {
return RusotoError::Service(AssociateDiscoveredResourceError::DryRunOperation(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(
AssociateDiscoveredResourceError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(AssociateDiscoveredResourceError::InvalidInput(
err.msg,
))
}
"PolicyErrorException" => {
return RusotoError::Service(AssociateDiscoveredResourceError::PolicyError(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
AssociateDiscoveredResourceError::ResourceNotFound(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
AssociateDiscoveredResourceError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedOperation" => {
return RusotoError::Service(
AssociateDiscoveredResourceError::UnauthorizedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AssociateDiscoveredResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateDiscoveredResourceError {
fn description(&self) -> &str {
match *self {
AssociateDiscoveredResourceError::AccessDenied(ref cause) => cause,
AssociateDiscoveredResourceError::DryRunOperation(ref cause) => cause,
AssociateDiscoveredResourceError::InternalServerError(ref cause) => cause,
AssociateDiscoveredResourceError::InvalidInput(ref cause) => cause,
AssociateDiscoveredResourceError::PolicyError(ref cause) => cause,
AssociateDiscoveredResourceError::ResourceNotFound(ref cause) => cause,
AssociateDiscoveredResourceError::ServiceUnavailable(ref cause) => cause,
AssociateDiscoveredResourceError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateProgressUpdateStreamError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl CreateProgressUpdateStreamError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateProgressUpdateStreamError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateProgressUpdateStreamError::AccessDenied(
err.msg,
))
}
"DryRunOperation" => {
return RusotoError::Service(CreateProgressUpdateStreamError::DryRunOperation(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(
CreateProgressUpdateStreamError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(CreateProgressUpdateStreamError::InvalidInput(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(
CreateProgressUpdateStreamError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedOperation" => {
return RusotoError::Service(
CreateProgressUpdateStreamError::UnauthorizedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateProgressUpdateStreamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateProgressUpdateStreamError {
fn description(&self) -> &str {
match *self {
CreateProgressUpdateStreamError::AccessDenied(ref cause) => cause,
CreateProgressUpdateStreamError::DryRunOperation(ref cause) => cause,
CreateProgressUpdateStreamError::InternalServerError(ref cause) => cause,
CreateProgressUpdateStreamError::InvalidInput(ref cause) => cause,
CreateProgressUpdateStreamError::ServiceUnavailable(ref cause) => cause,
CreateProgressUpdateStreamError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteProgressUpdateStreamError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl DeleteProgressUpdateStreamError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteProgressUpdateStreamError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteProgressUpdateStreamError::AccessDenied(
err.msg,
))
}
"DryRunOperation" => {
return RusotoError::Service(DeleteProgressUpdateStreamError::DryRunOperation(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(
DeleteProgressUpdateStreamError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(DeleteProgressUpdateStreamError::InvalidInput(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteProgressUpdateStreamError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(
DeleteProgressUpdateStreamError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedOperation" => {
return RusotoError::Service(
DeleteProgressUpdateStreamError::UnauthorizedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteProgressUpdateStreamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteProgressUpdateStreamError {
fn description(&self) -> &str {
match *self {
DeleteProgressUpdateStreamError::AccessDenied(ref cause) => cause,
DeleteProgressUpdateStreamError::DryRunOperation(ref cause) => cause,
DeleteProgressUpdateStreamError::InternalServerError(ref cause) => cause,
DeleteProgressUpdateStreamError::InvalidInput(ref cause) => cause,
DeleteProgressUpdateStreamError::ResourceNotFound(ref cause) => cause,
DeleteProgressUpdateStreamError::ServiceUnavailable(ref cause) => cause,
DeleteProgressUpdateStreamError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeApplicationStateError {
AccessDenied(String),
InternalServerError(String),
InvalidInput(String),
PolicyError(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DescribeApplicationStateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeApplicationStateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DescribeApplicationStateError::AccessDenied(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(
DescribeApplicationStateError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(DescribeApplicationStateError::InvalidInput(
err.msg,
))
}
"PolicyErrorException" => {
return RusotoError::Service(DescribeApplicationStateError::PolicyError(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeApplicationStateError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeApplicationStateError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeApplicationStateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeApplicationStateError {
fn description(&self) -> &str {
match *self {
DescribeApplicationStateError::AccessDenied(ref cause) => cause,
DescribeApplicationStateError::InternalServerError(ref cause) => cause,
DescribeApplicationStateError::InvalidInput(ref cause) => cause,
DescribeApplicationStateError::PolicyError(ref cause) => cause,
DescribeApplicationStateError::ResourceNotFound(ref cause) => cause,
DescribeApplicationStateError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeMigrationTaskError {
AccessDenied(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DescribeMigrationTaskError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeMigrationTaskError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DescribeMigrationTaskError::AccessDenied(err.msg))
}
"InternalServerError" => {
return RusotoError::Service(DescribeMigrationTaskError::InternalServerError(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(DescribeMigrationTaskError::InvalidInput(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeMigrationTaskError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeMigrationTaskError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeMigrationTaskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeMigrationTaskError {
fn description(&self) -> &str {
match *self {
DescribeMigrationTaskError::AccessDenied(ref cause) => cause,
DescribeMigrationTaskError::InternalServerError(ref cause) => cause,
DescribeMigrationTaskError::InvalidInput(ref cause) => cause,
DescribeMigrationTaskError::ResourceNotFound(ref cause) => cause,
DescribeMigrationTaskError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateCreatedArtifactError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl DisassociateCreatedArtifactError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DisassociateCreatedArtifactError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DisassociateCreatedArtifactError::AccessDenied(
err.msg,
))
}
"DryRunOperation" => {
return RusotoError::Service(DisassociateCreatedArtifactError::DryRunOperation(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(
DisassociateCreatedArtifactError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(DisassociateCreatedArtifactError::InvalidInput(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DisassociateCreatedArtifactError::ResourceNotFound(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
DisassociateCreatedArtifactError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedOperation" => {
return RusotoError::Service(
DisassociateCreatedArtifactError::UnauthorizedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateCreatedArtifactError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateCreatedArtifactError {
fn description(&self) -> &str {
match *self {
DisassociateCreatedArtifactError::AccessDenied(ref cause) => cause,
DisassociateCreatedArtifactError::DryRunOperation(ref cause) => cause,
DisassociateCreatedArtifactError::InternalServerError(ref cause) => cause,
DisassociateCreatedArtifactError::InvalidInput(ref cause) => cause,
DisassociateCreatedArtifactError::ResourceNotFound(ref cause) => cause,
DisassociateCreatedArtifactError::ServiceUnavailable(ref cause) => cause,
DisassociateCreatedArtifactError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateDiscoveredResourceError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl DisassociateDiscoveredResourceError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DisassociateDiscoveredResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DisassociateDiscoveredResourceError::AccessDenied(
err.msg,
))
}
"DryRunOperation" => {
return RusotoError::Service(
DisassociateDiscoveredResourceError::DryRunOperation(err.msg),
)
}
"InternalServerError" => {
return RusotoError::Service(
DisassociateDiscoveredResourceError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(DisassociateDiscoveredResourceError::InvalidInput(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DisassociateDiscoveredResourceError::ResourceNotFound(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
DisassociateDiscoveredResourceError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedOperation" => {
return RusotoError::Service(
DisassociateDiscoveredResourceError::UnauthorizedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateDiscoveredResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateDiscoveredResourceError {
fn description(&self) -> &str {
match *self {
DisassociateDiscoveredResourceError::AccessDenied(ref cause) => cause,
DisassociateDiscoveredResourceError::DryRunOperation(ref cause) => cause,
DisassociateDiscoveredResourceError::InternalServerError(ref cause) => cause,
DisassociateDiscoveredResourceError::InvalidInput(ref cause) => cause,
DisassociateDiscoveredResourceError::ResourceNotFound(ref cause) => cause,
DisassociateDiscoveredResourceError::ServiceUnavailable(ref cause) => cause,
DisassociateDiscoveredResourceError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ImportMigrationTaskError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl ImportMigrationTaskError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ImportMigrationTaskError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ImportMigrationTaskError::AccessDenied(err.msg))
}
"DryRunOperation" => {
return RusotoError::Service(ImportMigrationTaskError::DryRunOperation(err.msg))
}
"InternalServerError" => {
return RusotoError::Service(ImportMigrationTaskError::InternalServerError(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(ImportMigrationTaskError::InvalidInput(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ImportMigrationTaskError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ImportMigrationTaskError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperation" => {
return RusotoError::Service(ImportMigrationTaskError::UnauthorizedOperation(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ImportMigrationTaskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ImportMigrationTaskError {
fn description(&self) -> &str {
match *self {
ImportMigrationTaskError::AccessDenied(ref cause) => cause,
ImportMigrationTaskError::DryRunOperation(ref cause) => cause,
ImportMigrationTaskError::InternalServerError(ref cause) => cause,
ImportMigrationTaskError::InvalidInput(ref cause) => cause,
ImportMigrationTaskError::ResourceNotFound(ref cause) => cause,
ImportMigrationTaskError::ServiceUnavailable(ref cause) => cause,
ImportMigrationTaskError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListCreatedArtifactsError {
AccessDenied(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl ListCreatedArtifactsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListCreatedArtifactsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListCreatedArtifactsError::AccessDenied(err.msg))
}
"InternalServerError" => {
return RusotoError::Service(ListCreatedArtifactsError::InternalServerError(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(ListCreatedArtifactsError::InvalidInput(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListCreatedArtifactsError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ListCreatedArtifactsError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListCreatedArtifactsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListCreatedArtifactsError {
fn description(&self) -> &str {
match *self {
ListCreatedArtifactsError::AccessDenied(ref cause) => cause,
ListCreatedArtifactsError::InternalServerError(ref cause) => cause,
ListCreatedArtifactsError::InvalidInput(ref cause) => cause,
ListCreatedArtifactsError::ResourceNotFound(ref cause) => cause,
ListCreatedArtifactsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDiscoveredResourcesError {
AccessDenied(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl ListDiscoveredResourcesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDiscoveredResourcesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListDiscoveredResourcesError::AccessDenied(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(ListDiscoveredResourcesError::InternalServerError(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(ListDiscoveredResourcesError::InvalidInput(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListDiscoveredResourcesError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ListDiscoveredResourcesError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListDiscoveredResourcesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDiscoveredResourcesError {
fn description(&self) -> &str {
match *self {
ListDiscoveredResourcesError::AccessDenied(ref cause) => cause,
ListDiscoveredResourcesError::InternalServerError(ref cause) => cause,
ListDiscoveredResourcesError::InvalidInput(ref cause) => cause,
ListDiscoveredResourcesError::ResourceNotFound(ref cause) => cause,
ListDiscoveredResourcesError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListMigrationTasksError {
AccessDenied(String),
InternalServerError(String),
InvalidInput(String),
PolicyError(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl ListMigrationTasksError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListMigrationTasksError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListMigrationTasksError::AccessDenied(err.msg))
}
"InternalServerError" => {
return RusotoError::Service(ListMigrationTasksError::InternalServerError(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(ListMigrationTasksError::InvalidInput(err.msg))
}
"PolicyErrorException" => {
return RusotoError::Service(ListMigrationTasksError::PolicyError(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListMigrationTasksError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ListMigrationTasksError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListMigrationTasksError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListMigrationTasksError {
fn description(&self) -> &str {
match *self {
ListMigrationTasksError::AccessDenied(ref cause) => cause,
ListMigrationTasksError::InternalServerError(ref cause) => cause,
ListMigrationTasksError::InvalidInput(ref cause) => cause,
ListMigrationTasksError::PolicyError(ref cause) => cause,
ListMigrationTasksError::ResourceNotFound(ref cause) => cause,
ListMigrationTasksError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListProgressUpdateStreamsError {
AccessDenied(String),
InternalServerError(String),
InvalidInput(String),
ServiceUnavailable(String),
}
impl ListProgressUpdateStreamsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListProgressUpdateStreamsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListProgressUpdateStreamsError::AccessDenied(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(
ListProgressUpdateStreamsError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(ListProgressUpdateStreamsError::InvalidInput(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(
ListProgressUpdateStreamsError::ServiceUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListProgressUpdateStreamsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListProgressUpdateStreamsError {
fn description(&self) -> &str {
match *self {
ListProgressUpdateStreamsError::AccessDenied(ref cause) => cause,
ListProgressUpdateStreamsError::InternalServerError(ref cause) => cause,
ListProgressUpdateStreamsError::InvalidInput(ref cause) => cause,
ListProgressUpdateStreamsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum NotifyApplicationStateError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
PolicyError(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl NotifyApplicationStateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<NotifyApplicationStateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(NotifyApplicationStateError::AccessDenied(err.msg))
}
"DryRunOperation" => {
return RusotoError::Service(NotifyApplicationStateError::DryRunOperation(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(NotifyApplicationStateError::InternalServerError(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(NotifyApplicationStateError::InvalidInput(err.msg))
}
"PolicyErrorException" => {
return RusotoError::Service(NotifyApplicationStateError::PolicyError(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(NotifyApplicationStateError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(NotifyApplicationStateError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperation" => {
return RusotoError::Service(
NotifyApplicationStateError::UnauthorizedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for NotifyApplicationStateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for NotifyApplicationStateError {
fn description(&self) -> &str {
match *self {
NotifyApplicationStateError::AccessDenied(ref cause) => cause,
NotifyApplicationStateError::DryRunOperation(ref cause) => cause,
NotifyApplicationStateError::InternalServerError(ref cause) => cause,
NotifyApplicationStateError::InvalidInput(ref cause) => cause,
NotifyApplicationStateError::PolicyError(ref cause) => cause,
NotifyApplicationStateError::ResourceNotFound(ref cause) => cause,
NotifyApplicationStateError::ServiceUnavailable(ref cause) => cause,
NotifyApplicationStateError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum NotifyMigrationTaskStateError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl NotifyMigrationTaskStateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<NotifyMigrationTaskStateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(NotifyMigrationTaskStateError::AccessDenied(
err.msg,
))
}
"DryRunOperation" => {
return RusotoError::Service(NotifyMigrationTaskStateError::DryRunOperation(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(
NotifyMigrationTaskStateError::InternalServerError(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(NotifyMigrationTaskStateError::InvalidInput(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(NotifyMigrationTaskStateError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(NotifyMigrationTaskStateError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperation" => {
return RusotoError::Service(
NotifyMigrationTaskStateError::UnauthorizedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for NotifyMigrationTaskStateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for NotifyMigrationTaskStateError {
fn description(&self) -> &str {
match *self {
NotifyMigrationTaskStateError::AccessDenied(ref cause) => cause,
NotifyMigrationTaskStateError::DryRunOperation(ref cause) => cause,
NotifyMigrationTaskStateError::InternalServerError(ref cause) => cause,
NotifyMigrationTaskStateError::InvalidInput(ref cause) => cause,
NotifyMigrationTaskStateError::ResourceNotFound(ref cause) => cause,
NotifyMigrationTaskStateError::ServiceUnavailable(ref cause) => cause,
NotifyMigrationTaskStateError::UnauthorizedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutResourceAttributesError {
AccessDenied(String),
DryRunOperation(String),
InternalServerError(String),
InvalidInput(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
}
impl PutResourceAttributesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutResourceAttributesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(PutResourceAttributesError::AccessDenied(err.msg))
}
"DryRunOperation" => {
return RusotoError::Service(PutResourceAttributesError::DryRunOperation(
err.msg,
))
}
"InternalServerError" => {
return RusotoError::Service(PutResourceAttributesError::InternalServerError(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(PutResourceAttributesError::InvalidInput(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(PutResourceAttributesError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(PutResourceAttributesError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperation" => {
return RusotoError::Service(PutResourceAttributesError::UnauthorizedOperation(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutResourceAttributesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutResourceAttributesError {
fn description(&self) -> &str {
match *self {
PutResourceAttributesError::AccessDenied(ref cause) => cause,
PutResourceAttributesError::DryRunOperation(ref cause) => cause,
PutResourceAttributesError::InternalServerError(ref cause) => cause,
PutResourceAttributesError::InvalidInput(ref cause) => cause,
PutResourceAttributesError::ResourceNotFound(ref cause) => cause,
PutResourceAttributesError::ServiceUnavailable(ref cause) => cause,
PutResourceAttributesError::UnauthorizedOperation(ref cause) => cause,
}
}
}
pub trait MigrationHub {
fn associate_created_artifact(
&self,
input: AssociateCreatedArtifactRequest,
) -> RusotoFuture<AssociateCreatedArtifactResult, AssociateCreatedArtifactError>;
fn associate_discovered_resource(
&self,
input: AssociateDiscoveredResourceRequest,
) -> RusotoFuture<AssociateDiscoveredResourceResult, AssociateDiscoveredResourceError>;
fn create_progress_update_stream(
&self,
input: CreateProgressUpdateStreamRequest,
) -> RusotoFuture<CreateProgressUpdateStreamResult, CreateProgressUpdateStreamError>;
fn delete_progress_update_stream(
&self,
input: DeleteProgressUpdateStreamRequest,
) -> RusotoFuture<DeleteProgressUpdateStreamResult, DeleteProgressUpdateStreamError>;
fn describe_application_state(
&self,
input: DescribeApplicationStateRequest,
) -> RusotoFuture<DescribeApplicationStateResult, DescribeApplicationStateError>;
fn describe_migration_task(
&self,
input: DescribeMigrationTaskRequest,
) -> RusotoFuture<DescribeMigrationTaskResult, DescribeMigrationTaskError>;
fn disassociate_created_artifact(
&self,
input: DisassociateCreatedArtifactRequest,
) -> RusotoFuture<DisassociateCreatedArtifactResult, DisassociateCreatedArtifactError>;
fn disassociate_discovered_resource(
&self,
input: DisassociateDiscoveredResourceRequest,
) -> RusotoFuture<DisassociateDiscoveredResourceResult, DisassociateDiscoveredResourceError>;
fn import_migration_task(
&self,
input: ImportMigrationTaskRequest,
) -> RusotoFuture<ImportMigrationTaskResult, ImportMigrationTaskError>;
fn list_created_artifacts(
&self,
input: ListCreatedArtifactsRequest,
) -> RusotoFuture<ListCreatedArtifactsResult, ListCreatedArtifactsError>;
fn list_discovered_resources(
&self,
input: ListDiscoveredResourcesRequest,
) -> RusotoFuture<ListDiscoveredResourcesResult, ListDiscoveredResourcesError>;
fn list_migration_tasks(
&self,
input: ListMigrationTasksRequest,
) -> RusotoFuture<ListMigrationTasksResult, ListMigrationTasksError>;
fn list_progress_update_streams(
&self,
input: ListProgressUpdateStreamsRequest,
) -> RusotoFuture<ListProgressUpdateStreamsResult, ListProgressUpdateStreamsError>;
fn notify_application_state(
&self,
input: NotifyApplicationStateRequest,
) -> RusotoFuture<NotifyApplicationStateResult, NotifyApplicationStateError>;
fn notify_migration_task_state(
&self,
input: NotifyMigrationTaskStateRequest,
) -> RusotoFuture<NotifyMigrationTaskStateResult, NotifyMigrationTaskStateError>;
fn put_resource_attributes(
&self,
input: PutResourceAttributesRequest,
) -> RusotoFuture<PutResourceAttributesResult, PutResourceAttributesError>;
}
#[derive(Clone)]
pub struct MigrationHubClient {
client: Client,
region: region::Region,
}
impl MigrationHubClient {
pub fn new(region: region::Region) -> MigrationHubClient {
MigrationHubClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> MigrationHubClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
MigrationHubClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl MigrationHub for MigrationHubClient {
fn associate_created_artifact(
&self,
input: AssociateCreatedArtifactRequest,
) -> RusotoFuture<AssociateCreatedArtifactResult, AssociateCreatedArtifactError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.AssociateCreatedArtifact");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<AssociateCreatedArtifactResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AssociateCreatedArtifactError::from_response(response))
}))
}
})
}
fn associate_discovered_resource(
&self,
input: AssociateDiscoveredResourceRequest,
) -> RusotoFuture<AssociateDiscoveredResourceResult, AssociateDiscoveredResourceError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSMigrationHub.AssociateDiscoveredResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<AssociateDiscoveredResourceResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AssociateDiscoveredResourceError::from_response(response))
}))
}
})
}
fn create_progress_update_stream(
&self,
input: CreateProgressUpdateStreamRequest,
) -> RusotoFuture<CreateProgressUpdateStreamResult, CreateProgressUpdateStreamError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.CreateProgressUpdateStream");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateProgressUpdateStreamResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateProgressUpdateStreamError::from_response(response))
}))
}
})
}
fn delete_progress_update_stream(
&self,
input: DeleteProgressUpdateStreamRequest,
) -> RusotoFuture<DeleteProgressUpdateStreamResult, DeleteProgressUpdateStreamError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.DeleteProgressUpdateStream");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteProgressUpdateStreamResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteProgressUpdateStreamError::from_response(response))
}))
}
})
}
fn describe_application_state(
&self,
input: DescribeApplicationStateRequest,
) -> RusotoFuture<DescribeApplicationStateResult, DescribeApplicationStateError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.DescribeApplicationState");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeApplicationStateResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeApplicationStateError::from_response(response))
}))
}
})
}
fn describe_migration_task(
&self,
input: DescribeMigrationTaskRequest,
) -> RusotoFuture<DescribeMigrationTaskResult, DescribeMigrationTaskError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.DescribeMigrationTask");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeMigrationTaskResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeMigrationTaskError::from_response(response))
}),
)
}
})
}
fn disassociate_created_artifact(
&self,
input: DisassociateCreatedArtifactRequest,
) -> RusotoFuture<DisassociateCreatedArtifactResult, DisassociateCreatedArtifactError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSMigrationHub.DisassociateCreatedArtifact",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateCreatedArtifactResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociateCreatedArtifactError::from_response(response))
}))
}
})
}
fn disassociate_discovered_resource(
&self,
input: DisassociateDiscoveredResourceRequest,
) -> RusotoFuture<DisassociateDiscoveredResourceResult, DisassociateDiscoveredResourceError>
{
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSMigrationHub.DisassociateDiscoveredResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateDiscoveredResourceResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociateDiscoveredResourceError::from_response(response))
}))
}
})
}
fn import_migration_task(
&self,
input: ImportMigrationTaskRequest,
) -> RusotoFuture<ImportMigrationTaskResult, ImportMigrationTaskError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.ImportMigrationTask");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ImportMigrationTaskResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ImportMigrationTaskError::from_response(response))
}),
)
}
})
}
fn list_created_artifacts(
&self,
input: ListCreatedArtifactsRequest,
) -> RusotoFuture<ListCreatedArtifactsResult, ListCreatedArtifactsError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.ListCreatedArtifacts");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListCreatedArtifactsResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListCreatedArtifactsError::from_response(response))
}),
)
}
})
}
fn list_discovered_resources(
&self,
input: ListDiscoveredResourcesRequest,
) -> RusotoFuture<ListDiscoveredResourcesResult, ListDiscoveredResourcesError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.ListDiscoveredResources");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListDiscoveredResourcesResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListDiscoveredResourcesError::from_response(response))
}))
}
})
}
fn list_migration_tasks(
&self,
input: ListMigrationTasksRequest,
) -> RusotoFuture<ListMigrationTasksResult, ListMigrationTasksError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.ListMigrationTasks");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListMigrationTasksResult, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListMigrationTasksError::from_response(response))),
)
}
})
}
fn list_progress_update_streams(
&self,
input: ListProgressUpdateStreamsRequest,
) -> RusotoFuture<ListProgressUpdateStreamsResult, ListProgressUpdateStreamsError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.ListProgressUpdateStreams");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListProgressUpdateStreamsResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListProgressUpdateStreamsError::from_response(response))
}))
}
})
}
fn notify_application_state(
&self,
input: NotifyApplicationStateRequest,
) -> RusotoFuture<NotifyApplicationStateResult, NotifyApplicationStateError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.NotifyApplicationState");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<NotifyApplicationStateResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(NotifyApplicationStateError::from_response(response))
}),
)
}
})
}
fn notify_migration_task_state(
&self,
input: NotifyMigrationTaskStateRequest,
) -> RusotoFuture<NotifyMigrationTaskStateResult, NotifyMigrationTaskStateError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.NotifyMigrationTaskState");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<NotifyMigrationTaskStateResult, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(NotifyMigrationTaskStateError::from_response(response))
}))
}
})
}
fn put_resource_attributes(
&self,
input: PutResourceAttributesRequest,
) -> RusotoFuture<PutResourceAttributesResult, PutResourceAttributesError> {
let mut request = SignedRequest::new("POST", "mgh", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSMigrationHub.PutResourceAttributes");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<PutResourceAttributesResult, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutResourceAttributesError::from_response(response))
}),
)
}
})
}
}