aws_sdk_eventbridge/operation/describe_archive/
_describe_archive_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeArchiveOutput {
6 pub archive_arn: ::std::option::Option<::std::string::String>,
8 pub archive_name: ::std::option::Option<::std::string::String>,
10 pub event_source_arn: ::std::option::Option<::std::string::String>,
12 pub description: ::std::option::Option<::std::string::String>,
14 pub event_pattern: ::std::option::Option<::std::string::String>,
16 pub state: ::std::option::Option<crate::types::ArchiveState>,
18 pub state_reason: ::std::option::Option<::std::string::String>,
20 pub kms_key_identifier: ::std::option::Option<::std::string::String>,
23 pub retention_days: ::std::option::Option<i32>,
25 pub size_bytes: i64,
27 pub event_count: i64,
29 pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
31 _request_id: Option<String>,
32}
33impl DescribeArchiveOutput {
34 pub fn archive_arn(&self) -> ::std::option::Option<&str> {
36 self.archive_arn.as_deref()
37 }
38 pub fn archive_name(&self) -> ::std::option::Option<&str> {
40 self.archive_name.as_deref()
41 }
42 pub fn event_source_arn(&self) -> ::std::option::Option<&str> {
44 self.event_source_arn.as_deref()
45 }
46 pub fn description(&self) -> ::std::option::Option<&str> {
48 self.description.as_deref()
49 }
50 pub fn event_pattern(&self) -> ::std::option::Option<&str> {
52 self.event_pattern.as_deref()
53 }
54 pub fn state(&self) -> ::std::option::Option<&crate::types::ArchiveState> {
56 self.state.as_ref()
57 }
58 pub fn state_reason(&self) -> ::std::option::Option<&str> {
60 self.state_reason.as_deref()
61 }
62 pub fn kms_key_identifier(&self) -> ::std::option::Option<&str> {
65 self.kms_key_identifier.as_deref()
66 }
67 pub fn retention_days(&self) -> ::std::option::Option<i32> {
69 self.retention_days
70 }
71 pub fn size_bytes(&self) -> i64 {
73 self.size_bytes
74 }
75 pub fn event_count(&self) -> i64 {
77 self.event_count
78 }
79 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 pub fn builder() -> crate::operation::describe_archive::builders::DescribeArchiveOutputBuilder {
92 crate::operation::describe_archive::builders::DescribeArchiveOutputBuilder::default()
93 }
94}
95
96#[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 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 pub fn set_archive_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.archive_arn = input;
123 self
124 }
125 pub fn get_archive_arn(&self) -> &::std::option::Option<::std::string::String> {
127 &self.archive_arn
128 }
129 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 pub fn set_archive_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.archive_name = input;
137 self
138 }
139 pub fn get_archive_name(&self) -> &::std::option::Option<::std::string::String> {
141 &self.archive_name
142 }
143 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 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 pub fn get_event_source_arn(&self) -> &::std::option::Option<::std::string::String> {
155 &self.event_source_arn
156 }
157 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.description = input;
165 self
166 }
167 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
169 &self.description
170 }
171 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 pub fn set_event_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.event_pattern = input;
179 self
180 }
181 pub fn get_event_pattern(&self) -> &::std::option::Option<::std::string::String> {
183 &self.event_pattern
184 }
185 pub fn state(mut self, input: crate::types::ArchiveState) -> Self {
187 self.state = ::std::option::Option::Some(input);
188 self
189 }
190 pub fn set_state(mut self, input: ::std::option::Option<crate::types::ArchiveState>) -> Self {
192 self.state = input;
193 self
194 }
195 pub fn get_state(&self) -> &::std::option::Option<crate::types::ArchiveState> {
197 &self.state
198 }
199 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 pub fn set_state_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206 self.state_reason = input;
207 self
208 }
209 pub fn get_state_reason(&self) -> &::std::option::Option<::std::string::String> {
211 &self.state_reason
212 }
213 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 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 pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
228 &self.kms_key_identifier
229 }
230 pub fn retention_days(mut self, input: i32) -> Self {
232 self.retention_days = ::std::option::Option::Some(input);
233 self
234 }
235 pub fn set_retention_days(mut self, input: ::std::option::Option<i32>) -> Self {
237 self.retention_days = input;
238 self
239 }
240 pub fn get_retention_days(&self) -> &::std::option::Option<i32> {
242 &self.retention_days
243 }
244 pub fn size_bytes(mut self, input: i64) -> Self {
246 self.size_bytes = ::std::option::Option::Some(input);
247 self
248 }
249 pub fn set_size_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
251 self.size_bytes = input;
252 self
253 }
254 pub fn get_size_bytes(&self) -> &::std::option::Option<i64> {
256 &self.size_bytes
257 }
258 pub fn event_count(mut self, input: i64) -> Self {
260 self.event_count = ::std::option::Option::Some(input);
261 self
262 }
263 pub fn set_event_count(mut self, input: ::std::option::Option<i64>) -> Self {
265 self.event_count = input;
266 self
267 }
268 pub fn get_event_count(&self) -> &::std::option::Option<i64> {
270 &self.event_count
271 }
272 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 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 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 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}