1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The trigger threshold of the action. </p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ActionThreshold {
    /// <p> The threshold of a notification.</p>
    pub action_threshold_value: f64,
    /// <p> The type of threshold for a notification.</p>
    pub action_threshold_type: crate::types::ThresholdType,
}
impl ActionThreshold {
    /// <p> The threshold of a notification.</p>
    pub fn action_threshold_value(&self) -> f64 {
        self.action_threshold_value
    }
    /// <p> The type of threshold for a notification.</p>
    pub fn action_threshold_type(&self) -> &crate::types::ThresholdType {
        &self.action_threshold_type
    }
}
impl ActionThreshold {
    /// Creates a new builder-style object to manufacture [`ActionThreshold`](crate::types::ActionThreshold).
    pub fn builder() -> crate::types::builders::ActionThresholdBuilder {
        crate::types::builders::ActionThresholdBuilder::default()
    }
}

/// A builder for [`ActionThreshold`](crate::types::ActionThreshold).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ActionThresholdBuilder {
    pub(crate) action_threshold_value: ::std::option::Option<f64>,
    pub(crate) action_threshold_type: ::std::option::Option<crate::types::ThresholdType>,
}
impl ActionThresholdBuilder {
    /// <p> The threshold of a notification.</p>
    /// This field is required.
    pub fn action_threshold_value(mut self, input: f64) -> Self {
        self.action_threshold_value = ::std::option::Option::Some(input);
        self
    }
    /// <p> The threshold of a notification.</p>
    pub fn set_action_threshold_value(mut self, input: ::std::option::Option<f64>) -> Self {
        self.action_threshold_value = input;
        self
    }
    /// <p> The threshold of a notification.</p>
    pub fn get_action_threshold_value(&self) -> &::std::option::Option<f64> {
        &self.action_threshold_value
    }
    /// <p> The type of threshold for a notification.</p>
    /// This field is required.
    pub fn action_threshold_type(mut self, input: crate::types::ThresholdType) -> Self {
        self.action_threshold_type = ::std::option::Option::Some(input);
        self
    }
    /// <p> The type of threshold for a notification.</p>
    pub fn set_action_threshold_type(mut self, input: ::std::option::Option<crate::types::ThresholdType>) -> Self {
        self.action_threshold_type = input;
        self
    }
    /// <p> The type of threshold for a notification.</p>
    pub fn get_action_threshold_type(&self) -> &::std::option::Option<crate::types::ThresholdType> {
        &self.action_threshold_type
    }
    /// Consumes the builder and constructs a [`ActionThreshold`](crate::types::ActionThreshold).
    /// This method will fail if any of the following fields are not set:
    /// - [`action_threshold_type`](crate::types::builders::ActionThresholdBuilder::action_threshold_type)
    pub fn build(self) -> ::std::result::Result<crate::types::ActionThreshold, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::ActionThreshold {
            action_threshold_value: self.action_threshold_value.unwrap_or_default(),
            action_threshold_type: self.action_threshold_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "action_threshold_type",
                    "action_threshold_type was not specified but it is required when building ActionThreshold",
                )
            })?,
        })
    }
}