use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConsumedLicenseSummary {
#[serde(rename = "ConsumedLicenses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub consumed_licenses: Option<i64>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateLicenseConfigurationRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "LicenseCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_count: Option<i64>,
#[serde(rename = "LicenseCountHardLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_count_hard_limit: Option<bool>,
#[serde(rename = "LicenseCountingType")]
pub license_counting_type: String,
#[serde(rename = "LicenseRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_rules: Option<Vec<String>>,
#[serde(rename = "Name")]
pub 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 CreateLicenseConfigurationResponse {
#[serde(rename = "LicenseConfigurationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteLicenseConfigurationRequest {
#[serde(rename = "LicenseConfigurationArn")]
pub license_configuration_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteLicenseConfigurationResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Filter {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: 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 GetLicenseConfigurationRequest {
#[serde(rename = "LicenseConfigurationArn")]
pub license_configuration_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLicenseConfigurationResponse {
#[serde(rename = "ConsumedLicenseSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub consumed_license_summary_list: Option<Vec<ConsumedLicenseSummary>>,
#[serde(rename = "ConsumedLicenses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub consumed_licenses: Option<i64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "LicenseConfigurationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_arn: Option<String>,
#[serde(rename = "LicenseConfigurationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_id: Option<String>,
#[serde(rename = "LicenseCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_count: Option<i64>,
#[serde(rename = "LicenseCountHardLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_count_hard_limit: Option<bool>,
#[serde(rename = "LicenseCountingType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_counting_type: Option<String>,
#[serde(rename = "LicenseRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_rules: Option<Vec<String>>,
#[serde(rename = "ManagedResourceSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub managed_resource_summary_list: Option<Vec<ManagedResourceSummary>>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "OwnerAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub owner_account_id: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: 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 GetServiceSettingsRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetServiceSettingsResponse {
#[serde(rename = "EnableCrossAccountsDiscovery")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_cross_accounts_discovery: Option<bool>,
#[serde(rename = "OrganizationConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_configuration: Option<OrganizationConfiguration>,
#[serde(rename = "S3BucketArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_bucket_arn: Option<String>,
#[serde(rename = "SnsTopicArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sns_topic_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InventoryFilter {
#[serde(rename = "Condition")]
pub condition: String,
#[serde(rename = "Name")]
pub name: 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 LicenseConfiguration {
#[serde(rename = "ConsumedLicenseSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub consumed_license_summary_list: Option<Vec<ConsumedLicenseSummary>>,
#[serde(rename = "ConsumedLicenses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub consumed_licenses: Option<i64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "LicenseConfigurationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_arn: Option<String>,
#[serde(rename = "LicenseConfigurationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_id: Option<String>,
#[serde(rename = "LicenseCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_count: Option<i64>,
#[serde(rename = "LicenseCountHardLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_count_hard_limit: Option<bool>,
#[serde(rename = "LicenseCountingType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_counting_type: Option<String>,
#[serde(rename = "LicenseRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_rules: Option<Vec<String>>,
#[serde(rename = "ManagedResourceSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub managed_resource_summary_list: Option<Vec<ManagedResourceSummary>>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "OwnerAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub owner_account_id: Option<String>,
#[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 LicenseConfigurationAssociation {
#[serde(rename = "AssociationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub association_time: Option<f64>,
#[serde(rename = "ResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
#[serde(rename = "ResourceOwnerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_owner_id: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LicenseConfigurationUsage {
#[serde(rename = "AssociationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub association_time: Option<f64>,
#[serde(rename = "ConsumedLicenses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub consumed_licenses: Option<i64>,
#[serde(rename = "ResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
#[serde(rename = "ResourceOwnerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_owner_id: Option<String>,
#[serde(rename = "ResourceStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_status: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LicenseSpecification {
#[serde(rename = "LicenseConfigurationArn")]
pub license_configuration_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAssociationsForLicenseConfigurationRequest {
#[serde(rename = "LicenseConfigurationArn")]
pub license_configuration_arn: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListAssociationsForLicenseConfigurationResponse {
#[serde(rename = "LicenseConfigurationAssociations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_associations: Option<Vec<LicenseConfigurationAssociation>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListLicenseConfigurationsRequest {
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<Vec<Filter>>,
#[serde(rename = "LicenseConfigurationArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_arns: Option<Vec<String>>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListLicenseConfigurationsResponse {
#[serde(rename = "LicenseConfigurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configurations: Option<Vec<LicenseConfiguration>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListLicenseSpecificationsForResourceRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListLicenseSpecificationsForResourceResponse {
#[serde(rename = "LicenseSpecifications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_specifications: Option<Vec<LicenseSpecification>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListResourceInventoryRequest {
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<Vec<InventoryFilter>>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListResourceInventoryResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResourceInventoryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_inventory_list: Option<Vec<ResourceInventory>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListUsageForLicenseConfigurationRequest {
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<Vec<Filter>>,
#[serde(rename = "LicenseConfigurationArn")]
pub license_configuration_arn: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListUsageForLicenseConfigurationResponse {
#[serde(rename = "LicenseConfigurationUsageList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_usage_list: Option<Vec<LicenseConfigurationUsage>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ManagedResourceSummary {
#[serde(rename = "AssociationCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub association_count: Option<i64>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct OrganizationConfiguration {
#[serde(rename = "EnableIntegration")]
pub enable_integration: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceInventory {
#[serde(rename = "Platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "PlatformVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform_version: Option<String>,
#[serde(rename = "ResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "ResourceOwningAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_owning_account_id: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UntagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateLicenseConfigurationRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "LicenseConfigurationArn")]
pub license_configuration_arn: String,
#[serde(rename = "LicenseConfigurationStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_configuration_status: Option<String>,
#[serde(rename = "LicenseCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_count: Option<i64>,
#[serde(rename = "LicenseCountHardLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_count_hard_limit: Option<bool>,
#[serde(rename = "LicenseRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_rules: Option<Vec<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 UpdateLicenseConfigurationResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateLicenseSpecificationsForResourceRequest {
#[serde(rename = "AddLicenseSpecifications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub add_license_specifications: Option<Vec<LicenseSpecification>>,
#[serde(rename = "RemoveLicenseSpecifications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remove_license_specifications: Option<Vec<LicenseSpecification>>,
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateLicenseSpecificationsForResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateServiceSettingsRequest {
#[serde(rename = "EnableCrossAccountsDiscovery")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_cross_accounts_discovery: Option<bool>,
#[serde(rename = "OrganizationConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_configuration: Option<OrganizationConfiguration>,
#[serde(rename = "S3BucketArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_bucket_arn: Option<String>,
#[serde(rename = "SnsTopicArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sns_topic_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateServiceSettingsResponse {}
#[derive(Debug, PartialEq)]
pub enum CreateLicenseConfigurationError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ResourceLimitExceeded(String),
ServerInternal(String),
}
impl CreateLicenseConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateLicenseConfigurationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateLicenseConfigurationError::AccessDenied(
err.msg,
))
}
"AuthorizationException" => {
return RusotoError::Service(CreateLicenseConfigurationError::Authorization(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(
CreateLicenseConfigurationError::InvalidParameterValue(err.msg),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(
CreateLicenseConfigurationError::RateLimitExceeded(err.msg),
)
}
"ResourceLimitExceededException" => {
return RusotoError::Service(
CreateLicenseConfigurationError::ResourceLimitExceeded(err.msg),
)
}
"ServerInternalException" => {
return RusotoError::Service(CreateLicenseConfigurationError::ServerInternal(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateLicenseConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateLicenseConfigurationError {
fn description(&self) -> &str {
match *self {
CreateLicenseConfigurationError::AccessDenied(ref cause) => cause,
CreateLicenseConfigurationError::Authorization(ref cause) => cause,
CreateLicenseConfigurationError::InvalidParameterValue(ref cause) => cause,
CreateLicenseConfigurationError::RateLimitExceeded(ref cause) => cause,
CreateLicenseConfigurationError::ResourceLimitExceeded(ref cause) => cause,
CreateLicenseConfigurationError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLicenseConfigurationError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl DeleteLicenseConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteLicenseConfigurationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteLicenseConfigurationError::AccessDenied(
err.msg,
))
}
"AuthorizationException" => {
return RusotoError::Service(DeleteLicenseConfigurationError::Authorization(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(
DeleteLicenseConfigurationError::InvalidParameterValue(err.msg),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(
DeleteLicenseConfigurationError::RateLimitExceeded(err.msg),
)
}
"ServerInternalException" => {
return RusotoError::Service(DeleteLicenseConfigurationError::ServerInternal(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteLicenseConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLicenseConfigurationError {
fn description(&self) -> &str {
match *self {
DeleteLicenseConfigurationError::AccessDenied(ref cause) => cause,
DeleteLicenseConfigurationError::Authorization(ref cause) => cause,
DeleteLicenseConfigurationError::InvalidParameterValue(ref cause) => cause,
DeleteLicenseConfigurationError::RateLimitExceeded(ref cause) => cause,
DeleteLicenseConfigurationError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLicenseConfigurationError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl GetLicenseConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLicenseConfigurationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(GetLicenseConfigurationError::AccessDenied(
err.msg,
))
}
"AuthorizationException" => {
return RusotoError::Service(GetLicenseConfigurationError::Authorization(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(
GetLicenseConfigurationError::InvalidParameterValue(err.msg),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(GetLicenseConfigurationError::RateLimitExceeded(
err.msg,
))
}
"ServerInternalException" => {
return RusotoError::Service(GetLicenseConfigurationError::ServerInternal(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLicenseConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLicenseConfigurationError {
fn description(&self) -> &str {
match *self {
GetLicenseConfigurationError::AccessDenied(ref cause) => cause,
GetLicenseConfigurationError::Authorization(ref cause) => cause,
GetLicenseConfigurationError::InvalidParameterValue(ref cause) => cause,
GetLicenseConfigurationError::RateLimitExceeded(ref cause) => cause,
GetLicenseConfigurationError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetServiceSettingsError {
AccessDenied(String),
Authorization(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl GetServiceSettingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetServiceSettingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(GetServiceSettingsError::AccessDenied(err.msg))
}
"AuthorizationException" => {
return RusotoError::Service(GetServiceSettingsError::Authorization(err.msg))
}
"RateLimitExceededException" => {
return RusotoError::Service(GetServiceSettingsError::RateLimitExceeded(
err.msg,
))
}
"ServerInternalException" => {
return RusotoError::Service(GetServiceSettingsError::ServerInternal(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetServiceSettingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetServiceSettingsError {
fn description(&self) -> &str {
match *self {
GetServiceSettingsError::AccessDenied(ref cause) => cause,
GetServiceSettingsError::Authorization(ref cause) => cause,
GetServiceSettingsError::RateLimitExceeded(ref cause) => cause,
GetServiceSettingsError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAssociationsForLicenseConfigurationError {
AccessDenied(String),
Authorization(String),
FilterLimitExceeded(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl ListAssociationsForLicenseConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListAssociationsForLicenseConfigurationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(
ListAssociationsForLicenseConfigurationError::AccessDenied(err.msg),
)
}
"AuthorizationException" => {
return RusotoError::Service(
ListAssociationsForLicenseConfigurationError::Authorization(err.msg),
)
}
"FilterLimitExceededException" => {
return RusotoError::Service(
ListAssociationsForLicenseConfigurationError::FilterLimitExceeded(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
ListAssociationsForLicenseConfigurationError::InvalidParameterValue(
err.msg,
),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(
ListAssociationsForLicenseConfigurationError::RateLimitExceeded(err.msg),
)
}
"ServerInternalException" => {
return RusotoError::Service(
ListAssociationsForLicenseConfigurationError::ServerInternal(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAssociationsForLicenseConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAssociationsForLicenseConfigurationError {
fn description(&self) -> &str {
match *self {
ListAssociationsForLicenseConfigurationError::AccessDenied(ref cause) => cause,
ListAssociationsForLicenseConfigurationError::Authorization(ref cause) => cause,
ListAssociationsForLicenseConfigurationError::FilterLimitExceeded(ref cause) => cause,
ListAssociationsForLicenseConfigurationError::InvalidParameterValue(ref cause) => cause,
ListAssociationsForLicenseConfigurationError::RateLimitExceeded(ref cause) => cause,
ListAssociationsForLicenseConfigurationError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListLicenseConfigurationsError {
AccessDenied(String),
Authorization(String),
FilterLimitExceeded(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl ListLicenseConfigurationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListLicenseConfigurationsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListLicenseConfigurationsError::AccessDenied(
err.msg,
))
}
"AuthorizationException" => {
return RusotoError::Service(ListLicenseConfigurationsError::Authorization(
err.msg,
))
}
"FilterLimitExceededException" => {
return RusotoError::Service(
ListLicenseConfigurationsError::FilterLimitExceeded(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
ListLicenseConfigurationsError::InvalidParameterValue(err.msg),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(ListLicenseConfigurationsError::RateLimitExceeded(
err.msg,
))
}
"ServerInternalException" => {
return RusotoError::Service(ListLicenseConfigurationsError::ServerInternal(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListLicenseConfigurationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListLicenseConfigurationsError {
fn description(&self) -> &str {
match *self {
ListLicenseConfigurationsError::AccessDenied(ref cause) => cause,
ListLicenseConfigurationsError::Authorization(ref cause) => cause,
ListLicenseConfigurationsError::FilterLimitExceeded(ref cause) => cause,
ListLicenseConfigurationsError::InvalidParameterValue(ref cause) => cause,
ListLicenseConfigurationsError::RateLimitExceeded(ref cause) => cause,
ListLicenseConfigurationsError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListLicenseSpecificationsForResourceError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl ListLicenseSpecificationsForResourceError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListLicenseSpecificationsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(
ListLicenseSpecificationsForResourceError::AccessDenied(err.msg),
)
}
"AuthorizationException" => {
return RusotoError::Service(
ListLicenseSpecificationsForResourceError::Authorization(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
ListLicenseSpecificationsForResourceError::InvalidParameterValue(err.msg),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(
ListLicenseSpecificationsForResourceError::RateLimitExceeded(err.msg),
)
}
"ServerInternalException" => {
return RusotoError::Service(
ListLicenseSpecificationsForResourceError::ServerInternal(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListLicenseSpecificationsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListLicenseSpecificationsForResourceError {
fn description(&self) -> &str {
match *self {
ListLicenseSpecificationsForResourceError::AccessDenied(ref cause) => cause,
ListLicenseSpecificationsForResourceError::Authorization(ref cause) => cause,
ListLicenseSpecificationsForResourceError::InvalidParameterValue(ref cause) => cause,
ListLicenseSpecificationsForResourceError::RateLimitExceeded(ref cause) => cause,
ListLicenseSpecificationsForResourceError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListResourceInventoryError {
AccessDenied(String),
Authorization(String),
FailedDependency(String),
FilterLimitExceeded(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl ListResourceInventoryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListResourceInventoryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListResourceInventoryError::AccessDenied(err.msg))
}
"AuthorizationException" => {
return RusotoError::Service(ListResourceInventoryError::Authorization(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(ListResourceInventoryError::FailedDependency(
err.msg,
))
}
"FilterLimitExceededException" => {
return RusotoError::Service(ListResourceInventoryError::FilterLimitExceeded(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(ListResourceInventoryError::InvalidParameterValue(
err.msg,
))
}
"RateLimitExceededException" => {
return RusotoError::Service(ListResourceInventoryError::RateLimitExceeded(
err.msg,
))
}
"ServerInternalException" => {
return RusotoError::Service(ListResourceInventoryError::ServerInternal(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListResourceInventoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListResourceInventoryError {
fn description(&self) -> &str {
match *self {
ListResourceInventoryError::AccessDenied(ref cause) => cause,
ListResourceInventoryError::Authorization(ref cause) => cause,
ListResourceInventoryError::FailedDependency(ref cause) => cause,
ListResourceInventoryError::FilterLimitExceeded(ref cause) => cause,
ListResourceInventoryError::InvalidParameterValue(ref cause) => cause,
ListResourceInventoryError::RateLimitExceeded(ref cause) => cause,
ListResourceInventoryError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListTagsForResourceError::AccessDenied(err.msg))
}
"AuthorizationException" => {
return RusotoError::Service(ListTagsForResourceError::Authorization(err.msg))
}
"InvalidParameterValueException" => {
return RusotoError::Service(ListTagsForResourceError::InvalidParameterValue(
err.msg,
))
}
"RateLimitExceededException" => {
return RusotoError::Service(ListTagsForResourceError::RateLimitExceeded(
err.msg,
))
}
"ServerInternalException" => {
return RusotoError::Service(ListTagsForResourceError::ServerInternal(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::AccessDenied(ref cause) => cause,
ListTagsForResourceError::Authorization(ref cause) => cause,
ListTagsForResourceError::InvalidParameterValue(ref cause) => cause,
ListTagsForResourceError::RateLimitExceeded(ref cause) => cause,
ListTagsForResourceError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUsageForLicenseConfigurationError {
AccessDenied(String),
Authorization(String),
FilterLimitExceeded(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl ListUsageForLicenseConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListUsageForLicenseConfigurationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(
ListUsageForLicenseConfigurationError::AccessDenied(err.msg),
)
}
"AuthorizationException" => {
return RusotoError::Service(
ListUsageForLicenseConfigurationError::Authorization(err.msg),
)
}
"FilterLimitExceededException" => {
return RusotoError::Service(
ListUsageForLicenseConfigurationError::FilterLimitExceeded(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
ListUsageForLicenseConfigurationError::InvalidParameterValue(err.msg),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(
ListUsageForLicenseConfigurationError::RateLimitExceeded(err.msg),
)
}
"ServerInternalException" => {
return RusotoError::Service(
ListUsageForLicenseConfigurationError::ServerInternal(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListUsageForLicenseConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListUsageForLicenseConfigurationError {
fn description(&self) -> &str {
match *self {
ListUsageForLicenseConfigurationError::AccessDenied(ref cause) => cause,
ListUsageForLicenseConfigurationError::Authorization(ref cause) => cause,
ListUsageForLicenseConfigurationError::FilterLimitExceeded(ref cause) => cause,
ListUsageForLicenseConfigurationError::InvalidParameterValue(ref cause) => cause,
ListUsageForLicenseConfigurationError::RateLimitExceeded(ref cause) => cause,
ListUsageForLicenseConfigurationError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(TagResourceError::AccessDenied(err.msg))
}
"AuthorizationException" => {
return RusotoError::Service(TagResourceError::Authorization(err.msg))
}
"InvalidParameterValueException" => {
return RusotoError::Service(TagResourceError::InvalidParameterValue(err.msg))
}
"RateLimitExceededException" => {
return RusotoError::Service(TagResourceError::RateLimitExceeded(err.msg))
}
"ServerInternalException" => {
return RusotoError::Service(TagResourceError::ServerInternal(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::AccessDenied(ref cause) => cause,
TagResourceError::Authorization(ref cause) => cause,
TagResourceError::InvalidParameterValue(ref cause) => cause,
TagResourceError::RateLimitExceeded(ref cause) => cause,
TagResourceError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UntagResourceError::AccessDenied(err.msg))
}
"AuthorizationException" => {
return RusotoError::Service(UntagResourceError::Authorization(err.msg))
}
"InvalidParameterValueException" => {
return RusotoError::Service(UntagResourceError::InvalidParameterValue(err.msg))
}
"RateLimitExceededException" => {
return RusotoError::Service(UntagResourceError::RateLimitExceeded(err.msg))
}
"ServerInternalException" => {
return RusotoError::Service(UntagResourceError::ServerInternal(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::AccessDenied(ref cause) => cause,
UntagResourceError::Authorization(ref cause) => cause,
UntagResourceError::InvalidParameterValue(ref cause) => cause,
UntagResourceError::RateLimitExceeded(ref cause) => cause,
UntagResourceError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateLicenseConfigurationError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl UpdateLicenseConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateLicenseConfigurationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateLicenseConfigurationError::AccessDenied(
err.msg,
))
}
"AuthorizationException" => {
return RusotoError::Service(UpdateLicenseConfigurationError::Authorization(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(
UpdateLicenseConfigurationError::InvalidParameterValue(err.msg),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(
UpdateLicenseConfigurationError::RateLimitExceeded(err.msg),
)
}
"ServerInternalException" => {
return RusotoError::Service(UpdateLicenseConfigurationError::ServerInternal(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateLicenseConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateLicenseConfigurationError {
fn description(&self) -> &str {
match *self {
UpdateLicenseConfigurationError::AccessDenied(ref cause) => cause,
UpdateLicenseConfigurationError::Authorization(ref cause) => cause,
UpdateLicenseConfigurationError::InvalidParameterValue(ref cause) => cause,
UpdateLicenseConfigurationError::RateLimitExceeded(ref cause) => cause,
UpdateLicenseConfigurationError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateLicenseSpecificationsForResourceError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
InvalidResourceState(String),
LicenseUsage(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl UpdateLicenseSpecificationsForResourceError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateLicenseSpecificationsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(
UpdateLicenseSpecificationsForResourceError::AccessDenied(err.msg),
)
}
"AuthorizationException" => {
return RusotoError::Service(
UpdateLicenseSpecificationsForResourceError::Authorization(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
UpdateLicenseSpecificationsForResourceError::InvalidParameterValue(err.msg),
)
}
"InvalidResourceStateException" => {
return RusotoError::Service(
UpdateLicenseSpecificationsForResourceError::InvalidResourceState(err.msg),
)
}
"LicenseUsageException" => {
return RusotoError::Service(
UpdateLicenseSpecificationsForResourceError::LicenseUsage(err.msg),
)
}
"RateLimitExceededException" => {
return RusotoError::Service(
UpdateLicenseSpecificationsForResourceError::RateLimitExceeded(err.msg),
)
}
"ServerInternalException" => {
return RusotoError::Service(
UpdateLicenseSpecificationsForResourceError::ServerInternal(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateLicenseSpecificationsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateLicenseSpecificationsForResourceError {
fn description(&self) -> &str {
match *self {
UpdateLicenseSpecificationsForResourceError::AccessDenied(ref cause) => cause,
UpdateLicenseSpecificationsForResourceError::Authorization(ref cause) => cause,
UpdateLicenseSpecificationsForResourceError::InvalidParameterValue(ref cause) => cause,
UpdateLicenseSpecificationsForResourceError::InvalidResourceState(ref cause) => cause,
UpdateLicenseSpecificationsForResourceError::LicenseUsage(ref cause) => cause,
UpdateLicenseSpecificationsForResourceError::RateLimitExceeded(ref cause) => cause,
UpdateLicenseSpecificationsForResourceError::ServerInternal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateServiceSettingsError {
AccessDenied(String),
Authorization(String),
InvalidParameterValue(String),
RateLimitExceeded(String),
ServerInternal(String),
}
impl UpdateServiceSettingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateServiceSettingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateServiceSettingsError::AccessDenied(err.msg))
}
"AuthorizationException" => {
return RusotoError::Service(UpdateServiceSettingsError::Authorization(err.msg))
}
"InvalidParameterValueException" => {
return RusotoError::Service(UpdateServiceSettingsError::InvalidParameterValue(
err.msg,
))
}
"RateLimitExceededException" => {
return RusotoError::Service(UpdateServiceSettingsError::RateLimitExceeded(
err.msg,
))
}
"ServerInternalException" => {
return RusotoError::Service(UpdateServiceSettingsError::ServerInternal(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateServiceSettingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateServiceSettingsError {
fn description(&self) -> &str {
match *self {
UpdateServiceSettingsError::AccessDenied(ref cause) => cause,
UpdateServiceSettingsError::Authorization(ref cause) => cause,
UpdateServiceSettingsError::InvalidParameterValue(ref cause) => cause,
UpdateServiceSettingsError::RateLimitExceeded(ref cause) => cause,
UpdateServiceSettingsError::ServerInternal(ref cause) => cause,
}
}
}
pub trait LicenseManager {
fn create_license_configuration(
&self,
input: CreateLicenseConfigurationRequest,
) -> RusotoFuture<CreateLicenseConfigurationResponse, CreateLicenseConfigurationError>;
fn delete_license_configuration(
&self,
input: DeleteLicenseConfigurationRequest,
) -> RusotoFuture<DeleteLicenseConfigurationResponse, DeleteLicenseConfigurationError>;
fn get_license_configuration(
&self,
input: GetLicenseConfigurationRequest,
) -> RusotoFuture<GetLicenseConfigurationResponse, GetLicenseConfigurationError>;
fn get_service_settings(
&self,
) -> RusotoFuture<GetServiceSettingsResponse, GetServiceSettingsError>;
fn list_associations_for_license_configuration(
&self,
input: ListAssociationsForLicenseConfigurationRequest,
) -> RusotoFuture<
ListAssociationsForLicenseConfigurationResponse,
ListAssociationsForLicenseConfigurationError,
>;
fn list_license_configurations(
&self,
input: ListLicenseConfigurationsRequest,
) -> RusotoFuture<ListLicenseConfigurationsResponse, ListLicenseConfigurationsError>;
fn list_license_specifications_for_resource(
&self,
input: ListLicenseSpecificationsForResourceRequest,
) -> RusotoFuture<
ListLicenseSpecificationsForResourceResponse,
ListLicenseSpecificationsForResourceError,
>;
fn list_resource_inventory(
&self,
input: ListResourceInventoryRequest,
) -> RusotoFuture<ListResourceInventoryResponse, ListResourceInventoryError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError>;
fn list_usage_for_license_configuration(
&self,
input: ListUsageForLicenseConfigurationRequest,
) -> RusotoFuture<ListUsageForLicenseConfigurationResponse, ListUsageForLicenseConfigurationError>;
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError>;
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError>;
fn update_license_configuration(
&self,
input: UpdateLicenseConfigurationRequest,
) -> RusotoFuture<UpdateLicenseConfigurationResponse, UpdateLicenseConfigurationError>;
fn update_license_specifications_for_resource(
&self,
input: UpdateLicenseSpecificationsForResourceRequest,
) -> RusotoFuture<
UpdateLicenseSpecificationsForResourceResponse,
UpdateLicenseSpecificationsForResourceError,
>;
fn update_service_settings(
&self,
input: UpdateServiceSettingsRequest,
) -> RusotoFuture<UpdateServiceSettingsResponse, UpdateServiceSettingsError>;
}
#[derive(Clone)]
pub struct LicenseManagerClient {
client: Client,
region: region::Region,
}
impl LicenseManagerClient {
pub fn new(region: region::Region) -> LicenseManagerClient {
LicenseManagerClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> LicenseManagerClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
LicenseManagerClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl LicenseManager for LicenseManagerClient {
fn create_license_configuration(
&self,
input: CreateLicenseConfigurationRequest,
) -> RusotoFuture<CreateLicenseConfigurationResponse, CreateLicenseConfigurationError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSLicenseManager.CreateLicenseConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateLicenseConfigurationResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateLicenseConfigurationError::from_response(response))
}))
}
})
}
fn delete_license_configuration(
&self,
input: DeleteLicenseConfigurationRequest,
) -> RusotoFuture<DeleteLicenseConfigurationResponse, DeleteLicenseConfigurationError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSLicenseManager.DeleteLicenseConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteLicenseConfigurationResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteLicenseConfigurationError::from_response(response))
}))
}
})
}
fn get_license_configuration(
&self,
input: GetLicenseConfigurationRequest,
) -> RusotoFuture<GetLicenseConfigurationResponse, GetLicenseConfigurationError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSLicenseManager.GetLicenseConfiguration");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetLicenseConfigurationResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetLicenseConfigurationError::from_response(response))
}))
}
})
}
fn get_service_settings(
&self,
) -> RusotoFuture<GetServiceSettingsResponse, GetServiceSettingsError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSLicenseManager.GetServiceSettings");
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetServiceSettingsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetServiceSettingsError::from_response(response))),
)
}
})
}
fn list_associations_for_license_configuration(
&self,
input: ListAssociationsForLicenseConfigurationRequest,
) -> RusotoFuture<
ListAssociationsForLicenseConfigurationResponse,
ListAssociationsForLicenseConfigurationError,
> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSLicenseManager.ListAssociationsForLicenseConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListAssociationsForLicenseConfigurationResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListAssociationsForLicenseConfigurationError::from_response(
response,
))
}))
}
})
}
fn list_license_configurations(
&self,
input: ListLicenseConfigurationsRequest,
) -> RusotoFuture<ListLicenseConfigurationsResponse, ListLicenseConfigurationsError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSLicenseManager.ListLicenseConfigurations",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListLicenseConfigurationsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListLicenseConfigurationsError::from_response(response))
}))
}
})
}
fn list_license_specifications_for_resource(
&self,
input: ListLicenseSpecificationsForResourceRequest,
) -> RusotoFuture<
ListLicenseSpecificationsForResourceResponse,
ListLicenseSpecificationsForResourceError,
> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSLicenseManager.ListLicenseSpecificationsForResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListLicenseSpecificationsForResourceResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListLicenseSpecificationsForResourceError::from_response(
response,
))
}))
}
})
}
fn list_resource_inventory(
&self,
input: ListResourceInventoryRequest,
) -> RusotoFuture<ListResourceInventoryResponse, ListResourceInventoryError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSLicenseManager.ListResourceInventory");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListResourceInventoryResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListResourceInventoryError::from_response(response))
}),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSLicenseManager.ListTagsForResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn list_usage_for_license_configuration(
&self,
input: ListUsageForLicenseConfigurationRequest,
) -> RusotoFuture<ListUsageForLicenseConfigurationResponse, ListUsageForLicenseConfigurationError>
{
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSLicenseManager.ListUsageForLicenseConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListUsageForLicenseConfigurationResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListUsageForLicenseConfigurationError::from_response(
response,
))
}))
}
})
}
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSLicenseManager.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSLicenseManager.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_license_configuration(
&self,
input: UpdateLicenseConfigurationRequest,
) -> RusotoFuture<UpdateLicenseConfigurationResponse, UpdateLicenseConfigurationError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSLicenseManager.UpdateLicenseConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateLicenseConfigurationResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateLicenseConfigurationError::from_response(response))
}))
}
})
}
fn update_license_specifications_for_resource(
&self,
input: UpdateLicenseSpecificationsForResourceRequest,
) -> RusotoFuture<
UpdateLicenseSpecificationsForResourceResponse,
UpdateLicenseSpecificationsForResourceError,
> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSLicenseManager.UpdateLicenseSpecificationsForResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateLicenseSpecificationsForResourceResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateLicenseSpecificationsForResourceError::from_response(
response,
))
}))
}
})
}
fn update_service_settings(
&self,
input: UpdateServiceSettingsRequest,
) -> RusotoFuture<UpdateServiceSettingsResponse, UpdateServiceSettingsError> {
let mut request = SignedRequest::new("POST", "license-manager", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSLicenseManager.UpdateServiceSettings");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateServiceSettingsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateServiceSettingsError::from_response(response))
}),
)
}
})
}
}