aws_sdk_eventbridge/operation/describe_archive/
_describe_archive_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeArchiveOutput {
6    /// <p>The ARN of the archive.</p>
7    pub archive_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the archive.</p>
9    pub archive_name: ::std::option::Option<::std::string::String>,
10    /// <p>The ARN of the event source associated with the archive.</p>
11    pub event_source_arn: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the archive.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The event pattern used to filter events sent to the archive.</p>
15    pub event_pattern: ::std::option::Option<::std::string::String>,
16    /// <p>The state of the archive.</p>
17    pub state: ::std::option::Option<crate::types::ArchiveState>,
18    /// <p>The reason that the archive is in the state.</p>
19    pub state_reason: ::std::option::Option<::std::string::String>,
20    /// <p>The identifier of the KMS customer managed key for EventBridge to use to encrypt this archive, if one has been specified.</p>
21    /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
22    pub kms_key_identifier: ::std::option::Option<::std::string::String>,
23    /// <p>The number of days to retain events for in the archive.</p>
24    pub retention_days: ::std::option::Option<i32>,
25    /// <p>The size of the archive in bytes.</p>
26    pub size_bytes: i64,
27    /// <p>The number of events in the archive.</p>
28    pub event_count: i64,
29    /// <p>The time at which the archive was created.</p>
30    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
31    _request_id: Option<String>,
32}
33impl DescribeArchiveOutput {
34    /// <p>The ARN of the archive.</p>
35    pub fn archive_arn(&self) -> ::std::option::Option<&str> {
36        self.archive_arn.as_deref()
37    }
38    /// <p>The name of the archive.</p>
39    pub fn archive_name(&self) -> ::std::option::Option<&str> {
40        self.archive_name.as_deref()
41    }
42    /// <p>The ARN of the event source associated with the archive.</p>
43    pub fn event_source_arn(&self) -> ::std::option::Option<&str> {
44        self.event_source_arn.as_deref()
45    }
46    /// <p>The description of the archive.</p>
47    pub fn description(&self) -> ::std::option::Option<&str> {
48        self.description.as_deref()
49    }
50    /// <p>The event pattern used to filter events sent to the archive.</p>
51    pub fn event_pattern(&self) -> ::std::option::Option<&str> {
52        self.event_pattern.as_deref()
53    }
54    /// <p>The state of the archive.</p>
55    pub fn state(&self) -> ::std::option::Option<&crate::types::ArchiveState> {
56        self.state.as_ref()
57    }
58    /// <p>The reason that the archive is in the state.</p>
59    pub fn state_reason(&self) -> ::std::option::Option<&str> {
60        self.state_reason.as_deref()
61    }
62    /// <p>The identifier of the KMS customer managed key for EventBridge to use to encrypt this archive, if one has been specified.</p>
63    /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
64    pub fn kms_key_identifier(&self) -> ::std::option::Option<&str> {
65        self.kms_key_identifier.as_deref()
66    }
67    /// <p>The number of days to retain events for in the archive.</p>
68    pub fn retention_days(&self) -> ::std::option::Option<i32> {
69        self.retention_days
70    }
71    /// <p>The size of the archive in bytes.</p>
72    pub fn size_bytes(&self) -> i64 {
73        self.size_bytes
74    }
75    /// <p>The number of events in the archive.</p>
76    pub fn event_count(&self) -> i64 {
77        self.event_count
78    }
79    /// <p>The time at which the archive was created.</p>
80    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
81        self.creation_time.as_ref()
82    }
83}
84impl ::aws_types::request_id::RequestId for DescribeArchiveOutput {
85    fn request_id(&self) -> Option<&str> {
86        self._request_id.as_deref()
87    }
88}
89impl DescribeArchiveOutput {
90    /// Creates a new builder-style object to manufacture [`DescribeArchiveOutput`](crate::operation::describe_archive::DescribeArchiveOutput).
91    pub fn builder() -> crate::operation::describe_archive::builders::DescribeArchiveOutputBuilder {
92        crate::operation::describe_archive::builders::DescribeArchiveOutputBuilder::default()
93    }
94}
95
96/// A builder for [`DescribeArchiveOutput`](crate::operation::describe_archive::DescribeArchiveOutput).
97#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
98#[non_exhaustive]
99pub struct DescribeArchiveOutputBuilder {
100    pub(crate) archive_arn: ::std::option::Option<::std::string::String>,
101    pub(crate) archive_name: ::std::option::Option<::std::string::String>,
102    pub(crate) event_source_arn: ::std::option::Option<::std::string::String>,
103    pub(crate) description: ::std::option::Option<::std::string::String>,
104    pub(crate) event_pattern: ::std::option::Option<::std::string::String>,
105    pub(crate) state: ::std::option::Option<crate::types::ArchiveState>,
106    pub(crate) state_reason: ::std::option::Option<::std::string::String>,
107    pub(crate) kms_key_identifier: ::std::option::Option<::std::string::String>,
108    pub(crate) retention_days: ::std::option::Option<i32>,
109    pub(crate) size_bytes: ::std::option::Option<i64>,
110    pub(crate) event_count: ::std::option::Option<i64>,
111    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
112    _request_id: Option<String>,
113}
114impl DescribeArchiveOutputBuilder {
115    /// <p>The ARN of the archive.</p>
116    pub fn archive_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.archive_arn = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The ARN of the archive.</p>
121    pub fn set_archive_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.archive_arn = input;
123        self
124    }
125    /// <p>The ARN of the archive.</p>
126    pub fn get_archive_arn(&self) -> &::std::option::Option<::std::string::String> {
127        &self.archive_arn
128    }
129    /// <p>The name of the archive.</p>
130    pub fn archive_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.archive_name = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>The name of the archive.</p>
135    pub fn set_archive_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.archive_name = input;
137        self
138    }
139    /// <p>The name of the archive.</p>
140    pub fn get_archive_name(&self) -> &::std::option::Option<::std::string::String> {
141        &self.archive_name
142    }
143    /// <p>The ARN of the event source associated with the archive.</p>
144    pub fn event_source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.event_source_arn = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The ARN of the event source associated with the archive.</p>
149    pub fn set_event_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.event_source_arn = input;
151        self
152    }
153    /// <p>The ARN of the event source associated with the archive.</p>
154    pub fn get_event_source_arn(&self) -> &::std::option::Option<::std::string::String> {
155        &self.event_source_arn
156    }
157    /// <p>The description of the archive.</p>
158    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.description = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The description of the archive.</p>
163    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.description = input;
165        self
166    }
167    /// <p>The description of the archive.</p>
168    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
169        &self.description
170    }
171    /// <p>The event pattern used to filter events sent to the archive.</p>
172    pub fn event_pattern(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.event_pattern = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The event pattern used to filter events sent to the archive.</p>
177    pub fn set_event_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.event_pattern = input;
179        self
180    }
181    /// <p>The event pattern used to filter events sent to the archive.</p>
182    pub fn get_event_pattern(&self) -> &::std::option::Option<::std::string::String> {
183        &self.event_pattern
184    }
185    /// <p>The state of the archive.</p>
186    pub fn state(mut self, input: crate::types::ArchiveState) -> Self {
187        self.state = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>The state of the archive.</p>
191    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ArchiveState>) -> Self {
192        self.state = input;
193        self
194    }
195    /// <p>The state of the archive.</p>
196    pub fn get_state(&self) -> &::std::option::Option<crate::types::ArchiveState> {
197        &self.state
198    }
199    /// <p>The reason that the archive is in the state.</p>
200    pub fn state_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201        self.state_reason = ::std::option::Option::Some(input.into());
202        self
203    }
204    /// <p>The reason that the archive is in the state.</p>
205    pub fn set_state_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206        self.state_reason = input;
207        self
208    }
209    /// <p>The reason that the archive is in the state.</p>
210    pub fn get_state_reason(&self) -> &::std::option::Option<::std::string::String> {
211        &self.state_reason
212    }
213    /// <p>The identifier of the KMS customer managed key for EventBridge to use to encrypt this archive, if one has been specified.</p>
214    /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
215    pub fn kms_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.kms_key_identifier = ::std::option::Option::Some(input.into());
217        self
218    }
219    /// <p>The identifier of the KMS customer managed key for EventBridge to use to encrypt this archive, if one has been specified.</p>
220    /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
221    pub fn set_kms_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222        self.kms_key_identifier = input;
223        self
224    }
225    /// <p>The identifier of the KMS customer managed key for EventBridge to use to encrypt this archive, if one has been specified.</p>
226    /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
227    pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
228        &self.kms_key_identifier
229    }
230    /// <p>The number of days to retain events for in the archive.</p>
231    pub fn retention_days(mut self, input: i32) -> Self {
232        self.retention_days = ::std::option::Option::Some(input);
233        self
234    }
235    /// <p>The number of days to retain events for in the archive.</p>
236    pub fn set_retention_days(mut self, input: ::std::option::Option<i32>) -> Self {
237        self.retention_days = input;
238        self
239    }
240    /// <p>The number of days to retain events for in the archive.</p>
241    pub fn get_retention_days(&self) -> &::std::option::Option<i32> {
242        &self.retention_days
243    }
244    /// <p>The size of the archive in bytes.</p>
245    pub fn size_bytes(mut self, input: i64) -> Self {
246        self.size_bytes = ::std::option::Option::Some(input);
247        self
248    }
249    /// <p>The size of the archive in bytes.</p>
250    pub fn set_size_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
251        self.size_bytes = input;
252        self
253    }
254    /// <p>The size of the archive in bytes.</p>
255    pub fn get_size_bytes(&self) -> &::std::option::Option<i64> {
256        &self.size_bytes
257    }
258    /// <p>The number of events in the archive.</p>
259    pub fn event_count(mut self, input: i64) -> Self {
260        self.event_count = ::std::option::Option::Some(input);
261        self
262    }
263    /// <p>The number of events in the archive.</p>
264    pub fn set_event_count(mut self, input: ::std::option::Option<i64>) -> Self {
265        self.event_count = input;
266        self
267    }
268    /// <p>The number of events in the archive.</p>
269    pub fn get_event_count(&self) -> &::std::option::Option<i64> {
270        &self.event_count
271    }
272    /// <p>The time at which the archive was created.</p>
273    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
274        self.creation_time = ::std::option::Option::Some(input);
275        self
276    }
277    /// <p>The time at which the archive was created.</p>
278    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
279        self.creation_time = input;
280        self
281    }
282    /// <p>The time at which the archive was created.</p>
283    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
284        &self.creation_time
285    }
286    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
287        self._request_id = Some(request_id.into());
288        self
289    }
290
291    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
292        self._request_id = request_id;
293        self
294    }
295    /// Consumes the builder and constructs a [`DescribeArchiveOutput`](crate::operation::describe_archive::DescribeArchiveOutput).
296    pub fn build(self) -> crate::operation::describe_archive::DescribeArchiveOutput {
297        crate::operation::describe_archive::DescribeArchiveOutput {
298            archive_arn: self.archive_arn,
299            archive_name: self.archive_name,
300            event_source_arn: self.event_source_arn,
301            description: self.description,
302            event_pattern: self.event_pattern,
303            state: self.state,
304            state_reason: self.state_reason,
305            kms_key_identifier: self.kms_key_identifier,
306            retention_days: self.retention_days,
307            size_bytes: self.size_bytes.unwrap_or_default(),
308            event_count: self.event_count.unwrap_or_default(),
309            creation_time: self.creation_time,
310            _request_id: self._request_id,
311        }
312    }
313}