aws_sdk_budgets/types/
_action_threshold.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ActionThreshold {
7 pub action_threshold_value: f64,
9 pub action_threshold_type: crate::types::ThresholdType,
11}
12impl ActionThreshold {
13 pub fn action_threshold_value(&self) -> f64 {
15 self.action_threshold_value
16 }
17 pub fn action_threshold_type(&self) -> &crate::types::ThresholdType {
19 &self.action_threshold_type
20 }
21}
22impl ActionThreshold {
23 pub fn builder() -> crate::types::builders::ActionThresholdBuilder {
25 crate::types::builders::ActionThresholdBuilder::default()
26 }
27}
28
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct ActionThresholdBuilder {
33 pub(crate) action_threshold_value: ::std::option::Option<f64>,
34 pub(crate) action_threshold_type: ::std::option::Option<crate::types::ThresholdType>,
35}
36impl ActionThresholdBuilder {
37 pub fn action_threshold_value(mut self, input: f64) -> Self {
40 self.action_threshold_value = ::std::option::Option::Some(input);
41 self
42 }
43 pub fn set_action_threshold_value(mut self, input: ::std::option::Option<f64>) -> Self {
45 self.action_threshold_value = input;
46 self
47 }
48 pub fn get_action_threshold_value(&self) -> &::std::option::Option<f64> {
50 &self.action_threshold_value
51 }
52 pub fn action_threshold_type(mut self, input: crate::types::ThresholdType) -> Self {
55 self.action_threshold_type = ::std::option::Option::Some(input);
56 self
57 }
58 pub fn set_action_threshold_type(mut self, input: ::std::option::Option<crate::types::ThresholdType>) -> Self {
60 self.action_threshold_type = input;
61 self
62 }
63 pub fn get_action_threshold_type(&self) -> &::std::option::Option<crate::types::ThresholdType> {
65 &self.action_threshold_type
66 }
67 pub fn build(self) -> ::std::result::Result<crate::types::ActionThreshold, ::aws_smithy_types::error::operation::BuildError> {
71 ::std::result::Result::Ok(crate::types::ActionThreshold {
72 action_threshold_value: self.action_threshold_value.unwrap_or_default(),
73 action_threshold_type: self.action_threshold_type.ok_or_else(|| {
74 ::aws_smithy_types::error::operation::BuildError::missing_field(
75 "action_threshold_type",
76 "action_threshold_type was not specified but it is required when building ActionThreshold",
77 )
78 })?,
79 })
80 }
81}