aws_sdk_lookoutmetrics/operation/update_metric_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_metric_set::_update_metric_set_output::UpdateMetricSetOutputBuilder;
3
4pub use crate::operation::update_metric_set::_update_metric_set_input::UpdateMetricSetInputBuilder;
5
6impl crate::operation::update_metric_set::builders::UpdateMetricSetInputBuilder {
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::update_metric_set::UpdateMetricSetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_metric_set::UpdateMetricSetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_metric_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateMetricSet`.
24///
25/// <p>Updates a dataset.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateMetricSetFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_metric_set::builders::UpdateMetricSetInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_metric_set::UpdateMetricSetOutput,
35        crate::operation::update_metric_set::UpdateMetricSetError,
36    > for UpdateMetricSetFluentBuilder
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::update_metric_set::UpdateMetricSetOutput,
44            crate::operation::update_metric_set::UpdateMetricSetError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateMetricSetFluentBuilder {
51    /// Creates a new `UpdateMetricSetFluentBuilder`.
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 UpdateMetricSet as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_metric_set::builders::UpdateMetricSetInputBuilder {
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::update_metric_set::UpdateMetricSetOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_metric_set::UpdateMetricSetError,
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::update_metric_set::UpdateMetricSet::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_metric_set::UpdateMetricSet::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::update_metric_set::UpdateMetricSetOutput,
97        crate::operation::update_metric_set::UpdateMetricSetError,
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 ARN of the dataset to update.</p>
112    pub fn metric_set_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.metric_set_arn(input.into());
114        self
115    }
116    /// <p>The ARN of the dataset to update.</p>
117    pub fn set_metric_set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_metric_set_arn(input);
119        self
120    }
121    /// <p>The ARN of the dataset to update.</p>
122    pub fn get_metric_set_arn(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_metric_set_arn()
124    }
125    /// <p>The dataset's description.</p>
126    pub fn metric_set_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.metric_set_description(input.into());
128        self
129    }
130    /// <p>The dataset's description.</p>
131    pub fn set_metric_set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_metric_set_description(input);
133        self
134    }
135    /// <p>The dataset's description.</p>
136    pub fn get_metric_set_description(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_metric_set_description()
138    }
139    ///
140    /// Appends an item to `MetricList`.
141    ///
142    /// To override the contents of this collection use [`set_metric_list`](Self::set_metric_list).
143    ///
144    /// <p>The metric list.</p>
145    pub fn metric_list(mut self, input: crate::types::Metric) -> Self {
146        self.inner = self.inner.metric_list(input);
147        self
148    }
149    /// <p>The metric list.</p>
150    pub fn set_metric_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Metric>>) -> Self {
151        self.inner = self.inner.set_metric_list(input);
152        self
153    }
154    /// <p>The metric list.</p>
155    pub fn get_metric_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Metric>> {
156        self.inner.get_metric_list()
157    }
158    /// <p>After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3, Redshift, Athena and datasources.</p>
159    pub fn offset(mut self, input: i32) -> Self {
160        self.inner = self.inner.offset(input);
161        self
162    }
163    /// <p>After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3, Redshift, Athena and datasources.</p>
164    pub fn set_offset(mut self, input: ::std::option::Option<i32>) -> Self {
165        self.inner = self.inner.set_offset(input);
166        self
167    }
168    /// <p>After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3, Redshift, Athena and datasources.</p>
169    pub fn get_offset(&self) -> &::std::option::Option<i32> {
170        self.inner.get_offset()
171    }
172    /// <p>The timestamp column.</p>
173    pub fn timestamp_column(mut self, input: crate::types::TimestampColumn) -> Self {
174        self.inner = self.inner.timestamp_column(input);
175        self
176    }
177    /// <p>The timestamp column.</p>
178    pub fn set_timestamp_column(mut self, input: ::std::option::Option<crate::types::TimestampColumn>) -> Self {
179        self.inner = self.inner.set_timestamp_column(input);
180        self
181    }
182    /// <p>The timestamp column.</p>
183    pub fn get_timestamp_column(&self) -> &::std::option::Option<crate::types::TimestampColumn> {
184        self.inner.get_timestamp_column()
185    }
186    ///
187    /// Appends an item to `DimensionList`.
188    ///
189    /// To override the contents of this collection use [`set_dimension_list`](Self::set_dimension_list).
190    ///
191    /// <p>The dimension list.</p>
192    pub fn dimension_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.dimension_list(input.into());
194        self
195    }
196    /// <p>The dimension list.</p>
197    pub fn set_dimension_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
198        self.inner = self.inner.set_dimension_list(input);
199        self
200    }
201    /// <p>The dimension list.</p>
202    pub fn get_dimension_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
203        self.inner.get_dimension_list()
204    }
205    /// <p>The dataset's interval.</p>
206    pub fn metric_set_frequency(mut self, input: crate::types::Frequency) -> Self {
207        self.inner = self.inner.metric_set_frequency(input);
208        self
209    }
210    /// <p>The dataset's interval.</p>
211    pub fn set_metric_set_frequency(mut self, input: ::std::option::Option<crate::types::Frequency>) -> Self {
212        self.inner = self.inner.set_metric_set_frequency(input);
213        self
214    }
215    /// <p>The dataset's interval.</p>
216    pub fn get_metric_set_frequency(&self) -> &::std::option::Option<crate::types::Frequency> {
217        self.inner.get_metric_set_frequency()
218    }
219    /// <p>Contains information about source data used to generate metrics.</p>
220    pub fn metric_source(mut self, input: crate::types::MetricSource) -> Self {
221        self.inner = self.inner.metric_source(input);
222        self
223    }
224    /// <p>Contains information about source data used to generate metrics.</p>
225    pub fn set_metric_source(mut self, input: ::std::option::Option<crate::types::MetricSource>) -> Self {
226        self.inner = self.inner.set_metric_source(input);
227        self
228    }
229    /// <p>Contains information about source data used to generate metrics.</p>
230    pub fn get_metric_source(&self) -> &::std::option::Option<crate::types::MetricSource> {
231        self.inner.get_metric_source()
232    }
233    ///
234    /// Appends an item to `DimensionFilterList`.
235    ///
236    /// To override the contents of this collection use [`set_dimension_filter_list`](Self::set_dimension_filter_list).
237    ///
238    /// <p>Describes a list of filters for choosing specific dimensions and specific values. Each filter consists of the dimension and one of its values that you want to include. When multiple dimensions or values are specified, the dimensions are joined with an AND operation and the values are joined with an OR operation.</p>
239    pub fn dimension_filter_list(mut self, input: crate::types::MetricSetDimensionFilter) -> Self {
240        self.inner = self.inner.dimension_filter_list(input);
241        self
242    }
243    /// <p>Describes a list of filters for choosing specific dimensions and specific values. Each filter consists of the dimension and one of its values that you want to include. When multiple dimensions or values are specified, the dimensions are joined with an AND operation and the values are joined with an OR operation.</p>
244    pub fn set_dimension_filter_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricSetDimensionFilter>>) -> Self {
245        self.inner = self.inner.set_dimension_filter_list(input);
246        self
247    }
248    /// <p>Describes a list of filters for choosing specific dimensions and specific values. Each filter consists of the dimension and one of its values that you want to include. When multiple dimensions or values are specified, the dimensions are joined with an AND operation and the values are joined with an OR operation.</p>
249    pub fn get_dimension_filter_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricSetDimensionFilter>> {
250        self.inner.get_dimension_filter_list()
251    }
252}