aws_sdk_location/operation/put_geofence/
_put_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 PutGeofenceOutput {
6    /// <p>The geofence identifier entered in the request.</p>
7    pub geofence_id: ::std::string::String,
8    /// <p>The timestamp for when the geofence 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>
9    pub create_time: ::aws_smithy_types::DateTime,
10    /// <p>The timestamp for when the geofence 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>
11    pub update_time: ::aws_smithy_types::DateTime,
12    _request_id: Option<String>,
13}
14impl PutGeofenceOutput {
15    /// <p>The geofence identifier entered in the request.</p>
16    pub fn geofence_id(&self) -> &str {
17        use std::ops::Deref;
18        self.geofence_id.deref()
19    }
20    /// <p>The timestamp for when the geofence 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>
21    pub fn create_time(&self) -> &::aws_smithy_types::DateTime {
22        &self.create_time
23    }
24    /// <p>The timestamp for when the geofence 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>
25    pub fn update_time(&self) -> &::aws_smithy_types::DateTime {
26        &self.update_time
27    }
28}
29impl ::std::fmt::Debug for PutGeofenceOutput {
30    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31        let mut formatter = f.debug_struct("PutGeofenceOutput");
32        formatter.field("geofence_id", &self.geofence_id);
33        formatter.field("create_time", &"*** Sensitive Data Redacted ***");
34        formatter.field("update_time", &"*** Sensitive Data Redacted ***");
35        formatter.field("_request_id", &self._request_id);
36        formatter.finish()
37    }
38}
39impl ::aws_types::request_id::RequestId for PutGeofenceOutput {
40    fn request_id(&self) -> Option<&str> {
41        self._request_id.as_deref()
42    }
43}
44impl PutGeofenceOutput {
45    /// Creates a new builder-style object to manufacture [`PutGeofenceOutput`](crate::operation::put_geofence::PutGeofenceOutput).
46    pub fn builder() -> crate::operation::put_geofence::builders::PutGeofenceOutputBuilder {
47        crate::operation::put_geofence::builders::PutGeofenceOutputBuilder::default()
48    }
49}
50
51/// A builder for [`PutGeofenceOutput`](crate::operation::put_geofence::PutGeofenceOutput).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
53#[non_exhaustive]
54pub struct PutGeofenceOutputBuilder {
55    pub(crate) geofence_id: ::std::option::Option<::std::string::String>,
56    pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
57    pub(crate) update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
58    _request_id: Option<String>,
59}
60impl PutGeofenceOutputBuilder {
61    /// <p>The geofence identifier entered in the request.</p>
62    /// This field is required.
63    pub fn geofence_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.geofence_id = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The geofence identifier entered in the request.</p>
68    pub fn set_geofence_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.geofence_id = input;
70        self
71    }
72    /// <p>The geofence identifier entered in the request.</p>
73    pub fn get_geofence_id(&self) -> &::std::option::Option<::std::string::String> {
74        &self.geofence_id
75    }
76    /// <p>The timestamp for when the geofence 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>
77    /// This field is required.
78    pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
79        self.create_time = ::std::option::Option::Some(input);
80        self
81    }
82    /// <p>The timestamp for when the geofence 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>
83    pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
84        self.create_time = input;
85        self
86    }
87    /// <p>The timestamp for when the geofence 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>
88    pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
89        &self.create_time
90    }
91    /// <p>The timestamp for when the geofence 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>
92    /// This field is required.
93    pub fn update_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
94        self.update_time = ::std::option::Option::Some(input);
95        self
96    }
97    /// <p>The timestamp for when the geofence 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>
98    pub fn set_update_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
99        self.update_time = input;
100        self
101    }
102    /// <p>The timestamp for when the geofence 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>
103    pub fn get_update_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
104        &self.update_time
105    }
106    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
107        self._request_id = Some(request_id.into());
108        self
109    }
110
111    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
112        self._request_id = request_id;
113        self
114    }
115    /// Consumes the builder and constructs a [`PutGeofenceOutput`](crate::operation::put_geofence::PutGeofenceOutput).
116    /// This method will fail if any of the following fields are not set:
117    /// - [`geofence_id`](crate::operation::put_geofence::builders::PutGeofenceOutputBuilder::geofence_id)
118    /// - [`create_time`](crate::operation::put_geofence::builders::PutGeofenceOutputBuilder::create_time)
119    /// - [`update_time`](crate::operation::put_geofence::builders::PutGeofenceOutputBuilder::update_time)
120    pub fn build(self) -> ::std::result::Result<crate::operation::put_geofence::PutGeofenceOutput, ::aws_smithy_types::error::operation::BuildError> {
121        ::std::result::Result::Ok(crate::operation::put_geofence::PutGeofenceOutput {
122            geofence_id: self.geofence_id.ok_or_else(|| {
123                ::aws_smithy_types::error::operation::BuildError::missing_field(
124                    "geofence_id",
125                    "geofence_id was not specified but it is required when building PutGeofenceOutput",
126                )
127            })?,
128            create_time: self.create_time.ok_or_else(|| {
129                ::aws_smithy_types::error::operation::BuildError::missing_field(
130                    "create_time",
131                    "create_time was not specified but it is required when building PutGeofenceOutput",
132                )
133            })?,
134            update_time: self.update_time.ok_or_else(|| {
135                ::aws_smithy_types::error::operation::BuildError::missing_field(
136                    "update_time",
137                    "update_time was not specified but it is required when building PutGeofenceOutput",
138                )
139            })?,
140            _request_id: self._request_id,
141        })
142    }
143}
144impl ::std::fmt::Debug for PutGeofenceOutputBuilder {
145    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
146        let mut formatter = f.debug_struct("PutGeofenceOutputBuilder");
147        formatter.field("geofence_id", &self.geofence_id);
148        formatter.field("create_time", &"*** Sensitive Data Redacted ***");
149        formatter.field("update_time", &"*** Sensitive Data Redacted ***");
150        formatter.field("_request_id", &self._request_id);
151        formatter.finish()
152    }
153}