use std::error::Error;
use std::fmt;
use std::io;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoFuture};
use rusoto_core::credential::{CredentialsError, ProvideAwsCredentials};
use rusoto_core::request::HttpDispatchError;
use rusoto_core::signature::SignedRequest;
use serde_json;
use serde_json::from_slice;
use serde_json::Value as SerdeJsonValue;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AcceptPortfolioShareInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AcceptPortfolioShareOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AccessLevelFilter {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociatePrincipalWithPortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
#[serde(rename = "PrincipalARN")]
pub principal_arn: String,
#[serde(rename = "PrincipalType")]
pub principal_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociatePrincipalWithPortfolioOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociateProductWithPortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
#[serde(rename = "ProductId")]
pub product_id: String,
#[serde(rename = "SourcePortfolioId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_portfolio_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociateProductWithPortfolioOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociateTagOptionWithResourceInput {
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "TagOptionId")]
pub tag_option_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociateTagOptionWithResourceOutput {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CloudWatchDashboard {
#[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 ConstraintDetail {
#[serde(rename = "ConstraintId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_id: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Owner")]
#[serde(skip_serializing_if = "Option::is_none")]
pub owner: 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 ConstraintSummary {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CopyProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "CopyOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub copy_options: Option<Vec<String>>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "SourceProductArn")]
pub source_product_arn: String,
#[serde(rename = "SourceProvisioningArtifactIdentifiers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_provisioning_artifact_identifiers:
Option<Vec<::std::collections::HashMap<String, String>>>,
#[serde(rename = "TargetProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_product_id: Option<String>,
#[serde(rename = "TargetProductName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_product_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CopyProductOutput {
#[serde(rename = "CopyProductToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub copy_product_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateConstraintInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "Parameters")]
pub parameters: String,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
#[serde(rename = "ProductId")]
pub product_id: String,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateConstraintOutput {
#[serde(rename = "ConstraintDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_detail: Option<ConstraintDetail>,
#[serde(rename = "ConstraintParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_parameters: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreatePortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "DisplayName")]
pub display_name: String,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "ProviderName")]
pub provider_name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreatePortfolioOutput {
#[serde(rename = "PortfolioDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub portfolio_detail: Option<PortfolioDetail>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreatePortfolioShareInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "AccountId")]
pub account_id: String,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreatePortfolioShareOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Distributor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub distributor: Option<String>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Owner")]
pub owner: String,
#[serde(rename = "ProductType")]
pub product_type: String,
#[serde(rename = "ProvisioningArtifactParameters")]
pub provisioning_artifact_parameters: ProvisioningArtifactProperties,
#[serde(rename = "SupportDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_description: Option<String>,
#[serde(rename = "SupportEmail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_email: Option<String>,
#[serde(rename = "SupportUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_url: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateProductOutput {
#[serde(rename = "ProductViewDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_detail: Option<ProductViewDetail>,
#[serde(rename = "ProvisioningArtifactDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_detail: Option<ProvisioningArtifactDetail>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateProvisionedProductPlanInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "NotificationArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_arns: Option<Vec<String>>,
#[serde(rename = "PathId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path_id: Option<String>,
#[serde(rename = "PlanName")]
pub plan_name: String,
#[serde(rename = "PlanType")]
pub plan_type: String,
#[serde(rename = "ProductId")]
pub product_id: String,
#[serde(rename = "ProvisionedProductName")]
pub provisioned_product_name: String,
#[serde(rename = "ProvisioningArtifactId")]
pub provisioning_artifact_id: String,
#[serde(rename = "ProvisioningParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_parameters: Option<Vec<UpdateProvisioningParameter>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateProvisionedProductPlanOutput {
#[serde(rename = "PlanId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan_id: Option<String>,
#[serde(rename = "PlanName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan_name: Option<String>,
#[serde(rename = "ProvisionProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provision_product_id: Option<String>,
#[serde(rename = "ProvisionedProductName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_name: Option<String>,
#[serde(rename = "ProvisioningArtifactId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateProvisioningArtifactInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "Parameters")]
pub parameters: ProvisioningArtifactProperties,
#[serde(rename = "ProductId")]
pub product_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateProvisioningArtifactOutput {
#[serde(rename = "Info")]
#[serde(skip_serializing_if = "Option::is_none")]
pub info: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "ProvisioningArtifactDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_detail: Option<ProvisioningArtifactDetail>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateTagOptionInput {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateTagOptionOutput {
#[serde(rename = "TagOptionDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_option_detail: Option<TagOptionDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteConstraintInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteConstraintOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeletePortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeletePortfolioOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeletePortfolioShareInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "AccountId")]
pub account_id: String,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeletePortfolioShareOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteProductOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteProvisionedProductPlanInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "IgnoreErrors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ignore_errors: Option<bool>,
#[serde(rename = "PlanId")]
pub plan_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteProvisionedProductPlanOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteProvisioningArtifactInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "ProductId")]
pub product_id: String,
#[serde(rename = "ProvisioningArtifactId")]
pub provisioning_artifact_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteProvisioningArtifactOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteTagOptionInput {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteTagOptionOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConstraintInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeConstraintOutput {
#[serde(rename = "ConstraintDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_detail: Option<ConstraintDetail>,
#[serde(rename = "ConstraintParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_parameters: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeCopyProductStatusInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "CopyProductToken")]
pub copy_product_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeCopyProductStatusOutput {
#[serde(rename = "CopyProductStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub copy_product_status: Option<String>,
#[serde(rename = "StatusDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_detail: Option<String>,
#[serde(rename = "TargetProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_product_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribePortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribePortfolioOutput {
#[serde(rename = "PortfolioDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub portfolio_detail: Option<PortfolioDetail>,
#[serde(rename = "TagOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_options: Option<Vec<TagOptionDetail>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeProductAsAdminInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeProductAsAdminOutput {
#[serde(rename = "ProductViewDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_detail: Option<ProductViewDetail>,
#[serde(rename = "ProvisioningArtifactSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_summaries: Option<Vec<ProvisioningArtifactSummary>>,
#[serde(rename = "TagOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_options: Option<Vec<TagOptionDetail>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeProductOutput {
#[serde(rename = "ProductViewSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_summary: Option<ProductViewSummary>,
#[serde(rename = "ProvisioningArtifacts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifacts: Option<Vec<ProvisioningArtifact>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeProductViewInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeProductViewOutput {
#[serde(rename = "ProductViewSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_summary: Option<ProductViewSummary>,
#[serde(rename = "ProvisioningArtifacts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifacts: Option<Vec<ProvisioningArtifact>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeProvisionedProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeProvisionedProductOutput {
#[serde(rename = "CloudWatchDashboards")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cloud_watch_dashboards: Option<Vec<CloudWatchDashboard>>,
#[serde(rename = "ProvisionedProductDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_detail: Option<ProvisionedProductDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeProvisionedProductPlanInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "PlanId")]
pub plan_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeProvisionedProductPlanOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ProvisionedProductPlanDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_plan_details: Option<ProvisionedProductPlanDetails>,
#[serde(rename = "ResourceChanges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_changes: Option<Vec<ResourceChange>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeProvisioningArtifactInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "ProductId")]
pub product_id: String,
#[serde(rename = "ProvisioningArtifactId")]
pub provisioning_artifact_id: String,
#[serde(rename = "Verbose")]
#[serde(skip_serializing_if = "Option::is_none")]
pub verbose: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeProvisioningArtifactOutput {
#[serde(rename = "Info")]
#[serde(skip_serializing_if = "Option::is_none")]
pub info: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "ProvisioningArtifactDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_detail: Option<ProvisioningArtifactDetail>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeProvisioningParametersInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PathId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path_id: Option<String>,
#[serde(rename = "ProductId")]
pub product_id: String,
#[serde(rename = "ProvisioningArtifactId")]
pub provisioning_artifact_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeProvisioningParametersOutput {
#[serde(rename = "ConstraintSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_summaries: Option<Vec<ConstraintSummary>>,
#[serde(rename = "ProvisioningArtifactParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_parameters: Option<Vec<ProvisioningArtifactParameter>>,
#[serde(rename = "TagOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_options: Option<Vec<TagOptionSummary>>,
#[serde(rename = "UsageInstructions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub usage_instructions: Option<Vec<UsageInstruction>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeRecordInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeRecordOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "RecordDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_detail: Option<RecordDetail>,
#[serde(rename = "RecordOutputs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_outputs: Option<Vec<RecordOutput>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeTagOptionInput {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeTagOptionOutput {
#[serde(rename = "TagOptionDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_option_detail: Option<TagOptionDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociatePrincipalFromPortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
#[serde(rename = "PrincipalARN")]
pub principal_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociatePrincipalFromPortfolioOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateProductFromPortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
#[serde(rename = "ProductId")]
pub product_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateProductFromPortfolioOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateTagOptionFromResourceInput {
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "TagOptionId")]
pub tag_option_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateTagOptionFromResourceOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ExecuteProvisionedProductPlanInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "PlanId")]
pub plan_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExecuteProvisionedProductPlanOutput {
#[serde(rename = "RecordDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_detail: Option<RecordDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LaunchPathSummary {
#[serde(rename = "ConstraintSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_summaries: Option<Vec<ConstraintSummary>>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAcceptedPortfolioSharesInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "PortfolioShareType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub portfolio_share_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListAcceptedPortfolioSharesOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "PortfolioDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub portfolio_details: Option<Vec<PortfolioDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListConstraintsForPortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
#[serde(rename = "ProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListConstraintsForPortfolioOutput {
#[serde(rename = "ConstraintDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_details: Option<Vec<ConstraintDetail>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListLaunchPathsInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "ProductId")]
pub product_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListLaunchPathsOutput {
#[serde(rename = "LaunchPathSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub launch_path_summaries: Option<Vec<LaunchPathSummary>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListPortfolioAccessInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListPortfolioAccessOutput {
#[serde(rename = "AccountIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_ids: Option<Vec<String>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListPortfoliosForProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "ProductId")]
pub product_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListPortfoliosForProductOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "PortfolioDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub portfolio_details: Option<Vec<PortfolioDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListPortfoliosInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListPortfoliosOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "PortfolioDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub portfolio_details: Option<Vec<PortfolioDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListPrincipalsForPortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListPrincipalsForPortfolioOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "Principals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principals: Option<Vec<Principal>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListProvisionedProductPlansInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "AccessLevelFilter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_level_filter: Option<AccessLevelFilter>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "ProvisionProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provision_product_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListProvisionedProductPlansOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ProvisionedProductPlans")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_plans: Option<Vec<ProvisionedProductPlanSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListProvisioningArtifactsInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "ProductId")]
pub product_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListProvisioningArtifactsOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ProvisioningArtifactDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_details: Option<Vec<ProvisioningArtifactDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListRecordHistoryInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "AccessLevelFilter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_level_filter: Option<AccessLevelFilter>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "SearchFilter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub search_filter: Option<ListRecordHistorySearchFilter>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListRecordHistoryOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "RecordDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_details: Option<Vec<RecordDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListRecordHistorySearchFilter {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListResourcesForTagOptionInput {
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "TagOptionId")]
pub tag_option_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListResourcesForTagOptionOutput {
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "ResourceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_details: Option<Vec<ResourceDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagOptionsFilters {
#[serde(rename = "Active")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagOptionsInput {
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<ListTagOptionsFilters>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagOptionsOutput {
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "TagOptionDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_option_details: Option<Vec<TagOptionDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ParameterConstraints {
#[serde(rename = "AllowedValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allowed_values: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PortfolioDetail {
#[serde(rename = "ARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "DisplayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "ProviderName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provider_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Principal {
#[serde(rename = "PrincipalARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principal_arn: Option<String>,
#[serde(rename = "PrincipalType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principal_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProductViewAggregationValue {
#[serde(rename = "ApproximateCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub approximate_count: Option<i64>,
#[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 ProductViewDetail {
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[serde(rename = "ProductARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_arn: Option<String>,
#[serde(rename = "ProductViewSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_summary: Option<ProductViewSummary>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProductViewSummary {
#[serde(rename = "Distributor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub distributor: Option<String>,
#[serde(rename = "HasDefaultPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub has_default_path: Option<bool>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Owner")]
#[serde(skip_serializing_if = "Option::is_none")]
pub owner: Option<String>,
#[serde(rename = "ProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_id: Option<String>,
#[serde(rename = "ShortDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub short_description: Option<String>,
#[serde(rename = "SupportDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_description: Option<String>,
#[serde(rename = "SupportEmail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_email: Option<String>,
#[serde(rename = "SupportUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_url: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ProvisionProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "NotificationArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_arns: Option<Vec<String>>,
#[serde(rename = "PathId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path_id: Option<String>,
#[serde(rename = "ProductId")]
pub product_id: String,
#[serde(rename = "ProvisionToken")]
pub provision_token: String,
#[serde(rename = "ProvisionedProductName")]
pub provisioned_product_name: String,
#[serde(rename = "ProvisioningArtifactId")]
pub provisioning_artifact_id: String,
#[serde(rename = "ProvisioningParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_parameters: Option<Vec<ProvisioningParameter>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProvisionProductOutput {
#[serde(rename = "RecordDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_detail: Option<RecordDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProvisionedProductAttribute {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "IdempotencyToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub idempotency_token: Option<String>,
#[serde(rename = "LastRecordId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_record_id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "PhysicalId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub physical_id: Option<String>,
#[serde(rename = "ProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_id: Option<String>,
#[serde(rename = "ProvisioningArtifactId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_id: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "StatusMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_message: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "UserArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_arn: Option<String>,
#[serde(rename = "UserArnSession")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_arn_session: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProvisionedProductDetail {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "IdempotencyToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub idempotency_token: Option<String>,
#[serde(rename = "LastRecordId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_record_id: 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 = "StatusMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_message: 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 ProvisionedProductPlanDetails {
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[serde(rename = "NotificationArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_arns: Option<Vec<String>>,
#[serde(rename = "PathId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path_id: Option<String>,
#[serde(rename = "PlanId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan_id: Option<String>,
#[serde(rename = "PlanName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan_name: Option<String>,
#[serde(rename = "PlanType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan_type: Option<String>,
#[serde(rename = "ProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_id: Option<String>,
#[serde(rename = "ProvisionProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provision_product_id: Option<String>,
#[serde(rename = "ProvisionProductName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provision_product_name: Option<String>,
#[serde(rename = "ProvisioningArtifactId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_id: Option<String>,
#[serde(rename = "ProvisioningParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_parameters: Option<Vec<UpdateProvisioningParameter>>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "StatusMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_message: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "UpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProvisionedProductPlanSummary {
#[serde(rename = "PlanId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan_id: Option<String>,
#[serde(rename = "PlanName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan_name: Option<String>,
#[serde(rename = "PlanType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan_type: Option<String>,
#[serde(rename = "ProvisionProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provision_product_id: Option<String>,
#[serde(rename = "ProvisionProductName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provision_product_name: Option<String>,
#[serde(rename = "ProvisioningArtifactId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProvisioningArtifact {
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[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 = "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 ProvisioningArtifactDetail {
#[serde(rename = "Active")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[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 = "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>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProvisioningArtifactParameter {
#[serde(rename = "DefaultValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_value: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IsNoEcho")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_no_echo: Option<bool>,
#[serde(rename = "ParameterConstraints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_constraints: Option<ParameterConstraints>,
#[serde(rename = "ParameterKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_key: Option<String>,
#[serde(rename = "ParameterType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ProvisioningArtifactProperties {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Info")]
pub info: ::std::collections::HashMap<String, 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>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProvisioningArtifactSummary {
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[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 = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ProvisioningArtifactMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_metadata: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ProvisioningParameter {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RecordDetail {
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[serde(rename = "PathId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path_id: Option<String>,
#[serde(rename = "ProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_id: Option<String>,
#[serde(rename = "ProvisionedProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_id: Option<String>,
#[serde(rename = "ProvisionedProductName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_name: Option<String>,
#[serde(rename = "ProvisionedProductType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_type: Option<String>,
#[serde(rename = "ProvisioningArtifactId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_id: Option<String>,
#[serde(rename = "RecordErrors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_errors: Option<Vec<RecordError>>,
#[serde(rename = "RecordId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_id: Option<String>,
#[serde(rename = "RecordTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_tags: Option<Vec<RecordTag>>,
#[serde(rename = "RecordType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_type: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "UpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RecordError {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RecordOutput {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "OutputKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_key: Option<String>,
#[serde(rename = "OutputValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RecordTag {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RejectPortfolioShareInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PortfolioId")]
pub portfolio_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RejectPortfolioShareOutput {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceChange {
#[serde(rename = "Action")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<String>,
#[serde(rename = "Details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<Vec<ResourceChangeDetail>>,
#[serde(rename = "LogicalResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logical_resource_id: Option<String>,
#[serde(rename = "PhysicalResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub physical_resource_id: Option<String>,
#[serde(rename = "Replacement")]
#[serde(skip_serializing_if = "Option::is_none")]
pub replacement: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "Scope")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scope: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceChangeDetail {
#[serde(rename = "CausingEntity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub causing_entity: Option<String>,
#[serde(rename = "Evaluation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation: Option<String>,
#[serde(rename = "Target")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target: Option<ResourceTargetDefinition>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceDetail {
#[serde(rename = "ARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[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 = "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 ResourceTargetDefinition {
#[serde(rename = "Attribute")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attribute: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "RequiresRecreation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requires_recreation: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ScanProvisionedProductsInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "AccessLevelFilter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_level_filter: Option<AccessLevelFilter>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ScanProvisionedProductsOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ProvisionedProducts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_products: Option<Vec<ProvisionedProductDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SearchProductsAsAdminInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<::std::collections::HashMap<String, Vec<String>>>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "PortfolioId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub portfolio_id: Option<String>,
#[serde(rename = "ProductSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_source: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SearchProductsAsAdminOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ProductViewDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_details: Option<Vec<ProductViewDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SearchProductsInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<::std::collections::HashMap<String, Vec<String>>>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SearchProductsOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ProductViewAggregations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_aggregations:
Option<::std::collections::HashMap<String, Vec<ProductViewAggregationValue>>>,
#[serde(rename = "ProductViewSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_summaries: Option<Vec<ProductViewSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SearchProvisionedProductsInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "AccessLevelFilter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_level_filter: Option<AccessLevelFilter>,
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<::std::collections::HashMap<String, Vec<String>>>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SearchProvisionedProductsOutput {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ProvisionedProducts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_products: Option<Vec<ProvisionedProductAttribute>>,
#[serde(rename = "TotalResultsCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_results_count: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagOptionDetail {
#[serde(rename = "Active")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagOptionSummary {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Values")]
#[serde(skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TerminateProvisionedProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "IgnoreErrors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ignore_errors: Option<bool>,
#[serde(rename = "ProvisionedProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_id: Option<String>,
#[serde(rename = "ProvisionedProductName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_name: Option<String>,
#[serde(rename = "TerminateToken")]
pub terminate_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TerminateProvisionedProductOutput {
#[serde(rename = "RecordDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_detail: Option<RecordDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateConstraintInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateConstraintOutput {
#[serde(rename = "ConstraintDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_detail: Option<ConstraintDetail>,
#[serde(rename = "ConstraintParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraint_parameters: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdatePortfolioInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "AddTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub add_tags: Option<Vec<Tag>>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "DisplayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "ProviderName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provider_name: Option<String>,
#[serde(rename = "RemoveTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remove_tags: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdatePortfolioOutput {
#[serde(rename = "PortfolioDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub portfolio_detail: Option<PortfolioDetail>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "AddTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub add_tags: Option<Vec<Tag>>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Distributor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub distributor: Option<String>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Owner")]
#[serde(skip_serializing_if = "Option::is_none")]
pub owner: Option<String>,
#[serde(rename = "RemoveTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remove_tags: Option<Vec<String>>,
#[serde(rename = "SupportDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_description: Option<String>,
#[serde(rename = "SupportEmail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_email: Option<String>,
#[serde(rename = "SupportUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub support_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateProductOutput {
#[serde(rename = "ProductViewDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_view_detail: Option<ProductViewDetail>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateProvisionedProductInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "PathId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path_id: Option<String>,
#[serde(rename = "ProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_id: Option<String>,
#[serde(rename = "ProvisionedProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_id: Option<String>,
#[serde(rename = "ProvisionedProductName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioned_product_name: Option<String>,
#[serde(rename = "ProvisioningArtifactId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_id: Option<String>,
#[serde(rename = "ProvisioningParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_parameters: Option<Vec<UpdateProvisioningParameter>>,
#[serde(rename = "UpdateToken")]
pub update_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateProvisionedProductOutput {
#[serde(rename = "RecordDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_detail: Option<RecordDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateProvisioningArtifactInput {
#[serde(rename = "AcceptLanguage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_language: Option<String>,
#[serde(rename = "Active")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[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 = "ProductId")]
pub product_id: String,
#[serde(rename = "ProvisioningArtifactId")]
pub provisioning_artifact_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateProvisioningArtifactOutput {
#[serde(rename = "Info")]
#[serde(skip_serializing_if = "Option::is_none")]
pub info: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "ProvisioningArtifactDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub provisioning_artifact_detail: Option<ProvisioningArtifactDetail>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UpdateProvisioningParameter {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "UsePreviousValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub use_previous_value: Option<bool>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateTagOptionInput {
#[serde(rename = "Active")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[serde(rename = "Id")]
pub id: 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 UpdateTagOptionOutput {
#[serde(rename = "TagOptionDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_option_detail: Option<TagOptionDetail>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UsageInstruction {
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum AcceptPortfolioShareError {
InvalidParameters(String),
LimitExceeded(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AcceptPortfolioShareError {
pub fn from_response(res: BufferedHttpResponse) -> AcceptPortfolioShareError {
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 {
"InvalidParametersException" => {
return AcceptPortfolioShareError::InvalidParameters(String::from(error_message))
}
"LimitExceededException" => {
return AcceptPortfolioShareError::LimitExceeded(String::from(error_message))
}
"ResourceNotFoundException" => {
return AcceptPortfolioShareError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return AcceptPortfolioShareError::Validation(error_message.to_string())
}
_ => {}
}
}
return AcceptPortfolioShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AcceptPortfolioShareError {
fn from(err: serde_json::error::Error) -> AcceptPortfolioShareError {
AcceptPortfolioShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AcceptPortfolioShareError {
fn from(err: CredentialsError) -> AcceptPortfolioShareError {
AcceptPortfolioShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for AcceptPortfolioShareError {
fn from(err: HttpDispatchError) -> AcceptPortfolioShareError {
AcceptPortfolioShareError::HttpDispatch(err)
}
}
impl From<io::Error> for AcceptPortfolioShareError {
fn from(err: io::Error) -> AcceptPortfolioShareError {
AcceptPortfolioShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AcceptPortfolioShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AcceptPortfolioShareError {
fn description(&self) -> &str {
match *self {
AcceptPortfolioShareError::InvalidParameters(ref cause) => cause,
AcceptPortfolioShareError::LimitExceeded(ref cause) => cause,
AcceptPortfolioShareError::ResourceNotFound(ref cause) => cause,
AcceptPortfolioShareError::Validation(ref cause) => cause,
AcceptPortfolioShareError::Credentials(ref err) => err.description(),
AcceptPortfolioShareError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AcceptPortfolioShareError::ParseError(ref cause) => cause,
AcceptPortfolioShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AssociatePrincipalWithPortfolioError {
InvalidParameters(String),
LimitExceeded(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AssociatePrincipalWithPortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> AssociatePrincipalWithPortfolioError {
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 {
"InvalidParametersException" => {
return AssociatePrincipalWithPortfolioError::InvalidParameters(String::from(
error_message,
))
}
"LimitExceededException" => {
return AssociatePrincipalWithPortfolioError::LimitExceeded(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return AssociatePrincipalWithPortfolioError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return AssociatePrincipalWithPortfolioError::Validation(
error_message.to_string(),
)
}
_ => {}
}
}
return AssociatePrincipalWithPortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AssociatePrincipalWithPortfolioError {
fn from(err: serde_json::error::Error) -> AssociatePrincipalWithPortfolioError {
AssociatePrincipalWithPortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AssociatePrincipalWithPortfolioError {
fn from(err: CredentialsError) -> AssociatePrincipalWithPortfolioError {
AssociatePrincipalWithPortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for AssociatePrincipalWithPortfolioError {
fn from(err: HttpDispatchError) -> AssociatePrincipalWithPortfolioError {
AssociatePrincipalWithPortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for AssociatePrincipalWithPortfolioError {
fn from(err: io::Error) -> AssociatePrincipalWithPortfolioError {
AssociatePrincipalWithPortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AssociatePrincipalWithPortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociatePrincipalWithPortfolioError {
fn description(&self) -> &str {
match *self {
AssociatePrincipalWithPortfolioError::InvalidParameters(ref cause) => cause,
AssociatePrincipalWithPortfolioError::LimitExceeded(ref cause) => cause,
AssociatePrincipalWithPortfolioError::ResourceNotFound(ref cause) => cause,
AssociatePrincipalWithPortfolioError::Validation(ref cause) => cause,
AssociatePrincipalWithPortfolioError::Credentials(ref err) => err.description(),
AssociatePrincipalWithPortfolioError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AssociatePrincipalWithPortfolioError::ParseError(ref cause) => cause,
AssociatePrincipalWithPortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AssociateProductWithPortfolioError {
InvalidParameters(String),
LimitExceeded(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AssociateProductWithPortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> AssociateProductWithPortfolioError {
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 {
"InvalidParametersException" => {
return AssociateProductWithPortfolioError::InvalidParameters(String::from(
error_message,
))
}
"LimitExceededException" => {
return AssociateProductWithPortfolioError::LimitExceeded(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return AssociateProductWithPortfolioError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return AssociateProductWithPortfolioError::Validation(error_message.to_string())
}
_ => {}
}
}
return AssociateProductWithPortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AssociateProductWithPortfolioError {
fn from(err: serde_json::error::Error) -> AssociateProductWithPortfolioError {
AssociateProductWithPortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AssociateProductWithPortfolioError {
fn from(err: CredentialsError) -> AssociateProductWithPortfolioError {
AssociateProductWithPortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for AssociateProductWithPortfolioError {
fn from(err: HttpDispatchError) -> AssociateProductWithPortfolioError {
AssociateProductWithPortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for AssociateProductWithPortfolioError {
fn from(err: io::Error) -> AssociateProductWithPortfolioError {
AssociateProductWithPortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AssociateProductWithPortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateProductWithPortfolioError {
fn description(&self) -> &str {
match *self {
AssociateProductWithPortfolioError::InvalidParameters(ref cause) => cause,
AssociateProductWithPortfolioError::LimitExceeded(ref cause) => cause,
AssociateProductWithPortfolioError::ResourceNotFound(ref cause) => cause,
AssociateProductWithPortfolioError::Validation(ref cause) => cause,
AssociateProductWithPortfolioError::Credentials(ref err) => err.description(),
AssociateProductWithPortfolioError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AssociateProductWithPortfolioError::ParseError(ref cause) => cause,
AssociateProductWithPortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum AssociateTagOptionWithResourceError {
DuplicateResource(String),
InvalidParameters(String),
InvalidState(String),
LimitExceeded(String),
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AssociateTagOptionWithResourceError {
pub fn from_response(res: BufferedHttpResponse) -> AssociateTagOptionWithResourceError {
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 {
"DuplicateResourceException" => {
return AssociateTagOptionWithResourceError::DuplicateResource(String::from(
error_message,
))
}
"InvalidParametersException" => {
return AssociateTagOptionWithResourceError::InvalidParameters(String::from(
error_message,
))
}
"InvalidStateException" => {
return AssociateTagOptionWithResourceError::InvalidState(String::from(
error_message,
))
}
"LimitExceededException" => {
return AssociateTagOptionWithResourceError::LimitExceeded(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return AssociateTagOptionWithResourceError::ResourceNotFound(String::from(
error_message,
))
}
"TagOptionNotMigratedException" => {
return AssociateTagOptionWithResourceError::TagOptionNotMigrated(String::from(
error_message,
))
}
"ValidationException" => {
return AssociateTagOptionWithResourceError::Validation(
error_message.to_string(),
)
}
_ => {}
}
}
return AssociateTagOptionWithResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AssociateTagOptionWithResourceError {
fn from(err: serde_json::error::Error) -> AssociateTagOptionWithResourceError {
AssociateTagOptionWithResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AssociateTagOptionWithResourceError {
fn from(err: CredentialsError) -> AssociateTagOptionWithResourceError {
AssociateTagOptionWithResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for AssociateTagOptionWithResourceError {
fn from(err: HttpDispatchError) -> AssociateTagOptionWithResourceError {
AssociateTagOptionWithResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for AssociateTagOptionWithResourceError {
fn from(err: io::Error) -> AssociateTagOptionWithResourceError {
AssociateTagOptionWithResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AssociateTagOptionWithResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateTagOptionWithResourceError {
fn description(&self) -> &str {
match *self {
AssociateTagOptionWithResourceError::DuplicateResource(ref cause) => cause,
AssociateTagOptionWithResourceError::InvalidParameters(ref cause) => cause,
AssociateTagOptionWithResourceError::InvalidState(ref cause) => cause,
AssociateTagOptionWithResourceError::LimitExceeded(ref cause) => cause,
AssociateTagOptionWithResourceError::ResourceNotFound(ref cause) => cause,
AssociateTagOptionWithResourceError::TagOptionNotMigrated(ref cause) => cause,
AssociateTagOptionWithResourceError::Validation(ref cause) => cause,
AssociateTagOptionWithResourceError::Credentials(ref err) => err.description(),
AssociateTagOptionWithResourceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
AssociateTagOptionWithResourceError::ParseError(ref cause) => cause,
AssociateTagOptionWithResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CopyProductError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CopyProductError {
pub fn from_response(res: BufferedHttpResponse) -> CopyProductError {
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 {
"InvalidParametersException" => {
return CopyProductError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return CopyProductError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return CopyProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return CopyProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CopyProductError {
fn from(err: serde_json::error::Error) -> CopyProductError {
CopyProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CopyProductError {
fn from(err: CredentialsError) -> CopyProductError {
CopyProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for CopyProductError {
fn from(err: HttpDispatchError) -> CopyProductError {
CopyProductError::HttpDispatch(err)
}
}
impl From<io::Error> for CopyProductError {
fn from(err: io::Error) -> CopyProductError {
CopyProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CopyProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CopyProductError {
fn description(&self) -> &str {
match *self {
CopyProductError::InvalidParameters(ref cause) => cause,
CopyProductError::ResourceNotFound(ref cause) => cause,
CopyProductError::Validation(ref cause) => cause,
CopyProductError::Credentials(ref err) => err.description(),
CopyProductError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CopyProductError::ParseError(ref cause) => cause,
CopyProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateConstraintError {
DuplicateResource(String),
InvalidParameters(String),
LimitExceeded(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateConstraintError {
pub fn from_response(res: BufferedHttpResponse) -> CreateConstraintError {
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 {
"DuplicateResourceException" => {
return CreateConstraintError::DuplicateResource(String::from(error_message))
}
"InvalidParametersException" => {
return CreateConstraintError::InvalidParameters(String::from(error_message))
}
"LimitExceededException" => {
return CreateConstraintError::LimitExceeded(String::from(error_message))
}
"ResourceNotFoundException" => {
return CreateConstraintError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return CreateConstraintError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateConstraintError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateConstraintError {
fn from(err: serde_json::error::Error) -> CreateConstraintError {
CreateConstraintError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateConstraintError {
fn from(err: CredentialsError) -> CreateConstraintError {
CreateConstraintError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateConstraintError {
fn from(err: HttpDispatchError) -> CreateConstraintError {
CreateConstraintError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateConstraintError {
fn from(err: io::Error) -> CreateConstraintError {
CreateConstraintError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateConstraintError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateConstraintError {
fn description(&self) -> &str {
match *self {
CreateConstraintError::DuplicateResource(ref cause) => cause,
CreateConstraintError::InvalidParameters(ref cause) => cause,
CreateConstraintError::LimitExceeded(ref cause) => cause,
CreateConstraintError::ResourceNotFound(ref cause) => cause,
CreateConstraintError::Validation(ref cause) => cause,
CreateConstraintError::Credentials(ref err) => err.description(),
CreateConstraintError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateConstraintError::ParseError(ref cause) => cause,
CreateConstraintError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreatePortfolioError {
InvalidParameters(String),
LimitExceeded(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreatePortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> CreatePortfolioError {
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 {
"InvalidParametersException" => {
return CreatePortfolioError::InvalidParameters(String::from(error_message))
}
"LimitExceededException" => {
return CreatePortfolioError::LimitExceeded(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return CreatePortfolioError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return CreatePortfolioError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreatePortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreatePortfolioError {
fn from(err: serde_json::error::Error) -> CreatePortfolioError {
CreatePortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreatePortfolioError {
fn from(err: CredentialsError) -> CreatePortfolioError {
CreatePortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreatePortfolioError {
fn from(err: HttpDispatchError) -> CreatePortfolioError {
CreatePortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for CreatePortfolioError {
fn from(err: io::Error) -> CreatePortfolioError {
CreatePortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreatePortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreatePortfolioError {
fn description(&self) -> &str {
match *self {
CreatePortfolioError::InvalidParameters(ref cause) => cause,
CreatePortfolioError::LimitExceeded(ref cause) => cause,
CreatePortfolioError::TagOptionNotMigrated(ref cause) => cause,
CreatePortfolioError::Validation(ref cause) => cause,
CreatePortfolioError::Credentials(ref err) => err.description(),
CreatePortfolioError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreatePortfolioError::ParseError(ref cause) => cause,
CreatePortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreatePortfolioShareError {
InvalidParameters(String),
LimitExceeded(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreatePortfolioShareError {
pub fn from_response(res: BufferedHttpResponse) -> CreatePortfolioShareError {
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 {
"InvalidParametersException" => {
return CreatePortfolioShareError::InvalidParameters(String::from(error_message))
}
"LimitExceededException" => {
return CreatePortfolioShareError::LimitExceeded(String::from(error_message))
}
"ResourceNotFoundException" => {
return CreatePortfolioShareError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return CreatePortfolioShareError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreatePortfolioShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreatePortfolioShareError {
fn from(err: serde_json::error::Error) -> CreatePortfolioShareError {
CreatePortfolioShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreatePortfolioShareError {
fn from(err: CredentialsError) -> CreatePortfolioShareError {
CreatePortfolioShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreatePortfolioShareError {
fn from(err: HttpDispatchError) -> CreatePortfolioShareError {
CreatePortfolioShareError::HttpDispatch(err)
}
}
impl From<io::Error> for CreatePortfolioShareError {
fn from(err: io::Error) -> CreatePortfolioShareError {
CreatePortfolioShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreatePortfolioShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreatePortfolioShareError {
fn description(&self) -> &str {
match *self {
CreatePortfolioShareError::InvalidParameters(ref cause) => cause,
CreatePortfolioShareError::LimitExceeded(ref cause) => cause,
CreatePortfolioShareError::ResourceNotFound(ref cause) => cause,
CreatePortfolioShareError::Validation(ref cause) => cause,
CreatePortfolioShareError::Credentials(ref err) => err.description(),
CreatePortfolioShareError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreatePortfolioShareError::ParseError(ref cause) => cause,
CreatePortfolioShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateProductError {
InvalidParameters(String),
LimitExceeded(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateProductError {
pub fn from_response(res: BufferedHttpResponse) -> CreateProductError {
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 {
"InvalidParametersException" => {
return CreateProductError::InvalidParameters(String::from(error_message))
}
"LimitExceededException" => {
return CreateProductError::LimitExceeded(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return CreateProductError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return CreateProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateProductError {
fn from(err: serde_json::error::Error) -> CreateProductError {
CreateProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateProductError {
fn from(err: CredentialsError) -> CreateProductError {
CreateProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateProductError {
fn from(err: HttpDispatchError) -> CreateProductError {
CreateProductError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateProductError {
fn from(err: io::Error) -> CreateProductError {
CreateProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateProductError {
fn description(&self) -> &str {
match *self {
CreateProductError::InvalidParameters(ref cause) => cause,
CreateProductError::LimitExceeded(ref cause) => cause,
CreateProductError::TagOptionNotMigrated(ref cause) => cause,
CreateProductError::Validation(ref cause) => cause,
CreateProductError::Credentials(ref err) => err.description(),
CreateProductError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateProductError::ParseError(ref cause) => cause,
CreateProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateProvisionedProductPlanError {
InvalidParameters(String),
InvalidState(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateProvisionedProductPlanError {
pub fn from_response(res: BufferedHttpResponse) -> CreateProvisionedProductPlanError {
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 {
"InvalidParametersException" => {
return CreateProvisionedProductPlanError::InvalidParameters(String::from(
error_message,
))
}
"InvalidStateException" => {
return CreateProvisionedProductPlanError::InvalidState(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return CreateProvisionedProductPlanError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return CreateProvisionedProductPlanError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateProvisionedProductPlanError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateProvisionedProductPlanError {
fn from(err: serde_json::error::Error) -> CreateProvisionedProductPlanError {
CreateProvisionedProductPlanError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateProvisionedProductPlanError {
fn from(err: CredentialsError) -> CreateProvisionedProductPlanError {
CreateProvisionedProductPlanError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateProvisionedProductPlanError {
fn from(err: HttpDispatchError) -> CreateProvisionedProductPlanError {
CreateProvisionedProductPlanError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateProvisionedProductPlanError {
fn from(err: io::Error) -> CreateProvisionedProductPlanError {
CreateProvisionedProductPlanError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateProvisionedProductPlanError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateProvisionedProductPlanError {
fn description(&self) -> &str {
match *self {
CreateProvisionedProductPlanError::InvalidParameters(ref cause) => cause,
CreateProvisionedProductPlanError::InvalidState(ref cause) => cause,
CreateProvisionedProductPlanError::ResourceNotFound(ref cause) => cause,
CreateProvisionedProductPlanError::Validation(ref cause) => cause,
CreateProvisionedProductPlanError::Credentials(ref err) => err.description(),
CreateProvisionedProductPlanError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateProvisionedProductPlanError::ParseError(ref cause) => cause,
CreateProvisionedProductPlanError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateProvisioningArtifactError {
InvalidParameters(String),
LimitExceeded(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateProvisioningArtifactError {
pub fn from_response(res: BufferedHttpResponse) -> CreateProvisioningArtifactError {
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 {
"InvalidParametersException" => {
return CreateProvisioningArtifactError::InvalidParameters(String::from(
error_message,
))
}
"LimitExceededException" => {
return CreateProvisioningArtifactError::LimitExceeded(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return CreateProvisioningArtifactError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return CreateProvisioningArtifactError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateProvisioningArtifactError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateProvisioningArtifactError {
fn from(err: serde_json::error::Error) -> CreateProvisioningArtifactError {
CreateProvisioningArtifactError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateProvisioningArtifactError {
fn from(err: CredentialsError) -> CreateProvisioningArtifactError {
CreateProvisioningArtifactError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateProvisioningArtifactError {
fn from(err: HttpDispatchError) -> CreateProvisioningArtifactError {
CreateProvisioningArtifactError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateProvisioningArtifactError {
fn from(err: io::Error) -> CreateProvisioningArtifactError {
CreateProvisioningArtifactError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateProvisioningArtifactError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateProvisioningArtifactError {
fn description(&self) -> &str {
match *self {
CreateProvisioningArtifactError::InvalidParameters(ref cause) => cause,
CreateProvisioningArtifactError::LimitExceeded(ref cause) => cause,
CreateProvisioningArtifactError::ResourceNotFound(ref cause) => cause,
CreateProvisioningArtifactError::Validation(ref cause) => cause,
CreateProvisioningArtifactError::Credentials(ref err) => err.description(),
CreateProvisioningArtifactError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateProvisioningArtifactError::ParseError(ref cause) => cause,
CreateProvisioningArtifactError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateTagOptionError {
DuplicateResource(String),
LimitExceeded(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateTagOptionError {
pub fn from_response(res: BufferedHttpResponse) -> CreateTagOptionError {
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 {
"DuplicateResourceException" => {
return CreateTagOptionError::DuplicateResource(String::from(error_message))
}
"LimitExceededException" => {
return CreateTagOptionError::LimitExceeded(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return CreateTagOptionError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return CreateTagOptionError::Validation(error_message.to_string())
}
_ => {}
}
}
return CreateTagOptionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateTagOptionError {
fn from(err: serde_json::error::Error) -> CreateTagOptionError {
CreateTagOptionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateTagOptionError {
fn from(err: CredentialsError) -> CreateTagOptionError {
CreateTagOptionError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateTagOptionError {
fn from(err: HttpDispatchError) -> CreateTagOptionError {
CreateTagOptionError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateTagOptionError {
fn from(err: io::Error) -> CreateTagOptionError {
CreateTagOptionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateTagOptionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateTagOptionError {
fn description(&self) -> &str {
match *self {
CreateTagOptionError::DuplicateResource(ref cause) => cause,
CreateTagOptionError::LimitExceeded(ref cause) => cause,
CreateTagOptionError::TagOptionNotMigrated(ref cause) => cause,
CreateTagOptionError::Validation(ref cause) => cause,
CreateTagOptionError::Credentials(ref err) => err.description(),
CreateTagOptionError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateTagOptionError::ParseError(ref cause) => cause,
CreateTagOptionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteConstraintError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteConstraintError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteConstraintError {
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 {
"InvalidParametersException" => {
return DeleteConstraintError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return DeleteConstraintError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return DeleteConstraintError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteConstraintError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteConstraintError {
fn from(err: serde_json::error::Error) -> DeleteConstraintError {
DeleteConstraintError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteConstraintError {
fn from(err: CredentialsError) -> DeleteConstraintError {
DeleteConstraintError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteConstraintError {
fn from(err: HttpDispatchError) -> DeleteConstraintError {
DeleteConstraintError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteConstraintError {
fn from(err: io::Error) -> DeleteConstraintError {
DeleteConstraintError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteConstraintError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteConstraintError {
fn description(&self) -> &str {
match *self {
DeleteConstraintError::InvalidParameters(ref cause) => cause,
DeleteConstraintError::ResourceNotFound(ref cause) => cause,
DeleteConstraintError::Validation(ref cause) => cause,
DeleteConstraintError::Credentials(ref err) => err.description(),
DeleteConstraintError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteConstraintError::ParseError(ref cause) => cause,
DeleteConstraintError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeletePortfolioError {
InvalidParameters(String),
ResourceInUse(String),
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeletePortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> DeletePortfolioError {
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 {
"InvalidParametersException" => {
return DeletePortfolioError::InvalidParameters(String::from(error_message))
}
"ResourceInUseException" => {
return DeletePortfolioError::ResourceInUse(String::from(error_message))
}
"ResourceNotFoundException" => {
return DeletePortfolioError::ResourceNotFound(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return DeletePortfolioError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return DeletePortfolioError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeletePortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeletePortfolioError {
fn from(err: serde_json::error::Error) -> DeletePortfolioError {
DeletePortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeletePortfolioError {
fn from(err: CredentialsError) -> DeletePortfolioError {
DeletePortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeletePortfolioError {
fn from(err: HttpDispatchError) -> DeletePortfolioError {
DeletePortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for DeletePortfolioError {
fn from(err: io::Error) -> DeletePortfolioError {
DeletePortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeletePortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeletePortfolioError {
fn description(&self) -> &str {
match *self {
DeletePortfolioError::InvalidParameters(ref cause) => cause,
DeletePortfolioError::ResourceInUse(ref cause) => cause,
DeletePortfolioError::ResourceNotFound(ref cause) => cause,
DeletePortfolioError::TagOptionNotMigrated(ref cause) => cause,
DeletePortfolioError::Validation(ref cause) => cause,
DeletePortfolioError::Credentials(ref err) => err.description(),
DeletePortfolioError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeletePortfolioError::ParseError(ref cause) => cause,
DeletePortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeletePortfolioShareError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeletePortfolioShareError {
pub fn from_response(res: BufferedHttpResponse) -> DeletePortfolioShareError {
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 {
"ResourceNotFoundException" => {
return DeletePortfolioShareError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return DeletePortfolioShareError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeletePortfolioShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeletePortfolioShareError {
fn from(err: serde_json::error::Error) -> DeletePortfolioShareError {
DeletePortfolioShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeletePortfolioShareError {
fn from(err: CredentialsError) -> DeletePortfolioShareError {
DeletePortfolioShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeletePortfolioShareError {
fn from(err: HttpDispatchError) -> DeletePortfolioShareError {
DeletePortfolioShareError::HttpDispatch(err)
}
}
impl From<io::Error> for DeletePortfolioShareError {
fn from(err: io::Error) -> DeletePortfolioShareError {
DeletePortfolioShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeletePortfolioShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeletePortfolioShareError {
fn description(&self) -> &str {
match *self {
DeletePortfolioShareError::ResourceNotFound(ref cause) => cause,
DeletePortfolioShareError::Validation(ref cause) => cause,
DeletePortfolioShareError::Credentials(ref err) => err.description(),
DeletePortfolioShareError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeletePortfolioShareError::ParseError(ref cause) => cause,
DeletePortfolioShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteProductError {
InvalidParameters(String),
ResourceInUse(String),
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteProductError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteProductError {
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 {
"InvalidParametersException" => {
return DeleteProductError::InvalidParameters(String::from(error_message))
}
"ResourceInUseException" => {
return DeleteProductError::ResourceInUse(String::from(error_message))
}
"ResourceNotFoundException" => {
return DeleteProductError::ResourceNotFound(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return DeleteProductError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return DeleteProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteProductError {
fn from(err: serde_json::error::Error) -> DeleteProductError {
DeleteProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteProductError {
fn from(err: CredentialsError) -> DeleteProductError {
DeleteProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteProductError {
fn from(err: HttpDispatchError) -> DeleteProductError {
DeleteProductError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteProductError {
fn from(err: io::Error) -> DeleteProductError {
DeleteProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteProductError {
fn description(&self) -> &str {
match *self {
DeleteProductError::InvalidParameters(ref cause) => cause,
DeleteProductError::ResourceInUse(ref cause) => cause,
DeleteProductError::ResourceNotFound(ref cause) => cause,
DeleteProductError::TagOptionNotMigrated(ref cause) => cause,
DeleteProductError::Validation(ref cause) => cause,
DeleteProductError::Credentials(ref err) => err.description(),
DeleteProductError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteProductError::ParseError(ref cause) => cause,
DeleteProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteProvisionedProductPlanError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteProvisionedProductPlanError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteProvisionedProductPlanError {
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 {
"InvalidParametersException" => {
return DeleteProvisionedProductPlanError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return DeleteProvisionedProductPlanError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DeleteProvisionedProductPlanError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteProvisionedProductPlanError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteProvisionedProductPlanError {
fn from(err: serde_json::error::Error) -> DeleteProvisionedProductPlanError {
DeleteProvisionedProductPlanError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteProvisionedProductPlanError {
fn from(err: CredentialsError) -> DeleteProvisionedProductPlanError {
DeleteProvisionedProductPlanError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteProvisionedProductPlanError {
fn from(err: HttpDispatchError) -> DeleteProvisionedProductPlanError {
DeleteProvisionedProductPlanError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteProvisionedProductPlanError {
fn from(err: io::Error) -> DeleteProvisionedProductPlanError {
DeleteProvisionedProductPlanError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteProvisionedProductPlanError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteProvisionedProductPlanError {
fn description(&self) -> &str {
match *self {
DeleteProvisionedProductPlanError::InvalidParameters(ref cause) => cause,
DeleteProvisionedProductPlanError::ResourceNotFound(ref cause) => cause,
DeleteProvisionedProductPlanError::Validation(ref cause) => cause,
DeleteProvisionedProductPlanError::Credentials(ref err) => err.description(),
DeleteProvisionedProductPlanError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteProvisionedProductPlanError::ParseError(ref cause) => cause,
DeleteProvisionedProductPlanError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteProvisioningArtifactError {
InvalidParameters(String),
ResourceInUse(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteProvisioningArtifactError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteProvisioningArtifactError {
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 {
"InvalidParametersException" => {
return DeleteProvisioningArtifactError::InvalidParameters(String::from(
error_message,
))
}
"ResourceInUseException" => {
return DeleteProvisioningArtifactError::ResourceInUse(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return DeleteProvisioningArtifactError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DeleteProvisioningArtifactError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteProvisioningArtifactError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteProvisioningArtifactError {
fn from(err: serde_json::error::Error) -> DeleteProvisioningArtifactError {
DeleteProvisioningArtifactError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteProvisioningArtifactError {
fn from(err: CredentialsError) -> DeleteProvisioningArtifactError {
DeleteProvisioningArtifactError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteProvisioningArtifactError {
fn from(err: HttpDispatchError) -> DeleteProvisioningArtifactError {
DeleteProvisioningArtifactError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteProvisioningArtifactError {
fn from(err: io::Error) -> DeleteProvisioningArtifactError {
DeleteProvisioningArtifactError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteProvisioningArtifactError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteProvisioningArtifactError {
fn description(&self) -> &str {
match *self {
DeleteProvisioningArtifactError::InvalidParameters(ref cause) => cause,
DeleteProvisioningArtifactError::ResourceInUse(ref cause) => cause,
DeleteProvisioningArtifactError::ResourceNotFound(ref cause) => cause,
DeleteProvisioningArtifactError::Validation(ref cause) => cause,
DeleteProvisioningArtifactError::Credentials(ref err) => err.description(),
DeleteProvisioningArtifactError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteProvisioningArtifactError::ParseError(ref cause) => cause,
DeleteProvisioningArtifactError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteTagOptionError {
ResourceInUse(String),
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteTagOptionError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteTagOptionError {
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 {
"ResourceInUseException" => {
return DeleteTagOptionError::ResourceInUse(String::from(error_message))
}
"ResourceNotFoundException" => {
return DeleteTagOptionError::ResourceNotFound(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return DeleteTagOptionError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return DeleteTagOptionError::Validation(error_message.to_string())
}
_ => {}
}
}
return DeleteTagOptionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteTagOptionError {
fn from(err: serde_json::error::Error) -> DeleteTagOptionError {
DeleteTagOptionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteTagOptionError {
fn from(err: CredentialsError) -> DeleteTagOptionError {
DeleteTagOptionError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteTagOptionError {
fn from(err: HttpDispatchError) -> DeleteTagOptionError {
DeleteTagOptionError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteTagOptionError {
fn from(err: io::Error) -> DeleteTagOptionError {
DeleteTagOptionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteTagOptionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteTagOptionError {
fn description(&self) -> &str {
match *self {
DeleteTagOptionError::ResourceInUse(ref cause) => cause,
DeleteTagOptionError::ResourceNotFound(ref cause) => cause,
DeleteTagOptionError::TagOptionNotMigrated(ref cause) => cause,
DeleteTagOptionError::Validation(ref cause) => cause,
DeleteTagOptionError::Credentials(ref err) => err.description(),
DeleteTagOptionError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteTagOptionError::ParseError(ref cause) => cause,
DeleteTagOptionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConstraintError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConstraintError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeConstraintError {
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 {
"ResourceNotFoundException" => {
return DescribeConstraintError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return DescribeConstraintError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeConstraintError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConstraintError {
fn from(err: serde_json::error::Error) -> DescribeConstraintError {
DescribeConstraintError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConstraintError {
fn from(err: CredentialsError) -> DescribeConstraintError {
DescribeConstraintError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConstraintError {
fn from(err: HttpDispatchError) -> DescribeConstraintError {
DescribeConstraintError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConstraintError {
fn from(err: io::Error) -> DescribeConstraintError {
DescribeConstraintError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeConstraintError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConstraintError {
fn description(&self) -> &str {
match *self {
DescribeConstraintError::ResourceNotFound(ref cause) => cause,
DescribeConstraintError::Validation(ref cause) => cause,
DescribeConstraintError::Credentials(ref err) => err.description(),
DescribeConstraintError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConstraintError::ParseError(ref cause) => cause,
DescribeConstraintError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCopyProductStatusError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeCopyProductStatusError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeCopyProductStatusError {
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 {
"ResourceNotFoundException" => {
return DescribeCopyProductStatusError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DescribeCopyProductStatusError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeCopyProductStatusError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeCopyProductStatusError {
fn from(err: serde_json::error::Error) -> DescribeCopyProductStatusError {
DescribeCopyProductStatusError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeCopyProductStatusError {
fn from(err: CredentialsError) -> DescribeCopyProductStatusError {
DescribeCopyProductStatusError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeCopyProductStatusError {
fn from(err: HttpDispatchError) -> DescribeCopyProductStatusError {
DescribeCopyProductStatusError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeCopyProductStatusError {
fn from(err: io::Error) -> DescribeCopyProductStatusError {
DescribeCopyProductStatusError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeCopyProductStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCopyProductStatusError {
fn description(&self) -> &str {
match *self {
DescribeCopyProductStatusError::ResourceNotFound(ref cause) => cause,
DescribeCopyProductStatusError::Validation(ref cause) => cause,
DescribeCopyProductStatusError::Credentials(ref err) => err.description(),
DescribeCopyProductStatusError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeCopyProductStatusError::ParseError(ref cause) => cause,
DescribeCopyProductStatusError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribePortfolioError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribePortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> DescribePortfolioError {
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 {
"ResourceNotFoundException" => {
return DescribePortfolioError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return DescribePortfolioError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribePortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribePortfolioError {
fn from(err: serde_json::error::Error) -> DescribePortfolioError {
DescribePortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribePortfolioError {
fn from(err: CredentialsError) -> DescribePortfolioError {
DescribePortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribePortfolioError {
fn from(err: HttpDispatchError) -> DescribePortfolioError {
DescribePortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribePortfolioError {
fn from(err: io::Error) -> DescribePortfolioError {
DescribePortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribePortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribePortfolioError {
fn description(&self) -> &str {
match *self {
DescribePortfolioError::ResourceNotFound(ref cause) => cause,
DescribePortfolioError::Validation(ref cause) => cause,
DescribePortfolioError::Credentials(ref err) => err.description(),
DescribePortfolioError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribePortfolioError::ParseError(ref cause) => cause,
DescribePortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeProductError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeProductError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeProductError {
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 {
"InvalidParametersException" => {
return DescribeProductError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return DescribeProductError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return DescribeProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeProductError {
fn from(err: serde_json::error::Error) -> DescribeProductError {
DescribeProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeProductError {
fn from(err: CredentialsError) -> DescribeProductError {
DescribeProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeProductError {
fn from(err: HttpDispatchError) -> DescribeProductError {
DescribeProductError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeProductError {
fn from(err: io::Error) -> DescribeProductError {
DescribeProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeProductError {
fn description(&self) -> &str {
match *self {
DescribeProductError::InvalidParameters(ref cause) => cause,
DescribeProductError::ResourceNotFound(ref cause) => cause,
DescribeProductError::Validation(ref cause) => cause,
DescribeProductError::Credentials(ref err) => err.description(),
DescribeProductError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeProductError::ParseError(ref cause) => cause,
DescribeProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeProductAsAdminError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeProductAsAdminError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeProductAsAdminError {
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 {
"ResourceNotFoundException" => {
return DescribeProductAsAdminError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DescribeProductAsAdminError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeProductAsAdminError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeProductAsAdminError {
fn from(err: serde_json::error::Error) -> DescribeProductAsAdminError {
DescribeProductAsAdminError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeProductAsAdminError {
fn from(err: CredentialsError) -> DescribeProductAsAdminError {
DescribeProductAsAdminError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeProductAsAdminError {
fn from(err: HttpDispatchError) -> DescribeProductAsAdminError {
DescribeProductAsAdminError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeProductAsAdminError {
fn from(err: io::Error) -> DescribeProductAsAdminError {
DescribeProductAsAdminError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeProductAsAdminError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeProductAsAdminError {
fn description(&self) -> &str {
match *self {
DescribeProductAsAdminError::ResourceNotFound(ref cause) => cause,
DescribeProductAsAdminError::Validation(ref cause) => cause,
DescribeProductAsAdminError::Credentials(ref err) => err.description(),
DescribeProductAsAdminError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeProductAsAdminError::ParseError(ref cause) => cause,
DescribeProductAsAdminError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeProductViewError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeProductViewError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeProductViewError {
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 {
"InvalidParametersException" => {
return DescribeProductViewError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return DescribeProductViewError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return DescribeProductViewError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeProductViewError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeProductViewError {
fn from(err: serde_json::error::Error) -> DescribeProductViewError {
DescribeProductViewError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeProductViewError {
fn from(err: CredentialsError) -> DescribeProductViewError {
DescribeProductViewError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeProductViewError {
fn from(err: HttpDispatchError) -> DescribeProductViewError {
DescribeProductViewError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeProductViewError {
fn from(err: io::Error) -> DescribeProductViewError {
DescribeProductViewError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeProductViewError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeProductViewError {
fn description(&self) -> &str {
match *self {
DescribeProductViewError::InvalidParameters(ref cause) => cause,
DescribeProductViewError::ResourceNotFound(ref cause) => cause,
DescribeProductViewError::Validation(ref cause) => cause,
DescribeProductViewError::Credentials(ref err) => err.description(),
DescribeProductViewError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeProductViewError::ParseError(ref cause) => cause,
DescribeProductViewError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeProvisionedProductError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeProvisionedProductError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeProvisionedProductError {
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 {
"ResourceNotFoundException" => {
return DescribeProvisionedProductError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DescribeProvisionedProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeProvisionedProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeProvisionedProductError {
fn from(err: serde_json::error::Error) -> DescribeProvisionedProductError {
DescribeProvisionedProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeProvisionedProductError {
fn from(err: CredentialsError) -> DescribeProvisionedProductError {
DescribeProvisionedProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeProvisionedProductError {
fn from(err: HttpDispatchError) -> DescribeProvisionedProductError {
DescribeProvisionedProductError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeProvisionedProductError {
fn from(err: io::Error) -> DescribeProvisionedProductError {
DescribeProvisionedProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeProvisionedProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeProvisionedProductError {
fn description(&self) -> &str {
match *self {
DescribeProvisionedProductError::ResourceNotFound(ref cause) => cause,
DescribeProvisionedProductError::Validation(ref cause) => cause,
DescribeProvisionedProductError::Credentials(ref err) => err.description(),
DescribeProvisionedProductError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeProvisionedProductError::ParseError(ref cause) => cause,
DescribeProvisionedProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeProvisionedProductPlanError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeProvisionedProductPlanError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeProvisionedProductPlanError {
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 {
"InvalidParametersException" => {
return DescribeProvisionedProductPlanError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return DescribeProvisionedProductPlanError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DescribeProvisionedProductPlanError::Validation(
error_message.to_string(),
)
}
_ => {}
}
}
return DescribeProvisionedProductPlanError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeProvisionedProductPlanError {
fn from(err: serde_json::error::Error) -> DescribeProvisionedProductPlanError {
DescribeProvisionedProductPlanError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeProvisionedProductPlanError {
fn from(err: CredentialsError) -> DescribeProvisionedProductPlanError {
DescribeProvisionedProductPlanError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeProvisionedProductPlanError {
fn from(err: HttpDispatchError) -> DescribeProvisionedProductPlanError {
DescribeProvisionedProductPlanError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeProvisionedProductPlanError {
fn from(err: io::Error) -> DescribeProvisionedProductPlanError {
DescribeProvisionedProductPlanError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeProvisionedProductPlanError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeProvisionedProductPlanError {
fn description(&self) -> &str {
match *self {
DescribeProvisionedProductPlanError::InvalidParameters(ref cause) => cause,
DescribeProvisionedProductPlanError::ResourceNotFound(ref cause) => cause,
DescribeProvisionedProductPlanError::Validation(ref cause) => cause,
DescribeProvisionedProductPlanError::Credentials(ref err) => err.description(),
DescribeProvisionedProductPlanError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeProvisionedProductPlanError::ParseError(ref cause) => cause,
DescribeProvisionedProductPlanError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeProvisioningArtifactError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeProvisioningArtifactError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeProvisioningArtifactError {
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 {
"ResourceNotFoundException" => {
return DescribeProvisioningArtifactError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DescribeProvisioningArtifactError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeProvisioningArtifactError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeProvisioningArtifactError {
fn from(err: serde_json::error::Error) -> DescribeProvisioningArtifactError {
DescribeProvisioningArtifactError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeProvisioningArtifactError {
fn from(err: CredentialsError) -> DescribeProvisioningArtifactError {
DescribeProvisioningArtifactError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeProvisioningArtifactError {
fn from(err: HttpDispatchError) -> DescribeProvisioningArtifactError {
DescribeProvisioningArtifactError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeProvisioningArtifactError {
fn from(err: io::Error) -> DescribeProvisioningArtifactError {
DescribeProvisioningArtifactError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeProvisioningArtifactError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeProvisioningArtifactError {
fn description(&self) -> &str {
match *self {
DescribeProvisioningArtifactError::ResourceNotFound(ref cause) => cause,
DescribeProvisioningArtifactError::Validation(ref cause) => cause,
DescribeProvisioningArtifactError::Credentials(ref err) => err.description(),
DescribeProvisioningArtifactError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeProvisioningArtifactError::ParseError(ref cause) => cause,
DescribeProvisioningArtifactError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeProvisioningParametersError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeProvisioningParametersError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeProvisioningParametersError {
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 {
"InvalidParametersException" => {
return DescribeProvisioningParametersError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return DescribeProvisioningParametersError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DescribeProvisioningParametersError::Validation(
error_message.to_string(),
)
}
_ => {}
}
}
return DescribeProvisioningParametersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeProvisioningParametersError {
fn from(err: serde_json::error::Error) -> DescribeProvisioningParametersError {
DescribeProvisioningParametersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeProvisioningParametersError {
fn from(err: CredentialsError) -> DescribeProvisioningParametersError {
DescribeProvisioningParametersError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeProvisioningParametersError {
fn from(err: HttpDispatchError) -> DescribeProvisioningParametersError {
DescribeProvisioningParametersError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeProvisioningParametersError {
fn from(err: io::Error) -> DescribeProvisioningParametersError {
DescribeProvisioningParametersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeProvisioningParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeProvisioningParametersError {
fn description(&self) -> &str {
match *self {
DescribeProvisioningParametersError::InvalidParameters(ref cause) => cause,
DescribeProvisioningParametersError::ResourceNotFound(ref cause) => cause,
DescribeProvisioningParametersError::Validation(ref cause) => cause,
DescribeProvisioningParametersError::Credentials(ref err) => err.description(),
DescribeProvisioningParametersError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeProvisioningParametersError::ParseError(ref cause) => cause,
DescribeProvisioningParametersError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeRecordError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeRecordError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeRecordError {
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 {
"ResourceNotFoundException" => {
return DescribeRecordError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return DescribeRecordError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeRecordError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeRecordError {
fn from(err: serde_json::error::Error) -> DescribeRecordError {
DescribeRecordError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeRecordError {
fn from(err: CredentialsError) -> DescribeRecordError {
DescribeRecordError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeRecordError {
fn from(err: HttpDispatchError) -> DescribeRecordError {
DescribeRecordError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeRecordError {
fn from(err: io::Error) -> DescribeRecordError {
DescribeRecordError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeRecordError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeRecordError {
fn description(&self) -> &str {
match *self {
DescribeRecordError::ResourceNotFound(ref cause) => cause,
DescribeRecordError::Validation(ref cause) => cause,
DescribeRecordError::Credentials(ref err) => err.description(),
DescribeRecordError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeRecordError::ParseError(ref cause) => cause,
DescribeRecordError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTagOptionError {
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeTagOptionError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeTagOptionError {
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 {
"ResourceNotFoundException" => {
return DescribeTagOptionError::ResourceNotFound(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return DescribeTagOptionError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return DescribeTagOptionError::Validation(error_message.to_string())
}
_ => {}
}
}
return DescribeTagOptionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeTagOptionError {
fn from(err: serde_json::error::Error) -> DescribeTagOptionError {
DescribeTagOptionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeTagOptionError {
fn from(err: CredentialsError) -> DescribeTagOptionError {
DescribeTagOptionError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeTagOptionError {
fn from(err: HttpDispatchError) -> DescribeTagOptionError {
DescribeTagOptionError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeTagOptionError {
fn from(err: io::Error) -> DescribeTagOptionError {
DescribeTagOptionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeTagOptionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTagOptionError {
fn description(&self) -> &str {
match *self {
DescribeTagOptionError::ResourceNotFound(ref cause) => cause,
DescribeTagOptionError::TagOptionNotMigrated(ref cause) => cause,
DescribeTagOptionError::Validation(ref cause) => cause,
DescribeTagOptionError::Credentials(ref err) => err.description(),
DescribeTagOptionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeTagOptionError::ParseError(ref cause) => cause,
DescribeTagOptionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociatePrincipalFromPortfolioError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DisassociatePrincipalFromPortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> DisassociatePrincipalFromPortfolioError {
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 {
"InvalidParametersException" => {
return DisassociatePrincipalFromPortfolioError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return DisassociatePrincipalFromPortfolioError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DisassociatePrincipalFromPortfolioError::Validation(
error_message.to_string(),
)
}
_ => {}
}
}
return DisassociatePrincipalFromPortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DisassociatePrincipalFromPortfolioError {
fn from(err: serde_json::error::Error) -> DisassociatePrincipalFromPortfolioError {
DisassociatePrincipalFromPortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DisassociatePrincipalFromPortfolioError {
fn from(err: CredentialsError) -> DisassociatePrincipalFromPortfolioError {
DisassociatePrincipalFromPortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for DisassociatePrincipalFromPortfolioError {
fn from(err: HttpDispatchError) -> DisassociatePrincipalFromPortfolioError {
DisassociatePrincipalFromPortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for DisassociatePrincipalFromPortfolioError {
fn from(err: io::Error) -> DisassociatePrincipalFromPortfolioError {
DisassociatePrincipalFromPortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DisassociatePrincipalFromPortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociatePrincipalFromPortfolioError {
fn description(&self) -> &str {
match *self {
DisassociatePrincipalFromPortfolioError::InvalidParameters(ref cause) => cause,
DisassociatePrincipalFromPortfolioError::ResourceNotFound(ref cause) => cause,
DisassociatePrincipalFromPortfolioError::Validation(ref cause) => cause,
DisassociatePrincipalFromPortfolioError::Credentials(ref err) => err.description(),
DisassociatePrincipalFromPortfolioError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DisassociatePrincipalFromPortfolioError::ParseError(ref cause) => cause,
DisassociatePrincipalFromPortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateProductFromPortfolioError {
InvalidParameters(String),
ResourceInUse(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DisassociateProductFromPortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> DisassociateProductFromPortfolioError {
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 {
"InvalidParametersException" => {
return DisassociateProductFromPortfolioError::InvalidParameters(String::from(
error_message,
))
}
"ResourceInUseException" => {
return DisassociateProductFromPortfolioError::ResourceInUse(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return DisassociateProductFromPortfolioError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return DisassociateProductFromPortfolioError::Validation(
error_message.to_string(),
)
}
_ => {}
}
}
return DisassociateProductFromPortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DisassociateProductFromPortfolioError {
fn from(err: serde_json::error::Error) -> DisassociateProductFromPortfolioError {
DisassociateProductFromPortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DisassociateProductFromPortfolioError {
fn from(err: CredentialsError) -> DisassociateProductFromPortfolioError {
DisassociateProductFromPortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for DisassociateProductFromPortfolioError {
fn from(err: HttpDispatchError) -> DisassociateProductFromPortfolioError {
DisassociateProductFromPortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for DisassociateProductFromPortfolioError {
fn from(err: io::Error) -> DisassociateProductFromPortfolioError {
DisassociateProductFromPortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DisassociateProductFromPortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateProductFromPortfolioError {
fn description(&self) -> &str {
match *self {
DisassociateProductFromPortfolioError::InvalidParameters(ref cause) => cause,
DisassociateProductFromPortfolioError::ResourceInUse(ref cause) => cause,
DisassociateProductFromPortfolioError::ResourceNotFound(ref cause) => cause,
DisassociateProductFromPortfolioError::Validation(ref cause) => cause,
DisassociateProductFromPortfolioError::Credentials(ref err) => err.description(),
DisassociateProductFromPortfolioError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DisassociateProductFromPortfolioError::ParseError(ref cause) => cause,
DisassociateProductFromPortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateTagOptionFromResourceError {
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DisassociateTagOptionFromResourceError {
pub fn from_response(res: BufferedHttpResponse) -> DisassociateTagOptionFromResourceError {
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 {
"ResourceNotFoundException" => {
return DisassociateTagOptionFromResourceError::ResourceNotFound(String::from(
error_message,
))
}
"TagOptionNotMigratedException" => {
return DisassociateTagOptionFromResourceError::TagOptionNotMigrated(
String::from(error_message),
)
}
"ValidationException" => {
return DisassociateTagOptionFromResourceError::Validation(
error_message.to_string(),
)
}
_ => {}
}
}
return DisassociateTagOptionFromResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DisassociateTagOptionFromResourceError {
fn from(err: serde_json::error::Error) -> DisassociateTagOptionFromResourceError {
DisassociateTagOptionFromResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DisassociateTagOptionFromResourceError {
fn from(err: CredentialsError) -> DisassociateTagOptionFromResourceError {
DisassociateTagOptionFromResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for DisassociateTagOptionFromResourceError {
fn from(err: HttpDispatchError) -> DisassociateTagOptionFromResourceError {
DisassociateTagOptionFromResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for DisassociateTagOptionFromResourceError {
fn from(err: io::Error) -> DisassociateTagOptionFromResourceError {
DisassociateTagOptionFromResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DisassociateTagOptionFromResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateTagOptionFromResourceError {
fn description(&self) -> &str {
match *self {
DisassociateTagOptionFromResourceError::ResourceNotFound(ref cause) => cause,
DisassociateTagOptionFromResourceError::TagOptionNotMigrated(ref cause) => cause,
DisassociateTagOptionFromResourceError::Validation(ref cause) => cause,
DisassociateTagOptionFromResourceError::Credentials(ref err) => err.description(),
DisassociateTagOptionFromResourceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DisassociateTagOptionFromResourceError::ParseError(ref cause) => cause,
DisassociateTagOptionFromResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ExecuteProvisionedProductPlanError {
InvalidParameters(String),
InvalidState(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ExecuteProvisionedProductPlanError {
pub fn from_response(res: BufferedHttpResponse) -> ExecuteProvisionedProductPlanError {
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 {
"InvalidParametersException" => {
return ExecuteProvisionedProductPlanError::InvalidParameters(String::from(
error_message,
))
}
"InvalidStateException" => {
return ExecuteProvisionedProductPlanError::InvalidState(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return ExecuteProvisionedProductPlanError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return ExecuteProvisionedProductPlanError::Validation(error_message.to_string())
}
_ => {}
}
}
return ExecuteProvisionedProductPlanError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ExecuteProvisionedProductPlanError {
fn from(err: serde_json::error::Error) -> ExecuteProvisionedProductPlanError {
ExecuteProvisionedProductPlanError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ExecuteProvisionedProductPlanError {
fn from(err: CredentialsError) -> ExecuteProvisionedProductPlanError {
ExecuteProvisionedProductPlanError::Credentials(err)
}
}
impl From<HttpDispatchError> for ExecuteProvisionedProductPlanError {
fn from(err: HttpDispatchError) -> ExecuteProvisionedProductPlanError {
ExecuteProvisionedProductPlanError::HttpDispatch(err)
}
}
impl From<io::Error> for ExecuteProvisionedProductPlanError {
fn from(err: io::Error) -> ExecuteProvisionedProductPlanError {
ExecuteProvisionedProductPlanError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ExecuteProvisionedProductPlanError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ExecuteProvisionedProductPlanError {
fn description(&self) -> &str {
match *self {
ExecuteProvisionedProductPlanError::InvalidParameters(ref cause) => cause,
ExecuteProvisionedProductPlanError::InvalidState(ref cause) => cause,
ExecuteProvisionedProductPlanError::ResourceNotFound(ref cause) => cause,
ExecuteProvisionedProductPlanError::Validation(ref cause) => cause,
ExecuteProvisionedProductPlanError::Credentials(ref err) => err.description(),
ExecuteProvisionedProductPlanError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ExecuteProvisionedProductPlanError::ParseError(ref cause) => cause,
ExecuteProvisionedProductPlanError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAcceptedPortfolioSharesError {
InvalidParameters(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListAcceptedPortfolioSharesError {
pub fn from_response(res: BufferedHttpResponse) -> ListAcceptedPortfolioSharesError {
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 {
"InvalidParametersException" => {
return ListAcceptedPortfolioSharesError::InvalidParameters(String::from(
error_message,
))
}
"ValidationException" => {
return ListAcceptedPortfolioSharesError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListAcceptedPortfolioSharesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListAcceptedPortfolioSharesError {
fn from(err: serde_json::error::Error) -> ListAcceptedPortfolioSharesError {
ListAcceptedPortfolioSharesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListAcceptedPortfolioSharesError {
fn from(err: CredentialsError) -> ListAcceptedPortfolioSharesError {
ListAcceptedPortfolioSharesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListAcceptedPortfolioSharesError {
fn from(err: HttpDispatchError) -> ListAcceptedPortfolioSharesError {
ListAcceptedPortfolioSharesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListAcceptedPortfolioSharesError {
fn from(err: io::Error) -> ListAcceptedPortfolioSharesError {
ListAcceptedPortfolioSharesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListAcceptedPortfolioSharesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAcceptedPortfolioSharesError {
fn description(&self) -> &str {
match *self {
ListAcceptedPortfolioSharesError::InvalidParameters(ref cause) => cause,
ListAcceptedPortfolioSharesError::Validation(ref cause) => cause,
ListAcceptedPortfolioSharesError::Credentials(ref err) => err.description(),
ListAcceptedPortfolioSharesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListAcceptedPortfolioSharesError::ParseError(ref cause) => cause,
ListAcceptedPortfolioSharesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListConstraintsForPortfolioError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListConstraintsForPortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> ListConstraintsForPortfolioError {
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 {
"InvalidParametersException" => {
return ListConstraintsForPortfolioError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return ListConstraintsForPortfolioError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return ListConstraintsForPortfolioError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListConstraintsForPortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListConstraintsForPortfolioError {
fn from(err: serde_json::error::Error) -> ListConstraintsForPortfolioError {
ListConstraintsForPortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListConstraintsForPortfolioError {
fn from(err: CredentialsError) -> ListConstraintsForPortfolioError {
ListConstraintsForPortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListConstraintsForPortfolioError {
fn from(err: HttpDispatchError) -> ListConstraintsForPortfolioError {
ListConstraintsForPortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for ListConstraintsForPortfolioError {
fn from(err: io::Error) -> ListConstraintsForPortfolioError {
ListConstraintsForPortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListConstraintsForPortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListConstraintsForPortfolioError {
fn description(&self) -> &str {
match *self {
ListConstraintsForPortfolioError::InvalidParameters(ref cause) => cause,
ListConstraintsForPortfolioError::ResourceNotFound(ref cause) => cause,
ListConstraintsForPortfolioError::Validation(ref cause) => cause,
ListConstraintsForPortfolioError::Credentials(ref err) => err.description(),
ListConstraintsForPortfolioError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListConstraintsForPortfolioError::ParseError(ref cause) => cause,
ListConstraintsForPortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListLaunchPathsError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListLaunchPathsError {
pub fn from_response(res: BufferedHttpResponse) -> ListLaunchPathsError {
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 {
"InvalidParametersException" => {
return ListLaunchPathsError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return ListLaunchPathsError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return ListLaunchPathsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListLaunchPathsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListLaunchPathsError {
fn from(err: serde_json::error::Error) -> ListLaunchPathsError {
ListLaunchPathsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListLaunchPathsError {
fn from(err: CredentialsError) -> ListLaunchPathsError {
ListLaunchPathsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListLaunchPathsError {
fn from(err: HttpDispatchError) -> ListLaunchPathsError {
ListLaunchPathsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListLaunchPathsError {
fn from(err: io::Error) -> ListLaunchPathsError {
ListLaunchPathsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListLaunchPathsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListLaunchPathsError {
fn description(&self) -> &str {
match *self {
ListLaunchPathsError::InvalidParameters(ref cause) => cause,
ListLaunchPathsError::ResourceNotFound(ref cause) => cause,
ListLaunchPathsError::Validation(ref cause) => cause,
ListLaunchPathsError::Credentials(ref err) => err.description(),
ListLaunchPathsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListLaunchPathsError::ParseError(ref cause) => cause,
ListLaunchPathsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListPortfolioAccessError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListPortfolioAccessError {
pub fn from_response(res: BufferedHttpResponse) -> ListPortfolioAccessError {
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 {
"ResourceNotFoundException" => {
return ListPortfolioAccessError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return ListPortfolioAccessError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListPortfolioAccessError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListPortfolioAccessError {
fn from(err: serde_json::error::Error) -> ListPortfolioAccessError {
ListPortfolioAccessError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListPortfolioAccessError {
fn from(err: CredentialsError) -> ListPortfolioAccessError {
ListPortfolioAccessError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListPortfolioAccessError {
fn from(err: HttpDispatchError) -> ListPortfolioAccessError {
ListPortfolioAccessError::HttpDispatch(err)
}
}
impl From<io::Error> for ListPortfolioAccessError {
fn from(err: io::Error) -> ListPortfolioAccessError {
ListPortfolioAccessError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListPortfolioAccessError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListPortfolioAccessError {
fn description(&self) -> &str {
match *self {
ListPortfolioAccessError::ResourceNotFound(ref cause) => cause,
ListPortfolioAccessError::Validation(ref cause) => cause,
ListPortfolioAccessError::Credentials(ref err) => err.description(),
ListPortfolioAccessError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListPortfolioAccessError::ParseError(ref cause) => cause,
ListPortfolioAccessError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListPortfoliosError {
InvalidParameters(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListPortfoliosError {
pub fn from_response(res: BufferedHttpResponse) -> ListPortfoliosError {
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 {
"InvalidParametersException" => {
return ListPortfoliosError::InvalidParameters(String::from(error_message))
}
"ValidationException" => {
return ListPortfoliosError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListPortfoliosError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListPortfoliosError {
fn from(err: serde_json::error::Error) -> ListPortfoliosError {
ListPortfoliosError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListPortfoliosError {
fn from(err: CredentialsError) -> ListPortfoliosError {
ListPortfoliosError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListPortfoliosError {
fn from(err: HttpDispatchError) -> ListPortfoliosError {
ListPortfoliosError::HttpDispatch(err)
}
}
impl From<io::Error> for ListPortfoliosError {
fn from(err: io::Error) -> ListPortfoliosError {
ListPortfoliosError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListPortfoliosError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListPortfoliosError {
fn description(&self) -> &str {
match *self {
ListPortfoliosError::InvalidParameters(ref cause) => cause,
ListPortfoliosError::Validation(ref cause) => cause,
ListPortfoliosError::Credentials(ref err) => err.description(),
ListPortfoliosError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListPortfoliosError::ParseError(ref cause) => cause,
ListPortfoliosError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListPortfoliosForProductError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListPortfoliosForProductError {
pub fn from_response(res: BufferedHttpResponse) -> ListPortfoliosForProductError {
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 {
"InvalidParametersException" => {
return ListPortfoliosForProductError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return ListPortfoliosForProductError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return ListPortfoliosForProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListPortfoliosForProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListPortfoliosForProductError {
fn from(err: serde_json::error::Error) -> ListPortfoliosForProductError {
ListPortfoliosForProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListPortfoliosForProductError {
fn from(err: CredentialsError) -> ListPortfoliosForProductError {
ListPortfoliosForProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListPortfoliosForProductError {
fn from(err: HttpDispatchError) -> ListPortfoliosForProductError {
ListPortfoliosForProductError::HttpDispatch(err)
}
}
impl From<io::Error> for ListPortfoliosForProductError {
fn from(err: io::Error) -> ListPortfoliosForProductError {
ListPortfoliosForProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListPortfoliosForProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListPortfoliosForProductError {
fn description(&self) -> &str {
match *self {
ListPortfoliosForProductError::InvalidParameters(ref cause) => cause,
ListPortfoliosForProductError::ResourceNotFound(ref cause) => cause,
ListPortfoliosForProductError::Validation(ref cause) => cause,
ListPortfoliosForProductError::Credentials(ref err) => err.description(),
ListPortfoliosForProductError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListPortfoliosForProductError::ParseError(ref cause) => cause,
ListPortfoliosForProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListPrincipalsForPortfolioError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListPrincipalsForPortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> ListPrincipalsForPortfolioError {
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 {
"InvalidParametersException" => {
return ListPrincipalsForPortfolioError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return ListPrincipalsForPortfolioError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return ListPrincipalsForPortfolioError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListPrincipalsForPortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListPrincipalsForPortfolioError {
fn from(err: serde_json::error::Error) -> ListPrincipalsForPortfolioError {
ListPrincipalsForPortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListPrincipalsForPortfolioError {
fn from(err: CredentialsError) -> ListPrincipalsForPortfolioError {
ListPrincipalsForPortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListPrincipalsForPortfolioError {
fn from(err: HttpDispatchError) -> ListPrincipalsForPortfolioError {
ListPrincipalsForPortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for ListPrincipalsForPortfolioError {
fn from(err: io::Error) -> ListPrincipalsForPortfolioError {
ListPrincipalsForPortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListPrincipalsForPortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListPrincipalsForPortfolioError {
fn description(&self) -> &str {
match *self {
ListPrincipalsForPortfolioError::InvalidParameters(ref cause) => cause,
ListPrincipalsForPortfolioError::ResourceNotFound(ref cause) => cause,
ListPrincipalsForPortfolioError::Validation(ref cause) => cause,
ListPrincipalsForPortfolioError::Credentials(ref err) => err.description(),
ListPrincipalsForPortfolioError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListPrincipalsForPortfolioError::ParseError(ref cause) => cause,
ListPrincipalsForPortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListProvisionedProductPlansError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListProvisionedProductPlansError {
pub fn from_response(res: BufferedHttpResponse) -> ListProvisionedProductPlansError {
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 {
"InvalidParametersException" => {
return ListProvisionedProductPlansError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return ListProvisionedProductPlansError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return ListProvisionedProductPlansError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListProvisionedProductPlansError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListProvisionedProductPlansError {
fn from(err: serde_json::error::Error) -> ListProvisionedProductPlansError {
ListProvisionedProductPlansError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListProvisionedProductPlansError {
fn from(err: CredentialsError) -> ListProvisionedProductPlansError {
ListProvisionedProductPlansError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListProvisionedProductPlansError {
fn from(err: HttpDispatchError) -> ListProvisionedProductPlansError {
ListProvisionedProductPlansError::HttpDispatch(err)
}
}
impl From<io::Error> for ListProvisionedProductPlansError {
fn from(err: io::Error) -> ListProvisionedProductPlansError {
ListProvisionedProductPlansError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListProvisionedProductPlansError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListProvisionedProductPlansError {
fn description(&self) -> &str {
match *self {
ListProvisionedProductPlansError::InvalidParameters(ref cause) => cause,
ListProvisionedProductPlansError::ResourceNotFound(ref cause) => cause,
ListProvisionedProductPlansError::Validation(ref cause) => cause,
ListProvisionedProductPlansError::Credentials(ref err) => err.description(),
ListProvisionedProductPlansError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListProvisionedProductPlansError::ParseError(ref cause) => cause,
ListProvisionedProductPlansError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListProvisioningArtifactsError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListProvisioningArtifactsError {
pub fn from_response(res: BufferedHttpResponse) -> ListProvisioningArtifactsError {
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 {
"InvalidParametersException" => {
return ListProvisioningArtifactsError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return ListProvisioningArtifactsError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return ListProvisioningArtifactsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListProvisioningArtifactsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListProvisioningArtifactsError {
fn from(err: serde_json::error::Error) -> ListProvisioningArtifactsError {
ListProvisioningArtifactsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListProvisioningArtifactsError {
fn from(err: CredentialsError) -> ListProvisioningArtifactsError {
ListProvisioningArtifactsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListProvisioningArtifactsError {
fn from(err: HttpDispatchError) -> ListProvisioningArtifactsError {
ListProvisioningArtifactsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListProvisioningArtifactsError {
fn from(err: io::Error) -> ListProvisioningArtifactsError {
ListProvisioningArtifactsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListProvisioningArtifactsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListProvisioningArtifactsError {
fn description(&self) -> &str {
match *self {
ListProvisioningArtifactsError::InvalidParameters(ref cause) => cause,
ListProvisioningArtifactsError::ResourceNotFound(ref cause) => cause,
ListProvisioningArtifactsError::Validation(ref cause) => cause,
ListProvisioningArtifactsError::Credentials(ref err) => err.description(),
ListProvisioningArtifactsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListProvisioningArtifactsError::ParseError(ref cause) => cause,
ListProvisioningArtifactsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListRecordHistoryError {
InvalidParameters(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListRecordHistoryError {
pub fn from_response(res: BufferedHttpResponse) -> ListRecordHistoryError {
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 {
"InvalidParametersException" => {
return ListRecordHistoryError::InvalidParameters(String::from(error_message))
}
"ValidationException" => {
return ListRecordHistoryError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListRecordHistoryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListRecordHistoryError {
fn from(err: serde_json::error::Error) -> ListRecordHistoryError {
ListRecordHistoryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListRecordHistoryError {
fn from(err: CredentialsError) -> ListRecordHistoryError {
ListRecordHistoryError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListRecordHistoryError {
fn from(err: HttpDispatchError) -> ListRecordHistoryError {
ListRecordHistoryError::HttpDispatch(err)
}
}
impl From<io::Error> for ListRecordHistoryError {
fn from(err: io::Error) -> ListRecordHistoryError {
ListRecordHistoryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListRecordHistoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListRecordHistoryError {
fn description(&self) -> &str {
match *self {
ListRecordHistoryError::InvalidParameters(ref cause) => cause,
ListRecordHistoryError::Validation(ref cause) => cause,
ListRecordHistoryError::Credentials(ref err) => err.description(),
ListRecordHistoryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListRecordHistoryError::ParseError(ref cause) => cause,
ListRecordHistoryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListResourcesForTagOptionError {
InvalidParameters(String),
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListResourcesForTagOptionError {
pub fn from_response(res: BufferedHttpResponse) -> ListResourcesForTagOptionError {
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 {
"InvalidParametersException" => {
return ListResourcesForTagOptionError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return ListResourcesForTagOptionError::ResourceNotFound(String::from(
error_message,
))
}
"TagOptionNotMigratedException" => {
return ListResourcesForTagOptionError::TagOptionNotMigrated(String::from(
error_message,
))
}
"ValidationException" => {
return ListResourcesForTagOptionError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListResourcesForTagOptionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListResourcesForTagOptionError {
fn from(err: serde_json::error::Error) -> ListResourcesForTagOptionError {
ListResourcesForTagOptionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListResourcesForTagOptionError {
fn from(err: CredentialsError) -> ListResourcesForTagOptionError {
ListResourcesForTagOptionError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListResourcesForTagOptionError {
fn from(err: HttpDispatchError) -> ListResourcesForTagOptionError {
ListResourcesForTagOptionError::HttpDispatch(err)
}
}
impl From<io::Error> for ListResourcesForTagOptionError {
fn from(err: io::Error) -> ListResourcesForTagOptionError {
ListResourcesForTagOptionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListResourcesForTagOptionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListResourcesForTagOptionError {
fn description(&self) -> &str {
match *self {
ListResourcesForTagOptionError::InvalidParameters(ref cause) => cause,
ListResourcesForTagOptionError::ResourceNotFound(ref cause) => cause,
ListResourcesForTagOptionError::TagOptionNotMigrated(ref cause) => cause,
ListResourcesForTagOptionError::Validation(ref cause) => cause,
ListResourcesForTagOptionError::Credentials(ref err) => err.description(),
ListResourcesForTagOptionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListResourcesForTagOptionError::ParseError(ref cause) => cause,
ListResourcesForTagOptionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagOptionsError {
InvalidParameters(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTagOptionsError {
pub fn from_response(res: BufferedHttpResponse) -> ListTagOptionsError {
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 {
"InvalidParametersException" => {
return ListTagOptionsError::InvalidParameters(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return ListTagOptionsError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return ListTagOptionsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ListTagOptionsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTagOptionsError {
fn from(err: serde_json::error::Error) -> ListTagOptionsError {
ListTagOptionsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTagOptionsError {
fn from(err: CredentialsError) -> ListTagOptionsError {
ListTagOptionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTagOptionsError {
fn from(err: HttpDispatchError) -> ListTagOptionsError {
ListTagOptionsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTagOptionsError {
fn from(err: io::Error) -> ListTagOptionsError {
ListTagOptionsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListTagOptionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagOptionsError {
fn description(&self) -> &str {
match *self {
ListTagOptionsError::InvalidParameters(ref cause) => cause,
ListTagOptionsError::TagOptionNotMigrated(ref cause) => cause,
ListTagOptionsError::Validation(ref cause) => cause,
ListTagOptionsError::Credentials(ref err) => err.description(),
ListTagOptionsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListTagOptionsError::ParseError(ref cause) => cause,
ListTagOptionsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ProvisionProductError {
DuplicateResource(String),
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ProvisionProductError {
pub fn from_response(res: BufferedHttpResponse) -> ProvisionProductError {
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 {
"DuplicateResourceException" => {
return ProvisionProductError::DuplicateResource(String::from(error_message))
}
"InvalidParametersException" => {
return ProvisionProductError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return ProvisionProductError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return ProvisionProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return ProvisionProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ProvisionProductError {
fn from(err: serde_json::error::Error) -> ProvisionProductError {
ProvisionProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ProvisionProductError {
fn from(err: CredentialsError) -> ProvisionProductError {
ProvisionProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for ProvisionProductError {
fn from(err: HttpDispatchError) -> ProvisionProductError {
ProvisionProductError::HttpDispatch(err)
}
}
impl From<io::Error> for ProvisionProductError {
fn from(err: io::Error) -> ProvisionProductError {
ProvisionProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ProvisionProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ProvisionProductError {
fn description(&self) -> &str {
match *self {
ProvisionProductError::DuplicateResource(ref cause) => cause,
ProvisionProductError::InvalidParameters(ref cause) => cause,
ProvisionProductError::ResourceNotFound(ref cause) => cause,
ProvisionProductError::Validation(ref cause) => cause,
ProvisionProductError::Credentials(ref err) => err.description(),
ProvisionProductError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ProvisionProductError::ParseError(ref cause) => cause,
ProvisionProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RejectPortfolioShareError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RejectPortfolioShareError {
pub fn from_response(res: BufferedHttpResponse) -> RejectPortfolioShareError {
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 {
"ResourceNotFoundException" => {
return RejectPortfolioShareError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return RejectPortfolioShareError::Validation(error_message.to_string())
}
_ => {}
}
}
return RejectPortfolioShareError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RejectPortfolioShareError {
fn from(err: serde_json::error::Error) -> RejectPortfolioShareError {
RejectPortfolioShareError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RejectPortfolioShareError {
fn from(err: CredentialsError) -> RejectPortfolioShareError {
RejectPortfolioShareError::Credentials(err)
}
}
impl From<HttpDispatchError> for RejectPortfolioShareError {
fn from(err: HttpDispatchError) -> RejectPortfolioShareError {
RejectPortfolioShareError::HttpDispatch(err)
}
}
impl From<io::Error> for RejectPortfolioShareError {
fn from(err: io::Error) -> RejectPortfolioShareError {
RejectPortfolioShareError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RejectPortfolioShareError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RejectPortfolioShareError {
fn description(&self) -> &str {
match *self {
RejectPortfolioShareError::ResourceNotFound(ref cause) => cause,
RejectPortfolioShareError::Validation(ref cause) => cause,
RejectPortfolioShareError::Credentials(ref err) => err.description(),
RejectPortfolioShareError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
RejectPortfolioShareError::ParseError(ref cause) => cause,
RejectPortfolioShareError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ScanProvisionedProductsError {
InvalidParameters(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ScanProvisionedProductsError {
pub fn from_response(res: BufferedHttpResponse) -> ScanProvisionedProductsError {
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 {
"InvalidParametersException" => {
return ScanProvisionedProductsError::InvalidParameters(String::from(
error_message,
))
}
"ValidationException" => {
return ScanProvisionedProductsError::Validation(error_message.to_string())
}
_ => {}
}
}
return ScanProvisionedProductsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ScanProvisionedProductsError {
fn from(err: serde_json::error::Error) -> ScanProvisionedProductsError {
ScanProvisionedProductsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ScanProvisionedProductsError {
fn from(err: CredentialsError) -> ScanProvisionedProductsError {
ScanProvisionedProductsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ScanProvisionedProductsError {
fn from(err: HttpDispatchError) -> ScanProvisionedProductsError {
ScanProvisionedProductsError::HttpDispatch(err)
}
}
impl From<io::Error> for ScanProvisionedProductsError {
fn from(err: io::Error) -> ScanProvisionedProductsError {
ScanProvisionedProductsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ScanProvisionedProductsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ScanProvisionedProductsError {
fn description(&self) -> &str {
match *self {
ScanProvisionedProductsError::InvalidParameters(ref cause) => cause,
ScanProvisionedProductsError::Validation(ref cause) => cause,
ScanProvisionedProductsError::Credentials(ref err) => err.description(),
ScanProvisionedProductsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ScanProvisionedProductsError::ParseError(ref cause) => cause,
ScanProvisionedProductsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum SearchProductsError {
InvalidParameters(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl SearchProductsError {
pub fn from_response(res: BufferedHttpResponse) -> SearchProductsError {
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 {
"InvalidParametersException" => {
return SearchProductsError::InvalidParameters(String::from(error_message))
}
"ValidationException" => {
return SearchProductsError::Validation(error_message.to_string())
}
_ => {}
}
}
return SearchProductsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for SearchProductsError {
fn from(err: serde_json::error::Error) -> SearchProductsError {
SearchProductsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for SearchProductsError {
fn from(err: CredentialsError) -> SearchProductsError {
SearchProductsError::Credentials(err)
}
}
impl From<HttpDispatchError> for SearchProductsError {
fn from(err: HttpDispatchError) -> SearchProductsError {
SearchProductsError::HttpDispatch(err)
}
}
impl From<io::Error> for SearchProductsError {
fn from(err: io::Error) -> SearchProductsError {
SearchProductsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for SearchProductsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SearchProductsError {
fn description(&self) -> &str {
match *self {
SearchProductsError::InvalidParameters(ref cause) => cause,
SearchProductsError::Validation(ref cause) => cause,
SearchProductsError::Credentials(ref err) => err.description(),
SearchProductsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
SearchProductsError::ParseError(ref cause) => cause,
SearchProductsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum SearchProductsAsAdminError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl SearchProductsAsAdminError {
pub fn from_response(res: BufferedHttpResponse) -> SearchProductsAsAdminError {
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 {
"InvalidParametersException" => {
return SearchProductsAsAdminError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return SearchProductsAsAdminError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return SearchProductsAsAdminError::Validation(error_message.to_string())
}
_ => {}
}
}
return SearchProductsAsAdminError::Unknown(res);
}
}
impl From<serde_json::error::Error> for SearchProductsAsAdminError {
fn from(err: serde_json::error::Error) -> SearchProductsAsAdminError {
SearchProductsAsAdminError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for SearchProductsAsAdminError {
fn from(err: CredentialsError) -> SearchProductsAsAdminError {
SearchProductsAsAdminError::Credentials(err)
}
}
impl From<HttpDispatchError> for SearchProductsAsAdminError {
fn from(err: HttpDispatchError) -> SearchProductsAsAdminError {
SearchProductsAsAdminError::HttpDispatch(err)
}
}
impl From<io::Error> for SearchProductsAsAdminError {
fn from(err: io::Error) -> SearchProductsAsAdminError {
SearchProductsAsAdminError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for SearchProductsAsAdminError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SearchProductsAsAdminError {
fn description(&self) -> &str {
match *self {
SearchProductsAsAdminError::InvalidParameters(ref cause) => cause,
SearchProductsAsAdminError::ResourceNotFound(ref cause) => cause,
SearchProductsAsAdminError::Validation(ref cause) => cause,
SearchProductsAsAdminError::Credentials(ref err) => err.description(),
SearchProductsAsAdminError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
SearchProductsAsAdminError::ParseError(ref cause) => cause,
SearchProductsAsAdminError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum SearchProvisionedProductsError {
InvalidParameters(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl SearchProvisionedProductsError {
pub fn from_response(res: BufferedHttpResponse) -> SearchProvisionedProductsError {
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 {
"InvalidParametersException" => {
return SearchProvisionedProductsError::InvalidParameters(String::from(
error_message,
))
}
"ValidationException" => {
return SearchProvisionedProductsError::Validation(error_message.to_string())
}
_ => {}
}
}
return SearchProvisionedProductsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for SearchProvisionedProductsError {
fn from(err: serde_json::error::Error) -> SearchProvisionedProductsError {
SearchProvisionedProductsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for SearchProvisionedProductsError {
fn from(err: CredentialsError) -> SearchProvisionedProductsError {
SearchProvisionedProductsError::Credentials(err)
}
}
impl From<HttpDispatchError> for SearchProvisionedProductsError {
fn from(err: HttpDispatchError) -> SearchProvisionedProductsError {
SearchProvisionedProductsError::HttpDispatch(err)
}
}
impl From<io::Error> for SearchProvisionedProductsError {
fn from(err: io::Error) -> SearchProvisionedProductsError {
SearchProvisionedProductsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for SearchProvisionedProductsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SearchProvisionedProductsError {
fn description(&self) -> &str {
match *self {
SearchProvisionedProductsError::InvalidParameters(ref cause) => cause,
SearchProvisionedProductsError::Validation(ref cause) => cause,
SearchProvisionedProductsError::Credentials(ref err) => err.description(),
SearchProvisionedProductsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
SearchProvisionedProductsError::ParseError(ref cause) => cause,
SearchProvisionedProductsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum TerminateProvisionedProductError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl TerminateProvisionedProductError {
pub fn from_response(res: BufferedHttpResponse) -> TerminateProvisionedProductError {
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 {
"ResourceNotFoundException" => {
return TerminateProvisionedProductError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return TerminateProvisionedProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return TerminateProvisionedProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for TerminateProvisionedProductError {
fn from(err: serde_json::error::Error) -> TerminateProvisionedProductError {
TerminateProvisionedProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for TerminateProvisionedProductError {
fn from(err: CredentialsError) -> TerminateProvisionedProductError {
TerminateProvisionedProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for TerminateProvisionedProductError {
fn from(err: HttpDispatchError) -> TerminateProvisionedProductError {
TerminateProvisionedProductError::HttpDispatch(err)
}
}
impl From<io::Error> for TerminateProvisionedProductError {
fn from(err: io::Error) -> TerminateProvisionedProductError {
TerminateProvisionedProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for TerminateProvisionedProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TerminateProvisionedProductError {
fn description(&self) -> &str {
match *self {
TerminateProvisionedProductError::ResourceNotFound(ref cause) => cause,
TerminateProvisionedProductError::Validation(ref cause) => cause,
TerminateProvisionedProductError::Credentials(ref err) => err.description(),
TerminateProvisionedProductError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
TerminateProvisionedProductError::ParseError(ref cause) => cause,
TerminateProvisionedProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateConstraintError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateConstraintError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateConstraintError {
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 {
"InvalidParametersException" => {
return UpdateConstraintError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return UpdateConstraintError::ResourceNotFound(String::from(error_message))
}
"ValidationException" => {
return UpdateConstraintError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateConstraintError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateConstraintError {
fn from(err: serde_json::error::Error) -> UpdateConstraintError {
UpdateConstraintError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateConstraintError {
fn from(err: CredentialsError) -> UpdateConstraintError {
UpdateConstraintError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateConstraintError {
fn from(err: HttpDispatchError) -> UpdateConstraintError {
UpdateConstraintError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateConstraintError {
fn from(err: io::Error) -> UpdateConstraintError {
UpdateConstraintError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateConstraintError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateConstraintError {
fn description(&self) -> &str {
match *self {
UpdateConstraintError::InvalidParameters(ref cause) => cause,
UpdateConstraintError::ResourceNotFound(ref cause) => cause,
UpdateConstraintError::Validation(ref cause) => cause,
UpdateConstraintError::Credentials(ref err) => err.description(),
UpdateConstraintError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateConstraintError::ParseError(ref cause) => cause,
UpdateConstraintError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdatePortfolioError {
InvalidParameters(String),
LimitExceeded(String),
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdatePortfolioError {
pub fn from_response(res: BufferedHttpResponse) -> UpdatePortfolioError {
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 {
"InvalidParametersException" => {
return UpdatePortfolioError::InvalidParameters(String::from(error_message))
}
"LimitExceededException" => {
return UpdatePortfolioError::LimitExceeded(String::from(error_message))
}
"ResourceNotFoundException" => {
return UpdatePortfolioError::ResourceNotFound(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return UpdatePortfolioError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return UpdatePortfolioError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdatePortfolioError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdatePortfolioError {
fn from(err: serde_json::error::Error) -> UpdatePortfolioError {
UpdatePortfolioError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdatePortfolioError {
fn from(err: CredentialsError) -> UpdatePortfolioError {
UpdatePortfolioError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdatePortfolioError {
fn from(err: HttpDispatchError) -> UpdatePortfolioError {
UpdatePortfolioError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdatePortfolioError {
fn from(err: io::Error) -> UpdatePortfolioError {
UpdatePortfolioError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdatePortfolioError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdatePortfolioError {
fn description(&self) -> &str {
match *self {
UpdatePortfolioError::InvalidParameters(ref cause) => cause,
UpdatePortfolioError::LimitExceeded(ref cause) => cause,
UpdatePortfolioError::ResourceNotFound(ref cause) => cause,
UpdatePortfolioError::TagOptionNotMigrated(ref cause) => cause,
UpdatePortfolioError::Validation(ref cause) => cause,
UpdatePortfolioError::Credentials(ref err) => err.description(),
UpdatePortfolioError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdatePortfolioError::ParseError(ref cause) => cause,
UpdatePortfolioError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateProductError {
InvalidParameters(String),
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateProductError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateProductError {
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 {
"InvalidParametersException" => {
return UpdateProductError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return UpdateProductError::ResourceNotFound(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return UpdateProductError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return UpdateProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateProductError {
fn from(err: serde_json::error::Error) -> UpdateProductError {
UpdateProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateProductError {
fn from(err: CredentialsError) -> UpdateProductError {
UpdateProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateProductError {
fn from(err: HttpDispatchError) -> UpdateProductError {
UpdateProductError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateProductError {
fn from(err: io::Error) -> UpdateProductError {
UpdateProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateProductError {
fn description(&self) -> &str {
match *self {
UpdateProductError::InvalidParameters(ref cause) => cause,
UpdateProductError::ResourceNotFound(ref cause) => cause,
UpdateProductError::TagOptionNotMigrated(ref cause) => cause,
UpdateProductError::Validation(ref cause) => cause,
UpdateProductError::Credentials(ref err) => err.description(),
UpdateProductError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateProductError::ParseError(ref cause) => cause,
UpdateProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateProvisionedProductError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateProvisionedProductError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateProvisionedProductError {
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 {
"InvalidParametersException" => {
return UpdateProvisionedProductError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return UpdateProvisionedProductError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return UpdateProvisionedProductError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateProvisionedProductError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateProvisionedProductError {
fn from(err: serde_json::error::Error) -> UpdateProvisionedProductError {
UpdateProvisionedProductError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateProvisionedProductError {
fn from(err: CredentialsError) -> UpdateProvisionedProductError {
UpdateProvisionedProductError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateProvisionedProductError {
fn from(err: HttpDispatchError) -> UpdateProvisionedProductError {
UpdateProvisionedProductError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateProvisionedProductError {
fn from(err: io::Error) -> UpdateProvisionedProductError {
UpdateProvisionedProductError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateProvisionedProductError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateProvisionedProductError {
fn description(&self) -> &str {
match *self {
UpdateProvisionedProductError::InvalidParameters(ref cause) => cause,
UpdateProvisionedProductError::ResourceNotFound(ref cause) => cause,
UpdateProvisionedProductError::Validation(ref cause) => cause,
UpdateProvisionedProductError::Credentials(ref err) => err.description(),
UpdateProvisionedProductError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateProvisionedProductError::ParseError(ref cause) => cause,
UpdateProvisionedProductError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateProvisioningArtifactError {
InvalidParameters(String),
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateProvisioningArtifactError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateProvisioningArtifactError {
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 {
"InvalidParametersException" => {
return UpdateProvisioningArtifactError::InvalidParameters(String::from(
error_message,
))
}
"ResourceNotFoundException" => {
return UpdateProvisioningArtifactError::ResourceNotFound(String::from(
error_message,
))
}
"ValidationException" => {
return UpdateProvisioningArtifactError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateProvisioningArtifactError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateProvisioningArtifactError {
fn from(err: serde_json::error::Error) -> UpdateProvisioningArtifactError {
UpdateProvisioningArtifactError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateProvisioningArtifactError {
fn from(err: CredentialsError) -> UpdateProvisioningArtifactError {
UpdateProvisioningArtifactError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateProvisioningArtifactError {
fn from(err: HttpDispatchError) -> UpdateProvisioningArtifactError {
UpdateProvisioningArtifactError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateProvisioningArtifactError {
fn from(err: io::Error) -> UpdateProvisioningArtifactError {
UpdateProvisioningArtifactError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateProvisioningArtifactError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateProvisioningArtifactError {
fn description(&self) -> &str {
match *self {
UpdateProvisioningArtifactError::InvalidParameters(ref cause) => cause,
UpdateProvisioningArtifactError::ResourceNotFound(ref cause) => cause,
UpdateProvisioningArtifactError::Validation(ref cause) => cause,
UpdateProvisioningArtifactError::Credentials(ref err) => err.description(),
UpdateProvisioningArtifactError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateProvisioningArtifactError::ParseError(ref cause) => cause,
UpdateProvisioningArtifactError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateTagOptionError {
DuplicateResource(String),
InvalidParameters(String),
ResourceNotFound(String),
TagOptionNotMigrated(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateTagOptionError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateTagOptionError {
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 {
"DuplicateResourceException" => {
return UpdateTagOptionError::DuplicateResource(String::from(error_message))
}
"InvalidParametersException" => {
return UpdateTagOptionError::InvalidParameters(String::from(error_message))
}
"ResourceNotFoundException" => {
return UpdateTagOptionError::ResourceNotFound(String::from(error_message))
}
"TagOptionNotMigratedException" => {
return UpdateTagOptionError::TagOptionNotMigrated(String::from(error_message))
}
"ValidationException" => {
return UpdateTagOptionError::Validation(error_message.to_string())
}
_ => {}
}
}
return UpdateTagOptionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateTagOptionError {
fn from(err: serde_json::error::Error) -> UpdateTagOptionError {
UpdateTagOptionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateTagOptionError {
fn from(err: CredentialsError) -> UpdateTagOptionError {
UpdateTagOptionError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateTagOptionError {
fn from(err: HttpDispatchError) -> UpdateTagOptionError {
UpdateTagOptionError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateTagOptionError {
fn from(err: io::Error) -> UpdateTagOptionError {
UpdateTagOptionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateTagOptionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateTagOptionError {
fn description(&self) -> &str {
match *self {
UpdateTagOptionError::DuplicateResource(ref cause) => cause,
UpdateTagOptionError::InvalidParameters(ref cause) => cause,
UpdateTagOptionError::ResourceNotFound(ref cause) => cause,
UpdateTagOptionError::TagOptionNotMigrated(ref cause) => cause,
UpdateTagOptionError::Validation(ref cause) => cause,
UpdateTagOptionError::Credentials(ref err) => err.description(),
UpdateTagOptionError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateTagOptionError::ParseError(ref cause) => cause,
UpdateTagOptionError::Unknown(_) => "unknown error",
}
}
}
pub trait ServiceCatalog {
fn accept_portfolio_share(
&self,
input: AcceptPortfolioShareInput,
) -> RusotoFuture<AcceptPortfolioShareOutput, AcceptPortfolioShareError>;
fn associate_principal_with_portfolio(
&self,
input: AssociatePrincipalWithPortfolioInput,
) -> RusotoFuture<AssociatePrincipalWithPortfolioOutput, AssociatePrincipalWithPortfolioError>;
fn associate_product_with_portfolio(
&self,
input: AssociateProductWithPortfolioInput,
) -> RusotoFuture<AssociateProductWithPortfolioOutput, AssociateProductWithPortfolioError>;
fn associate_tag_option_with_resource(
&self,
input: AssociateTagOptionWithResourceInput,
) -> RusotoFuture<AssociateTagOptionWithResourceOutput, AssociateTagOptionWithResourceError>;
fn copy_product(
&self,
input: CopyProductInput,
) -> RusotoFuture<CopyProductOutput, CopyProductError>;
fn create_constraint(
&self,
input: CreateConstraintInput,
) -> RusotoFuture<CreateConstraintOutput, CreateConstraintError>;
fn create_portfolio(
&self,
input: CreatePortfolioInput,
) -> RusotoFuture<CreatePortfolioOutput, CreatePortfolioError>;
fn create_portfolio_share(
&self,
input: CreatePortfolioShareInput,
) -> RusotoFuture<CreatePortfolioShareOutput, CreatePortfolioShareError>;
fn create_product(
&self,
input: CreateProductInput,
) -> RusotoFuture<CreateProductOutput, CreateProductError>;
fn create_provisioned_product_plan(
&self,
input: CreateProvisionedProductPlanInput,
) -> RusotoFuture<CreateProvisionedProductPlanOutput, CreateProvisionedProductPlanError>;
fn create_provisioning_artifact(
&self,
input: CreateProvisioningArtifactInput,
) -> RusotoFuture<CreateProvisioningArtifactOutput, CreateProvisioningArtifactError>;
fn create_tag_option(
&self,
input: CreateTagOptionInput,
) -> RusotoFuture<CreateTagOptionOutput, CreateTagOptionError>;
fn delete_constraint(
&self,
input: DeleteConstraintInput,
) -> RusotoFuture<DeleteConstraintOutput, DeleteConstraintError>;
fn delete_portfolio(
&self,
input: DeletePortfolioInput,
) -> RusotoFuture<DeletePortfolioOutput, DeletePortfolioError>;
fn delete_portfolio_share(
&self,
input: DeletePortfolioShareInput,
) -> RusotoFuture<DeletePortfolioShareOutput, DeletePortfolioShareError>;
fn delete_product(
&self,
input: DeleteProductInput,
) -> RusotoFuture<DeleteProductOutput, DeleteProductError>;
fn delete_provisioned_product_plan(
&self,
input: DeleteProvisionedProductPlanInput,
) -> RusotoFuture<DeleteProvisionedProductPlanOutput, DeleteProvisionedProductPlanError>;
fn delete_provisioning_artifact(
&self,
input: DeleteProvisioningArtifactInput,
) -> RusotoFuture<DeleteProvisioningArtifactOutput, DeleteProvisioningArtifactError>;
fn delete_tag_option(
&self,
input: DeleteTagOptionInput,
) -> RusotoFuture<DeleteTagOptionOutput, DeleteTagOptionError>;
fn describe_constraint(
&self,
input: DescribeConstraintInput,
) -> RusotoFuture<DescribeConstraintOutput, DescribeConstraintError>;
fn describe_copy_product_status(
&self,
input: DescribeCopyProductStatusInput,
) -> RusotoFuture<DescribeCopyProductStatusOutput, DescribeCopyProductStatusError>;
fn describe_portfolio(
&self,
input: DescribePortfolioInput,
) -> RusotoFuture<DescribePortfolioOutput, DescribePortfolioError>;
fn describe_product(
&self,
input: DescribeProductInput,
) -> RusotoFuture<DescribeProductOutput, DescribeProductError>;
fn describe_product_as_admin(
&self,
input: DescribeProductAsAdminInput,
) -> RusotoFuture<DescribeProductAsAdminOutput, DescribeProductAsAdminError>;
fn describe_product_view(
&self,
input: DescribeProductViewInput,
) -> RusotoFuture<DescribeProductViewOutput, DescribeProductViewError>;
fn describe_provisioned_product(
&self,
input: DescribeProvisionedProductInput,
) -> RusotoFuture<DescribeProvisionedProductOutput, DescribeProvisionedProductError>;
fn describe_provisioned_product_plan(
&self,
input: DescribeProvisionedProductPlanInput,
) -> RusotoFuture<DescribeProvisionedProductPlanOutput, DescribeProvisionedProductPlanError>;
fn describe_provisioning_artifact(
&self,
input: DescribeProvisioningArtifactInput,
) -> RusotoFuture<DescribeProvisioningArtifactOutput, DescribeProvisioningArtifactError>;
fn describe_provisioning_parameters(
&self,
input: DescribeProvisioningParametersInput,
) -> RusotoFuture<DescribeProvisioningParametersOutput, DescribeProvisioningParametersError>;
fn describe_record(
&self,
input: DescribeRecordInput,
) -> RusotoFuture<DescribeRecordOutput, DescribeRecordError>;
fn describe_tag_option(
&self,
input: DescribeTagOptionInput,
) -> RusotoFuture<DescribeTagOptionOutput, DescribeTagOptionError>;
fn disassociate_principal_from_portfolio(
&self,
input: DisassociatePrincipalFromPortfolioInput,
) -> RusotoFuture<
DisassociatePrincipalFromPortfolioOutput,
DisassociatePrincipalFromPortfolioError,
>;
fn disassociate_product_from_portfolio(
&self,
input: DisassociateProductFromPortfolioInput,
) -> RusotoFuture<DisassociateProductFromPortfolioOutput, DisassociateProductFromPortfolioError>;
fn disassociate_tag_option_from_resource(
&self,
input: DisassociateTagOptionFromResourceInput,
) -> RusotoFuture<DisassociateTagOptionFromResourceOutput, DisassociateTagOptionFromResourceError>;
fn execute_provisioned_product_plan(
&self,
input: ExecuteProvisionedProductPlanInput,
) -> RusotoFuture<ExecuteProvisionedProductPlanOutput, ExecuteProvisionedProductPlanError>;
fn list_accepted_portfolio_shares(
&self,
input: ListAcceptedPortfolioSharesInput,
) -> RusotoFuture<ListAcceptedPortfolioSharesOutput, ListAcceptedPortfolioSharesError>;
fn list_constraints_for_portfolio(
&self,
input: ListConstraintsForPortfolioInput,
) -> RusotoFuture<ListConstraintsForPortfolioOutput, ListConstraintsForPortfolioError>;
fn list_launch_paths(
&self,
input: ListLaunchPathsInput,
) -> RusotoFuture<ListLaunchPathsOutput, ListLaunchPathsError>;
fn list_portfolio_access(
&self,
input: ListPortfolioAccessInput,
) -> RusotoFuture<ListPortfolioAccessOutput, ListPortfolioAccessError>;
fn list_portfolios(
&self,
input: ListPortfoliosInput,
) -> RusotoFuture<ListPortfoliosOutput, ListPortfoliosError>;
fn list_portfolios_for_product(
&self,
input: ListPortfoliosForProductInput,
) -> RusotoFuture<ListPortfoliosForProductOutput, ListPortfoliosForProductError>;
fn list_principals_for_portfolio(
&self,
input: ListPrincipalsForPortfolioInput,
) -> RusotoFuture<ListPrincipalsForPortfolioOutput, ListPrincipalsForPortfolioError>;
fn list_provisioned_product_plans(
&self,
input: ListProvisionedProductPlansInput,
) -> RusotoFuture<ListProvisionedProductPlansOutput, ListProvisionedProductPlansError>;
fn list_provisioning_artifacts(
&self,
input: ListProvisioningArtifactsInput,
) -> RusotoFuture<ListProvisioningArtifactsOutput, ListProvisioningArtifactsError>;
fn list_record_history(
&self,
input: ListRecordHistoryInput,
) -> RusotoFuture<ListRecordHistoryOutput, ListRecordHistoryError>;
fn list_resources_for_tag_option(
&self,
input: ListResourcesForTagOptionInput,
) -> RusotoFuture<ListResourcesForTagOptionOutput, ListResourcesForTagOptionError>;
fn list_tag_options(
&self,
input: ListTagOptionsInput,
) -> RusotoFuture<ListTagOptionsOutput, ListTagOptionsError>;
fn provision_product(
&self,
input: ProvisionProductInput,
) -> RusotoFuture<ProvisionProductOutput, ProvisionProductError>;
fn reject_portfolio_share(
&self,
input: RejectPortfolioShareInput,
) -> RusotoFuture<RejectPortfolioShareOutput, RejectPortfolioShareError>;
fn scan_provisioned_products(
&self,
input: ScanProvisionedProductsInput,
) -> RusotoFuture<ScanProvisionedProductsOutput, ScanProvisionedProductsError>;
fn search_products(
&self,
input: SearchProductsInput,
) -> RusotoFuture<SearchProductsOutput, SearchProductsError>;
fn search_products_as_admin(
&self,
input: SearchProductsAsAdminInput,
) -> RusotoFuture<SearchProductsAsAdminOutput, SearchProductsAsAdminError>;
fn search_provisioned_products(
&self,
input: SearchProvisionedProductsInput,
) -> RusotoFuture<SearchProvisionedProductsOutput, SearchProvisionedProductsError>;
fn terminate_provisioned_product(
&self,
input: TerminateProvisionedProductInput,
) -> RusotoFuture<TerminateProvisionedProductOutput, TerminateProvisionedProductError>;
fn update_constraint(
&self,
input: UpdateConstraintInput,
) -> RusotoFuture<UpdateConstraintOutput, UpdateConstraintError>;
fn update_portfolio(
&self,
input: UpdatePortfolioInput,
) -> RusotoFuture<UpdatePortfolioOutput, UpdatePortfolioError>;
fn update_product(
&self,
input: UpdateProductInput,
) -> RusotoFuture<UpdateProductOutput, UpdateProductError>;
fn update_provisioned_product(
&self,
input: UpdateProvisionedProductInput,
) -> RusotoFuture<UpdateProvisionedProductOutput, UpdateProvisionedProductError>;
fn update_provisioning_artifact(
&self,
input: UpdateProvisioningArtifactInput,
) -> RusotoFuture<UpdateProvisioningArtifactOutput, UpdateProvisioningArtifactError>;
fn update_tag_option(
&self,
input: UpdateTagOptionInput,
) -> RusotoFuture<UpdateTagOptionOutput, UpdateTagOptionError>;
}
pub struct ServiceCatalogClient {
client: Client,
region: region::Region,
}
impl ServiceCatalogClient {
pub fn new(region: region::Region) -> ServiceCatalogClient {
ServiceCatalogClient {
client: Client::shared(),
region: region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> ServiceCatalogClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
ServiceCatalogClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region: region,
}
}
}
impl ServiceCatalog for ServiceCatalogClient {
fn accept_portfolio_share(
&self,
input: AcceptPortfolioShareInput,
) -> RusotoFuture<AcceptPortfolioShareOutput, AcceptPortfolioShareError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.AcceptPortfolioShare",
);
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::<AcceptPortfolioShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(AcceptPortfolioShareError::from_response(response))
}),
)
}
})
}
fn associate_principal_with_portfolio(
&self,
input: AssociatePrincipalWithPortfolioInput,
) -> RusotoFuture<AssociatePrincipalWithPortfolioOutput, AssociatePrincipalWithPortfolioError>
{
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.AssociatePrincipalWithPortfolio",
);
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::<AssociatePrincipalWithPortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AssociatePrincipalWithPortfolioError::from_response(
response,
))
}))
}
})
}
fn associate_product_with_portfolio(
&self,
input: AssociateProductWithPortfolioInput,
) -> RusotoFuture<AssociateProductWithPortfolioOutput, AssociateProductWithPortfolioError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.AssociateProductWithPortfolio",
);
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::<AssociateProductWithPortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AssociateProductWithPortfolioError::from_response(response))
}))
}
})
}
fn associate_tag_option_with_resource(
&self,
input: AssociateTagOptionWithResourceInput,
) -> RusotoFuture<AssociateTagOptionWithResourceOutput, AssociateTagOptionWithResourceError>
{
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.AssociateTagOptionWithResource",
);
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::<AssociateTagOptionWithResourceOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AssociateTagOptionWithResourceError::from_response(response))
}))
}
})
}
fn copy_product(
&self,
input: CopyProductInput,
) -> RusotoFuture<CopyProductOutput, CopyProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWS242ServiceCatalogService.CopyProduct");
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::<CopyProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CopyProductError::from_response(response))),
)
}
})
}
fn create_constraint(
&self,
input: CreateConstraintInput,
) -> RusotoFuture<CreateConstraintOutput, CreateConstraintError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.CreateConstraint",
);
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::<CreateConstraintOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateConstraintError::from_response(response))),
)
}
})
}
fn create_portfolio(
&self,
input: CreatePortfolioInput,
) -> RusotoFuture<CreatePortfolioOutput, CreatePortfolioError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.CreatePortfolio",
);
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::<CreatePortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreatePortfolioError::from_response(response))),
)
}
})
}
fn create_portfolio_share(
&self,
input: CreatePortfolioShareInput,
) -> RusotoFuture<CreatePortfolioShareOutput, CreatePortfolioShareError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.CreatePortfolioShare",
);
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::<CreatePortfolioShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreatePortfolioShareError::from_response(response))
}),
)
}
})
}
fn create_product(
&self,
input: CreateProductInput,
) -> RusotoFuture<CreateProductOutput, CreateProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWS242ServiceCatalogService.CreateProduct");
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::<CreateProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateProductError::from_response(response))),
)
}
})
}
fn create_provisioned_product_plan(
&self,
input: CreateProvisionedProductPlanInput,
) -> RusotoFuture<CreateProvisionedProductPlanOutput, CreateProvisionedProductPlanError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.CreateProvisionedProductPlan",
);
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::<CreateProvisionedProductPlanOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateProvisionedProductPlanError::from_response(response))
}))
}
})
}
fn create_provisioning_artifact(
&self,
input: CreateProvisioningArtifactInput,
) -> RusotoFuture<CreateProvisioningArtifactOutput, CreateProvisioningArtifactError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.CreateProvisioningArtifact",
);
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::<CreateProvisioningArtifactOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateProvisioningArtifactError::from_response(response))
}))
}
})
}
fn create_tag_option(
&self,
input: CreateTagOptionInput,
) -> RusotoFuture<CreateTagOptionOutput, CreateTagOptionError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.CreateTagOption",
);
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::<CreateTagOptionOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateTagOptionError::from_response(response))),
)
}
})
}
fn delete_constraint(
&self,
input: DeleteConstraintInput,
) -> RusotoFuture<DeleteConstraintOutput, DeleteConstraintError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DeleteConstraint",
);
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::<DeleteConstraintOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteConstraintError::from_response(response))),
)
}
})
}
fn delete_portfolio(
&self,
input: DeletePortfolioInput,
) -> RusotoFuture<DeletePortfolioOutput, DeletePortfolioError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DeletePortfolio",
);
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::<DeletePortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeletePortfolioError::from_response(response))),
)
}
})
}
fn delete_portfolio_share(
&self,
input: DeletePortfolioShareInput,
) -> RusotoFuture<DeletePortfolioShareOutput, DeletePortfolioShareError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DeletePortfolioShare",
);
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::<DeletePortfolioShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeletePortfolioShareError::from_response(response))
}),
)
}
})
}
fn delete_product(
&self,
input: DeleteProductInput,
) -> RusotoFuture<DeleteProductOutput, DeleteProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWS242ServiceCatalogService.DeleteProduct");
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::<DeleteProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteProductError::from_response(response))),
)
}
})
}
fn delete_provisioned_product_plan(
&self,
input: DeleteProvisionedProductPlanInput,
) -> RusotoFuture<DeleteProvisionedProductPlanOutput, DeleteProvisionedProductPlanError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DeleteProvisionedProductPlan",
);
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::<DeleteProvisionedProductPlanOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteProvisionedProductPlanError::from_response(response))
}))
}
})
}
fn delete_provisioning_artifact(
&self,
input: DeleteProvisioningArtifactInput,
) -> RusotoFuture<DeleteProvisioningArtifactOutput, DeleteProvisioningArtifactError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DeleteProvisioningArtifact",
);
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::<DeleteProvisioningArtifactOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteProvisioningArtifactError::from_response(response))
}))
}
})
}
fn delete_tag_option(
&self,
input: DeleteTagOptionInput,
) -> RusotoFuture<DeleteTagOptionOutput, DeleteTagOptionError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DeleteTagOption",
);
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::<DeleteTagOptionOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteTagOptionError::from_response(response))),
)
}
})
}
fn describe_constraint(
&self,
input: DescribeConstraintInput,
) -> RusotoFuture<DescribeConstraintOutput, DescribeConstraintError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeConstraint",
);
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::<DescribeConstraintOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeConstraintError::from_response(response))),
)
}
})
}
fn describe_copy_product_status(
&self,
input: DescribeCopyProductStatusInput,
) -> RusotoFuture<DescribeCopyProductStatusOutput, DescribeCopyProductStatusError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeCopyProductStatus",
);
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::<DescribeCopyProductStatusOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeCopyProductStatusError::from_response(response))
}))
}
})
}
fn describe_portfolio(
&self,
input: DescribePortfolioInput,
) -> RusotoFuture<DescribePortfolioOutput, DescribePortfolioError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribePortfolio",
);
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::<DescribePortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribePortfolioError::from_response(response))),
)
}
})
}
fn describe_product(
&self,
input: DescribeProductInput,
) -> RusotoFuture<DescribeProductOutput, DescribeProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeProduct",
);
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::<DescribeProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeProductError::from_response(response))),
)
}
})
}
fn describe_product_as_admin(
&self,
input: DescribeProductAsAdminInput,
) -> RusotoFuture<DescribeProductAsAdminOutput, DescribeProductAsAdminError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeProductAsAdmin",
);
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::<DescribeProductAsAdminOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeProductAsAdminError::from_response(response))
}),
)
}
})
}
fn describe_product_view(
&self,
input: DescribeProductViewInput,
) -> RusotoFuture<DescribeProductViewOutput, DescribeProductViewError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeProductView",
);
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::<DescribeProductViewOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeProductViewError::from_response(response))
}),
)
}
})
}
fn describe_provisioned_product(
&self,
input: DescribeProvisionedProductInput,
) -> RusotoFuture<DescribeProvisionedProductOutput, DescribeProvisionedProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeProvisionedProduct",
);
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::<DescribeProvisionedProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeProvisionedProductError::from_response(response))
}))
}
})
}
fn describe_provisioned_product_plan(
&self,
input: DescribeProvisionedProductPlanInput,
) -> RusotoFuture<DescribeProvisionedProductPlanOutput, DescribeProvisionedProductPlanError>
{
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeProvisionedProductPlan",
);
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::<DescribeProvisionedProductPlanOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeProvisionedProductPlanError::from_response(response))
}))
}
})
}
fn describe_provisioning_artifact(
&self,
input: DescribeProvisioningArtifactInput,
) -> RusotoFuture<DescribeProvisioningArtifactOutput, DescribeProvisioningArtifactError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeProvisioningArtifact",
);
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::<DescribeProvisioningArtifactOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeProvisioningArtifactError::from_response(response))
}))
}
})
}
fn describe_provisioning_parameters(
&self,
input: DescribeProvisioningParametersInput,
) -> RusotoFuture<DescribeProvisioningParametersOutput, DescribeProvisioningParametersError>
{
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeProvisioningParameters",
);
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::<DescribeProvisioningParametersOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeProvisioningParametersError::from_response(response))
}))
}
})
}
fn describe_record(
&self,
input: DescribeRecordInput,
) -> RusotoFuture<DescribeRecordOutput, DescribeRecordError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWS242ServiceCatalogService.DescribeRecord");
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::<DescribeRecordOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeRecordError::from_response(response))),
)
}
})
}
fn describe_tag_option(
&self,
input: DescribeTagOptionInput,
) -> RusotoFuture<DescribeTagOptionOutput, DescribeTagOptionError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DescribeTagOption",
);
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::<DescribeTagOptionOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeTagOptionError::from_response(response))),
)
}
})
}
fn disassociate_principal_from_portfolio(
&self,
input: DisassociatePrincipalFromPortfolioInput,
) -> RusotoFuture<
DisassociatePrincipalFromPortfolioOutput,
DisassociatePrincipalFromPortfolioError,
> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DisassociatePrincipalFromPortfolio",
);
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::<DisassociatePrincipalFromPortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociatePrincipalFromPortfolioError::from_response(
response,
))
}))
}
})
}
fn disassociate_product_from_portfolio(
&self,
input: DisassociateProductFromPortfolioInput,
) -> RusotoFuture<DisassociateProductFromPortfolioOutput, DisassociateProductFromPortfolioError>
{
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DisassociateProductFromPortfolio",
);
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::<DisassociateProductFromPortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociateProductFromPortfolioError::from_response(
response,
))
}))
}
})
}
fn disassociate_tag_option_from_resource(
&self,
input: DisassociateTagOptionFromResourceInput,
) -> RusotoFuture<DisassociateTagOptionFromResourceOutput, DisassociateTagOptionFromResourceError>
{
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.DisassociateTagOptionFromResource",
);
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::<DisassociateTagOptionFromResourceOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociateTagOptionFromResourceError::from_response(
response,
))
}))
}
})
}
fn execute_provisioned_product_plan(
&self,
input: ExecuteProvisionedProductPlanInput,
) -> RusotoFuture<ExecuteProvisionedProductPlanOutput, ExecuteProvisionedProductPlanError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ExecuteProvisionedProductPlan",
);
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::<ExecuteProvisionedProductPlanOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ExecuteProvisionedProductPlanError::from_response(response))
}))
}
})
}
fn list_accepted_portfolio_shares(
&self,
input: ListAcceptedPortfolioSharesInput,
) -> RusotoFuture<ListAcceptedPortfolioSharesOutput, ListAcceptedPortfolioSharesError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListAcceptedPortfolioShares",
);
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::<ListAcceptedPortfolioSharesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListAcceptedPortfolioSharesError::from_response(response))
}))
}
})
}
fn list_constraints_for_portfolio(
&self,
input: ListConstraintsForPortfolioInput,
) -> RusotoFuture<ListConstraintsForPortfolioOutput, ListConstraintsForPortfolioError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListConstraintsForPortfolio",
);
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::<ListConstraintsForPortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListConstraintsForPortfolioError::from_response(response))
}))
}
})
}
fn list_launch_paths(
&self,
input: ListLaunchPathsInput,
) -> RusotoFuture<ListLaunchPathsOutput, ListLaunchPathsError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListLaunchPaths",
);
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::<ListLaunchPathsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListLaunchPathsError::from_response(response))),
)
}
})
}
fn list_portfolio_access(
&self,
input: ListPortfolioAccessInput,
) -> RusotoFuture<ListPortfolioAccessOutput, ListPortfolioAccessError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListPortfolioAccess",
);
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::<ListPortfolioAccessOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListPortfolioAccessError::from_response(response))
}),
)
}
})
}
fn list_portfolios(
&self,
input: ListPortfoliosInput,
) -> RusotoFuture<ListPortfoliosOutput, ListPortfoliosError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWS242ServiceCatalogService.ListPortfolios");
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::<ListPortfoliosOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListPortfoliosError::from_response(response))),
)
}
})
}
fn list_portfolios_for_product(
&self,
input: ListPortfoliosForProductInput,
) -> RusotoFuture<ListPortfoliosForProductOutput, ListPortfoliosForProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListPortfoliosForProduct",
);
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::<ListPortfoliosForProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListPortfoliosForProductError::from_response(response))
}))
}
})
}
fn list_principals_for_portfolio(
&self,
input: ListPrincipalsForPortfolioInput,
) -> RusotoFuture<ListPrincipalsForPortfolioOutput, ListPrincipalsForPortfolioError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListPrincipalsForPortfolio",
);
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::<ListPrincipalsForPortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListPrincipalsForPortfolioError::from_response(response))
}))
}
})
}
fn list_provisioned_product_plans(
&self,
input: ListProvisionedProductPlansInput,
) -> RusotoFuture<ListProvisionedProductPlansOutput, ListProvisionedProductPlansError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListProvisionedProductPlans",
);
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::<ListProvisionedProductPlansOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListProvisionedProductPlansError::from_response(response))
}))
}
})
}
fn list_provisioning_artifacts(
&self,
input: ListProvisioningArtifactsInput,
) -> RusotoFuture<ListProvisioningArtifactsOutput, ListProvisioningArtifactsError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListProvisioningArtifacts",
);
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::<ListProvisioningArtifactsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListProvisioningArtifactsError::from_response(response))
}))
}
})
}
fn list_record_history(
&self,
input: ListRecordHistoryInput,
) -> RusotoFuture<ListRecordHistoryOutput, ListRecordHistoryError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListRecordHistory",
);
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::<ListRecordHistoryOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListRecordHistoryError::from_response(response))),
)
}
})
}
fn list_resources_for_tag_option(
&self,
input: ListResourcesForTagOptionInput,
) -> RusotoFuture<ListResourcesForTagOptionOutput, ListResourcesForTagOptionError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ListResourcesForTagOption",
);
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::<ListResourcesForTagOptionOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListResourcesForTagOptionError::from_response(response))
}))
}
})
}
fn list_tag_options(
&self,
input: ListTagOptionsInput,
) -> RusotoFuture<ListTagOptionsOutput, ListTagOptionsError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWS242ServiceCatalogService.ListTagOptions");
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::<ListTagOptionsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTagOptionsError::from_response(response))),
)
}
})
}
fn provision_product(
&self,
input: ProvisionProductInput,
) -> RusotoFuture<ProvisionProductOutput, ProvisionProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ProvisionProduct",
);
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::<ProvisionProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ProvisionProductError::from_response(response))),
)
}
})
}
fn reject_portfolio_share(
&self,
input: RejectPortfolioShareInput,
) -> RusotoFuture<RejectPortfolioShareOutput, RejectPortfolioShareError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.RejectPortfolioShare",
);
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::<RejectPortfolioShareOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(RejectPortfolioShareError::from_response(response))
}),
)
}
})
}
fn scan_provisioned_products(
&self,
input: ScanProvisionedProductsInput,
) -> RusotoFuture<ScanProvisionedProductsOutput, ScanProvisionedProductsError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.ScanProvisionedProducts",
);
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::<ScanProvisionedProductsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ScanProvisionedProductsError::from_response(response))
}))
}
})
}
fn search_products(
&self,
input: SearchProductsInput,
) -> RusotoFuture<SearchProductsOutput, SearchProductsError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWS242ServiceCatalogService.SearchProducts");
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::<SearchProductsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SearchProductsError::from_response(response))),
)
}
})
}
fn search_products_as_admin(
&self,
input: SearchProductsAsAdminInput,
) -> RusotoFuture<SearchProductsAsAdminOutput, SearchProductsAsAdminError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.SearchProductsAsAdmin",
);
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::<SearchProductsAsAdminOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(SearchProductsAsAdminError::from_response(response))
}),
)
}
})
}
fn search_provisioned_products(
&self,
input: SearchProvisionedProductsInput,
) -> RusotoFuture<SearchProvisionedProductsOutput, SearchProvisionedProductsError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.SearchProvisionedProducts",
);
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::<SearchProvisionedProductsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(SearchProvisionedProductsError::from_response(response))
}))
}
})
}
fn terminate_provisioned_product(
&self,
input: TerminateProvisionedProductInput,
) -> RusotoFuture<TerminateProvisionedProductOutput, TerminateProvisionedProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.TerminateProvisionedProduct",
);
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::<TerminateProvisionedProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(TerminateProvisionedProductError::from_response(response))
}))
}
})
}
fn update_constraint(
&self,
input: UpdateConstraintInput,
) -> RusotoFuture<UpdateConstraintOutput, UpdateConstraintError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.UpdateConstraint",
);
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::<UpdateConstraintOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateConstraintError::from_response(response))),
)
}
})
}
fn update_portfolio(
&self,
input: UpdatePortfolioInput,
) -> RusotoFuture<UpdatePortfolioOutput, UpdatePortfolioError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.UpdatePortfolio",
);
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::<UpdatePortfolioOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdatePortfolioError::from_response(response))),
)
}
})
}
fn update_product(
&self,
input: UpdateProductInput,
) -> RusotoFuture<UpdateProductOutput, UpdateProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWS242ServiceCatalogService.UpdateProduct");
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::<UpdateProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateProductError::from_response(response))),
)
}
})
}
fn update_provisioned_product(
&self,
input: UpdateProvisionedProductInput,
) -> RusotoFuture<UpdateProvisionedProductOutput, UpdateProvisionedProductError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.UpdateProvisionedProduct",
);
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::<UpdateProvisionedProductOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateProvisionedProductError::from_response(response))
}))
}
})
}
fn update_provisioning_artifact(
&self,
input: UpdateProvisioningArtifactInput,
) -> RusotoFuture<UpdateProvisioningArtifactOutput, UpdateProvisioningArtifactError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.UpdateProvisioningArtifact",
);
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::<UpdateProvisioningArtifactOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateProvisioningArtifactError::from_response(response))
}))
}
})
}
fn update_tag_option(
&self,
input: UpdateTagOptionInput,
) -> RusotoFuture<UpdateTagOptionOutput, UpdateTagOptionError> {
let mut request = SignedRequest::new("POST", "servicecatalog", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWS242ServiceCatalogService.UpdateTagOption",
);
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::<UpdateTagOptionOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateTagOptionError::from_response(response))),
)
}
})
}
}
#[cfg(test)]
mod protocol_tests {}