aws_sdk_location/operation/update_key/
_update_key_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)]
5pub struct UpdateKeyOutput {
6    /// <p>The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.</p>
7    /// <ul>
8    /// <li>
9    /// <p>Format example: <code>arn:aws:geo:region:account-id:key/ExampleKey</code></p></li>
10    /// </ul>
11    pub key_arn: ::std::string::String,
12    /// <p>The name of the API key resource.</p>
13    pub key_name: ::std::string::String,
14    /// <p>The timestamp for when the API key resource was last updated in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>.</p>
15    pub update_time: ::aws_smithy_types::DateTime,
16    _request_id: Option<String>,
17}
18impl UpdateKeyOutput {
19    /// <p>The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.</p>
20    /// <ul>
21    /// <li>
22    /// <p>Format example: <code>arn:aws:geo:region:account-id:key/ExampleKey</code></p></li>
23    /// </ul>
24    pub fn key_arn(&self) -> &str {
25        use std::ops::Deref;
26        self.key_arn.deref()
27    }
28    /// <p>The name of the API key resource.</p>
29    pub fn key_name(&self) -> &str {
30        use std::ops::Deref;
31        self.key_name.deref()
32    }
33    /// <p>The timestamp for when the API key resource was last updated in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>.</p>
34    pub fn update_time(&self) -> &::aws_smithy_types::DateTime {
35        &self.update_time
36    }
37}
38impl ::std::fmt::Debug for UpdateKeyOutput {
39    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
40        let mut formatter = f.debug_struct("UpdateKeyOutput");
41        formatter.field("key_arn", &self.key_arn);
42        formatter.field("key_name", &self.key_name);
43        formatter.field("update_time", &"*** Sensitive Data Redacted ***");
44        formatter.field("_request_id", &self._request_id);
45        formatter.finish()
46    }
47}
48impl ::aws_types::request_id::RequestId for UpdateKeyOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl UpdateKeyOutput {
54    /// Creates a new builder-style object to manufacture [`UpdateKeyOutput`](crate::operation::update_key::UpdateKeyOutput).
55    pub fn builder() -> crate::operation::update_key::builders::UpdateKeyOutputBuilder {
56        crate::operation::update_key::builders::UpdateKeyOutputBuilder::default()
57    }
58}
59
60/// A builder for [`UpdateKeyOutput`](crate::operation::update_key::UpdateKeyOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
62#[non_exhaustive]
63pub struct UpdateKeyOutputBuilder {
64    pub(crate) key_arn: ::std::option::Option<::std::string::String>,
65    pub(crate) key_name: ::std::option::Option<::std::string::String>,
66    pub(crate) update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
67    _request_id: Option<String>,
68}
69impl UpdateKeyOutputBuilder {
70    /// <p>The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.</p>
71    /// <ul>
72    /// <li>
73    /// <p>Format example: <code>arn:aws:geo:region:account-id:key/ExampleKey</code></p></li>
74    /// </ul>
75    /// This field is required.
76    pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.key_arn = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.</p>
81    /// <ul>
82    /// <li>
83    /// <p>Format example: <code>arn:aws:geo:region:account-id:key/ExampleKey</code></p></li>
84    /// </ul>
85    pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.key_arn = input;
87        self
88    }
89    /// <p>The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.</p>
90    /// <ul>
91    /// <li>
92    /// <p>Format example: <code>arn:aws:geo:region:account-id:key/ExampleKey</code></p></li>
93    /// </ul>
94    pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
95        &self.key_arn
96    }
97    /// <p>The name of the API key resource.</p>
98    /// This field is required.
99    pub fn key_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.key_name = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>The name of the API key resource.</p>
104    pub fn set_key_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.key_name = input;
106        self
107    }
108    /// <p>The name of the API key resource.</p>
109    pub fn get_key_name(&self) -> &::std::option::Option<::std::string::String> {
110        &self.key_name
111    }
112    /// <p>The timestamp for when the API key resource was last updated in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>.</p>
113    /// This field is required.
114    pub fn update_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
115        self.update_time = ::std::option::Option::Some(input);
116        self
117    }
118    /// <p>The timestamp for when the API key resource was last updated in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>.</p>
119    pub fn set_update_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
120        self.update_time = input;
121        self
122    }
123    /// <p>The timestamp for when the API key resource was last updated in <a href="https://www.iso.org/iso-8601-date-and-time-format.html"> ISO 8601</a> format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code>.</p>
124    pub fn get_update_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
125        &self.update_time
126    }
127    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
128        self._request_id = Some(request_id.into());
129        self
130    }
131
132    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
133        self._request_id = request_id;
134        self
135    }
136    /// Consumes the builder and constructs a [`UpdateKeyOutput`](crate::operation::update_key::UpdateKeyOutput).
137    /// This method will fail if any of the following fields are not set:
138    /// - [`key_arn`](crate::operation::update_key::builders::UpdateKeyOutputBuilder::key_arn)
139    /// - [`key_name`](crate::operation::update_key::builders::UpdateKeyOutputBuilder::key_name)
140    /// - [`update_time`](crate::operation::update_key::builders::UpdateKeyOutputBuilder::update_time)
141    pub fn build(self) -> ::std::result::Result<crate::operation::update_key::UpdateKeyOutput, ::aws_smithy_types::error::operation::BuildError> {
142        ::std::result::Result::Ok(crate::operation::update_key::UpdateKeyOutput {
143            key_arn: self.key_arn.ok_or_else(|| {
144                ::aws_smithy_types::error::operation::BuildError::missing_field(
145                    "key_arn",
146                    "key_arn was not specified but it is required when building UpdateKeyOutput",
147                )
148            })?,
149            key_name: self.key_name.ok_or_else(|| {
150                ::aws_smithy_types::error::operation::BuildError::missing_field(
151                    "key_name",
152                    "key_name was not specified but it is required when building UpdateKeyOutput",
153                )
154            })?,
155            update_time: self.update_time.ok_or_else(|| {
156                ::aws_smithy_types::error::operation::BuildError::missing_field(
157                    "update_time",
158                    "update_time was not specified but it is required when building UpdateKeyOutput",
159                )
160            })?,
161            _request_id: self._request_id,
162        })
163    }
164}
165impl ::std::fmt::Debug for UpdateKeyOutputBuilder {
166    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
167        let mut formatter = f.debug_struct("UpdateKeyOutputBuilder");
168        formatter.field("key_arn", &self.key_arn);
169        formatter.field("key_name", &self.key_name);
170        formatter.field("update_time", &"*** Sensitive Data Redacted ***");
171        formatter.field("_request_id", &self._request_id);
172        formatter.finish()
173    }
174}