aws_sdk_costoptimizationhub/types/
_ec2_instance_savings_plans.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The EC2 instance Savings Plans recommendation details.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Ec2InstanceSavingsPlans {
7    /// <p>The EC2 instance Savings Plans configuration used for recommendations.</p>
8    pub configuration: ::std::option::Option<crate::types::Ec2InstanceSavingsPlansConfiguration>,
9    /// <p>Cost impact of the Savings Plans purchase recommendation.</p>
10    pub cost_calculation: ::std::option::Option<crate::types::SavingsPlansCostCalculation>,
11}
12impl Ec2InstanceSavingsPlans {
13    /// <p>The EC2 instance Savings Plans configuration used for recommendations.</p>
14    pub fn configuration(&self) -> ::std::option::Option<&crate::types::Ec2InstanceSavingsPlansConfiguration> {
15        self.configuration.as_ref()
16    }
17    /// <p>Cost impact of the Savings Plans purchase recommendation.</p>
18    pub fn cost_calculation(&self) -> ::std::option::Option<&crate::types::SavingsPlansCostCalculation> {
19        self.cost_calculation.as_ref()
20    }
21}
22impl Ec2InstanceSavingsPlans {
23    /// Creates a new builder-style object to manufacture [`Ec2InstanceSavingsPlans`](crate::types::Ec2InstanceSavingsPlans).
24    pub fn builder() -> crate::types::builders::Ec2InstanceSavingsPlansBuilder {
25        crate::types::builders::Ec2InstanceSavingsPlansBuilder::default()
26    }
27}
28
29/// A builder for [`Ec2InstanceSavingsPlans`](crate::types::Ec2InstanceSavingsPlans).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct Ec2InstanceSavingsPlansBuilder {
33    pub(crate) configuration: ::std::option::Option<crate::types::Ec2InstanceSavingsPlansConfiguration>,
34    pub(crate) cost_calculation: ::std::option::Option<crate::types::SavingsPlansCostCalculation>,
35}
36impl Ec2InstanceSavingsPlansBuilder {
37    /// <p>The EC2 instance Savings Plans configuration used for recommendations.</p>
38    pub fn configuration(mut self, input: crate::types::Ec2InstanceSavingsPlansConfiguration) -> Self {
39        self.configuration = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The EC2 instance Savings Plans configuration used for recommendations.</p>
43    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::Ec2InstanceSavingsPlansConfiguration>) -> Self {
44        self.configuration = input;
45        self
46    }
47    /// <p>The EC2 instance Savings Plans configuration used for recommendations.</p>
48    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::Ec2InstanceSavingsPlansConfiguration> {
49        &self.configuration
50    }
51    /// <p>Cost impact of the Savings Plans purchase recommendation.</p>
52    pub fn cost_calculation(mut self, input: crate::types::SavingsPlansCostCalculation) -> Self {
53        self.cost_calculation = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>Cost impact of the Savings Plans purchase recommendation.</p>
57    pub fn set_cost_calculation(mut self, input: ::std::option::Option<crate::types::SavingsPlansCostCalculation>) -> Self {
58        self.cost_calculation = input;
59        self
60    }
61    /// <p>Cost impact of the Savings Plans purchase recommendation.</p>
62    pub fn get_cost_calculation(&self) -> &::std::option::Option<crate::types::SavingsPlansCostCalculation> {
63        &self.cost_calculation
64    }
65    /// Consumes the builder and constructs a [`Ec2InstanceSavingsPlans`](crate::types::Ec2InstanceSavingsPlans).
66    pub fn build(self) -> crate::types::Ec2InstanceSavingsPlans {
67        crate::types::Ec2InstanceSavingsPlans {
68            configuration: self.configuration,
69            cost_calculation: self.cost_calculation,
70        }
71    }
72}