aws_sdk_docdb/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 instances, security groups, snapshots, and DB parameter groups for the past 14 days. You can obtain events specific to a particular DB instance, security group, snapshot, or parameter group by providing the name as a parameter. By default, the events of the past hour 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 are returned. If not specified, then all sources are included in the response.</p>
118 /// <p>Constraints:</p>
119 /// <ul>
120 /// <li>
121 /// <p>If <code>SourceIdentifier</code> is provided, <code>SourceType</code> must also be provided.</p></li>
122 /// <li>
123 /// <p>If the source type is <code>DBInstance</code>, a <code>DBInstanceIdentifier</code> must be provided.</p></li>
124 /// <li>
125 /// <p>If the source type is <code>DBSecurityGroup</code>, a <code>DBSecurityGroupName</code> must be provided.</p></li>
126 /// <li>
127 /// <p>If the source type is <code>DBParameterGroup</code>, a <code>DBParameterGroupName</code> must be provided.</p></li>
128 /// <li>
129 /// <p>If the source type is <code>DBSnapshot</code>, a <code>DBSnapshotIdentifier</code> must be provided.</p></li>
130 /// <li>
131 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
132 /// </ul>
133 pub fn source_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.inner = self.inner.source_identifier(input.into());
135 self
136 }
137 /// <p>The identifier of the event source for which events are returned. If not specified, then all sources are included in the response.</p>
138 /// <p>Constraints:</p>
139 /// <ul>
140 /// <li>
141 /// <p>If <code>SourceIdentifier</code> is provided, <code>SourceType</code> must also be provided.</p></li>
142 /// <li>
143 /// <p>If the source type is <code>DBInstance</code>, a <code>DBInstanceIdentifier</code> must be provided.</p></li>
144 /// <li>
145 /// <p>If the source type is <code>DBSecurityGroup</code>, a <code>DBSecurityGroupName</code> must be provided.</p></li>
146 /// <li>
147 /// <p>If the source type is <code>DBParameterGroup</code>, a <code>DBParameterGroupName</code> must be provided.</p></li>
148 /// <li>
149 /// <p>If the source type is <code>DBSnapshot</code>, a <code>DBSnapshotIdentifier</code> must be provided.</p></li>
150 /// <li>
151 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
152 /// </ul>
153 pub fn set_source_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.inner = self.inner.set_source_identifier(input);
155 self
156 }
157 /// <p>The identifier of the event source for which events are returned. If not specified, then all sources are included in the response.</p>
158 /// <p>Constraints:</p>
159 /// <ul>
160 /// <li>
161 /// <p>If <code>SourceIdentifier</code> is provided, <code>SourceType</code> must also be provided.</p></li>
162 /// <li>
163 /// <p>If the source type is <code>DBInstance</code>, a <code>DBInstanceIdentifier</code> must be provided.</p></li>
164 /// <li>
165 /// <p>If the source type is <code>DBSecurityGroup</code>, a <code>DBSecurityGroupName</code> must be provided.</p></li>
166 /// <li>
167 /// <p>If the source type is <code>DBParameterGroup</code>, a <code>DBParameterGroupName</code> must be provided.</p></li>
168 /// <li>
169 /// <p>If the source type is <code>DBSnapshot</code>, a <code>DBSnapshotIdentifier</code> must be provided.</p></li>
170 /// <li>
171 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
172 /// </ul>
173 pub fn get_source_identifier(&self) -> &::std::option::Option<::std::string::String> {
174 self.inner.get_source_identifier()
175 }
176 /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
177 pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
178 self.inner = self.inner.source_type(input);
179 self
180 }
181 /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
182 pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
183 self.inner = self.inner.set_source_type(input);
184 self
185 }
186 /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
187 pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
188 self.inner.get_source_type()
189 }
190 /// <p>The beginning of the time interval to retrieve events for, specified in ISO 8601 format.</p>
191 /// <p>Example: 2009-07-08T18:00Z</p>
192 pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
193 self.inner = self.inner.start_time(input);
194 self
195 }
196 /// <p>The beginning of the time interval to retrieve events for, specified in ISO 8601 format.</p>
197 /// <p>Example: 2009-07-08T18:00Z</p>
198 pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
199 self.inner = self.inner.set_start_time(input);
200 self
201 }
202 /// <p>The beginning of the time interval to retrieve events for, specified in ISO 8601 format.</p>
203 /// <p>Example: 2009-07-08T18:00Z</p>
204 pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
205 self.inner.get_start_time()
206 }
207 /// <p>The end of the time interval for which to retrieve events, specified in ISO 8601 format.</p>
208 /// <p>Example: 2009-07-08T18:00Z</p>
209 pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
210 self.inner = self.inner.end_time(input);
211 self
212 }
213 /// <p>The end of the time interval for which to retrieve events, specified in ISO 8601 format.</p>
214 /// <p>Example: 2009-07-08T18:00Z</p>
215 pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
216 self.inner = self.inner.set_end_time(input);
217 self
218 }
219 /// <p>The end of the time interval for which to retrieve events, specified in ISO 8601 format.</p>
220 /// <p>Example: 2009-07-08T18:00Z</p>
221 pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
222 self.inner.get_end_time()
223 }
224 /// <p>The number of minutes to retrieve events for.</p>
225 /// <p>Default: 60</p>
226 pub fn duration(mut self, input: i32) -> Self {
227 self.inner = self.inner.duration(input);
228 self
229 }
230 /// <p>The number of minutes to retrieve events for.</p>
231 /// <p>Default: 60</p>
232 pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
233 self.inner = self.inner.set_duration(input);
234 self
235 }
236 /// <p>The number of minutes to retrieve events for.</p>
237 /// <p>Default: 60</p>
238 pub fn get_duration(&self) -> &::std::option::Option<i32> {
239 self.inner.get_duration()
240 }
241 ///
242 /// Appends an item to `EventCategories`.
243 ///
244 /// To override the contents of this collection use [`set_event_categories`](Self::set_event_categories).
245 ///
246 /// <p>A list of event categories that trigger notifications for an event notification subscription.</p>
247 pub fn event_categories(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
248 self.inner = self.inner.event_categories(input.into());
249 self
250 }
251 /// <p>A list of event categories that trigger notifications for an event notification subscription.</p>
252 pub fn set_event_categories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
253 self.inner = self.inner.set_event_categories(input);
254 self
255 }
256 /// <p>A list of event categories that trigger notifications for an event notification subscription.</p>
257 pub fn get_event_categories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
258 self.inner.get_event_categories()
259 }
260 ///
261 /// Appends an item to `Filters`.
262 ///
263 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
264 ///
265 /// <p>This parameter is not currently supported.</p>
266 pub fn filters(mut self, input: crate::types::Filter) -> Self {
267 self.inner = self.inner.filters(input);
268 self
269 }
270 /// <p>This parameter is not currently supported.</p>
271 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
272 self.inner = self.inner.set_filters(input);
273 self
274 }
275 /// <p>This parameter is not currently supported.</p>
276 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
277 self.inner.get_filters()
278 }
279 /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token (marker) is included in the response so that the remaining results can be retrieved.</p>
280 /// <p>Default: 100</p>
281 /// <p>Constraints: Minimum 20, maximum 100.</p>
282 pub fn max_records(mut self, input: i32) -> Self {
283 self.inner = self.inner.max_records(input);
284 self
285 }
286 /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token (marker) is included in the response so that the remaining results can be retrieved.</p>
287 /// <p>Default: 100</p>
288 /// <p>Constraints: Minimum 20, maximum 100.</p>
289 pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
290 self.inner = self.inner.set_max_records(input);
291 self
292 }
293 /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token (marker) is included in the response so that the remaining results can be retrieved.</p>
294 /// <p>Default: 100</p>
295 /// <p>Constraints: Minimum 20, maximum 100.</p>
296 pub fn get_max_records(&self) -> &::std::option::Option<i32> {
297 self.inner.get_max_records()
298 }
299 /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
300 pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
301 self.inner = self.inner.marker(input.into());
302 self
303 }
304 /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
305 pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
306 self.inner = self.inner.set_marker(input);
307 self
308 }
309 /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
310 pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
311 self.inner.get_marker()
312 }
313}