aws_sdk_location/operation/create_map/
_create_map_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 CreateMapOutput {
6    /// <p>The name of the map resource.</p>
7    pub map_name: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) for the map resource. Used to specify a resource across all Amazon Web Services.</p>
9    /// <ul>
10    /// <li>
11    /// <p>Format example: <code>arn:aws:geo:region:account-id:map/ExampleMap</code></p></li>
12    /// </ul>
13    pub map_arn: ::std::string::String,
14    /// <p>The timestamp for when the map resource was created 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 create_time: ::aws_smithy_types::DateTime,
16    _request_id: Option<String>,
17}
18impl CreateMapOutput {
19    /// <p>The name of the map resource.</p>
20    pub fn map_name(&self) -> &str {
21        use std::ops::Deref;
22        self.map_name.deref()
23    }
24    /// <p>The Amazon Resource Name (ARN) for the map resource. Used to specify a resource across all Amazon Web Services.</p>
25    /// <ul>
26    /// <li>
27    /// <p>Format example: <code>arn:aws:geo:region:account-id:map/ExampleMap</code></p></li>
28    /// </ul>
29    pub fn map_arn(&self) -> &str {
30        use std::ops::Deref;
31        self.map_arn.deref()
32    }
33    /// <p>The timestamp for when the map resource was created 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 create_time(&self) -> &::aws_smithy_types::DateTime {
35        &self.create_time
36    }
37}
38impl ::std::fmt::Debug for CreateMapOutput {
39    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
40        let mut formatter = f.debug_struct("CreateMapOutput");
41        formatter.field("map_name", &self.map_name);
42        formatter.field("map_arn", &self.map_arn);
43        formatter.field("create_time", &"*** Sensitive Data Redacted ***");
44        formatter.field("_request_id", &self._request_id);
45        formatter.finish()
46    }
47}
48impl ::aws_types::request_id::RequestId for CreateMapOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl CreateMapOutput {
54    /// Creates a new builder-style object to manufacture [`CreateMapOutput`](crate::operation::create_map::CreateMapOutput).
55    pub fn builder() -> crate::operation::create_map::builders::CreateMapOutputBuilder {
56        crate::operation::create_map::builders::CreateMapOutputBuilder::default()
57    }
58}
59
60/// A builder for [`CreateMapOutput`](crate::operation::create_map::CreateMapOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
62#[non_exhaustive]
63pub struct CreateMapOutputBuilder {
64    pub(crate) map_name: ::std::option::Option<::std::string::String>,
65    pub(crate) map_arn: ::std::option::Option<::std::string::String>,
66    pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
67    _request_id: Option<String>,
68}
69impl CreateMapOutputBuilder {
70    /// <p>The name of the map resource.</p>
71    /// This field is required.
72    pub fn map_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.map_name = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>The name of the map resource.</p>
77    pub fn set_map_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.map_name = input;
79        self
80    }
81    /// <p>The name of the map resource.</p>
82    pub fn get_map_name(&self) -> &::std::option::Option<::std::string::String> {
83        &self.map_name
84    }
85    /// <p>The Amazon Resource Name (ARN) for the map resource. Used to specify a resource across all Amazon Web Services.</p>
86    /// <ul>
87    /// <li>
88    /// <p>Format example: <code>arn:aws:geo:region:account-id:map/ExampleMap</code></p></li>
89    /// </ul>
90    /// This field is required.
91    pub fn map_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.map_arn = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>The Amazon Resource Name (ARN) for the map resource. Used to specify a resource across all Amazon Web Services.</p>
96    /// <ul>
97    /// <li>
98    /// <p>Format example: <code>arn:aws:geo:region:account-id:map/ExampleMap</code></p></li>
99    /// </ul>
100    pub fn set_map_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.map_arn = input;
102        self
103    }
104    /// <p>The Amazon Resource Name (ARN) for the map resource. Used to specify a resource across all Amazon Web Services.</p>
105    /// <ul>
106    /// <li>
107    /// <p>Format example: <code>arn:aws:geo:region:account-id:map/ExampleMap</code></p></li>
108    /// </ul>
109    pub fn get_map_arn(&self) -> &::std::option::Option<::std::string::String> {
110        &self.map_arn
111    }
112    /// <p>The timestamp for when the map resource was created 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 create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
115        self.create_time = ::std::option::Option::Some(input);
116        self
117    }
118    /// <p>The timestamp for when the map resource was created 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_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
120        self.create_time = input;
121        self
122    }
123    /// <p>The timestamp for when the map resource was created 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_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
125        &self.create_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 [`CreateMapOutput`](crate::operation::create_map::CreateMapOutput).
137    /// This method will fail if any of the following fields are not set:
138    /// - [`map_name`](crate::operation::create_map::builders::CreateMapOutputBuilder::map_name)
139    /// - [`map_arn`](crate::operation::create_map::builders::CreateMapOutputBuilder::map_arn)
140    /// - [`create_time`](crate::operation::create_map::builders::CreateMapOutputBuilder::create_time)
141    pub fn build(self) -> ::std::result::Result<crate::operation::create_map::CreateMapOutput, ::aws_smithy_types::error::operation::BuildError> {
142        ::std::result::Result::Ok(crate::operation::create_map::CreateMapOutput {
143            map_name: self.map_name.ok_or_else(|| {
144                ::aws_smithy_types::error::operation::BuildError::missing_field(
145                    "map_name",
146                    "map_name was not specified but it is required when building CreateMapOutput",
147                )
148            })?,
149            map_arn: self.map_arn.ok_or_else(|| {
150                ::aws_smithy_types::error::operation::BuildError::missing_field(
151                    "map_arn",
152                    "map_arn was not specified but it is required when building CreateMapOutput",
153                )
154            })?,
155            create_time: self.create_time.ok_or_else(|| {
156                ::aws_smithy_types::error::operation::BuildError::missing_field(
157                    "create_time",
158                    "create_time was not specified but it is required when building CreateMapOutput",
159                )
160            })?,
161            _request_id: self._request_id,
162        })
163    }
164}
165impl ::std::fmt::Debug for CreateMapOutputBuilder {
166    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
167        let mut formatter = f.debug_struct("CreateMapOutputBuilder");
168        formatter.field("map_name", &self.map_name);
169        formatter.field("map_arn", &self.map_arn);
170        formatter.field("create_time", &"*** Sensitive Data Redacted ***");
171        formatter.field("_request_id", &self._request_id);
172        formatter.finish()
173    }
174}