aws_sdk_costoptimizationhub/operation/get_recommendation/
_get_recommendation_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetRecommendationOutput {
pub recommendation_id: ::std::option::Option<::std::string::String>,
pub resource_id: ::std::option::Option<::std::string::String>,
pub resource_arn: ::std::option::Option<::std::string::String>,
pub account_id: ::std::option::Option<::std::string::String>,
pub currency_code: ::std::option::Option<::std::string::String>,
pub recommendation_lookback_period_in_days: ::std::option::Option<i32>,
pub cost_calculation_lookback_period_in_days: ::std::option::Option<i32>,
pub estimated_savings_percentage: ::std::option::Option<f64>,
pub estimated_savings_over_cost_calculation_lookback_period: ::std::option::Option<f64>,
pub current_resource_type: ::std::option::Option<crate::types::ResourceType>,
pub recommended_resource_type: ::std::option::Option<crate::types::ResourceType>,
pub region: ::std::option::Option<::std::string::String>,
pub source: ::std::option::Option<crate::types::Source>,
pub last_refresh_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub estimated_monthly_savings: ::std::option::Option<f64>,
pub estimated_monthly_cost: ::std::option::Option<f64>,
pub implementation_effort: ::std::option::Option<crate::types::ImplementationEffort>,
pub restart_needed: ::std::option::Option<bool>,
pub action_type: ::std::option::Option<crate::types::ActionType>,
pub rollback_possible: ::std::option::Option<bool>,
pub current_resource_details: ::std::option::Option<crate::types::ResourceDetails>,
pub recommended_resource_details: ::std::option::Option<crate::types::ResourceDetails>,
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
_request_id: Option<String>,
}
impl GetRecommendationOutput {
pub fn recommendation_id(&self) -> ::std::option::Option<&str> {
self.recommendation_id.as_deref()
}
pub fn resource_id(&self) -> ::std::option::Option<&str> {
self.resource_id.as_deref()
}
pub fn resource_arn(&self) -> ::std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn account_id(&self) -> ::std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn currency_code(&self) -> ::std::option::Option<&str> {
self.currency_code.as_deref()
}
pub fn recommendation_lookback_period_in_days(&self) -> ::std::option::Option<i32> {
self.recommendation_lookback_period_in_days
}
pub fn cost_calculation_lookback_period_in_days(&self) -> ::std::option::Option<i32> {
self.cost_calculation_lookback_period_in_days
}
pub fn estimated_savings_percentage(&self) -> ::std::option::Option<f64> {
self.estimated_savings_percentage
}
pub fn estimated_savings_over_cost_calculation_lookback_period(&self) -> ::std::option::Option<f64> {
self.estimated_savings_over_cost_calculation_lookback_period
}
pub fn current_resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
self.current_resource_type.as_ref()
}
pub fn recommended_resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
self.recommended_resource_type.as_ref()
}
pub fn region(&self) -> ::std::option::Option<&str> {
self.region.as_deref()
}
pub fn source(&self) -> ::std::option::Option<&crate::types::Source> {
self.source.as_ref()
}
pub fn last_refresh_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_refresh_timestamp.as_ref()
}
pub fn estimated_monthly_savings(&self) -> ::std::option::Option<f64> {
self.estimated_monthly_savings
}
pub fn estimated_monthly_cost(&self) -> ::std::option::Option<f64> {
self.estimated_monthly_cost
}
pub fn implementation_effort(&self) -> ::std::option::Option<&crate::types::ImplementationEffort> {
self.implementation_effort.as_ref()
}
pub fn restart_needed(&self) -> ::std::option::Option<bool> {
self.restart_needed
}
pub fn action_type(&self) -> ::std::option::Option<&crate::types::ActionType> {
self.action_type.as_ref()
}
pub fn rollback_possible(&self) -> ::std::option::Option<bool> {
self.rollback_possible
}
pub fn current_resource_details(&self) -> ::std::option::Option<&crate::types::ResourceDetails> {
self.current_resource_details.as_ref()
}
pub fn recommended_resource_details(&self) -> ::std::option::Option<&crate::types::ResourceDetails> {
self.recommended_resource_details.as_ref()
}
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
}
impl ::aws_types::request_id::RequestId for GetRecommendationOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetRecommendationOutput {
pub fn builder() -> crate::operation::get_recommendation::builders::GetRecommendationOutputBuilder {
crate::operation::get_recommendation::builders::GetRecommendationOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRecommendationOutputBuilder {
pub(crate) recommendation_id: ::std::option::Option<::std::string::String>,
pub(crate) resource_id: ::std::option::Option<::std::string::String>,
pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
pub(crate) account_id: ::std::option::Option<::std::string::String>,
pub(crate) currency_code: ::std::option::Option<::std::string::String>,
pub(crate) recommendation_lookback_period_in_days: ::std::option::Option<i32>,
pub(crate) cost_calculation_lookback_period_in_days: ::std::option::Option<i32>,
pub(crate) estimated_savings_percentage: ::std::option::Option<f64>,
pub(crate) estimated_savings_over_cost_calculation_lookback_period: ::std::option::Option<f64>,
pub(crate) current_resource_type: ::std::option::Option<crate::types::ResourceType>,
pub(crate) recommended_resource_type: ::std::option::Option<crate::types::ResourceType>,
pub(crate) region: ::std::option::Option<::std::string::String>,
pub(crate) source: ::std::option::Option<crate::types::Source>,
pub(crate) last_refresh_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) estimated_monthly_savings: ::std::option::Option<f64>,
pub(crate) estimated_monthly_cost: ::std::option::Option<f64>,
pub(crate) implementation_effort: ::std::option::Option<crate::types::ImplementationEffort>,
pub(crate) restart_needed: ::std::option::Option<bool>,
pub(crate) action_type: ::std::option::Option<crate::types::ActionType>,
pub(crate) rollback_possible: ::std::option::Option<bool>,
pub(crate) current_resource_details: ::std::option::Option<crate::types::ResourceDetails>,
pub(crate) recommended_resource_details: ::std::option::Option<crate::types::ResourceDetails>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
_request_id: Option<String>,
}
impl GetRecommendationOutputBuilder {
pub fn recommendation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.recommendation_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_recommendation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.recommendation_id = input;
self
}
pub fn get_recommendation_id(&self) -> &::std::option::Option<::std::string::String> {
&self.recommendation_id
}
pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_id = input;
self
}
pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_id
}
pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_arn
}
pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.account_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.account_id
}
pub fn currency_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.currency_code = ::std::option::Option::Some(input.into());
self
}
pub fn set_currency_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.currency_code = input;
self
}
pub fn get_currency_code(&self) -> &::std::option::Option<::std::string::String> {
&self.currency_code
}
pub fn recommendation_lookback_period_in_days(mut self, input: i32) -> Self {
self.recommendation_lookback_period_in_days = ::std::option::Option::Some(input);
self
}
pub fn set_recommendation_lookback_period_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
self.recommendation_lookback_period_in_days = input;
self
}
pub fn get_recommendation_lookback_period_in_days(&self) -> &::std::option::Option<i32> {
&self.recommendation_lookback_period_in_days
}
pub fn cost_calculation_lookback_period_in_days(mut self, input: i32) -> Self {
self.cost_calculation_lookback_period_in_days = ::std::option::Option::Some(input);
self
}
pub fn set_cost_calculation_lookback_period_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
self.cost_calculation_lookback_period_in_days = input;
self
}
pub fn get_cost_calculation_lookback_period_in_days(&self) -> &::std::option::Option<i32> {
&self.cost_calculation_lookback_period_in_days
}
pub fn estimated_savings_percentage(mut self, input: f64) -> Self {
self.estimated_savings_percentage = ::std::option::Option::Some(input);
self
}
pub fn set_estimated_savings_percentage(mut self, input: ::std::option::Option<f64>) -> Self {
self.estimated_savings_percentage = input;
self
}
pub fn get_estimated_savings_percentage(&self) -> &::std::option::Option<f64> {
&self.estimated_savings_percentage
}
pub fn estimated_savings_over_cost_calculation_lookback_period(mut self, input: f64) -> Self {
self.estimated_savings_over_cost_calculation_lookback_period = ::std::option::Option::Some(input);
self
}
pub fn set_estimated_savings_over_cost_calculation_lookback_period(mut self, input: ::std::option::Option<f64>) -> Self {
self.estimated_savings_over_cost_calculation_lookback_period = input;
self
}
pub fn get_estimated_savings_over_cost_calculation_lookback_period(&self) -> &::std::option::Option<f64> {
&self.estimated_savings_over_cost_calculation_lookback_period
}
pub fn current_resource_type(mut self, input: crate::types::ResourceType) -> Self {
self.current_resource_type = ::std::option::Option::Some(input);
self
}
pub fn set_current_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
self.current_resource_type = input;
self
}
pub fn get_current_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
&self.current_resource_type
}
pub fn recommended_resource_type(mut self, input: crate::types::ResourceType) -> Self {
self.recommended_resource_type = ::std::option::Option::Some(input);
self
}
pub fn set_recommended_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
self.recommended_resource_type = input;
self
}
pub fn get_recommended_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
&self.recommended_resource_type
}
pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.region = ::std::option::Option::Some(input.into());
self
}
pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.region = input;
self
}
pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
&self.region
}
pub fn source(mut self, input: crate::types::Source) -> Self {
self.source = ::std::option::Option::Some(input);
self
}
pub fn set_source(mut self, input: ::std::option::Option<crate::types::Source>) -> Self {
self.source = input;
self
}
pub fn get_source(&self) -> &::std::option::Option<crate::types::Source> {
&self.source
}
pub fn last_refresh_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_refresh_timestamp = ::std::option::Option::Some(input);
self
}
pub fn set_last_refresh_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_refresh_timestamp = input;
self
}
pub fn get_last_refresh_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_refresh_timestamp
}
pub fn estimated_monthly_savings(mut self, input: f64) -> Self {
self.estimated_monthly_savings = ::std::option::Option::Some(input);
self
}
pub fn set_estimated_monthly_savings(mut self, input: ::std::option::Option<f64>) -> Self {
self.estimated_monthly_savings = input;
self
}
pub fn get_estimated_monthly_savings(&self) -> &::std::option::Option<f64> {
&self.estimated_monthly_savings
}
pub fn estimated_monthly_cost(mut self, input: f64) -> Self {
self.estimated_monthly_cost = ::std::option::Option::Some(input);
self
}
pub fn set_estimated_monthly_cost(mut self, input: ::std::option::Option<f64>) -> Self {
self.estimated_monthly_cost = input;
self
}
pub fn get_estimated_monthly_cost(&self) -> &::std::option::Option<f64> {
&self.estimated_monthly_cost
}
pub fn implementation_effort(mut self, input: crate::types::ImplementationEffort) -> Self {
self.implementation_effort = ::std::option::Option::Some(input);
self
}
pub fn set_implementation_effort(mut self, input: ::std::option::Option<crate::types::ImplementationEffort>) -> Self {
self.implementation_effort = input;
self
}
pub fn get_implementation_effort(&self) -> &::std::option::Option<crate::types::ImplementationEffort> {
&self.implementation_effort
}
pub fn restart_needed(mut self, input: bool) -> Self {
self.restart_needed = ::std::option::Option::Some(input);
self
}
pub fn set_restart_needed(mut self, input: ::std::option::Option<bool>) -> Self {
self.restart_needed = input;
self
}
pub fn get_restart_needed(&self) -> &::std::option::Option<bool> {
&self.restart_needed
}
pub fn action_type(mut self, input: crate::types::ActionType) -> Self {
self.action_type = ::std::option::Option::Some(input);
self
}
pub fn set_action_type(mut self, input: ::std::option::Option<crate::types::ActionType>) -> Self {
self.action_type = input;
self
}
pub fn get_action_type(&self) -> &::std::option::Option<crate::types::ActionType> {
&self.action_type
}
pub fn rollback_possible(mut self, input: bool) -> Self {
self.rollback_possible = ::std::option::Option::Some(input);
self
}
pub fn set_rollback_possible(mut self, input: ::std::option::Option<bool>) -> Self {
self.rollback_possible = input;
self
}
pub fn get_rollback_possible(&self) -> &::std::option::Option<bool> {
&self.rollback_possible
}
pub fn current_resource_details(mut self, input: crate::types::ResourceDetails) -> Self {
self.current_resource_details = ::std::option::Option::Some(input);
self
}
pub fn set_current_resource_details(mut self, input: ::std::option::Option<crate::types::ResourceDetails>) -> Self {
self.current_resource_details = input;
self
}
pub fn get_current_resource_details(&self) -> &::std::option::Option<crate::types::ResourceDetails> {
&self.current_resource_details
}
pub fn recommended_resource_details(mut self, input: crate::types::ResourceDetails) -> Self {
self.recommended_resource_details = ::std::option::Option::Some(input);
self
}
pub fn set_recommended_resource_details(mut self, input: ::std::option::Option<crate::types::ResourceDetails>) -> Self {
self.recommended_resource_details = input;
self
}
pub fn get_recommended_resource_details(&self) -> &::std::option::Option<crate::types::ResourceDetails> {
&self.recommended_resource_details
}
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(self) -> crate::operation::get_recommendation::GetRecommendationOutput {
crate::operation::get_recommendation::GetRecommendationOutput {
recommendation_id: self.recommendation_id,
resource_id: self.resource_id,
resource_arn: self.resource_arn,
account_id: self.account_id,
currency_code: self.currency_code,
recommendation_lookback_period_in_days: self.recommendation_lookback_period_in_days,
cost_calculation_lookback_period_in_days: self.cost_calculation_lookback_period_in_days,
estimated_savings_percentage: self.estimated_savings_percentage,
estimated_savings_over_cost_calculation_lookback_period: self.estimated_savings_over_cost_calculation_lookback_period,
current_resource_type: self.current_resource_type,
recommended_resource_type: self.recommended_resource_type,
region: self.region,
source: self.source,
last_refresh_timestamp: self.last_refresh_timestamp,
estimated_monthly_savings: self.estimated_monthly_savings,
estimated_monthly_cost: self.estimated_monthly_cost,
implementation_effort: self.implementation_effort,
restart_needed: self.restart_needed,
action_type: self.action_type,
rollback_possible: self.rollback_possible,
current_resource_details: self.current_resource_details,
recommended_resource_details: self.recommended_resource_details,
tags: self.tags,
_request_id: self._request_id,
}
}
}