use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::proto;
use rusoto_core::request::HttpResponse;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
impl CostExplorerClient {
fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
let mut request = SignedRequest::new(http_method, "ce", &self.region, request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
request
}
async fn sign_and_dispatch<E>(
&self,
request: SignedRequest,
from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
) -> Result<HttpResponse, RusotoError<E>> {
let mut response = self.client.sign_and_dispatch(request).await?;
if !response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
return Err(from_response(response));
}
Ok(response)
}
}
use serde_json;
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Anomaly {
#[serde(rename = "AnomalyEndDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub anomaly_end_date: Option<String>,
#[serde(rename = "AnomalyId")]
pub anomaly_id: String,
#[serde(rename = "AnomalyScore")]
pub anomaly_score: AnomalyScore,
#[serde(rename = "AnomalyStartDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub anomaly_start_date: Option<String>,
#[serde(rename = "DimensionValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dimension_value: Option<String>,
#[serde(rename = "Feedback")]
#[serde(skip_serializing_if = "Option::is_none")]
pub feedback: Option<String>,
#[serde(rename = "Impact")]
pub impact: Impact,
#[serde(rename = "MonitorArn")]
pub monitor_arn: String,
#[serde(rename = "RootCauses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub root_causes: Option<Vec<RootCause>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct AnomalyDateInterval {
#[serde(rename = "EndDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<String>,
#[serde(rename = "StartDate")]
pub start_date: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct AnomalyMonitor {
#[serde(rename = "CreationDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_date: Option<String>,
#[serde(rename = "DimensionalValueCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dimensional_value_count: Option<i64>,
#[serde(rename = "LastEvaluatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_evaluated_date: Option<String>,
#[serde(rename = "LastUpdatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_date: Option<String>,
#[serde(rename = "MonitorArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor_arn: Option<String>,
#[serde(rename = "MonitorDimension")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor_dimension: Option<String>,
#[serde(rename = "MonitorName")]
pub monitor_name: String,
#[serde(rename = "MonitorSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor_specification: Option<Expression>,
#[serde(rename = "MonitorType")]
pub monitor_type: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AnomalyScore {
#[serde(rename = "CurrentScore")]
pub current_score: f64,
#[serde(rename = "MaxScore")]
pub max_score: f64,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct AnomalySubscription {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "Frequency")]
pub frequency: String,
#[serde(rename = "MonitorArnList")]
pub monitor_arn_list: Vec<String>,
#[serde(rename = "Subscribers")]
pub subscribers: Vec<Subscriber>,
#[serde(rename = "SubscriptionArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscription_arn: Option<String>,
#[serde(rename = "SubscriptionName")]
pub subscription_name: String,
#[serde(rename = "Threshold")]
pub threshold: f64,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CostCategory {
#[serde(rename = "CostCategoryArn")]
pub cost_category_arn: String,
#[serde(rename = "EffectiveEnd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_end: Option<String>,
#[serde(rename = "EffectiveStart")]
pub effective_start: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "ProcessingStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub processing_status: Option<Vec<CostCategoryProcessingStatus>>,
#[serde(rename = "RuleVersion")]
pub rule_version: String,
#[serde(rename = "Rules")]
pub rules: Vec<CostCategoryRule>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CostCategoryProcessingStatus {
#[serde(rename = "Component")]
#[serde(skip_serializing_if = "Option::is_none")]
pub component: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CostCategoryReference {
#[serde(rename = "CostCategoryArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost_category_arn: Option<String>,
#[serde(rename = "EffectiveEnd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_end: Option<String>,
#[serde(rename = "EffectiveStart")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_start: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "NumberOfRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_rules: Option<i64>,
#[serde(rename = "ProcessingStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub processing_status: Option<Vec<CostCategoryProcessingStatus>>,
#[serde(rename = "Values")]
#[serde(skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct CostCategoryRule {
#[serde(rename = "Rule")]
pub rule: Expression,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct CostCategoryValues {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "MatchOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub match_options: Option<Vec<String>>,
#[serde(rename = "Values")]
#[serde(skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Coverage {
#[serde(rename = "CoverageCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage_cost: Option<CoverageCost>,
#[serde(rename = "CoverageHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage_hours: Option<CoverageHours>,
#[serde(rename = "CoverageNormalizedUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage_normalized_units: Option<CoverageNormalizedUnits>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CoverageByTime {
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<ReservationCoverageGroup>>,
#[serde(rename = "TimePeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_period: Option<DateInterval>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<Coverage>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CoverageCost {
#[serde(rename = "OnDemandCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand_cost: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CoverageHours {
#[serde(rename = "CoverageHoursPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage_hours_percentage: Option<String>,
#[serde(rename = "OnDemandHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand_hours: Option<String>,
#[serde(rename = "ReservedHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reserved_hours: Option<String>,
#[serde(rename = "TotalRunningHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_running_hours: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CoverageNormalizedUnits {
#[serde(rename = "CoverageNormalizedUnitsPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage_normalized_units_percentage: Option<String>,
#[serde(rename = "OnDemandNormalizedUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand_normalized_units: Option<String>,
#[serde(rename = "ReservedNormalizedUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reserved_normalized_units: Option<String>,
#[serde(rename = "TotalRunningNormalizedUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_running_normalized_units: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateAnomalyMonitorRequest {
#[serde(rename = "AnomalyMonitor")]
pub anomaly_monitor: AnomalyMonitor,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateAnomalyMonitorResponse {
#[serde(rename = "MonitorArn")]
pub monitor_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateAnomalySubscriptionRequest {
#[serde(rename = "AnomalySubscription")]
pub anomaly_subscription: AnomalySubscription,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateAnomalySubscriptionResponse {
#[serde(rename = "SubscriptionArn")]
pub subscription_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateCostCategoryDefinitionRequest {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "RuleVersion")]
pub rule_version: String,
#[serde(rename = "Rules")]
pub rules: Vec<CostCategoryRule>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateCostCategoryDefinitionResponse {
#[serde(rename = "CostCategoryArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost_category_arn: Option<String>,
#[serde(rename = "EffectiveStart")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_start: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CurrentInstance {
#[serde(rename = "CurrencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
#[serde(rename = "InstanceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_name: Option<String>,
#[serde(rename = "MonthlyCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monthly_cost: Option<String>,
#[serde(rename = "OnDemandHoursInLookbackPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand_hours_in_lookback_period: Option<String>,
#[serde(rename = "ReservationCoveredHoursInLookbackPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reservation_covered_hours_in_lookback_period: Option<String>,
#[serde(rename = "ResourceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_details: Option<ResourceDetails>,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "ResourceUtilization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_utilization: Option<ResourceUtilization>,
#[serde(rename = "SavingsPlansCoveredHoursInLookbackPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_plans_covered_hours_in_lookback_period: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<TagValues>>,
#[serde(rename = "TotalRunningHoursInLookbackPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_running_hours_in_lookback_period: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct DateInterval {
#[serde(rename = "End")]
pub end: String,
#[serde(rename = "Start")]
pub start: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteAnomalyMonitorRequest {
#[serde(rename = "MonitorArn")]
pub monitor_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteAnomalyMonitorResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteAnomalySubscriptionRequest {
#[serde(rename = "SubscriptionArn")]
pub subscription_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteAnomalySubscriptionResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteCostCategoryDefinitionRequest {
#[serde(rename = "CostCategoryArn")]
pub cost_category_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteCostCategoryDefinitionResponse {
#[serde(rename = "CostCategoryArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost_category_arn: Option<String>,
#[serde(rename = "EffectiveEnd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_end: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeCostCategoryDefinitionRequest {
#[serde(rename = "CostCategoryArn")]
pub cost_category_arn: String,
#[serde(rename = "EffectiveOn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_on: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeCostCategoryDefinitionResponse {
#[serde(rename = "CostCategory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost_category: Option<CostCategory>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct DimensionValues {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "MatchOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub match_options: Option<Vec<String>>,
#[serde(rename = "Values")]
#[serde(skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DimensionValuesWithAttributes {
#[serde(rename = "Attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EBSResourceUtilization {
#[serde(rename = "EbsReadBytesPerSecond")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_read_bytes_per_second: Option<String>,
#[serde(rename = "EbsReadOpsPerSecond")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_read_ops_per_second: Option<String>,
#[serde(rename = "EbsWriteBytesPerSecond")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_write_bytes_per_second: Option<String>,
#[serde(rename = "EbsWriteOpsPerSecond")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_write_ops_per_second: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EC2InstanceDetails {
#[serde(rename = "AvailabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "CurrentGeneration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_generation: Option<bool>,
#[serde(rename = "Family")]
#[serde(skip_serializing_if = "Option::is_none")]
pub family: Option<String>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "Platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "SizeFlexEligible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_flex_eligible: Option<bool>,
#[serde(rename = "Tenancy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tenancy: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EC2ResourceDetails {
#[serde(rename = "HourlyOnDemandRate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hourly_on_demand_rate: Option<String>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "Memory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory: Option<String>,
#[serde(rename = "NetworkPerformance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_performance: Option<String>,
#[serde(rename = "Platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "Sku")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sku: Option<String>,
#[serde(rename = "Storage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage: Option<String>,
#[serde(rename = "Vcpu")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vcpu: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EC2ResourceUtilization {
#[serde(rename = "EBSResourceUtilization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_resource_utilization: Option<EBSResourceUtilization>,
#[serde(rename = "MaxCpuUtilizationPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_cpu_utilization_percentage: Option<String>,
#[serde(rename = "MaxMemoryUtilizationPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_memory_utilization_percentage: Option<String>,
#[serde(rename = "MaxStorageUtilizationPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_storage_utilization_percentage: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct EC2Specification {
#[serde(rename = "OfferingClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_class: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ESInstanceDetails {
#[serde(rename = "CurrentGeneration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_generation: Option<bool>,
#[serde(rename = "InstanceClass")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_class: Option<String>,
#[serde(rename = "InstanceSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_size: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "SizeFlexEligible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_flex_eligible: Option<bool>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ElastiCacheInstanceDetails {
#[serde(rename = "CurrentGeneration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_generation: Option<bool>,
#[serde(rename = "Family")]
#[serde(skip_serializing_if = "Option::is_none")]
pub family: Option<String>,
#[serde(rename = "NodeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_type: Option<String>,
#[serde(rename = "ProductDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_description: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "SizeFlexEligible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_flex_eligible: Option<bool>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Expression {
#[serde(rename = "And")]
#[serde(skip_serializing_if = "Option::is_none")]
pub and: Option<Vec<Expression>>,
#[serde(rename = "CostCategories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost_categories: Option<CostCategoryValues>,
#[serde(rename = "Dimensions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dimensions: Option<DimensionValues>,
#[serde(rename = "Not")]
#[serde(skip_serializing_if = "Option::is_none")]
pub not: Box<Option<Expression>>,
#[serde(rename = "Or")]
#[serde(skip_serializing_if = "Option::is_none")]
pub or: Option<Vec<Expression>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<TagValues>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ForecastResult {
#[serde(rename = "MeanValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mean_value: Option<String>,
#[serde(rename = "PredictionIntervalLowerBound")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prediction_interval_lower_bound: Option<String>,
#[serde(rename = "PredictionIntervalUpperBound")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prediction_interval_upper_bound: Option<String>,
#[serde(rename = "TimePeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_period: Option<DateInterval>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetAnomaliesRequest {
#[serde(rename = "DateInterval")]
pub date_interval: AnomalyDateInterval,
#[serde(rename = "Feedback")]
#[serde(skip_serializing_if = "Option::is_none")]
pub feedback: Option<String>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "MonitorArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor_arn: Option<String>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "TotalImpact")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_impact: Option<TotalImpactFilter>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetAnomaliesResponse {
#[serde(rename = "Anomalies")]
pub anomalies: Vec<Anomaly>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetAnomalyMonitorsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "MonitorArnList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor_arn_list: Option<Vec<String>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetAnomalyMonitorsResponse {
#[serde(rename = "AnomalyMonitors")]
pub anomaly_monitors: Vec<AnomalyMonitor>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetAnomalySubscriptionsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "MonitorArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor_arn: Option<String>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "SubscriptionArnList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscription_arn_list: Option<Vec<String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetAnomalySubscriptionsResponse {
#[serde(rename = "AnomalySubscriptions")]
pub anomaly_subscriptions: Vec<AnomalySubscription>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetCostAndUsageRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "Granularity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub granularity: Option<String>,
#[serde(rename = "GroupBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by: Option<Vec<GroupDefinition>>,
#[serde(rename = "Metrics")]
pub metrics: Vec<String>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetCostAndUsageResponse {
#[serde(rename = "GroupDefinitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_definitions: Option<Vec<GroupDefinition>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ResultsByTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub results_by_time: Option<Vec<ResultByTime>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetCostAndUsageWithResourcesRequest {
#[serde(rename = "Filter")]
pub filter: Expression,
#[serde(rename = "Granularity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub granularity: Option<String>,
#[serde(rename = "GroupBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by: Option<Vec<GroupDefinition>>,
#[serde(rename = "Metrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metrics: Option<Vec<String>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetCostAndUsageWithResourcesResponse {
#[serde(rename = "GroupDefinitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_definitions: Option<Vec<GroupDefinition>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ResultsByTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub results_by_time: Option<Vec<ResultByTime>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetCostForecastRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "Granularity")]
pub granularity: String,
#[serde(rename = "Metric")]
pub metric: String,
#[serde(rename = "PredictionIntervalLevel")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prediction_interval_level: Option<i64>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetCostForecastResponse {
#[serde(rename = "ForecastResultsByTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub forecast_results_by_time: Option<Vec<ForecastResult>>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<MetricValue>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetDimensionValuesRequest {
#[serde(rename = "Context")]
#[serde(skip_serializing_if = "Option::is_none")]
pub context: Option<String>,
#[serde(rename = "Dimension")]
pub dimension: String,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "SearchString")]
#[serde(skip_serializing_if = "Option::is_none")]
pub search_string: Option<String>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetDimensionValuesResponse {
#[serde(rename = "DimensionValues")]
pub dimension_values: Vec<DimensionValuesWithAttributes>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ReturnSize")]
pub return_size: i64,
#[serde(rename = "TotalSize")]
pub total_size: i64,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetReservationCoverageRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "Granularity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub granularity: Option<String>,
#[serde(rename = "GroupBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by: Option<Vec<GroupDefinition>>,
#[serde(rename = "Metrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metrics: Option<Vec<String>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetReservationCoverageResponse {
#[serde(rename = "CoveragesByTime")]
pub coverages_by_time: Vec<CoverageByTime>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<Coverage>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetReservationPurchaseRecommendationRequest {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "AccountScope")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_scope: Option<String>,
#[serde(rename = "LookbackPeriodInDays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lookback_period_in_days: Option<String>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PaymentOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_option: Option<String>,
#[serde(rename = "Service")]
pub service: String,
#[serde(rename = "ServiceSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_specification: Option<ServiceSpecification>,
#[serde(rename = "TermInYears")]
#[serde(skip_serializing_if = "Option::is_none")]
pub term_in_years: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetReservationPurchaseRecommendationResponse {
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<ReservationPurchaseRecommendationMetadata>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "Recommendations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommendations: Option<Vec<ReservationPurchaseRecommendation>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetReservationUtilizationRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "Granularity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub granularity: Option<String>,
#[serde(rename = "GroupBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by: Option<Vec<GroupDefinition>>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetReservationUtilizationResponse {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<ReservationAggregates>,
#[serde(rename = "UtilizationsByTime")]
pub utilizations_by_time: Vec<UtilizationByTime>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetRightsizingRecommendationRequest {
#[serde(rename = "Configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<RightsizingRecommendationConfiguration>,
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "Service")]
pub service: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetRightsizingRecommendationResponse {
#[serde(rename = "Configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<RightsizingRecommendationConfiguration>,
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<RightsizingRecommendationMetadata>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "RightsizingRecommendations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rightsizing_recommendations: Option<Vec<RightsizingRecommendation>>,
#[serde(rename = "Summary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub summary: Option<RightsizingRecommendationSummary>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetSavingsPlansCoverageRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "Granularity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub granularity: Option<String>,
#[serde(rename = "GroupBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by: Option<Vec<GroupDefinition>>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "Metrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metrics: Option<Vec<String>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetSavingsPlansCoverageResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SavingsPlansCoverages")]
pub savings_plans_coverages: Vec<SavingsPlansCoverage>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetSavingsPlansPurchaseRecommendationRequest {
#[serde(rename = "AccountScope")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_scope: Option<String>,
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "LookbackPeriodInDays")]
pub lookback_period_in_days: String,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "PageSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page_size: Option<i64>,
#[serde(rename = "PaymentOption")]
pub payment_option: String,
#[serde(rename = "SavingsPlansType")]
pub savings_plans_type: String,
#[serde(rename = "TermInYears")]
pub term_in_years: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetSavingsPlansPurchaseRecommendationResponse {
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<SavingsPlansPurchaseRecommendationMetadata>,
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "SavingsPlansPurchaseRecommendation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_plans_purchase_recommendation: Option<SavingsPlansPurchaseRecommendation>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetSavingsPlansUtilizationDetailsRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[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 = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetSavingsPlansUtilizationDetailsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SavingsPlansUtilizationDetails")]
pub savings_plans_utilization_details: Vec<SavingsPlansUtilizationDetail>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<SavingsPlansUtilizationAggregates>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetSavingsPlansUtilizationRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "Granularity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub granularity: Option<String>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetSavingsPlansUtilizationResponse {
#[serde(rename = "SavingsPlansUtilizationsByTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_plans_utilizations_by_time: Option<Vec<SavingsPlansUtilizationByTime>>,
#[serde(rename = "Total")]
pub total: SavingsPlansUtilizationAggregates,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetTagsRequest {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "SearchString")]
#[serde(skip_serializing_if = "Option::is_none")]
pub search_string: Option<String>,
#[serde(rename = "TagKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_key: Option<String>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetTagsResponse {
#[serde(rename = "NextPageToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_page_token: Option<String>,
#[serde(rename = "ReturnSize")]
pub return_size: i64,
#[serde(rename = "Tags")]
pub tags: Vec<String>,
#[serde(rename = "TotalSize")]
pub total_size: i64,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetUsageForecastRequest {
#[serde(rename = "Filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<Expression>,
#[serde(rename = "Granularity")]
pub granularity: String,
#[serde(rename = "Metric")]
pub metric: String,
#[serde(rename = "PredictionIntervalLevel")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prediction_interval_level: Option<i64>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetUsageForecastResponse {
#[serde(rename = "ForecastResultsByTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub forecast_results_by_time: Option<Vec<ForecastResult>>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<MetricValue>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Group {
#[serde(rename = "Keys")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keys: Option<Vec<String>>,
#[serde(rename = "Metrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metrics: Option<::std::collections::HashMap<String, MetricValue>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct GroupDefinition {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Impact {
#[serde(rename = "MaxImpact")]
pub max_impact: f64,
#[serde(rename = "TotalImpact")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_impact: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct InstanceDetails {
#[serde(rename = "EC2InstanceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec2_instance_details: Option<EC2InstanceDetails>,
#[serde(rename = "ESInstanceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub es_instance_details: Option<ESInstanceDetails>,
#[serde(rename = "ElastiCacheInstanceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub elasti_cache_instance_details: Option<ElastiCacheInstanceDetails>,
#[serde(rename = "RDSInstanceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rds_instance_details: Option<RDSInstanceDetails>,
#[serde(rename = "RedshiftInstanceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub redshift_instance_details: Option<RedshiftInstanceDetails>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListCostCategoryDefinitionsRequest {
#[serde(rename = "EffectiveOn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_on: Option<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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListCostCategoryDefinitionsResponse {
#[serde(rename = "CostCategoryReferences")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost_category_references: Option<Vec<CostCategoryReference>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct MetricValue {
#[serde(rename = "Amount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<String>,
#[serde(rename = "Unit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ModifyRecommendationDetail {
#[serde(rename = "TargetInstances")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_instances: Option<Vec<TargetInstance>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ProvideAnomalyFeedbackRequest {
#[serde(rename = "AnomalyId")]
pub anomaly_id: String,
#[serde(rename = "Feedback")]
pub feedback: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ProvideAnomalyFeedbackResponse {
#[serde(rename = "AnomalyId")]
pub anomaly_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RDSInstanceDetails {
#[serde(rename = "CurrentGeneration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_generation: Option<bool>,
#[serde(rename = "DatabaseEdition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub database_edition: Option<String>,
#[serde(rename = "DatabaseEngine")]
#[serde(skip_serializing_if = "Option::is_none")]
pub database_engine: Option<String>,
#[serde(rename = "DeploymentOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deployment_option: Option<String>,
#[serde(rename = "Family")]
#[serde(skip_serializing_if = "Option::is_none")]
pub family: Option<String>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "LicenseModel")]
#[serde(skip_serializing_if = "Option::is_none")]
pub license_model: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "SizeFlexEligible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_flex_eligible: Option<bool>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RedshiftInstanceDetails {
#[serde(rename = "CurrentGeneration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_generation: Option<bool>,
#[serde(rename = "Family")]
#[serde(skip_serializing_if = "Option::is_none")]
pub family: Option<String>,
#[serde(rename = "NodeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_type: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "SizeFlexEligible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_flex_eligible: Option<bool>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ReservationAggregates {
#[serde(rename = "AmortizedRecurringFee")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amortized_recurring_fee: Option<String>,
#[serde(rename = "AmortizedUpfrontFee")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amortized_upfront_fee: Option<String>,
#[serde(rename = "NetRISavings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub net_ri_savings: Option<String>,
#[serde(rename = "OnDemandCostOfRIHoursUsed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand_cost_of_ri_hours_used: Option<String>,
#[serde(rename = "PurchasedHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub purchased_hours: Option<String>,
#[serde(rename = "PurchasedUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub purchased_units: Option<String>,
#[serde(rename = "TotalActualHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_actual_hours: Option<String>,
#[serde(rename = "TotalActualUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_actual_units: Option<String>,
#[serde(rename = "TotalAmortizedFee")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_amortized_fee: Option<String>,
#[serde(rename = "TotalPotentialRISavings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_potential_ri_savings: Option<String>,
#[serde(rename = "UnusedHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unused_hours: Option<String>,
#[serde(rename = "UnusedUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unused_units: Option<String>,
#[serde(rename = "UtilizationPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub utilization_percentage: Option<String>,
#[serde(rename = "UtilizationPercentageInUnits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub utilization_percentage_in_units: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ReservationCoverageGroup {
#[serde(rename = "Attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Coverage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage: Option<Coverage>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ReservationPurchaseRecommendation {
#[serde(rename = "AccountScope")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_scope: Option<String>,
#[serde(rename = "LookbackPeriodInDays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lookback_period_in_days: Option<String>,
#[serde(rename = "PaymentOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_option: Option<String>,
#[serde(rename = "RecommendationDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommendation_details: Option<Vec<ReservationPurchaseRecommendationDetail>>,
#[serde(rename = "RecommendationSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommendation_summary: Option<ReservationPurchaseRecommendationSummary>,
#[serde(rename = "ServiceSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_specification: Option<ServiceSpecification>,
#[serde(rename = "TermInYears")]
#[serde(skip_serializing_if = "Option::is_none")]
pub term_in_years: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ReservationPurchaseRecommendationDetail {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "AverageNormalizedUnitsUsedPerHour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average_normalized_units_used_per_hour: Option<String>,
#[serde(rename = "AverageNumberOfInstancesUsedPerHour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average_number_of_instances_used_per_hour: Option<String>,
#[serde(rename = "AverageUtilization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average_utilization: Option<String>,
#[serde(rename = "CurrencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
#[serde(rename = "EstimatedBreakEvenInMonths")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_break_even_in_months: Option<String>,
#[serde(rename = "EstimatedMonthlyOnDemandCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_monthly_on_demand_cost: Option<String>,
#[serde(rename = "EstimatedMonthlySavingsAmount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_monthly_savings_amount: Option<String>,
#[serde(rename = "EstimatedMonthlySavingsPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_monthly_savings_percentage: Option<String>,
#[serde(rename = "EstimatedReservationCostForLookbackPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_reservation_cost_for_lookback_period: Option<String>,
#[serde(rename = "InstanceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_details: Option<InstanceDetails>,
#[serde(rename = "MaximumNormalizedUnitsUsedPerHour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum_normalized_units_used_per_hour: Option<String>,
#[serde(rename = "MaximumNumberOfInstancesUsedPerHour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum_number_of_instances_used_per_hour: Option<String>,
#[serde(rename = "MinimumNormalizedUnitsUsedPerHour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub minimum_normalized_units_used_per_hour: Option<String>,
#[serde(rename = "MinimumNumberOfInstancesUsedPerHour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub minimum_number_of_instances_used_per_hour: Option<String>,
#[serde(rename = "RecommendedNormalizedUnitsToPurchase")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommended_normalized_units_to_purchase: Option<String>,
#[serde(rename = "RecommendedNumberOfInstancesToPurchase")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommended_number_of_instances_to_purchase: Option<String>,
#[serde(rename = "RecurringStandardMonthlyCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recurring_standard_monthly_cost: Option<String>,
#[serde(rename = "UpfrontCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upfront_cost: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ReservationPurchaseRecommendationMetadata {
#[serde(rename = "GenerationTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub generation_timestamp: Option<String>,
#[serde(rename = "RecommendationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommendation_id: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ReservationPurchaseRecommendationSummary {
#[serde(rename = "CurrencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
#[serde(rename = "TotalEstimatedMonthlySavingsAmount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_estimated_monthly_savings_amount: Option<String>,
#[serde(rename = "TotalEstimatedMonthlySavingsPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_estimated_monthly_savings_percentage: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ReservationUtilizationGroup {
#[serde(rename = "Attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Utilization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub utilization: Option<ReservationAggregates>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ResourceDetails {
#[serde(rename = "EC2ResourceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec2_resource_details: Option<EC2ResourceDetails>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ResourceUtilization {
#[serde(rename = "EC2ResourceUtilization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec2_resource_utilization: Option<EC2ResourceUtilization>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ResultByTime {
#[serde(rename = "Estimated")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated: Option<bool>,
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<Group>>,
#[serde(rename = "TimePeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_period: Option<DateInterval>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<::std::collections::HashMap<String, MetricValue>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RightsizingRecommendation {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "CurrentInstance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_instance: Option<CurrentInstance>,
#[serde(rename = "ModifyRecommendationDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub modify_recommendation_detail: Option<ModifyRecommendationDetail>,
#[serde(rename = "RightsizingType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rightsizing_type: Option<String>,
#[serde(rename = "TerminateRecommendationDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub terminate_recommendation_detail: Option<TerminateRecommendationDetail>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct RightsizingRecommendationConfiguration {
#[serde(rename = "BenefitsConsidered")]
pub benefits_considered: bool,
#[serde(rename = "RecommendationTarget")]
pub recommendation_target: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RightsizingRecommendationMetadata {
#[serde(rename = "AdditionalMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_metadata: Option<String>,
#[serde(rename = "GenerationTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub generation_timestamp: Option<String>,
#[serde(rename = "LookbackPeriodInDays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lookback_period_in_days: Option<String>,
#[serde(rename = "RecommendationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommendation_id: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RightsizingRecommendationSummary {
#[serde(rename = "EstimatedTotalMonthlySavingsAmount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_total_monthly_savings_amount: Option<String>,
#[serde(rename = "SavingsCurrencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_currency_code: Option<String>,
#[serde(rename = "SavingsPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_percentage: Option<String>,
#[serde(rename = "TotalRecommendationCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_recommendation_count: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RootCause {
#[serde(rename = "LinkedAccount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub linked_account: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "Service")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[serde(rename = "UsageType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub usage_type: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansAmortizedCommitment {
#[serde(rename = "AmortizedRecurringCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amortized_recurring_commitment: Option<String>,
#[serde(rename = "AmortizedUpfrontCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amortized_upfront_commitment: Option<String>,
#[serde(rename = "TotalAmortizedCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_amortized_commitment: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansCoverage {
#[serde(rename = "Attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Coverage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage: Option<SavingsPlansCoverageData>,
#[serde(rename = "TimePeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_period: Option<DateInterval>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansCoverageData {
#[serde(rename = "CoveragePercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub coverage_percentage: Option<String>,
#[serde(rename = "OnDemandCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand_cost: Option<String>,
#[serde(rename = "SpendCoveredBySavingsPlans")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spend_covered_by_savings_plans: Option<String>,
#[serde(rename = "TotalCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_cost: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansDetails {
#[serde(rename = "InstanceFamily")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_family: Option<String>,
#[serde(rename = "OfferingId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub offering_id: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansPurchaseRecommendation {
#[serde(rename = "AccountScope")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_scope: Option<String>,
#[serde(rename = "LookbackPeriodInDays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lookback_period_in_days: Option<String>,
#[serde(rename = "PaymentOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_option: Option<String>,
#[serde(rename = "SavingsPlansPurchaseRecommendationDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_plans_purchase_recommendation_details:
Option<Vec<SavingsPlansPurchaseRecommendationDetail>>,
#[serde(rename = "SavingsPlansPurchaseRecommendationSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_plans_purchase_recommendation_summary:
Option<SavingsPlansPurchaseRecommendationSummary>,
#[serde(rename = "SavingsPlansType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_plans_type: Option<String>,
#[serde(rename = "TermInYears")]
#[serde(skip_serializing_if = "Option::is_none")]
pub term_in_years: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansPurchaseRecommendationDetail {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "CurrencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
#[serde(rename = "CurrentAverageHourlyOnDemandSpend")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_average_hourly_on_demand_spend: Option<String>,
#[serde(rename = "CurrentMaximumHourlyOnDemandSpend")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_maximum_hourly_on_demand_spend: Option<String>,
#[serde(rename = "CurrentMinimumHourlyOnDemandSpend")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_minimum_hourly_on_demand_spend: Option<String>,
#[serde(rename = "EstimatedAverageUtilization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_average_utilization: Option<String>,
#[serde(rename = "EstimatedMonthlySavingsAmount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_monthly_savings_amount: Option<String>,
#[serde(rename = "EstimatedOnDemandCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_on_demand_cost: Option<String>,
#[serde(rename = "EstimatedOnDemandCostWithCurrentCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_on_demand_cost_with_current_commitment: Option<String>,
#[serde(rename = "EstimatedROI")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_roi: Option<String>,
#[serde(rename = "EstimatedSPCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_sp_cost: Option<String>,
#[serde(rename = "EstimatedSavingsAmount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_savings_amount: Option<String>,
#[serde(rename = "EstimatedSavingsPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_savings_percentage: Option<String>,
#[serde(rename = "HourlyCommitmentToPurchase")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hourly_commitment_to_purchase: Option<String>,
#[serde(rename = "SavingsPlansDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_plans_details: Option<SavingsPlansDetails>,
#[serde(rename = "UpfrontCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upfront_cost: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansPurchaseRecommendationMetadata {
#[serde(rename = "AdditionalMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_metadata: Option<String>,
#[serde(rename = "GenerationTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub generation_timestamp: Option<String>,
#[serde(rename = "RecommendationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommendation_id: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansPurchaseRecommendationSummary {
#[serde(rename = "CurrencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
#[serde(rename = "CurrentOnDemandSpend")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_on_demand_spend: Option<String>,
#[serde(rename = "DailyCommitmentToPurchase")]
#[serde(skip_serializing_if = "Option::is_none")]
pub daily_commitment_to_purchase: Option<String>,
#[serde(rename = "EstimatedMonthlySavingsAmount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_monthly_savings_amount: Option<String>,
#[serde(rename = "EstimatedOnDemandCostWithCurrentCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_on_demand_cost_with_current_commitment: Option<String>,
#[serde(rename = "EstimatedROI")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_roi: Option<String>,
#[serde(rename = "EstimatedSavingsAmount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_savings_amount: Option<String>,
#[serde(rename = "EstimatedSavingsPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_savings_percentage: Option<String>,
#[serde(rename = "EstimatedTotalCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_total_cost: Option<String>,
#[serde(rename = "HourlyCommitmentToPurchase")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hourly_commitment_to_purchase: Option<String>,
#[serde(rename = "TotalRecommendationCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_recommendation_count: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansSavings {
#[serde(rename = "NetSavings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub net_savings: Option<String>,
#[serde(rename = "OnDemandCostEquivalent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand_cost_equivalent: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansUtilization {
#[serde(rename = "TotalCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_commitment: Option<String>,
#[serde(rename = "UnusedCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unused_commitment: Option<String>,
#[serde(rename = "UsedCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub used_commitment: Option<String>,
#[serde(rename = "UtilizationPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub utilization_percentage: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansUtilizationAggregates {
#[serde(rename = "AmortizedCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amortized_commitment: Option<SavingsPlansAmortizedCommitment>,
#[serde(rename = "Savings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings: Option<SavingsPlansSavings>,
#[serde(rename = "Utilization")]
pub utilization: SavingsPlansUtilization,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansUtilizationByTime {
#[serde(rename = "AmortizedCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amortized_commitment: Option<SavingsPlansAmortizedCommitment>,
#[serde(rename = "Savings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings: Option<SavingsPlansSavings>,
#[serde(rename = "TimePeriod")]
pub time_period: DateInterval,
#[serde(rename = "Utilization")]
pub utilization: SavingsPlansUtilization,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SavingsPlansUtilizationDetail {
#[serde(rename = "AmortizedCommitment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amortized_commitment: Option<SavingsPlansAmortizedCommitment>,
#[serde(rename = "Attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Savings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings: Option<SavingsPlansSavings>,
#[serde(rename = "SavingsPlanArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub savings_plan_arn: Option<String>,
#[serde(rename = "Utilization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub utilization: Option<SavingsPlansUtilization>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ServiceSpecification {
#[serde(rename = "EC2Specification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ec2_specification: Option<EC2Specification>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Subscriber {
#[serde(rename = "Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct TagValues {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "MatchOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub match_options: Option<Vec<String>>,
#[serde(rename = "Values")]
#[serde(skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct TargetInstance {
#[serde(rename = "CurrencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
#[serde(rename = "DefaultTargetInstance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_target_instance: Option<bool>,
#[serde(rename = "EstimatedMonthlyCost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_monthly_cost: Option<String>,
#[serde(rename = "EstimatedMonthlySavings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_monthly_savings: Option<String>,
#[serde(rename = "ExpectedResourceUtilization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expected_resource_utilization: Option<ResourceUtilization>,
#[serde(rename = "ResourceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_details: Option<ResourceDetails>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct TerminateRecommendationDetail {
#[serde(rename = "CurrencyCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
#[serde(rename = "EstimatedMonthlySavings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub estimated_monthly_savings: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TotalImpactFilter {
#[serde(rename = "EndValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_value: Option<f64>,
#[serde(rename = "NumericOperator")]
pub numeric_operator: String,
#[serde(rename = "StartValue")]
pub start_value: f64,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateAnomalyMonitorRequest {
#[serde(rename = "MonitorArn")]
pub monitor_arn: String,
#[serde(rename = "MonitorName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor_name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateAnomalyMonitorResponse {
#[serde(rename = "MonitorArn")]
pub monitor_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateAnomalySubscriptionRequest {
#[serde(rename = "Frequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub frequency: Option<String>,
#[serde(rename = "MonitorArnList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor_arn_list: Option<Vec<String>>,
#[serde(rename = "Subscribers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscribers: Option<Vec<Subscriber>>,
#[serde(rename = "SubscriptionArn")]
pub subscription_arn: String,
#[serde(rename = "SubscriptionName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscription_name: Option<String>,
#[serde(rename = "Threshold")]
#[serde(skip_serializing_if = "Option::is_none")]
pub threshold: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateAnomalySubscriptionResponse {
#[serde(rename = "SubscriptionArn")]
pub subscription_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateCostCategoryDefinitionRequest {
#[serde(rename = "CostCategoryArn")]
pub cost_category_arn: String,
#[serde(rename = "RuleVersion")]
pub rule_version: String,
#[serde(rename = "Rules")]
pub rules: Vec<CostCategoryRule>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateCostCategoryDefinitionResponse {
#[serde(rename = "CostCategoryArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cost_category_arn: Option<String>,
#[serde(rename = "EffectiveStart")]
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_start: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UtilizationByTime {
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<ReservationUtilizationGroup>>,
#[serde(rename = "TimePeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_period: Option<DateInterval>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<ReservationAggregates>,
}
#[derive(Debug, PartialEq)]
pub enum CreateAnomalyMonitorError {
LimitExceeded(String),
}
impl CreateAnomalyMonitorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAnomalyMonitorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(CreateAnomalyMonitorError::LimitExceeded(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateAnomalyMonitorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateAnomalyMonitorError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateAnomalyMonitorError {}
#[derive(Debug, PartialEq)]
pub enum CreateAnomalySubscriptionError {
LimitExceeded(String),
UnknownMonitor(String),
}
impl CreateAnomalySubscriptionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAnomalySubscriptionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(CreateAnomalySubscriptionError::LimitExceeded(
err.msg,
))
}
"UnknownMonitorException" => {
return RusotoError::Service(CreateAnomalySubscriptionError::UnknownMonitor(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateAnomalySubscriptionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateAnomalySubscriptionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
CreateAnomalySubscriptionError::UnknownMonitor(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateAnomalySubscriptionError {}
#[derive(Debug, PartialEq)]
pub enum CreateCostCategoryDefinitionError {
LimitExceeded(String),
ServiceQuotaExceeded(String),
}
impl CreateCostCategoryDefinitionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateCostCategoryDefinitionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(CreateCostCategoryDefinitionError::LimitExceeded(
err.msg,
))
}
"ServiceQuotaExceededException" => {
return RusotoError::Service(
CreateCostCategoryDefinitionError::ServiceQuotaExceeded(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateCostCategoryDefinitionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateCostCategoryDefinitionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
CreateCostCategoryDefinitionError::ServiceQuotaExceeded(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for CreateCostCategoryDefinitionError {}
#[derive(Debug, PartialEq)]
pub enum DeleteAnomalyMonitorError {
LimitExceeded(String),
UnknownMonitor(String),
}
impl DeleteAnomalyMonitorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAnomalyMonitorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(DeleteAnomalyMonitorError::LimitExceeded(err.msg))
}
"UnknownMonitorException" => {
return RusotoError::Service(DeleteAnomalyMonitorError::UnknownMonitor(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteAnomalyMonitorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteAnomalyMonitorError::LimitExceeded(ref cause) => write!(f, "{}", cause),
DeleteAnomalyMonitorError::UnknownMonitor(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteAnomalyMonitorError {}
#[derive(Debug, PartialEq)]
pub enum DeleteAnomalySubscriptionError {
LimitExceeded(String),
UnknownSubscription(String),
}
impl DeleteAnomalySubscriptionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAnomalySubscriptionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(DeleteAnomalySubscriptionError::LimitExceeded(
err.msg,
))
}
"UnknownSubscriptionException" => {
return RusotoError::Service(
DeleteAnomalySubscriptionError::UnknownSubscription(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteAnomalySubscriptionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteAnomalySubscriptionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
DeleteAnomalySubscriptionError::UnknownSubscription(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DeleteAnomalySubscriptionError {}
#[derive(Debug, PartialEq)]
pub enum DeleteCostCategoryDefinitionError {
LimitExceeded(String),
ResourceNotFound(String),
}
impl DeleteCostCategoryDefinitionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteCostCategoryDefinitionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(DeleteCostCategoryDefinitionError::LimitExceeded(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DeleteCostCategoryDefinitionError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteCostCategoryDefinitionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteCostCategoryDefinitionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
DeleteCostCategoryDefinitionError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DeleteCostCategoryDefinitionError {}
#[derive(Debug, PartialEq)]
pub enum DescribeCostCategoryDefinitionError {
LimitExceeded(String),
ResourceNotFound(String),
}
impl DescribeCostCategoryDefinitionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeCostCategoryDefinitionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(
DescribeCostCategoryDefinitionError::LimitExceeded(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DescribeCostCategoryDefinitionError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeCostCategoryDefinitionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeCostCategoryDefinitionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
DescribeCostCategoryDefinitionError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeCostCategoryDefinitionError {}
#[derive(Debug, PartialEq)]
pub enum GetAnomaliesError {
InvalidNextToken(String),
LimitExceeded(String),
}
impl GetAnomaliesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAnomaliesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(GetAnomaliesError::InvalidNextToken(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetAnomaliesError::LimitExceeded(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetAnomaliesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetAnomaliesError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetAnomaliesError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetAnomaliesError {}
#[derive(Debug, PartialEq)]
pub enum GetAnomalyMonitorsError {
InvalidNextToken(String),
LimitExceeded(String),
UnknownMonitor(String),
}
impl GetAnomalyMonitorsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAnomalyMonitorsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(GetAnomalyMonitorsError::InvalidNextToken(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetAnomalyMonitorsError::LimitExceeded(err.msg))
}
"UnknownMonitorException" => {
return RusotoError::Service(GetAnomalyMonitorsError::UnknownMonitor(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetAnomalyMonitorsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetAnomalyMonitorsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetAnomalyMonitorsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
GetAnomalyMonitorsError::UnknownMonitor(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetAnomalyMonitorsError {}
#[derive(Debug, PartialEq)]
pub enum GetAnomalySubscriptionsError {
InvalidNextToken(String),
LimitExceeded(String),
UnknownSubscription(String),
}
impl GetAnomalySubscriptionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAnomalySubscriptionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(GetAnomalySubscriptionsError::InvalidNextToken(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(GetAnomalySubscriptionsError::LimitExceeded(
err.msg,
))
}
"UnknownSubscriptionException" => {
return RusotoError::Service(GetAnomalySubscriptionsError::UnknownSubscription(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetAnomalySubscriptionsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetAnomalySubscriptionsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetAnomalySubscriptionsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
GetAnomalySubscriptionsError::UnknownSubscription(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetAnomalySubscriptionsError {}
#[derive(Debug, PartialEq)]
pub enum GetCostAndUsageError {
BillExpiration(String),
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
RequestChanged(String),
}
impl GetCostAndUsageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCostAndUsageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BillExpirationException" => {
return RusotoError::Service(GetCostAndUsageError::BillExpiration(err.msg))
}
"DataUnavailableException" => {
return RusotoError::Service(GetCostAndUsageError::DataUnavailable(err.msg))
}
"InvalidNextTokenException" => {
return RusotoError::Service(GetCostAndUsageError::InvalidNextToken(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetCostAndUsageError::LimitExceeded(err.msg))
}
"RequestChangedException" => {
return RusotoError::Service(GetCostAndUsageError::RequestChanged(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetCostAndUsageError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetCostAndUsageError::BillExpiration(ref cause) => write!(f, "{}", cause),
GetCostAndUsageError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetCostAndUsageError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetCostAndUsageError::LimitExceeded(ref cause) => write!(f, "{}", cause),
GetCostAndUsageError::RequestChanged(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetCostAndUsageError {}
#[derive(Debug, PartialEq)]
pub enum GetCostAndUsageWithResourcesError {
BillExpiration(String),
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
RequestChanged(String),
}
impl GetCostAndUsageWithResourcesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetCostAndUsageWithResourcesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BillExpirationException" => {
return RusotoError::Service(GetCostAndUsageWithResourcesError::BillExpiration(
err.msg,
))
}
"DataUnavailableException" => {
return RusotoError::Service(
GetCostAndUsageWithResourcesError::DataUnavailable(err.msg),
)
}
"InvalidNextTokenException" => {
return RusotoError::Service(
GetCostAndUsageWithResourcesError::InvalidNextToken(err.msg),
)
}
"LimitExceededException" => {
return RusotoError::Service(GetCostAndUsageWithResourcesError::LimitExceeded(
err.msg,
))
}
"RequestChangedException" => {
return RusotoError::Service(GetCostAndUsageWithResourcesError::RequestChanged(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetCostAndUsageWithResourcesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetCostAndUsageWithResourcesError::BillExpiration(ref cause) => write!(f, "{}", cause),
GetCostAndUsageWithResourcesError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetCostAndUsageWithResourcesError::InvalidNextToken(ref cause) => {
write!(f, "{}", cause)
}
GetCostAndUsageWithResourcesError::LimitExceeded(ref cause) => write!(f, "{}", cause),
GetCostAndUsageWithResourcesError::RequestChanged(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetCostAndUsageWithResourcesError {}
#[derive(Debug, PartialEq)]
pub enum GetCostForecastError {
DataUnavailable(String),
LimitExceeded(String),
}
impl GetCostForecastError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCostForecastError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataUnavailableException" => {
return RusotoError::Service(GetCostForecastError::DataUnavailable(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetCostForecastError::LimitExceeded(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetCostForecastError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetCostForecastError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetCostForecastError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetCostForecastError {}
#[derive(Debug, PartialEq)]
pub enum GetDimensionValuesError {
BillExpiration(String),
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
RequestChanged(String),
}
impl GetDimensionValuesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDimensionValuesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BillExpirationException" => {
return RusotoError::Service(GetDimensionValuesError::BillExpiration(err.msg))
}
"DataUnavailableException" => {
return RusotoError::Service(GetDimensionValuesError::DataUnavailable(err.msg))
}
"InvalidNextTokenException" => {
return RusotoError::Service(GetDimensionValuesError::InvalidNextToken(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetDimensionValuesError::LimitExceeded(err.msg))
}
"RequestChangedException" => {
return RusotoError::Service(GetDimensionValuesError::RequestChanged(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetDimensionValuesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetDimensionValuesError::BillExpiration(ref cause) => write!(f, "{}", cause),
GetDimensionValuesError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetDimensionValuesError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetDimensionValuesError::LimitExceeded(ref cause) => write!(f, "{}", cause),
GetDimensionValuesError::RequestChanged(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetDimensionValuesError {}
#[derive(Debug, PartialEq)]
pub enum GetReservationCoverageError {
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
}
impl GetReservationCoverageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetReservationCoverageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataUnavailableException" => {
return RusotoError::Service(GetReservationCoverageError::DataUnavailable(
err.msg,
))
}
"InvalidNextTokenException" => {
return RusotoError::Service(GetReservationCoverageError::InvalidNextToken(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(GetReservationCoverageError::LimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetReservationCoverageError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetReservationCoverageError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetReservationCoverageError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetReservationCoverageError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetReservationCoverageError {}
#[derive(Debug, PartialEq)]
pub enum GetReservationPurchaseRecommendationError {
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
}
impl GetReservationPurchaseRecommendationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetReservationPurchaseRecommendationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataUnavailableException" => {
return RusotoError::Service(
GetReservationPurchaseRecommendationError::DataUnavailable(err.msg),
)
}
"InvalidNextTokenException" => {
return RusotoError::Service(
GetReservationPurchaseRecommendationError::InvalidNextToken(err.msg),
)
}
"LimitExceededException" => {
return RusotoError::Service(
GetReservationPurchaseRecommendationError::LimitExceeded(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetReservationPurchaseRecommendationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetReservationPurchaseRecommendationError::DataUnavailable(ref cause) => {
write!(f, "{}", cause)
}
GetReservationPurchaseRecommendationError::InvalidNextToken(ref cause) => {
write!(f, "{}", cause)
}
GetReservationPurchaseRecommendationError::LimitExceeded(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for GetReservationPurchaseRecommendationError {}
#[derive(Debug, PartialEq)]
pub enum GetReservationUtilizationError {
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
}
impl GetReservationUtilizationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetReservationUtilizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataUnavailableException" => {
return RusotoError::Service(GetReservationUtilizationError::DataUnavailable(
err.msg,
))
}
"InvalidNextTokenException" => {
return RusotoError::Service(GetReservationUtilizationError::InvalidNextToken(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(GetReservationUtilizationError::LimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetReservationUtilizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetReservationUtilizationError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetReservationUtilizationError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetReservationUtilizationError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetReservationUtilizationError {}
#[derive(Debug, PartialEq)]
pub enum GetRightsizingRecommendationError {
InvalidNextToken(String),
LimitExceeded(String),
}
impl GetRightsizingRecommendationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetRightsizingRecommendationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(
GetRightsizingRecommendationError::InvalidNextToken(err.msg),
)
}
"LimitExceededException" => {
return RusotoError::Service(GetRightsizingRecommendationError::LimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetRightsizingRecommendationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetRightsizingRecommendationError::InvalidNextToken(ref cause) => {
write!(f, "{}", cause)
}
GetRightsizingRecommendationError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetRightsizingRecommendationError {}
#[derive(Debug, PartialEq)]
pub enum GetSavingsPlansCoverageError {
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
}
impl GetSavingsPlansCoverageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetSavingsPlansCoverageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataUnavailableException" => {
return RusotoError::Service(GetSavingsPlansCoverageError::DataUnavailable(
err.msg,
))
}
"InvalidNextTokenException" => {
return RusotoError::Service(GetSavingsPlansCoverageError::InvalidNextToken(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(GetSavingsPlansCoverageError::LimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetSavingsPlansCoverageError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetSavingsPlansCoverageError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetSavingsPlansCoverageError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetSavingsPlansCoverageError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetSavingsPlansCoverageError {}
#[derive(Debug, PartialEq)]
pub enum GetSavingsPlansPurchaseRecommendationError {
InvalidNextToken(String),
LimitExceeded(String),
}
impl GetSavingsPlansPurchaseRecommendationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetSavingsPlansPurchaseRecommendationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(
GetSavingsPlansPurchaseRecommendationError::InvalidNextToken(err.msg),
)
}
"LimitExceededException" => {
return RusotoError::Service(
GetSavingsPlansPurchaseRecommendationError::LimitExceeded(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetSavingsPlansPurchaseRecommendationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetSavingsPlansPurchaseRecommendationError::InvalidNextToken(ref cause) => {
write!(f, "{}", cause)
}
GetSavingsPlansPurchaseRecommendationError::LimitExceeded(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for GetSavingsPlansPurchaseRecommendationError {}
#[derive(Debug, PartialEq)]
pub enum GetSavingsPlansUtilizationError {
DataUnavailable(String),
LimitExceeded(String),
}
impl GetSavingsPlansUtilizationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetSavingsPlansUtilizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataUnavailableException" => {
return RusotoError::Service(GetSavingsPlansUtilizationError::DataUnavailable(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(GetSavingsPlansUtilizationError::LimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetSavingsPlansUtilizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetSavingsPlansUtilizationError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetSavingsPlansUtilizationError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetSavingsPlansUtilizationError {}
#[derive(Debug, PartialEq)]
pub enum GetSavingsPlansUtilizationDetailsError {
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
}
impl GetSavingsPlansUtilizationDetailsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetSavingsPlansUtilizationDetailsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataUnavailableException" => {
return RusotoError::Service(
GetSavingsPlansUtilizationDetailsError::DataUnavailable(err.msg),
)
}
"InvalidNextTokenException" => {
return RusotoError::Service(
GetSavingsPlansUtilizationDetailsError::InvalidNextToken(err.msg),
)
}
"LimitExceededException" => {
return RusotoError::Service(
GetSavingsPlansUtilizationDetailsError::LimitExceeded(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetSavingsPlansUtilizationDetailsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetSavingsPlansUtilizationDetailsError::DataUnavailable(ref cause) => {
write!(f, "{}", cause)
}
GetSavingsPlansUtilizationDetailsError::InvalidNextToken(ref cause) => {
write!(f, "{}", cause)
}
GetSavingsPlansUtilizationDetailsError::LimitExceeded(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for GetSavingsPlansUtilizationDetailsError {}
#[derive(Debug, PartialEq)]
pub enum GetTagsError {
BillExpiration(String),
DataUnavailable(String),
InvalidNextToken(String),
LimitExceeded(String),
RequestChanged(String),
}
impl GetTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTagsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"BillExpirationException" => {
return RusotoError::Service(GetTagsError::BillExpiration(err.msg))
}
"DataUnavailableException" => {
return RusotoError::Service(GetTagsError::DataUnavailable(err.msg))
}
"InvalidNextTokenException" => {
return RusotoError::Service(GetTagsError::InvalidNextToken(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetTagsError::LimitExceeded(err.msg))
}
"RequestChangedException" => {
return RusotoError::Service(GetTagsError::RequestChanged(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetTagsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetTagsError::BillExpiration(ref cause) => write!(f, "{}", cause),
GetTagsError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetTagsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
GetTagsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
GetTagsError::RequestChanged(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetTagsError {}
#[derive(Debug, PartialEq)]
pub enum GetUsageForecastError {
DataUnavailable(String),
LimitExceeded(String),
UnresolvableUsageUnit(String),
}
impl GetUsageForecastError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetUsageForecastError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataUnavailableException" => {
return RusotoError::Service(GetUsageForecastError::DataUnavailable(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetUsageForecastError::LimitExceeded(err.msg))
}
"UnresolvableUsageUnitException" => {
return RusotoError::Service(GetUsageForecastError::UnresolvableUsageUnit(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetUsageForecastError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetUsageForecastError::DataUnavailable(ref cause) => write!(f, "{}", cause),
GetUsageForecastError::LimitExceeded(ref cause) => write!(f, "{}", cause),
GetUsageForecastError::UnresolvableUsageUnit(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetUsageForecastError {}
#[derive(Debug, PartialEq)]
pub enum ListCostCategoryDefinitionsError {
LimitExceeded(String),
}
impl ListCostCategoryDefinitionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListCostCategoryDefinitionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(ListCostCategoryDefinitionsError::LimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListCostCategoryDefinitionsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListCostCategoryDefinitionsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListCostCategoryDefinitionsError {}
#[derive(Debug, PartialEq)]
pub enum ProvideAnomalyFeedbackError {
LimitExceeded(String),
}
impl ProvideAnomalyFeedbackError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ProvideAnomalyFeedbackError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(ProvideAnomalyFeedbackError::LimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ProvideAnomalyFeedbackError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ProvideAnomalyFeedbackError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ProvideAnomalyFeedbackError {}
#[derive(Debug, PartialEq)]
pub enum UpdateAnomalyMonitorError {
LimitExceeded(String),
UnknownMonitor(String),
}
impl UpdateAnomalyMonitorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAnomalyMonitorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(UpdateAnomalyMonitorError::LimitExceeded(err.msg))
}
"UnknownMonitorException" => {
return RusotoError::Service(UpdateAnomalyMonitorError::UnknownMonitor(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateAnomalyMonitorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateAnomalyMonitorError::LimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateAnomalyMonitorError::UnknownMonitor(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateAnomalyMonitorError {}
#[derive(Debug, PartialEq)]
pub enum UpdateAnomalySubscriptionError {
LimitExceeded(String),
UnknownMonitor(String),
UnknownSubscription(String),
}
impl UpdateAnomalySubscriptionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAnomalySubscriptionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(UpdateAnomalySubscriptionError::LimitExceeded(
err.msg,
))
}
"UnknownMonitorException" => {
return RusotoError::Service(UpdateAnomalySubscriptionError::UnknownMonitor(
err.msg,
))
}
"UnknownSubscriptionException" => {
return RusotoError::Service(
UpdateAnomalySubscriptionError::UnknownSubscription(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateAnomalySubscriptionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateAnomalySubscriptionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateAnomalySubscriptionError::UnknownMonitor(ref cause) => write!(f, "{}", cause),
UpdateAnomalySubscriptionError::UnknownSubscription(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for UpdateAnomalySubscriptionError {}
#[derive(Debug, PartialEq)]
pub enum UpdateCostCategoryDefinitionError {
LimitExceeded(String),
ResourceNotFound(String),
ServiceQuotaExceeded(String),
}
impl UpdateCostCategoryDefinitionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateCostCategoryDefinitionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"LimitExceededException" => {
return RusotoError::Service(UpdateCostCategoryDefinitionError::LimitExceeded(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
UpdateCostCategoryDefinitionError::ResourceNotFound(err.msg),
)
}
"ServiceQuotaExceededException" => {
return RusotoError::Service(
UpdateCostCategoryDefinitionError::ServiceQuotaExceeded(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateCostCategoryDefinitionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateCostCategoryDefinitionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateCostCategoryDefinitionError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
UpdateCostCategoryDefinitionError::ServiceQuotaExceeded(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for UpdateCostCategoryDefinitionError {}
#[async_trait]
pub trait CostExplorer {
async fn create_anomaly_monitor(
&self,
input: CreateAnomalyMonitorRequest,
) -> Result<CreateAnomalyMonitorResponse, RusotoError<CreateAnomalyMonitorError>>;
async fn create_anomaly_subscription(
&self,
input: CreateAnomalySubscriptionRequest,
) -> Result<CreateAnomalySubscriptionResponse, RusotoError<CreateAnomalySubscriptionError>>;
async fn create_cost_category_definition(
&self,
input: CreateCostCategoryDefinitionRequest,
) -> Result<CreateCostCategoryDefinitionResponse, RusotoError<CreateCostCategoryDefinitionError>>;
async fn delete_anomaly_monitor(
&self,
input: DeleteAnomalyMonitorRequest,
) -> Result<DeleteAnomalyMonitorResponse, RusotoError<DeleteAnomalyMonitorError>>;
async fn delete_anomaly_subscription(
&self,
input: DeleteAnomalySubscriptionRequest,
) -> Result<DeleteAnomalySubscriptionResponse, RusotoError<DeleteAnomalySubscriptionError>>;
async fn delete_cost_category_definition(
&self,
input: DeleteCostCategoryDefinitionRequest,
) -> Result<DeleteCostCategoryDefinitionResponse, RusotoError<DeleteCostCategoryDefinitionError>>;
async fn describe_cost_category_definition(
&self,
input: DescribeCostCategoryDefinitionRequest,
) -> Result<
DescribeCostCategoryDefinitionResponse,
RusotoError<DescribeCostCategoryDefinitionError>,
>;
async fn get_anomalies(
&self,
input: GetAnomaliesRequest,
) -> Result<GetAnomaliesResponse, RusotoError<GetAnomaliesError>>;
async fn get_anomaly_monitors(
&self,
input: GetAnomalyMonitorsRequest,
) -> Result<GetAnomalyMonitorsResponse, RusotoError<GetAnomalyMonitorsError>>;
async fn get_anomaly_subscriptions(
&self,
input: GetAnomalySubscriptionsRequest,
) -> Result<GetAnomalySubscriptionsResponse, RusotoError<GetAnomalySubscriptionsError>>;
async fn get_cost_and_usage(
&self,
input: GetCostAndUsageRequest,
) -> Result<GetCostAndUsageResponse, RusotoError<GetCostAndUsageError>>;
async fn get_cost_and_usage_with_resources(
&self,
input: GetCostAndUsageWithResourcesRequest,
) -> Result<GetCostAndUsageWithResourcesResponse, RusotoError<GetCostAndUsageWithResourcesError>>;
async fn get_cost_forecast(
&self,
input: GetCostForecastRequest,
) -> Result<GetCostForecastResponse, RusotoError<GetCostForecastError>>;
async fn get_dimension_values(
&self,
input: GetDimensionValuesRequest,
) -> Result<GetDimensionValuesResponse, RusotoError<GetDimensionValuesError>>;
async fn get_reservation_coverage(
&self,
input: GetReservationCoverageRequest,
) -> Result<GetReservationCoverageResponse, RusotoError<GetReservationCoverageError>>;
async fn get_reservation_purchase_recommendation(
&self,
input: GetReservationPurchaseRecommendationRequest,
) -> Result<
GetReservationPurchaseRecommendationResponse,
RusotoError<GetReservationPurchaseRecommendationError>,
>;
async fn get_reservation_utilization(
&self,
input: GetReservationUtilizationRequest,
) -> Result<GetReservationUtilizationResponse, RusotoError<GetReservationUtilizationError>>;
async fn get_rightsizing_recommendation(
&self,
input: GetRightsizingRecommendationRequest,
) -> Result<GetRightsizingRecommendationResponse, RusotoError<GetRightsizingRecommendationError>>;
async fn get_savings_plans_coverage(
&self,
input: GetSavingsPlansCoverageRequest,
) -> Result<GetSavingsPlansCoverageResponse, RusotoError<GetSavingsPlansCoverageError>>;
async fn get_savings_plans_purchase_recommendation(
&self,
input: GetSavingsPlansPurchaseRecommendationRequest,
) -> Result<
GetSavingsPlansPurchaseRecommendationResponse,
RusotoError<GetSavingsPlansPurchaseRecommendationError>,
>;
async fn get_savings_plans_utilization(
&self,
input: GetSavingsPlansUtilizationRequest,
) -> Result<GetSavingsPlansUtilizationResponse, RusotoError<GetSavingsPlansUtilizationError>>;
async fn get_savings_plans_utilization_details(
&self,
input: GetSavingsPlansUtilizationDetailsRequest,
) -> Result<
GetSavingsPlansUtilizationDetailsResponse,
RusotoError<GetSavingsPlansUtilizationDetailsError>,
>;
async fn get_tags(
&self,
input: GetTagsRequest,
) -> Result<GetTagsResponse, RusotoError<GetTagsError>>;
async fn get_usage_forecast(
&self,
input: GetUsageForecastRequest,
) -> Result<GetUsageForecastResponse, RusotoError<GetUsageForecastError>>;
async fn list_cost_category_definitions(
&self,
input: ListCostCategoryDefinitionsRequest,
) -> Result<ListCostCategoryDefinitionsResponse, RusotoError<ListCostCategoryDefinitionsError>>;
async fn provide_anomaly_feedback(
&self,
input: ProvideAnomalyFeedbackRequest,
) -> Result<ProvideAnomalyFeedbackResponse, RusotoError<ProvideAnomalyFeedbackError>>;
async fn update_anomaly_monitor(
&self,
input: UpdateAnomalyMonitorRequest,
) -> Result<UpdateAnomalyMonitorResponse, RusotoError<UpdateAnomalyMonitorError>>;
async fn update_anomaly_subscription(
&self,
input: UpdateAnomalySubscriptionRequest,
) -> Result<UpdateAnomalySubscriptionResponse, RusotoError<UpdateAnomalySubscriptionError>>;
async fn update_cost_category_definition(
&self,
input: UpdateCostCategoryDefinitionRequest,
) -> Result<UpdateCostCategoryDefinitionResponse, RusotoError<UpdateCostCategoryDefinitionError>>;
}
#[derive(Clone)]
pub struct CostExplorerClient {
client: Client,
region: region::Region,
}
impl CostExplorerClient {
pub fn new(region: region::Region) -> CostExplorerClient {
CostExplorerClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> CostExplorerClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
CostExplorerClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> CostExplorerClient {
CostExplorerClient { client, region }
}
}
#[async_trait]
impl CostExplorer for CostExplorerClient {
async fn create_anomaly_monitor(
&self,
input: CreateAnomalyMonitorRequest,
) -> Result<CreateAnomalyMonitorResponse, RusotoError<CreateAnomalyMonitorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.CreateAnomalyMonitor",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateAnomalyMonitorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateAnomalyMonitorResponse, _>()
}
async fn create_anomaly_subscription(
&self,
input: CreateAnomalySubscriptionRequest,
) -> Result<CreateAnomalySubscriptionResponse, RusotoError<CreateAnomalySubscriptionError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.CreateAnomalySubscription",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateAnomalySubscriptionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateAnomalySubscriptionResponse, _>()
}
async fn create_cost_category_definition(
&self,
input: CreateCostCategoryDefinitionRequest,
) -> Result<CreateCostCategoryDefinitionResponse, RusotoError<CreateCostCategoryDefinitionError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.CreateCostCategoryDefinition",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateCostCategoryDefinitionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateCostCategoryDefinitionResponse, _>()
}
async fn delete_anomaly_monitor(
&self,
input: DeleteAnomalyMonitorRequest,
) -> Result<DeleteAnomalyMonitorResponse, RusotoError<DeleteAnomalyMonitorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.DeleteAnomalyMonitor",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteAnomalyMonitorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteAnomalyMonitorResponse, _>()
}
async fn delete_anomaly_subscription(
&self,
input: DeleteAnomalySubscriptionRequest,
) -> Result<DeleteAnomalySubscriptionResponse, RusotoError<DeleteAnomalySubscriptionError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.DeleteAnomalySubscription",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteAnomalySubscriptionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteAnomalySubscriptionResponse, _>()
}
async fn delete_cost_category_definition(
&self,
input: DeleteCostCategoryDefinitionRequest,
) -> Result<DeleteCostCategoryDefinitionResponse, RusotoError<DeleteCostCategoryDefinitionError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.DeleteCostCategoryDefinition",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteCostCategoryDefinitionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteCostCategoryDefinitionResponse, _>()
}
async fn describe_cost_category_definition(
&self,
input: DescribeCostCategoryDefinitionRequest,
) -> Result<
DescribeCostCategoryDefinitionResponse,
RusotoError<DescribeCostCategoryDefinitionError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.DescribeCostCategoryDefinition",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeCostCategoryDefinitionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeCostCategoryDefinitionResponse, _>()
}
async fn get_anomalies(
&self,
input: GetAnomaliesRequest,
) -> Result<GetAnomaliesResponse, RusotoError<GetAnomaliesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSInsightsIndexService.GetAnomalies");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetAnomaliesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetAnomaliesResponse, _>()
}
async fn get_anomaly_monitors(
&self,
input: GetAnomalyMonitorsRequest,
) -> Result<GetAnomalyMonitorsResponse, RusotoError<GetAnomalyMonitorsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSInsightsIndexService.GetAnomalyMonitors");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetAnomalyMonitorsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetAnomalyMonitorsResponse, _>()
}
async fn get_anomaly_subscriptions(
&self,
input: GetAnomalySubscriptionsRequest,
) -> Result<GetAnomalySubscriptionsResponse, RusotoError<GetAnomalySubscriptionsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetAnomalySubscriptions",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetAnomalySubscriptionsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetAnomalySubscriptionsResponse, _>()
}
async fn get_cost_and_usage(
&self,
input: GetCostAndUsageRequest,
) -> Result<GetCostAndUsageResponse, RusotoError<GetCostAndUsageError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSInsightsIndexService.GetCostAndUsage");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetCostAndUsageError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetCostAndUsageResponse, _>()
}
async fn get_cost_and_usage_with_resources(
&self,
input: GetCostAndUsageWithResourcesRequest,
) -> Result<GetCostAndUsageWithResourcesResponse, RusotoError<GetCostAndUsageWithResourcesError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetCostAndUsageWithResources",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetCostAndUsageWithResourcesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetCostAndUsageWithResourcesResponse, _>()
}
async fn get_cost_forecast(
&self,
input: GetCostForecastRequest,
) -> Result<GetCostForecastResponse, RusotoError<GetCostForecastError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSInsightsIndexService.GetCostForecast");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetCostForecastError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetCostForecastResponse, _>()
}
async fn get_dimension_values(
&self,
input: GetDimensionValuesRequest,
) -> Result<GetDimensionValuesResponse, RusotoError<GetDimensionValuesError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSInsightsIndexService.GetDimensionValues");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetDimensionValuesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetDimensionValuesResponse, _>()
}
async fn get_reservation_coverage(
&self,
input: GetReservationCoverageRequest,
) -> Result<GetReservationCoverageResponse, RusotoError<GetReservationCoverageError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetReservationCoverage",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetReservationCoverageError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetReservationCoverageResponse, _>()
}
async fn get_reservation_purchase_recommendation(
&self,
input: GetReservationPurchaseRecommendationRequest,
) -> Result<
GetReservationPurchaseRecommendationResponse,
RusotoError<GetReservationPurchaseRecommendationError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetReservationPurchaseRecommendation",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
GetReservationPurchaseRecommendationError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetReservationPurchaseRecommendationResponse, _>()
}
async fn get_reservation_utilization(
&self,
input: GetReservationUtilizationRequest,
) -> Result<GetReservationUtilizationResponse, RusotoError<GetReservationUtilizationError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetReservationUtilization",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetReservationUtilizationError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetReservationUtilizationResponse, _>()
}
async fn get_rightsizing_recommendation(
&self,
input: GetRightsizingRecommendationRequest,
) -> Result<GetRightsizingRecommendationResponse, RusotoError<GetRightsizingRecommendationError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetRightsizingRecommendation",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetRightsizingRecommendationError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetRightsizingRecommendationResponse, _>()
}
async fn get_savings_plans_coverage(
&self,
input: GetSavingsPlansCoverageRequest,
) -> Result<GetSavingsPlansCoverageResponse, RusotoError<GetSavingsPlansCoverageError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetSavingsPlansCoverage",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetSavingsPlansCoverageError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetSavingsPlansCoverageResponse, _>()
}
async fn get_savings_plans_purchase_recommendation(
&self,
input: GetSavingsPlansPurchaseRecommendationRequest,
) -> Result<
GetSavingsPlansPurchaseRecommendationResponse,
RusotoError<GetSavingsPlansPurchaseRecommendationError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetSavingsPlansPurchaseRecommendation",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
GetSavingsPlansPurchaseRecommendationError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetSavingsPlansPurchaseRecommendationResponse, _>()
}
async fn get_savings_plans_utilization(
&self,
input: GetSavingsPlansUtilizationRequest,
) -> Result<GetSavingsPlansUtilizationResponse, RusotoError<GetSavingsPlansUtilizationError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetSavingsPlansUtilization",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetSavingsPlansUtilizationError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetSavingsPlansUtilizationResponse, _>()
}
async fn get_savings_plans_utilization_details(
&self,
input: GetSavingsPlansUtilizationDetailsRequest,
) -> Result<
GetSavingsPlansUtilizationDetailsResponse,
RusotoError<GetSavingsPlansUtilizationDetailsError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.GetSavingsPlansUtilizationDetails",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
GetSavingsPlansUtilizationDetailsError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetSavingsPlansUtilizationDetailsResponse, _>()
}
async fn get_tags(
&self,
input: GetTagsRequest,
) -> Result<GetTagsResponse, RusotoError<GetTagsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSInsightsIndexService.GetTags");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetTagsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetTagsResponse, _>()
}
async fn get_usage_forecast(
&self,
input: GetUsageForecastRequest,
) -> Result<GetUsageForecastResponse, RusotoError<GetUsageForecastError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSInsightsIndexService.GetUsageForecast");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetUsageForecastError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetUsageForecastResponse, _>()
}
async fn list_cost_category_definitions(
&self,
input: ListCostCategoryDefinitionsRequest,
) -> Result<ListCostCategoryDefinitionsResponse, RusotoError<ListCostCategoryDefinitionsError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.ListCostCategoryDefinitions",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListCostCategoryDefinitionsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListCostCategoryDefinitionsResponse, _>()
}
async fn provide_anomaly_feedback(
&self,
input: ProvideAnomalyFeedbackRequest,
) -> Result<ProvideAnomalyFeedbackResponse, RusotoError<ProvideAnomalyFeedbackError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.ProvideAnomalyFeedback",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ProvideAnomalyFeedbackError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ProvideAnomalyFeedbackResponse, _>()
}
async fn update_anomaly_monitor(
&self,
input: UpdateAnomalyMonitorRequest,
) -> Result<UpdateAnomalyMonitorResponse, RusotoError<UpdateAnomalyMonitorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.UpdateAnomalyMonitor",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateAnomalyMonitorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateAnomalyMonitorResponse, _>()
}
async fn update_anomaly_subscription(
&self,
input: UpdateAnomalySubscriptionRequest,
) -> Result<UpdateAnomalySubscriptionResponse, RusotoError<UpdateAnomalySubscriptionError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.UpdateAnomalySubscription",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateAnomalySubscriptionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateAnomalySubscriptionResponse, _>()
}
async fn update_cost_category_definition(
&self,
input: UpdateCostCategoryDefinitionRequest,
) -> Result<UpdateCostCategoryDefinitionResponse, RusotoError<UpdateCostCategoryDefinitionError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSInsightsIndexService.UpdateCostCategoryDefinition",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateCostCategoryDefinitionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateCostCategoryDefinitionResponse, _>()
}
}