aws_sdk_lookoutmetrics/operation/detect_metric_set_config/
_detect_metric_set_config_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 DetectMetricSetConfigInput {
6    /// <p>An anomaly detector ARN.</p>
7    pub anomaly_detector_arn: ::std::option::Option<::std::string::String>,
8    /// <p>A data source.</p>
9    pub auto_detection_metric_source: ::std::option::Option<crate::types::AutoDetectionMetricSource>,
10}
11impl DetectMetricSetConfigInput {
12    /// <p>An anomaly detector ARN.</p>
13    pub fn anomaly_detector_arn(&self) -> ::std::option::Option<&str> {
14        self.anomaly_detector_arn.as_deref()
15    }
16    /// <p>A data source.</p>
17    pub fn auto_detection_metric_source(&self) -> ::std::option::Option<&crate::types::AutoDetectionMetricSource> {
18        self.auto_detection_metric_source.as_ref()
19    }
20}
21impl DetectMetricSetConfigInput {
22    /// Creates a new builder-style object to manufacture [`DetectMetricSetConfigInput`](crate::operation::detect_metric_set_config::DetectMetricSetConfigInput).
23    pub fn builder() -> crate::operation::detect_metric_set_config::builders::DetectMetricSetConfigInputBuilder {
24        crate::operation::detect_metric_set_config::builders::DetectMetricSetConfigInputBuilder::default()
25    }
26}
27
28/// A builder for [`DetectMetricSetConfigInput`](crate::operation::detect_metric_set_config::DetectMetricSetConfigInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DetectMetricSetConfigInputBuilder {
32    pub(crate) anomaly_detector_arn: ::std::option::Option<::std::string::String>,
33    pub(crate) auto_detection_metric_source: ::std::option::Option<crate::types::AutoDetectionMetricSource>,
34}
35impl DetectMetricSetConfigInputBuilder {
36    /// <p>An anomaly detector ARN.</p>
37    /// This field is required.
38    pub fn anomaly_detector_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.anomaly_detector_arn = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>An anomaly detector ARN.</p>
43    pub fn set_anomaly_detector_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.anomaly_detector_arn = input;
45        self
46    }
47    /// <p>An anomaly detector ARN.</p>
48    pub fn get_anomaly_detector_arn(&self) -> &::std::option::Option<::std::string::String> {
49        &self.anomaly_detector_arn
50    }
51    /// <p>A data source.</p>
52    /// This field is required.
53    pub fn auto_detection_metric_source(mut self, input: crate::types::AutoDetectionMetricSource) -> Self {
54        self.auto_detection_metric_source = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>A data source.</p>
58    pub fn set_auto_detection_metric_source(mut self, input: ::std::option::Option<crate::types::AutoDetectionMetricSource>) -> Self {
59        self.auto_detection_metric_source = input;
60        self
61    }
62    /// <p>A data source.</p>
63    pub fn get_auto_detection_metric_source(&self) -> &::std::option::Option<crate::types::AutoDetectionMetricSource> {
64        &self.auto_detection_metric_source
65    }
66    /// Consumes the builder and constructs a [`DetectMetricSetConfigInput`](crate::operation::detect_metric_set_config::DetectMetricSetConfigInput).
67    pub fn build(
68        self,
69    ) -> ::std::result::Result<crate::operation::detect_metric_set_config::DetectMetricSetConfigInput, ::aws_smithy_types::error::operation::BuildError>
70    {
71        ::std::result::Result::Ok(crate::operation::detect_metric_set_config::DetectMetricSetConfigInput {
72            anomaly_detector_arn: self.anomaly_detector_arn,
73            auto_detection_metric_source: self.auto_detection_metric_source,
74        })
75    }
76}