aws_sdk_redshift/operation/describe_events/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_events::_describe_events_output::DescribeEventsOutputBuilder;
3
4pub use crate::operation::describe_events::_describe_events_input::DescribeEventsInputBuilder;
5
6impl crate::operation::describe_events::builders::DescribeEventsInputBuilder {
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::describe_events::DescribeEventsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_events::DescribeEventsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_events();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeEvents`.
24///
25/// <p>Returns events related to clusters, security groups, snapshots, and parameter groups for the past 14 days. Events specific to a particular cluster, security group, snapshot or parameter group can be obtained by providing the name as a parameter. By default, the past hour of events are returned.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DescribeEventsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::describe_events::builders::DescribeEventsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::describe_events::DescribeEventsOutput,
35        crate::operation::describe_events::DescribeEventsError,
36    > for DescribeEventsFluentBuilder
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::describe_events::DescribeEventsOutput,
44            crate::operation::describe_events::DescribeEventsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl DescribeEventsFluentBuilder {
51    /// Creates a new `DescribeEventsFluentBuilder`.
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 DescribeEvents as a reference.
60    pub fn as_input(&self) -> &crate::operation::describe_events::builders::DescribeEventsInputBuilder {
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::describe_events::DescribeEventsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::describe_events::DescribeEventsError,
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::describe_events::DescribeEvents::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::describe_events::DescribeEvents::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::describe_events::DescribeEventsOutput,
97        crate::operation::describe_events::DescribeEventsError,
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    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::describe_events::paginator::DescribeEventsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::describe_events::paginator::DescribeEventsPaginator {
115        crate::operation::describe_events::paginator::DescribeEventsPaginator::new(self.handle, self.inner)
116    }
117    /// <p>The identifier of the event source for which events will be returned. If this parameter is not specified, then all sources are included in the response.</p>
118    /// <p>Constraints:</p>
119    /// <p>If <i>SourceIdentifier</i> is supplied, <i>SourceType</i> must also be provided.</p>
120    /// <ul>
121    /// <li>
122    /// <p>Specify a cluster identifier when <i>SourceType</i> is <code>cluster</code>.</p></li>
123    /// <li>
124    /// <p>Specify a cluster security group name when <i>SourceType</i> is <code>cluster-security-group</code>.</p></li>
125    /// <li>
126    /// <p>Specify a cluster parameter group name when <i>SourceType</i> is <code>cluster-parameter-group</code>.</p></li>
127    /// <li>
128    /// <p>Specify a cluster snapshot identifier when <i>SourceType</i> is <code>cluster-snapshot</code>.</p></li>
129    /// </ul>
130    pub fn source_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.source_identifier(input.into());
132        self
133    }
134    /// <p>The identifier of the event source for which events will be returned. If this parameter is not specified, then all sources are included in the response.</p>
135    /// <p>Constraints:</p>
136    /// <p>If <i>SourceIdentifier</i> is supplied, <i>SourceType</i> must also be provided.</p>
137    /// <ul>
138    /// <li>
139    /// <p>Specify a cluster identifier when <i>SourceType</i> is <code>cluster</code>.</p></li>
140    /// <li>
141    /// <p>Specify a cluster security group name when <i>SourceType</i> is <code>cluster-security-group</code>.</p></li>
142    /// <li>
143    /// <p>Specify a cluster parameter group name when <i>SourceType</i> is <code>cluster-parameter-group</code>.</p></li>
144    /// <li>
145    /// <p>Specify a cluster snapshot identifier when <i>SourceType</i> is <code>cluster-snapshot</code>.</p></li>
146    /// </ul>
147    pub fn set_source_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_source_identifier(input);
149        self
150    }
151    /// <p>The identifier of the event source for which events will be returned. If this parameter is not specified, then all sources are included in the response.</p>
152    /// <p>Constraints:</p>
153    /// <p>If <i>SourceIdentifier</i> is supplied, <i>SourceType</i> must also be provided.</p>
154    /// <ul>
155    /// <li>
156    /// <p>Specify a cluster identifier when <i>SourceType</i> is <code>cluster</code>.</p></li>
157    /// <li>
158    /// <p>Specify a cluster security group name when <i>SourceType</i> is <code>cluster-security-group</code>.</p></li>
159    /// <li>
160    /// <p>Specify a cluster parameter group name when <i>SourceType</i> is <code>cluster-parameter-group</code>.</p></li>
161    /// <li>
162    /// <p>Specify a cluster snapshot identifier when <i>SourceType</i> is <code>cluster-snapshot</code>.</p></li>
163    /// </ul>
164    pub fn get_source_identifier(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_source_identifier()
166    }
167    /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
168    /// <p>Constraints:</p>
169    /// <p>If <i>SourceType</i> is supplied, <i>SourceIdentifier</i> must also be provided.</p>
170    /// <ul>
171    /// <li>
172    /// <p>Specify <code>cluster</code> when <i>SourceIdentifier</i> is a cluster identifier.</p></li>
173    /// <li>
174    /// <p>Specify <code>cluster-security-group</code> when <i>SourceIdentifier</i> is a cluster security group name.</p></li>
175    /// <li>
176    /// <p>Specify <code>cluster-parameter-group</code> when <i>SourceIdentifier</i> is a cluster parameter group name.</p></li>
177    /// <li>
178    /// <p>Specify <code>cluster-snapshot</code> when <i>SourceIdentifier</i> is a cluster snapshot identifier.</p></li>
179    /// </ul>
180    pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
181        self.inner = self.inner.source_type(input);
182        self
183    }
184    /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
185    /// <p>Constraints:</p>
186    /// <p>If <i>SourceType</i> is supplied, <i>SourceIdentifier</i> must also be provided.</p>
187    /// <ul>
188    /// <li>
189    /// <p>Specify <code>cluster</code> when <i>SourceIdentifier</i> is a cluster identifier.</p></li>
190    /// <li>
191    /// <p>Specify <code>cluster-security-group</code> when <i>SourceIdentifier</i> is a cluster security group name.</p></li>
192    /// <li>
193    /// <p>Specify <code>cluster-parameter-group</code> when <i>SourceIdentifier</i> is a cluster parameter group name.</p></li>
194    /// <li>
195    /// <p>Specify <code>cluster-snapshot</code> when <i>SourceIdentifier</i> is a cluster snapshot identifier.</p></li>
196    /// </ul>
197    pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
198        self.inner = self.inner.set_source_type(input);
199        self
200    }
201    /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
202    /// <p>Constraints:</p>
203    /// <p>If <i>SourceType</i> is supplied, <i>SourceIdentifier</i> must also be provided.</p>
204    /// <ul>
205    /// <li>
206    /// <p>Specify <code>cluster</code> when <i>SourceIdentifier</i> is a cluster identifier.</p></li>
207    /// <li>
208    /// <p>Specify <code>cluster-security-group</code> when <i>SourceIdentifier</i> is a cluster security group name.</p></li>
209    /// <li>
210    /// <p>Specify <code>cluster-parameter-group</code> when <i>SourceIdentifier</i> is a cluster parameter group name.</p></li>
211    /// <li>
212    /// <p>Specify <code>cluster-snapshot</code> when <i>SourceIdentifier</i> is a cluster snapshot identifier.</p></li>
213    /// </ul>
214    pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
215        self.inner.get_source_type()
216    }
217    /// <p>The beginning of the time interval to retrieve events for, specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
218    /// <p>Example: <code>2009-07-08T18:00Z</code></p>
219    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
220        self.inner = self.inner.start_time(input);
221        self
222    }
223    /// <p>The beginning of the time interval to retrieve events for, specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
224    /// <p>Example: <code>2009-07-08T18:00Z</code></p>
225    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
226        self.inner = self.inner.set_start_time(input);
227        self
228    }
229    /// <p>The beginning of the time interval to retrieve events for, specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
230    /// <p>Example: <code>2009-07-08T18:00Z</code></p>
231    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
232        self.inner.get_start_time()
233    }
234    /// <p>The end of the time interval for which to retrieve events, specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
235    /// <p>Example: <code>2009-07-08T18:00Z</code></p>
236    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
237        self.inner = self.inner.end_time(input);
238        self
239    }
240    /// <p>The end of the time interval for which to retrieve events, specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
241    /// <p>Example: <code>2009-07-08T18:00Z</code></p>
242    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
243        self.inner = self.inner.set_end_time(input);
244        self
245    }
246    /// <p>The end of the time interval for which to retrieve events, specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
247    /// <p>Example: <code>2009-07-08T18:00Z</code></p>
248    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
249        self.inner.get_end_time()
250    }
251    /// <p>The number of minutes prior to the time of the request for which to retrieve events. For example, if the request is sent at 18:00 and you specify a duration of 60, then only events which have occurred after 17:00 will be returned.</p>
252    /// <p>Default: <code>60</code></p>
253    pub fn duration(mut self, input: i32) -> Self {
254        self.inner = self.inner.duration(input);
255        self
256    }
257    /// <p>The number of minutes prior to the time of the request for which to retrieve events. For example, if the request is sent at 18:00 and you specify a duration of 60, then only events which have occurred after 17:00 will be returned.</p>
258    /// <p>Default: <code>60</code></p>
259    pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
260        self.inner = self.inner.set_duration(input);
261        self
262    }
263    /// <p>The number of minutes prior to the time of the request for which to retrieve events. For example, if the request is sent at 18:00 and you specify a duration of 60, then only events which have occurred after 17:00 will be returned.</p>
264    /// <p>Default: <code>60</code></p>
265    pub fn get_duration(&self) -> &::std::option::Option<i32> {
266        self.inner.get_duration()
267    }
268    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
269    /// <p>Default: <code>100</code></p>
270    /// <p>Constraints: minimum 20, maximum 100.</p>
271    pub fn max_records(mut self, input: i32) -> Self {
272        self.inner = self.inner.max_records(input);
273        self
274    }
275    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
276    /// <p>Default: <code>100</code></p>
277    /// <p>Constraints: minimum 20, maximum 100.</p>
278    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
279        self.inner = self.inner.set_max_records(input);
280        self
281    }
282    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
283    /// <p>Default: <code>100</code></p>
284    /// <p>Constraints: minimum 20, maximum 100.</p>
285    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
286        self.inner.get_max_records()
287    }
288    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeEvents</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
289    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
290        self.inner = self.inner.marker(input.into());
291        self
292    }
293    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeEvents</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
294    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
295        self.inner = self.inner.set_marker(input);
296        self
297    }
298    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeEvents</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
299    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
300        self.inner.get_marker()
301    }
302}