aws_sdk_costoptimizationhub/operation/update_preferences/
_update_preferences_input.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 UpdatePreferencesInput {
6    /// <p>Sets the "savings estimation mode" preference.</p>
7    pub savings_estimation_mode: ::std::option::Option<crate::types::SavingsEstimationMode>,
8    /// <p>Sets the "member account discount visibility" preference.</p>
9    pub member_account_discount_visibility: ::std::option::Option<crate::types::MemberAccountDiscountVisibility>,
10    /// <p>Sets the 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}
13impl UpdatePreferencesInput {
14    /// <p>Sets the "savings estimation mode" preference.</p>
15    pub fn savings_estimation_mode(&self) -> ::std::option::Option<&crate::types::SavingsEstimationMode> {
16        self.savings_estimation_mode.as_ref()
17    }
18    /// <p>Sets the "member account discount visibility" preference.</p>
19    pub fn member_account_discount_visibility(&self) -> ::std::option::Option<&crate::types::MemberAccountDiscountVisibility> {
20        self.member_account_discount_visibility.as_ref()
21    }
22    /// <p>Sets the preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
23    pub fn preferred_commitment(&self) -> ::std::option::Option<&crate::types::PreferredCommitment> {
24        self.preferred_commitment.as_ref()
25    }
26}
27impl UpdatePreferencesInput {
28    /// Creates a new builder-style object to manufacture [`UpdatePreferencesInput`](crate::operation::update_preferences::UpdatePreferencesInput).
29    pub fn builder() -> crate::operation::update_preferences::builders::UpdatePreferencesInputBuilder {
30        crate::operation::update_preferences::builders::UpdatePreferencesInputBuilder::default()
31    }
32}
33
34/// A builder for [`UpdatePreferencesInput`](crate::operation::update_preferences::UpdatePreferencesInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct UpdatePreferencesInputBuilder {
38    pub(crate) savings_estimation_mode: ::std::option::Option<crate::types::SavingsEstimationMode>,
39    pub(crate) member_account_discount_visibility: ::std::option::Option<crate::types::MemberAccountDiscountVisibility>,
40    pub(crate) preferred_commitment: ::std::option::Option<crate::types::PreferredCommitment>,
41}
42impl UpdatePreferencesInputBuilder {
43    /// <p>Sets the "savings estimation mode" preference.</p>
44    pub fn savings_estimation_mode(mut self, input: crate::types::SavingsEstimationMode) -> Self {
45        self.savings_estimation_mode = ::std::option::Option::Some(input);
46        self
47    }
48    /// <p>Sets the "savings estimation mode" preference.</p>
49    pub fn set_savings_estimation_mode(mut self, input: ::std::option::Option<crate::types::SavingsEstimationMode>) -> Self {
50        self.savings_estimation_mode = input;
51        self
52    }
53    /// <p>Sets the "savings estimation mode" preference.</p>
54    pub fn get_savings_estimation_mode(&self) -> &::std::option::Option<crate::types::SavingsEstimationMode> {
55        &self.savings_estimation_mode
56    }
57    /// <p>Sets the "member account discount visibility" preference.</p>
58    pub fn member_account_discount_visibility(mut self, input: crate::types::MemberAccountDiscountVisibility) -> Self {
59        self.member_account_discount_visibility = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>Sets the "member account discount visibility" preference.</p>
63    pub fn set_member_account_discount_visibility(mut self, input: ::std::option::Option<crate::types::MemberAccountDiscountVisibility>) -> Self {
64        self.member_account_discount_visibility = input;
65        self
66    }
67    /// <p>Sets the "member account discount visibility" preference.</p>
68    pub fn get_member_account_discount_visibility(&self) -> &::std::option::Option<crate::types::MemberAccountDiscountVisibility> {
69        &self.member_account_discount_visibility
70    }
71    /// <p>Sets the preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
72    pub fn preferred_commitment(mut self, input: crate::types::PreferredCommitment) -> Self {
73        self.preferred_commitment = ::std::option::Option::Some(input);
74        self
75    }
76    /// <p>Sets the preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
77    pub fn set_preferred_commitment(mut self, input: ::std::option::Option<crate::types::PreferredCommitment>) -> Self {
78        self.preferred_commitment = input;
79        self
80    }
81    /// <p>Sets the preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.</p>
82    pub fn get_preferred_commitment(&self) -> &::std::option::Option<crate::types::PreferredCommitment> {
83        &self.preferred_commitment
84    }
85    /// Consumes the builder and constructs a [`UpdatePreferencesInput`](crate::operation::update_preferences::UpdatePreferencesInput).
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::update_preferences::UpdatePreferencesInput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::update_preferences::UpdatePreferencesInput {
90            savings_estimation_mode: self.savings_estimation_mode,
91            member_account_discount_visibility: self.member_account_discount_visibility,
92            preferred_commitment: self.preferred_commitment,
93        })
94    }
95}