aws_sdk_location/operation/describe_key/
_describe_key_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct DescribeKeyOutput {
6 pub key: ::std::string::String,
8 pub key_arn: ::std::string::String,
14 pub key_name: ::std::string::String,
16 pub restrictions: ::std::option::Option<crate::types::ApiKeyRestrictions>,
18 pub create_time: ::aws_smithy_types::DateTime,
20 pub expire_time: ::aws_smithy_types::DateTime,
22 pub update_time: ::aws_smithy_types::DateTime,
24 pub description: ::std::option::Option<::std::string::String>,
26 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28 _request_id: Option<String>,
29}
30impl DescribeKeyOutput {
31 pub fn key(&self) -> &str {
33 use std::ops::Deref;
34 self.key.deref()
35 }
36 pub fn key_arn(&self) -> &str {
42 use std::ops::Deref;
43 self.key_arn.deref()
44 }
45 pub fn key_name(&self) -> &str {
47 use std::ops::Deref;
48 self.key_name.deref()
49 }
50 pub fn restrictions(&self) -> ::std::option::Option<&crate::types::ApiKeyRestrictions> {
52 self.restrictions.as_ref()
53 }
54 pub fn create_time(&self) -> &::aws_smithy_types::DateTime {
56 &self.create_time
57 }
58 pub fn expire_time(&self) -> &::aws_smithy_types::DateTime {
60 &self.expire_time
61 }
62 pub fn update_time(&self) -> &::aws_smithy_types::DateTime {
64 &self.update_time
65 }
66 pub fn description(&self) -> ::std::option::Option<&str> {
68 self.description.as_deref()
69 }
70 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
72 self.tags.as_ref()
73 }
74}
75impl ::std::fmt::Debug for DescribeKeyOutput {
76 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
77 let mut formatter = f.debug_struct("DescribeKeyOutput");
78 formatter.field("key", &"*** Sensitive Data Redacted ***");
79 formatter.field("key_arn", &self.key_arn);
80 formatter.field("key_name", &self.key_name);
81 formatter.field("restrictions", &self.restrictions);
82 formatter.field("create_time", &"*** Sensitive Data Redacted ***");
83 formatter.field("expire_time", &"*** Sensitive Data Redacted ***");
84 formatter.field("update_time", &"*** Sensitive Data Redacted ***");
85 formatter.field("description", &self.description);
86 formatter.field("tags", &self.tags);
87 formatter.field("_request_id", &self._request_id);
88 formatter.finish()
89 }
90}
91impl ::aws_types::request_id::RequestId for DescribeKeyOutput {
92 fn request_id(&self) -> Option<&str> {
93 self._request_id.as_deref()
94 }
95}
96impl DescribeKeyOutput {
97 pub fn builder() -> crate::operation::describe_key::builders::DescribeKeyOutputBuilder {
99 crate::operation::describe_key::builders::DescribeKeyOutputBuilder::default()
100 }
101}
102
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
105#[non_exhaustive]
106pub struct DescribeKeyOutputBuilder {
107 pub(crate) key: ::std::option::Option<::std::string::String>,
108 pub(crate) key_arn: ::std::option::Option<::std::string::String>,
109 pub(crate) key_name: ::std::option::Option<::std::string::String>,
110 pub(crate) restrictions: ::std::option::Option<crate::types::ApiKeyRestrictions>,
111 pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
112 pub(crate) expire_time: ::std::option::Option<::aws_smithy_types::DateTime>,
113 pub(crate) update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
114 pub(crate) description: ::std::option::Option<::std::string::String>,
115 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
116 _request_id: Option<String>,
117}
118impl DescribeKeyOutputBuilder {
119 pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.key = ::std::option::Option::Some(input.into());
123 self
124 }
125 pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.key = input;
128 self
129 }
130 pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
132 &self.key
133 }
134 pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.key_arn = ::std::option::Option::Some(input.into());
142 self
143 }
144 pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.key_arn = input;
151 self
152 }
153 pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
159 &self.key_arn
160 }
161 pub fn key_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164 self.key_name = ::std::option::Option::Some(input.into());
165 self
166 }
167 pub fn set_key_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169 self.key_name = input;
170 self
171 }
172 pub fn get_key_name(&self) -> &::std::option::Option<::std::string::String> {
174 &self.key_name
175 }
176 pub fn restrictions(mut self, input: crate::types::ApiKeyRestrictions) -> Self {
179 self.restrictions = ::std::option::Option::Some(input);
180 self
181 }
182 pub fn set_restrictions(mut self, input: ::std::option::Option<crate::types::ApiKeyRestrictions>) -> Self {
184 self.restrictions = input;
185 self
186 }
187 pub fn get_restrictions(&self) -> &::std::option::Option<crate::types::ApiKeyRestrictions> {
189 &self.restrictions
190 }
191 pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
194 self.create_time = ::std::option::Option::Some(input);
195 self
196 }
197 pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
199 self.create_time = input;
200 self
201 }
202 pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
204 &self.create_time
205 }
206 pub fn expire_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
209 self.expire_time = ::std::option::Option::Some(input);
210 self
211 }
212 pub fn set_expire_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
214 self.expire_time = input;
215 self
216 }
217 pub fn get_expire_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
219 &self.expire_time
220 }
221 pub fn update_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
224 self.update_time = ::std::option::Option::Some(input);
225 self
226 }
227 pub fn set_update_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
229 self.update_time = input;
230 self
231 }
232 pub fn get_update_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
234 &self.update_time
235 }
236 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238 self.description = ::std::option::Option::Some(input.into());
239 self
240 }
241 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243 self.description = input;
244 self
245 }
246 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
248 &self.description
249 }
250 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
256 let mut hash_map = self.tags.unwrap_or_default();
257 hash_map.insert(k.into(), v.into());
258 self.tags = ::std::option::Option::Some(hash_map);
259 self
260 }
261 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
263 self.tags = input;
264 self
265 }
266 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
268 &self.tags
269 }
270 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
271 self._request_id = Some(request_id.into());
272 self
273 }
274
275 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
276 self._request_id = request_id;
277 self
278 }
279 pub fn build(self) -> ::std::result::Result<crate::operation::describe_key::DescribeKeyOutput, ::aws_smithy_types::error::operation::BuildError> {
288 ::std::result::Result::Ok(crate::operation::describe_key::DescribeKeyOutput {
289 key: self.key.ok_or_else(|| {
290 ::aws_smithy_types::error::operation::BuildError::missing_field(
291 "key",
292 "key was not specified but it is required when building DescribeKeyOutput",
293 )
294 })?,
295 key_arn: self.key_arn.ok_or_else(|| {
296 ::aws_smithy_types::error::operation::BuildError::missing_field(
297 "key_arn",
298 "key_arn was not specified but it is required when building DescribeKeyOutput",
299 )
300 })?,
301 key_name: self.key_name.ok_or_else(|| {
302 ::aws_smithy_types::error::operation::BuildError::missing_field(
303 "key_name",
304 "key_name was not specified but it is required when building DescribeKeyOutput",
305 )
306 })?,
307 restrictions: self.restrictions,
308 create_time: self.create_time.ok_or_else(|| {
309 ::aws_smithy_types::error::operation::BuildError::missing_field(
310 "create_time",
311 "create_time was not specified but it is required when building DescribeKeyOutput",
312 )
313 })?,
314 expire_time: self.expire_time.ok_or_else(|| {
315 ::aws_smithy_types::error::operation::BuildError::missing_field(
316 "expire_time",
317 "expire_time was not specified but it is required when building DescribeKeyOutput",
318 )
319 })?,
320 update_time: self.update_time.ok_or_else(|| {
321 ::aws_smithy_types::error::operation::BuildError::missing_field(
322 "update_time",
323 "update_time was not specified but it is required when building DescribeKeyOutput",
324 )
325 })?,
326 description: self.description,
327 tags: self.tags,
328 _request_id: self._request_id,
329 })
330 }
331}
332impl ::std::fmt::Debug for DescribeKeyOutputBuilder {
333 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
334 let mut formatter = f.debug_struct("DescribeKeyOutputBuilder");
335 formatter.field("key", &"*** Sensitive Data Redacted ***");
336 formatter.field("key_arn", &self.key_arn);
337 formatter.field("key_name", &self.key_name);
338 formatter.field("restrictions", &self.restrictions);
339 formatter.field("create_time", &"*** Sensitive Data Redacted ***");
340 formatter.field("expire_time", &"*** Sensitive Data Redacted ***");
341 formatter.field("update_time", &"*** Sensitive Data Redacted ***");
342 formatter.field("description", &self.description);
343 formatter.field("tags", &self.tags);
344 formatter.field("_request_id", &self._request_id);
345 formatter.finish()
346 }
347}