aws_sdk_cloudwatch/operation/delete_anomaly_detector/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_anomaly_detector::_delete_anomaly_detector_output::DeleteAnomalyDetectorOutputBuilder;
3
4pub use crate::operation::delete_anomaly_detector::_delete_anomaly_detector_input::DeleteAnomalyDetectorInputBuilder;
5
6impl crate::operation::delete_anomaly_detector::builders::DeleteAnomalyDetectorInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_anomaly_detector();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteAnomalyDetector`.
24///
25/// <p>Deletes the specified anomaly detection model from your account. For more information about how to delete an anomaly detection model, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Anomaly_Detection_Alarm.html#Delete_Anomaly_Detection_Model">Deleting an anomaly detection model</a> in the <i>CloudWatch User Guide</i>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DeleteAnomalyDetectorFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::delete_anomaly_detector::builders::DeleteAnomalyDetectorInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorOutput,
35        crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorError,
36    > for DeleteAnomalyDetectorFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorOutput,
44            crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl DeleteAnomalyDetectorFluentBuilder {
51    /// Creates a new `DeleteAnomalyDetectorFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the DeleteAnomalyDetector as a reference.
60    pub fn as_input(&self) -> &crate::operation::delete_anomaly_detector::builders::DeleteAnomalyDetectorInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::delete_anomaly_detector::DeleteAnomalyDetector::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::delete_anomaly_detector::DeleteAnomalyDetector::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorOutput,
97        crate::operation::delete_anomaly_detector::DeleteAnomalyDetectorError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The namespace associated with the anomaly detection model to delete.</p>
112    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
113    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.namespace(input.into());
115        self
116    }
117    /// <p>The namespace associated with the anomaly detection model to delete.</p>
118    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
119    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_namespace(input);
121        self
122    }
123    /// <p>The namespace associated with the anomaly detection model to delete.</p>
124    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
125    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_namespace()
127    }
128    /// <p>The metric name associated with the anomaly detection model to delete.</p>
129    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
130    pub fn metric_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.metric_name(input.into());
132        self
133    }
134    /// <p>The metric name associated with the anomaly detection model to delete.</p>
135    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
136    pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_metric_name(input);
138        self
139    }
140    /// <p>The metric name associated with the anomaly detection model to delete.</p>
141    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
142    pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_metric_name()
144    }
145    ///
146    /// Appends an item to `Dimensions`.
147    ///
148    /// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
149    ///
150    /// <p>The metric dimensions associated with the anomaly detection model to delete.</p>
151    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
152    pub fn dimensions(mut self, input: crate::types::Dimension) -> Self {
153        self.inner = self.inner.dimensions(input);
154        self
155    }
156    /// <p>The metric dimensions associated with the anomaly detection model to delete.</p>
157    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
158    pub fn set_dimensions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Dimension>>) -> Self {
159        self.inner = self.inner.set_dimensions(input);
160        self
161    }
162    /// <p>The metric dimensions associated with the anomaly detection model to delete.</p>
163    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
164    pub fn get_dimensions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Dimension>> {
165        self.inner.get_dimensions()
166    }
167    /// <p>The statistic associated with the anomaly detection model to delete.</p>
168    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
169    pub fn stat(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.stat(input.into());
171        self
172    }
173    /// <p>The statistic associated with the anomaly detection model to delete.</p>
174    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
175    pub fn set_stat(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_stat(input);
177        self
178    }
179    /// <p>The statistic associated with the anomaly detection model to delete.</p>
180    #[deprecated(note = "Use SingleMetricAnomalyDetector.")]
181    pub fn get_stat(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_stat()
183    }
184    /// <p>A single metric anomaly detector to be deleted.</p>
185    /// <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
186    /// <ul>
187    /// <li>
188    /// <p><code>Dimensions</code>,</p></li>
189    /// <li>
190    /// <p><code>MetricName</code></p></li>
191    /// <li>
192    /// <p><code>Namespace</code></p></li>
193    /// <li>
194    /// <p><code>Stat</code></p></li>
195    /// <li>
196    /// <p>the <code>MetricMathAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code></p></li>
197    /// </ul>
198    /// <p>Instead, specify the single metric anomaly detector attributes as part of the <code>SingleMetricAnomalyDetector</code> property.</p>
199    pub fn single_metric_anomaly_detector(mut self, input: crate::types::SingleMetricAnomalyDetector) -> Self {
200        self.inner = self.inner.single_metric_anomaly_detector(input);
201        self
202    }
203    /// <p>A single metric anomaly detector to be deleted.</p>
204    /// <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
205    /// <ul>
206    /// <li>
207    /// <p><code>Dimensions</code>,</p></li>
208    /// <li>
209    /// <p><code>MetricName</code></p></li>
210    /// <li>
211    /// <p><code>Namespace</code></p></li>
212    /// <li>
213    /// <p><code>Stat</code></p></li>
214    /// <li>
215    /// <p>the <code>MetricMathAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code></p></li>
216    /// </ul>
217    /// <p>Instead, specify the single metric anomaly detector attributes as part of the <code>SingleMetricAnomalyDetector</code> property.</p>
218    pub fn set_single_metric_anomaly_detector(mut self, input: ::std::option::Option<crate::types::SingleMetricAnomalyDetector>) -> Self {
219        self.inner = self.inner.set_single_metric_anomaly_detector(input);
220        self
221    }
222    /// <p>A single metric anomaly detector to be deleted.</p>
223    /// <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
224    /// <ul>
225    /// <li>
226    /// <p><code>Dimensions</code>,</p></li>
227    /// <li>
228    /// <p><code>MetricName</code></p></li>
229    /// <li>
230    /// <p><code>Namespace</code></p></li>
231    /// <li>
232    /// <p><code>Stat</code></p></li>
233    /// <li>
234    /// <p>the <code>MetricMathAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code></p></li>
235    /// </ul>
236    /// <p>Instead, specify the single metric anomaly detector attributes as part of the <code>SingleMetricAnomalyDetector</code> property.</p>
237    pub fn get_single_metric_anomaly_detector(&self) -> &::std::option::Option<crate::types::SingleMetricAnomalyDetector> {
238        self.inner.get_single_metric_anomaly_detector()
239    }
240    /// <p>The metric math anomaly detector to be deleted.</p>
241    /// <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include following parameters in the same operation:</p>
242    /// <ul>
243    /// <li>
244    /// <p><code>Dimensions</code>,</p></li>
245    /// <li>
246    /// <p><code>MetricName</code></p></li>
247    /// <li>
248    /// <p><code>Namespace</code></p></li>
249    /// <li>
250    /// <p><code>Stat</code></p></li>
251    /// <li>
252    /// <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code></p></li>
253    /// </ul>
254    /// <p>Instead, specify the metric math anomaly detector attributes as part of the <code>MetricMathAnomalyDetector</code> property.</p>
255    pub fn metric_math_anomaly_detector(mut self, input: crate::types::MetricMathAnomalyDetector) -> Self {
256        self.inner = self.inner.metric_math_anomaly_detector(input);
257        self
258    }
259    /// <p>The metric math anomaly detector to be deleted.</p>
260    /// <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include following parameters in the same operation:</p>
261    /// <ul>
262    /// <li>
263    /// <p><code>Dimensions</code>,</p></li>
264    /// <li>
265    /// <p><code>MetricName</code></p></li>
266    /// <li>
267    /// <p><code>Namespace</code></p></li>
268    /// <li>
269    /// <p><code>Stat</code></p></li>
270    /// <li>
271    /// <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code></p></li>
272    /// </ul>
273    /// <p>Instead, specify the metric math anomaly detector attributes as part of the <code>MetricMathAnomalyDetector</code> property.</p>
274    pub fn set_metric_math_anomaly_detector(mut self, input: ::std::option::Option<crate::types::MetricMathAnomalyDetector>) -> Self {
275        self.inner = self.inner.set_metric_math_anomaly_detector(input);
276        self
277    }
278    /// <p>The metric math anomaly detector to be deleted.</p>
279    /// <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include following parameters in the same operation:</p>
280    /// <ul>
281    /// <li>
282    /// <p><code>Dimensions</code>,</p></li>
283    /// <li>
284    /// <p><code>MetricName</code></p></li>
285    /// <li>
286    /// <p><code>Namespace</code></p></li>
287    /// <li>
288    /// <p><code>Stat</code></p></li>
289    /// <li>
290    /// <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code></p></li>
291    /// </ul>
292    /// <p>Instead, specify the metric math anomaly detector attributes as part of the <code>MetricMathAnomalyDetector</code> property.</p>
293    pub fn get_metric_math_anomaly_detector(&self) -> &::std::option::Option<crate::types::MetricMathAnomalyDetector> {
294        self.inner.get_metric_math_anomaly_detector()
295    }
296}