aws_sdk_rds/operation/describe_events/
_describe_events_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeEventsInput {
7    /// <p>The identifier of the event source for which events are returned. If not specified, then all sources are included in the response.</p>
8    /// <p>Constraints:</p>
9    /// <ul>
10    /// <li>
11    /// <p>If <code>SourceIdentifier</code> is supplied, <code>SourceType</code> must also be provided.</p></li>
12    /// <li>
13    /// <p>If the source type is a DB instance, a <code>DBInstanceIdentifier</code> value must be supplied.</p></li>
14    /// <li>
15    /// <p>If the source type is a DB cluster, a <code>DBClusterIdentifier</code> value must be supplied.</p></li>
16    /// <li>
17    /// <p>If the source type is a DB parameter group, a <code>DBParameterGroupName</code> value must be supplied.</p></li>
18    /// <li>
19    /// <p>If the source type is a DB security group, a <code>DBSecurityGroupName</code> value must be supplied.</p></li>
20    /// <li>
21    /// <p>If the source type is a DB snapshot, a <code>DBSnapshotIdentifier</code> value must be supplied.</p></li>
22    /// <li>
23    /// <p>If the source type is a DB cluster snapshot, a <code>DBClusterSnapshotIdentifier</code> value must be supplied.</p></li>
24    /// <li>
25    /// <p>If the source type is an RDS Proxy, a <code>DBProxyName</code> value must be supplied.</p></li>
26    /// <li>
27    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
28    /// </ul>
29    pub source_identifier: ::std::option::Option<::std::string::String>,
30    /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
31    pub source_type: ::std::option::Option<crate::types::SourceType>,
32    /// <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>
33    /// <p>Example: 2009-07-08T18:00Z</p>
34    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
35    /// <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>
36    /// <p>Example: 2009-07-08T18:00Z</p>
37    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
38    /// <p>The number of minutes to retrieve events for.</p>
39    /// <p>Default: 60</p>
40    pub duration: ::std::option::Option<i32>,
41    /// <p>A list of event categories that trigger notifications for a event notification subscription.</p>
42    pub event_categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43    /// <p>This parameter isn't currently supported.</p>
44    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
45    /// <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 called a marker is included in the response so that you can retrieve the remaining results.</p>
46    /// <p>Default: 100</p>
47    /// <p>Constraints: Minimum 20, maximum 100.</p>
48    pub max_records: ::std::option::Option<i32>,
49    /// <p>An optional pagination token provided by a previous DescribeEvents request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
50    pub marker: ::std::option::Option<::std::string::String>,
51}
52impl DescribeEventsInput {
53    /// <p>The identifier of the event source for which events are returned. If not specified, then all sources are included in the response.</p>
54    /// <p>Constraints:</p>
55    /// <ul>
56    /// <li>
57    /// <p>If <code>SourceIdentifier</code> is supplied, <code>SourceType</code> must also be provided.</p></li>
58    /// <li>
59    /// <p>If the source type is a DB instance, a <code>DBInstanceIdentifier</code> value must be supplied.</p></li>
60    /// <li>
61    /// <p>If the source type is a DB cluster, a <code>DBClusterIdentifier</code> value must be supplied.</p></li>
62    /// <li>
63    /// <p>If the source type is a DB parameter group, a <code>DBParameterGroupName</code> value must be supplied.</p></li>
64    /// <li>
65    /// <p>If the source type is a DB security group, a <code>DBSecurityGroupName</code> value must be supplied.</p></li>
66    /// <li>
67    /// <p>If the source type is a DB snapshot, a <code>DBSnapshotIdentifier</code> value must be supplied.</p></li>
68    /// <li>
69    /// <p>If the source type is a DB cluster snapshot, a <code>DBClusterSnapshotIdentifier</code> value must be supplied.</p></li>
70    /// <li>
71    /// <p>If the source type is an RDS Proxy, a <code>DBProxyName</code> value must be supplied.</p></li>
72    /// <li>
73    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
74    /// </ul>
75    pub fn source_identifier(&self) -> ::std::option::Option<&str> {
76        self.source_identifier.as_deref()
77    }
78    /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
79    pub fn source_type(&self) -> ::std::option::Option<&crate::types::SourceType> {
80        self.source_type.as_ref()
81    }
82    /// <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>
83    /// <p>Example: 2009-07-08T18:00Z</p>
84    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
85        self.start_time.as_ref()
86    }
87    /// <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>
88    /// <p>Example: 2009-07-08T18:00Z</p>
89    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
90        self.end_time.as_ref()
91    }
92    /// <p>The number of minutes to retrieve events for.</p>
93    /// <p>Default: 60</p>
94    pub fn duration(&self) -> ::std::option::Option<i32> {
95        self.duration
96    }
97    /// <p>A list of event categories that trigger notifications for a event notification subscription.</p>
98    ///
99    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.event_categories.is_none()`.
100    pub fn event_categories(&self) -> &[::std::string::String] {
101        self.event_categories.as_deref().unwrap_or_default()
102    }
103    /// <p>This parameter isn't currently supported.</p>
104    ///
105    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
106    pub fn filters(&self) -> &[crate::types::Filter] {
107        self.filters.as_deref().unwrap_or_default()
108    }
109    /// <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 called a marker is included in the response so that you can retrieve the remaining results.</p>
110    /// <p>Default: 100</p>
111    /// <p>Constraints: Minimum 20, maximum 100.</p>
112    pub fn max_records(&self) -> ::std::option::Option<i32> {
113        self.max_records
114    }
115    /// <p>An optional pagination token provided by a previous DescribeEvents request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
116    pub fn marker(&self) -> ::std::option::Option<&str> {
117        self.marker.as_deref()
118    }
119}
120impl DescribeEventsInput {
121    /// Creates a new builder-style object to manufacture [`DescribeEventsInput`](crate::operation::describe_events::DescribeEventsInput).
122    pub fn builder() -> crate::operation::describe_events::builders::DescribeEventsInputBuilder {
123        crate::operation::describe_events::builders::DescribeEventsInputBuilder::default()
124    }
125}
126
127/// A builder for [`DescribeEventsInput`](crate::operation::describe_events::DescribeEventsInput).
128#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
129#[non_exhaustive]
130pub struct DescribeEventsInputBuilder {
131    pub(crate) source_identifier: ::std::option::Option<::std::string::String>,
132    pub(crate) source_type: ::std::option::Option<crate::types::SourceType>,
133    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
134    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
135    pub(crate) duration: ::std::option::Option<i32>,
136    pub(crate) event_categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
137    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
138    pub(crate) max_records: ::std::option::Option<i32>,
139    pub(crate) marker: ::std::option::Option<::std::string::String>,
140}
141impl DescribeEventsInputBuilder {
142    /// <p>The identifier of the event source for which events are returned. If not specified, then all sources are included in the response.</p>
143    /// <p>Constraints:</p>
144    /// <ul>
145    /// <li>
146    /// <p>If <code>SourceIdentifier</code> is supplied, <code>SourceType</code> must also be provided.</p></li>
147    /// <li>
148    /// <p>If the source type is a DB instance, a <code>DBInstanceIdentifier</code> value must be supplied.</p></li>
149    /// <li>
150    /// <p>If the source type is a DB cluster, a <code>DBClusterIdentifier</code> value must be supplied.</p></li>
151    /// <li>
152    /// <p>If the source type is a DB parameter group, a <code>DBParameterGroupName</code> value must be supplied.</p></li>
153    /// <li>
154    /// <p>If the source type is a DB security group, a <code>DBSecurityGroupName</code> value must be supplied.</p></li>
155    /// <li>
156    /// <p>If the source type is a DB snapshot, a <code>DBSnapshotIdentifier</code> value must be supplied.</p></li>
157    /// <li>
158    /// <p>If the source type is a DB cluster snapshot, a <code>DBClusterSnapshotIdentifier</code> value must be supplied.</p></li>
159    /// <li>
160    /// <p>If the source type is an RDS Proxy, a <code>DBProxyName</code> value must be supplied.</p></li>
161    /// <li>
162    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
163    /// </ul>
164    pub fn source_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.source_identifier = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>The identifier of the event source for which events are returned. If not specified, then all sources are included in the response.</p>
169    /// <p>Constraints:</p>
170    /// <ul>
171    /// <li>
172    /// <p>If <code>SourceIdentifier</code> is supplied, <code>SourceType</code> must also be provided.</p></li>
173    /// <li>
174    /// <p>If the source type is a DB instance, a <code>DBInstanceIdentifier</code> value must be supplied.</p></li>
175    /// <li>
176    /// <p>If the source type is a DB cluster, a <code>DBClusterIdentifier</code> value must be supplied.</p></li>
177    /// <li>
178    /// <p>If the source type is a DB parameter group, a <code>DBParameterGroupName</code> value must be supplied.</p></li>
179    /// <li>
180    /// <p>If the source type is a DB security group, a <code>DBSecurityGroupName</code> value must be supplied.</p></li>
181    /// <li>
182    /// <p>If the source type is a DB snapshot, a <code>DBSnapshotIdentifier</code> value must be supplied.</p></li>
183    /// <li>
184    /// <p>If the source type is a DB cluster snapshot, a <code>DBClusterSnapshotIdentifier</code> value must be supplied.</p></li>
185    /// <li>
186    /// <p>If the source type is an RDS Proxy, a <code>DBProxyName</code> value must be supplied.</p></li>
187    /// <li>
188    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
189    /// </ul>
190    pub fn set_source_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.source_identifier = input;
192        self
193    }
194    /// <p>The identifier of the event source for which events are returned. If not specified, then all sources are included in the response.</p>
195    /// <p>Constraints:</p>
196    /// <ul>
197    /// <li>
198    /// <p>If <code>SourceIdentifier</code> is supplied, <code>SourceType</code> must also be provided.</p></li>
199    /// <li>
200    /// <p>If the source type is a DB instance, a <code>DBInstanceIdentifier</code> value must be supplied.</p></li>
201    /// <li>
202    /// <p>If the source type is a DB cluster, a <code>DBClusterIdentifier</code> value must be supplied.</p></li>
203    /// <li>
204    /// <p>If the source type is a DB parameter group, a <code>DBParameterGroupName</code> value must be supplied.</p></li>
205    /// <li>
206    /// <p>If the source type is a DB security group, a <code>DBSecurityGroupName</code> value must be supplied.</p></li>
207    /// <li>
208    /// <p>If the source type is a DB snapshot, a <code>DBSnapshotIdentifier</code> value must be supplied.</p></li>
209    /// <li>
210    /// <p>If the source type is a DB cluster snapshot, a <code>DBClusterSnapshotIdentifier</code> value must be supplied.</p></li>
211    /// <li>
212    /// <p>If the source type is an RDS Proxy, a <code>DBProxyName</code> value must be supplied.</p></li>
213    /// <li>
214    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
215    /// </ul>
216    pub fn get_source_identifier(&self) -> &::std::option::Option<::std::string::String> {
217        &self.source_identifier
218    }
219    /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
220    pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
221        self.source_type = ::std::option::Option::Some(input);
222        self
223    }
224    /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
225    pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
226        self.source_type = input;
227        self
228    }
229    /// <p>The event source to retrieve events for. If no value is specified, all events are returned.</p>
230    pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
231        &self.source_type
232    }
233    /// <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>
234    /// <p>Example: 2009-07-08T18:00Z</p>
235    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
236        self.start_time = ::std::option::Option::Some(input);
237        self
238    }
239    /// <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>
240    /// <p>Example: 2009-07-08T18:00Z</p>
241    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
242        self.start_time = input;
243        self
244    }
245    /// <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>
246    /// <p>Example: 2009-07-08T18:00Z</p>
247    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
248        &self.start_time
249    }
250    /// <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>
251    /// <p>Example: 2009-07-08T18:00Z</p>
252    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
253        self.end_time = ::std::option::Option::Some(input);
254        self
255    }
256    /// <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>
257    /// <p>Example: 2009-07-08T18:00Z</p>
258    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
259        self.end_time = input;
260        self
261    }
262    /// <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>
263    /// <p>Example: 2009-07-08T18:00Z</p>
264    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
265        &self.end_time
266    }
267    /// <p>The number of minutes to retrieve events for.</p>
268    /// <p>Default: 60</p>
269    pub fn duration(mut self, input: i32) -> Self {
270        self.duration = ::std::option::Option::Some(input);
271        self
272    }
273    /// <p>The number of minutes to retrieve events for.</p>
274    /// <p>Default: 60</p>
275    pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
276        self.duration = input;
277        self
278    }
279    /// <p>The number of minutes to retrieve events for.</p>
280    /// <p>Default: 60</p>
281    pub fn get_duration(&self) -> &::std::option::Option<i32> {
282        &self.duration
283    }
284    /// Appends an item to `event_categories`.
285    ///
286    /// To override the contents of this collection use [`set_event_categories`](Self::set_event_categories).
287    ///
288    /// <p>A list of event categories that trigger notifications for a event notification subscription.</p>
289    pub fn event_categories(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
290        let mut v = self.event_categories.unwrap_or_default();
291        v.push(input.into());
292        self.event_categories = ::std::option::Option::Some(v);
293        self
294    }
295    /// <p>A list of event categories that trigger notifications for a event notification subscription.</p>
296    pub fn set_event_categories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
297        self.event_categories = input;
298        self
299    }
300    /// <p>A list of event categories that trigger notifications for a event notification subscription.</p>
301    pub fn get_event_categories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
302        &self.event_categories
303    }
304    /// Appends an item to `filters`.
305    ///
306    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
307    ///
308    /// <p>This parameter isn't currently supported.</p>
309    pub fn filters(mut self, input: crate::types::Filter) -> Self {
310        let mut v = self.filters.unwrap_or_default();
311        v.push(input);
312        self.filters = ::std::option::Option::Some(v);
313        self
314    }
315    /// <p>This parameter isn't currently supported.</p>
316    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
317        self.filters = input;
318        self
319    }
320    /// <p>This parameter isn't currently supported.</p>
321    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
322        &self.filters
323    }
324    /// <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 called a marker is included in the response so that you can retrieve the remaining results.</p>
325    /// <p>Default: 100</p>
326    /// <p>Constraints: Minimum 20, maximum 100.</p>
327    pub fn max_records(mut self, input: i32) -> Self {
328        self.max_records = ::std::option::Option::Some(input);
329        self
330    }
331    /// <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 called a marker is included in the response so that you can retrieve the remaining results.</p>
332    /// <p>Default: 100</p>
333    /// <p>Constraints: Minimum 20, maximum 100.</p>
334    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
335        self.max_records = input;
336        self
337    }
338    /// <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 called a marker is included in the response so that you can retrieve the remaining results.</p>
339    /// <p>Default: 100</p>
340    /// <p>Constraints: Minimum 20, maximum 100.</p>
341    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
342        &self.max_records
343    }
344    /// <p>An optional pagination token provided by a previous DescribeEvents request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
345    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
346        self.marker = ::std::option::Option::Some(input.into());
347        self
348    }
349    /// <p>An optional pagination token provided by a previous DescribeEvents request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
350    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
351        self.marker = input;
352        self
353    }
354    /// <p>An optional pagination token provided by a previous DescribeEvents request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
355    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
356        &self.marker
357    }
358    /// Consumes the builder and constructs a [`DescribeEventsInput`](crate::operation::describe_events::DescribeEventsInput).
359    pub fn build(
360        self,
361    ) -> ::std::result::Result<crate::operation::describe_events::DescribeEventsInput, ::aws_smithy_types::error::operation::BuildError> {
362        ::std::result::Result::Ok(crate::operation::describe_events::DescribeEventsInput {
363            source_identifier: self.source_identifier,
364            source_type: self.source_type,
365            start_time: self.start_time,
366            end_time: self.end_time,
367            duration: self.duration,
368            event_categories: self.event_categories,
369            filters: self.filters,
370            max_records: self.max_records,
371            marker: self.marker,
372        })
373    }
374}