aws_sdk_costoptimizationhub/operation/get_preferences/
_get_preferences_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetPreferencesOutput {
6    /// <p>Retrieves the status of the "savings estimation mode" preference.</p>
7    pub savings_estimation_mode: ::std::option::Option<crate::types::SavingsEstimationMode>,
8    /// <p>Retrieves the status of the "member account discount visibility" preference.</p>
9    pub member_account_discount_visibility: ::std::option::Option<crate::types::MemberAccountDiscountVisibility>,
10    /// <p>Retrieves the current preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
11    pub preferred_commitment: ::std::option::Option<crate::types::PreferredCommitment>,
12    _request_id: Option<String>,
13}
14impl GetPreferencesOutput {
15    /// <p>Retrieves the status of the "savings estimation mode" preference.</p>
16    pub fn savings_estimation_mode(&self) -> ::std::option::Option<&crate::types::SavingsEstimationMode> {
17        self.savings_estimation_mode.as_ref()
18    }
19    /// <p>Retrieves the status of the "member account discount visibility" preference.</p>
20    pub fn member_account_discount_visibility(&self) -> ::std::option::Option<&crate::types::MemberAccountDiscountVisibility> {
21        self.member_account_discount_visibility.as_ref()
22    }
23    /// <p>Retrieves the current preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
24    pub fn preferred_commitment(&self) -> ::std::option::Option<&crate::types::PreferredCommitment> {
25        self.preferred_commitment.as_ref()
26    }
27}
28impl ::aws_types::request_id::RequestId for GetPreferencesOutput {
29    fn request_id(&self) -> Option<&str> {
30        self._request_id.as_deref()
31    }
32}
33impl GetPreferencesOutput {
34    /// Creates a new builder-style object to manufacture [`GetPreferencesOutput`](crate::operation::get_preferences::GetPreferencesOutput).
35    pub fn builder() -> crate::operation::get_preferences::builders::GetPreferencesOutputBuilder {
36        crate::operation::get_preferences::builders::GetPreferencesOutputBuilder::default()
37    }
38}
39
40/// A builder for [`GetPreferencesOutput`](crate::operation::get_preferences::GetPreferencesOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetPreferencesOutputBuilder {
44    pub(crate) savings_estimation_mode: ::std::option::Option<crate::types::SavingsEstimationMode>,
45    pub(crate) member_account_discount_visibility: ::std::option::Option<crate::types::MemberAccountDiscountVisibility>,
46    pub(crate) preferred_commitment: ::std::option::Option<crate::types::PreferredCommitment>,
47    _request_id: Option<String>,
48}
49impl GetPreferencesOutputBuilder {
50    /// <p>Retrieves the status of the "savings estimation mode" preference.</p>
51    pub fn savings_estimation_mode(mut self, input: crate::types::SavingsEstimationMode) -> Self {
52        self.savings_estimation_mode = ::std::option::Option::Some(input);
53        self
54    }
55    /// <p>Retrieves the status of the "savings estimation mode" preference.</p>
56    pub fn set_savings_estimation_mode(mut self, input: ::std::option::Option<crate::types::SavingsEstimationMode>) -> Self {
57        self.savings_estimation_mode = input;
58        self
59    }
60    /// <p>Retrieves the status of the "savings estimation mode" preference.</p>
61    pub fn get_savings_estimation_mode(&self) -> &::std::option::Option<crate::types::SavingsEstimationMode> {
62        &self.savings_estimation_mode
63    }
64    /// <p>Retrieves the status of the "member account discount visibility" preference.</p>
65    pub fn member_account_discount_visibility(mut self, input: crate::types::MemberAccountDiscountVisibility) -> Self {
66        self.member_account_discount_visibility = ::std::option::Option::Some(input);
67        self
68    }
69    /// <p>Retrieves the status of the "member account discount visibility" preference.</p>
70    pub fn set_member_account_discount_visibility(mut self, input: ::std::option::Option<crate::types::MemberAccountDiscountVisibility>) -> Self {
71        self.member_account_discount_visibility = input;
72        self
73    }
74    /// <p>Retrieves the status of the "member account discount visibility" preference.</p>
75    pub fn get_member_account_discount_visibility(&self) -> &::std::option::Option<crate::types::MemberAccountDiscountVisibility> {
76        &self.member_account_discount_visibility
77    }
78    /// <p>Retrieves the current preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
79    pub fn preferred_commitment(mut self, input: crate::types::PreferredCommitment) -> Self {
80        self.preferred_commitment = ::std::option::Option::Some(input);
81        self
82    }
83    /// <p>Retrieves the current preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
84    pub fn set_preferred_commitment(mut self, input: ::std::option::Option<crate::types::PreferredCommitment>) -> Self {
85        self.preferred_commitment = input;
86        self
87    }
88    /// <p>Retrieves the current preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
89    pub fn get_preferred_commitment(&self) -> &::std::option::Option<crate::types::PreferredCommitment> {
90        &self.preferred_commitment
91    }
92    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93        self._request_id = Some(request_id.into());
94        self
95    }
96
97    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98        self._request_id = request_id;
99        self
100    }
101    /// Consumes the builder and constructs a [`GetPreferencesOutput`](crate::operation::get_preferences::GetPreferencesOutput).
102    pub fn build(self) -> crate::operation::get_preferences::GetPreferencesOutput {
103        crate::operation::get_preferences::GetPreferencesOutput {
104            savings_estimation_mode: self.savings_estimation_mode,
105            member_account_discount_visibility: self.member_account_discount_visibility,
106            preferred_commitment: self.preferred_commitment,
107            _request_id: self._request_id,
108        }
109    }
110}