aws_sdk_location/operation/get_geofence/_get_geofence_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 GetGeofenceOutput {
6 /// <p>The geofence identifier.</p>
7 pub geofence_id: ::std::string::String,
8 /// <p>Contains the geofence geometry details describing the position of the geofence. Can be a circle, a polygon, or a multipolygon.</p>
9 pub geometry: ::std::option::Option<crate::types::GeofenceGeometry>,
10 /// <p>Identifies the state of the geofence. A geofence will hold one of the following states:</p>
11 /// <ul>
12 /// <li>
13 /// <p><code>ACTIVE</code> — The geofence has been indexed by the system.</p></li>
14 /// <li>
15 /// <p><code>PENDING</code> — The geofence is being processed by the system.</p></li>
16 /// <li>
17 /// <p><code>FAILED</code> — The geofence failed to be indexed by the system.</p></li>
18 /// <li>
19 /// <p><code>DELETED</code> — The geofence has been deleted from the system index.</p></li>
20 /// <li>
21 /// <p><code>DELETING</code> — The geofence is being deleted from the system index.</p></li>
22 /// </ul>
23 pub status: ::std::string::String,
24 /// <p>The timestamp for when the geofence collection 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>
25 pub create_time: ::aws_smithy_types::DateTime,
26 /// <p>The timestamp for when the geofence collection 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>
27 pub update_time: ::aws_smithy_types::DateTime,
28 /// <p>User defined properties of the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.</p>
29 /// <p>Format: <code>"key" : "value"</code></p>
30 pub geofence_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
31 _request_id: Option<String>,
32}
33impl GetGeofenceOutput {
34 /// <p>The geofence identifier.</p>
35 pub fn geofence_id(&self) -> &str {
36 use std::ops::Deref;
37 self.geofence_id.deref()
38 }
39 /// <p>Contains the geofence geometry details describing the position of the geofence. Can be a circle, a polygon, or a multipolygon.</p>
40 pub fn geometry(&self) -> ::std::option::Option<&crate::types::GeofenceGeometry> {
41 self.geometry.as_ref()
42 }
43 /// <p>Identifies the state of the geofence. A geofence will hold one of the following states:</p>
44 /// <ul>
45 /// <li>
46 /// <p><code>ACTIVE</code> — The geofence has been indexed by the system.</p></li>
47 /// <li>
48 /// <p><code>PENDING</code> — The geofence is being processed by the system.</p></li>
49 /// <li>
50 /// <p><code>FAILED</code> — The geofence failed to be indexed by the system.</p></li>
51 /// <li>
52 /// <p><code>DELETED</code> — The geofence has been deleted from the system index.</p></li>
53 /// <li>
54 /// <p><code>DELETING</code> — The geofence is being deleted from the system index.</p></li>
55 /// </ul>
56 pub fn status(&self) -> &str {
57 use std::ops::Deref;
58 self.status.deref()
59 }
60 /// <p>The timestamp for when the geofence collection 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>
61 pub fn create_time(&self) -> &::aws_smithy_types::DateTime {
62 &self.create_time
63 }
64 /// <p>The timestamp for when the geofence collection 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>
65 pub fn update_time(&self) -> &::aws_smithy_types::DateTime {
66 &self.update_time
67 }
68 /// <p>User defined properties of the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.</p>
69 /// <p>Format: <code>"key" : "value"</code></p>
70 pub fn geofence_properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
71 self.geofence_properties.as_ref()
72 }
73}
74impl ::std::fmt::Debug for GetGeofenceOutput {
75 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
76 let mut formatter = f.debug_struct("GetGeofenceOutput");
77 formatter.field("geofence_id", &self.geofence_id);
78 formatter.field("geometry", &self.geometry);
79 formatter.field("status", &self.status);
80 formatter.field("create_time", &"*** Sensitive Data Redacted ***");
81 formatter.field("update_time", &"*** Sensitive Data Redacted ***");
82 formatter.field("geofence_properties", &"*** Sensitive Data Redacted ***");
83 formatter.field("_request_id", &self._request_id);
84 formatter.finish()
85 }
86}
87impl ::aws_types::request_id::RequestId for GetGeofenceOutput {
88 fn request_id(&self) -> Option<&str> {
89 self._request_id.as_deref()
90 }
91}
92impl GetGeofenceOutput {
93 /// Creates a new builder-style object to manufacture [`GetGeofenceOutput`](crate::operation::get_geofence::GetGeofenceOutput).
94 pub fn builder() -> crate::operation::get_geofence::builders::GetGeofenceOutputBuilder {
95 crate::operation::get_geofence::builders::GetGeofenceOutputBuilder::default()
96 }
97}
98
99/// A builder for [`GetGeofenceOutput`](crate::operation::get_geofence::GetGeofenceOutput).
100#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
101#[non_exhaustive]
102pub struct GetGeofenceOutputBuilder {
103 pub(crate) geofence_id: ::std::option::Option<::std::string::String>,
104 pub(crate) geometry: ::std::option::Option<crate::types::GeofenceGeometry>,
105 pub(crate) status: ::std::option::Option<::std::string::String>,
106 pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
107 pub(crate) update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
108 pub(crate) geofence_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
109 _request_id: Option<String>,
110}
111impl GetGeofenceOutputBuilder {
112 /// <p>The geofence identifier.</p>
113 /// This field is required.
114 pub fn geofence_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.geofence_id = ::std::option::Option::Some(input.into());
116 self
117 }
118 /// <p>The geofence identifier.</p>
119 pub fn set_geofence_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.geofence_id = input;
121 self
122 }
123 /// <p>The geofence identifier.</p>
124 pub fn get_geofence_id(&self) -> &::std::option::Option<::std::string::String> {
125 &self.geofence_id
126 }
127 /// <p>Contains the geofence geometry details describing the position of the geofence. Can be a circle, a polygon, or a multipolygon.</p>
128 /// This field is required.
129 pub fn geometry(mut self, input: crate::types::GeofenceGeometry) -> Self {
130 self.geometry = ::std::option::Option::Some(input);
131 self
132 }
133 /// <p>Contains the geofence geometry details describing the position of the geofence. Can be a circle, a polygon, or a multipolygon.</p>
134 pub fn set_geometry(mut self, input: ::std::option::Option<crate::types::GeofenceGeometry>) -> Self {
135 self.geometry = input;
136 self
137 }
138 /// <p>Contains the geofence geometry details describing the position of the geofence. Can be a circle, a polygon, or a multipolygon.</p>
139 pub fn get_geometry(&self) -> &::std::option::Option<crate::types::GeofenceGeometry> {
140 &self.geometry
141 }
142 /// <p>Identifies the state of the geofence. A geofence will hold one of the following states:</p>
143 /// <ul>
144 /// <li>
145 /// <p><code>ACTIVE</code> — The geofence has been indexed by the system.</p></li>
146 /// <li>
147 /// <p><code>PENDING</code> — The geofence is being processed by the system.</p></li>
148 /// <li>
149 /// <p><code>FAILED</code> — The geofence failed to be indexed by the system.</p></li>
150 /// <li>
151 /// <p><code>DELETED</code> — The geofence has been deleted from the system index.</p></li>
152 /// <li>
153 /// <p><code>DELETING</code> — The geofence is being deleted from the system index.</p></li>
154 /// </ul>
155 /// This field is required.
156 pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157 self.status = ::std::option::Option::Some(input.into());
158 self
159 }
160 /// <p>Identifies the state of the geofence. A geofence will hold one of the following states:</p>
161 /// <ul>
162 /// <li>
163 /// <p><code>ACTIVE</code> — The geofence has been indexed by the system.</p></li>
164 /// <li>
165 /// <p><code>PENDING</code> — The geofence is being processed by the system.</p></li>
166 /// <li>
167 /// <p><code>FAILED</code> — The geofence failed to be indexed by the system.</p></li>
168 /// <li>
169 /// <p><code>DELETED</code> — The geofence has been deleted from the system index.</p></li>
170 /// <li>
171 /// <p><code>DELETING</code> — The geofence is being deleted from the system index.</p></li>
172 /// </ul>
173 pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.status = input;
175 self
176 }
177 /// <p>Identifies the state of the geofence. A geofence will hold one of the following states:</p>
178 /// <ul>
179 /// <li>
180 /// <p><code>ACTIVE</code> — The geofence has been indexed by the system.</p></li>
181 /// <li>
182 /// <p><code>PENDING</code> — The geofence is being processed by the system.</p></li>
183 /// <li>
184 /// <p><code>FAILED</code> — The geofence failed to be indexed by the system.</p></li>
185 /// <li>
186 /// <p><code>DELETED</code> — The geofence has been deleted from the system index.</p></li>
187 /// <li>
188 /// <p><code>DELETING</code> — The geofence is being deleted from the system index.</p></li>
189 /// </ul>
190 pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
191 &self.status
192 }
193 /// <p>The timestamp for when the geofence collection 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>
194 /// This field is required.
195 pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
196 self.create_time = ::std::option::Option::Some(input);
197 self
198 }
199 /// <p>The timestamp for when the geofence collection 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>
200 pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
201 self.create_time = input;
202 self
203 }
204 /// <p>The timestamp for when the geofence collection 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>
205 pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
206 &self.create_time
207 }
208 /// <p>The timestamp for when the geofence collection 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>
209 /// This field is required.
210 pub fn update_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
211 self.update_time = ::std::option::Option::Some(input);
212 self
213 }
214 /// <p>The timestamp for when the geofence collection 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>
215 pub fn set_update_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
216 self.update_time = input;
217 self
218 }
219 /// <p>The timestamp for when the geofence collection 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>
220 pub fn get_update_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
221 &self.update_time
222 }
223 /// Adds a key-value pair to `geofence_properties`.
224 ///
225 /// To override the contents of this collection use [`set_geofence_properties`](Self::set_geofence_properties).
226 ///
227 /// <p>User defined properties of the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.</p>
228 /// <p>Format: <code>"key" : "value"</code></p>
229 pub fn geofence_properties(
230 mut self,
231 k: impl ::std::convert::Into<::std::string::String>,
232 v: impl ::std::convert::Into<::std::string::String>,
233 ) -> Self {
234 let mut hash_map = self.geofence_properties.unwrap_or_default();
235 hash_map.insert(k.into(), v.into());
236 self.geofence_properties = ::std::option::Option::Some(hash_map);
237 self
238 }
239 /// <p>User defined properties of the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.</p>
240 /// <p>Format: <code>"key" : "value"</code></p>
241 pub fn set_geofence_properties(
242 mut self,
243 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
244 ) -> Self {
245 self.geofence_properties = input;
246 self
247 }
248 /// <p>User defined properties of the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.</p>
249 /// <p>Format: <code>"key" : "value"</code></p>
250 pub fn get_geofence_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
251 &self.geofence_properties
252 }
253 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
254 self._request_id = Some(request_id.into());
255 self
256 }
257
258 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
259 self._request_id = request_id;
260 self
261 }
262 /// Consumes the builder and constructs a [`GetGeofenceOutput`](crate::operation::get_geofence::GetGeofenceOutput).
263 /// This method will fail if any of the following fields are not set:
264 /// - [`geofence_id`](crate::operation::get_geofence::builders::GetGeofenceOutputBuilder::geofence_id)
265 /// - [`status`](crate::operation::get_geofence::builders::GetGeofenceOutputBuilder::status)
266 /// - [`create_time`](crate::operation::get_geofence::builders::GetGeofenceOutputBuilder::create_time)
267 /// - [`update_time`](crate::operation::get_geofence::builders::GetGeofenceOutputBuilder::update_time)
268 pub fn build(self) -> ::std::result::Result<crate::operation::get_geofence::GetGeofenceOutput, ::aws_smithy_types::error::operation::BuildError> {
269 ::std::result::Result::Ok(crate::operation::get_geofence::GetGeofenceOutput {
270 geofence_id: self.geofence_id.ok_or_else(|| {
271 ::aws_smithy_types::error::operation::BuildError::missing_field(
272 "geofence_id",
273 "geofence_id was not specified but it is required when building GetGeofenceOutput",
274 )
275 })?,
276 geometry: self.geometry,
277 status: self.status.ok_or_else(|| {
278 ::aws_smithy_types::error::operation::BuildError::missing_field(
279 "status",
280 "status was not specified but it is required when building GetGeofenceOutput",
281 )
282 })?,
283 create_time: self.create_time.ok_or_else(|| {
284 ::aws_smithy_types::error::operation::BuildError::missing_field(
285 "create_time",
286 "create_time was not specified but it is required when building GetGeofenceOutput",
287 )
288 })?,
289 update_time: self.update_time.ok_or_else(|| {
290 ::aws_smithy_types::error::operation::BuildError::missing_field(
291 "update_time",
292 "update_time was not specified but it is required when building GetGeofenceOutput",
293 )
294 })?,
295 geofence_properties: self.geofence_properties,
296 _request_id: self._request_id,
297 })
298 }
299}
300impl ::std::fmt::Debug for GetGeofenceOutputBuilder {
301 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
302 let mut formatter = f.debug_struct("GetGeofenceOutputBuilder");
303 formatter.field("geofence_id", &self.geofence_id);
304 formatter.field("geometry", &self.geometry);
305 formatter.field("status", &self.status);
306 formatter.field("create_time", &"*** Sensitive Data Redacted ***");
307 formatter.field("update_time", &"*** Sensitive Data Redacted ***");
308 formatter.field("geofence_properties", &"*** Sensitive Data Redacted ***");
309 formatter.field("_request_id", &self._request_id);
310 formatter.finish()
311 }
312}