Skip to main content

aws_sdk_costexplorer/types/
_anomaly_score.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Quantifies the anomaly. The higher score means that it's more anomalous.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AnomalyScore {
7    /// <p>The maximum score that's observed during the <code>AnomalyDateInterval</code>.</p>
8    pub max_score: f64,
9    /// <p>The last observed score.</p>
10    pub current_score: f64,
11}
12impl AnomalyScore {
13    /// <p>The maximum score that's observed during the <code>AnomalyDateInterval</code>.</p>
14    pub fn max_score(&self) -> f64 {
15        self.max_score
16    }
17    /// <p>The last observed score.</p>
18    pub fn current_score(&self) -> f64 {
19        self.current_score
20    }
21}
22impl AnomalyScore {
23    /// Creates a new builder-style object to manufacture [`AnomalyScore`](crate::types::AnomalyScore).
24    pub fn builder() -> crate::types::builders::AnomalyScoreBuilder {
25        crate::types::builders::AnomalyScoreBuilder::default()
26    }
27}
28
29/// A builder for [`AnomalyScore`](crate::types::AnomalyScore).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct AnomalyScoreBuilder {
33    pub(crate) max_score: ::std::option::Option<f64>,
34    pub(crate) current_score: ::std::option::Option<f64>,
35}
36impl AnomalyScoreBuilder {
37    /// <p>The maximum score that's observed during the <code>AnomalyDateInterval</code>.</p>
38    /// This field is required.
39    pub fn max_score(mut self, input: f64) -> Self {
40        self.max_score = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>The maximum score that's observed during the <code>AnomalyDateInterval</code>.</p>
44    pub fn set_max_score(mut self, input: ::std::option::Option<f64>) -> Self {
45        self.max_score = input;
46        self
47    }
48    /// <p>The maximum score that's observed during the <code>AnomalyDateInterval</code>.</p>
49    pub fn get_max_score(&self) -> &::std::option::Option<f64> {
50        &self.max_score
51    }
52    /// <p>The last observed score.</p>
53    /// This field is required.
54    pub fn current_score(mut self, input: f64) -> Self {
55        self.current_score = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>The last observed score.</p>
59    pub fn set_current_score(mut self, input: ::std::option::Option<f64>) -> Self {
60        self.current_score = input;
61        self
62    }
63    /// <p>The last observed score.</p>
64    pub fn get_current_score(&self) -> &::std::option::Option<f64> {
65        &self.current_score
66    }
67    /// Consumes the builder and constructs a [`AnomalyScore`](crate::types::AnomalyScore).
68    pub fn build(self) -> crate::types::AnomalyScore {
69        crate::types::AnomalyScore {
70            max_score: self.max_score.unwrap_or_default(),
71            current_score: self.current_score.unwrap_or_default(),
72        }
73    }
74}