aws_sdk_location/operation/create_tracker/
_create_tracker_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 CreateTrackerOutput {
6    /// <p>The name of the tracker resource.</p>
7    pub tracker_name: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) for the tracker resource. Used when you need 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:tracker/ExampleTracker</code></p></li>
12    /// </ul>
13    pub tracker_arn: ::std::string::String,
14    /// <p>The timestamp for when the tracker 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 CreateTrackerOutput {
19    /// <p>The name of the tracker resource.</p>
20    pub fn tracker_name(&self) -> &str {
21        use std::ops::Deref;
22        self.tracker_name.deref()
23    }
24    /// <p>The Amazon Resource Name (ARN) for the tracker resource. Used when you need 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:tracker/ExampleTracker</code></p></li>
28    /// </ul>
29    pub fn tracker_arn(&self) -> &str {
30        use std::ops::Deref;
31        self.tracker_arn.deref()
32    }
33    /// <p>The timestamp for when the tracker 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 CreateTrackerOutput {
39    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
40        let mut formatter = f.debug_struct("CreateTrackerOutput");
41        formatter.field("tracker_name", &self.tracker_name);
42        formatter.field("tracker_arn", &self.tracker_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 CreateTrackerOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl CreateTrackerOutput {
54    /// Creates a new builder-style object to manufacture [`CreateTrackerOutput`](crate::operation::create_tracker::CreateTrackerOutput).
55    pub fn builder() -> crate::operation::create_tracker::builders::CreateTrackerOutputBuilder {
56        crate::operation::create_tracker::builders::CreateTrackerOutputBuilder::default()
57    }
58}
59
60/// A builder for [`CreateTrackerOutput`](crate::operation::create_tracker::CreateTrackerOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
62#[non_exhaustive]
63pub struct CreateTrackerOutputBuilder {
64    pub(crate) tracker_name: ::std::option::Option<::std::string::String>,
65    pub(crate) tracker_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 CreateTrackerOutputBuilder {
70    /// <p>The name of the tracker resource.</p>
71    /// This field is required.
72    pub fn tracker_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.tracker_name = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>The name of the tracker resource.</p>
77    pub fn set_tracker_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.tracker_name = input;
79        self
80    }
81    /// <p>The name of the tracker resource.</p>
82    pub fn get_tracker_name(&self) -> &::std::option::Option<::std::string::String> {
83        &self.tracker_name
84    }
85    /// <p>The Amazon Resource Name (ARN) for the tracker resource. Used when you need 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:tracker/ExampleTracker</code></p></li>
89    /// </ul>
90    /// This field is required.
91    pub fn tracker_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.tracker_arn = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>The Amazon Resource Name (ARN) for the tracker resource. Used when you need 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:tracker/ExampleTracker</code></p></li>
99    /// </ul>
100    pub fn set_tracker_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.tracker_arn = input;
102        self
103    }
104    /// <p>The Amazon Resource Name (ARN) for the tracker resource. Used when you need 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:tracker/ExampleTracker</code></p></li>
108    /// </ul>
109    pub fn get_tracker_arn(&self) -> &::std::option::Option<::std::string::String> {
110        &self.tracker_arn
111    }
112    /// <p>The timestamp for when the tracker 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 tracker 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 tracker 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 [`CreateTrackerOutput`](crate::operation::create_tracker::CreateTrackerOutput).
137    /// This method will fail if any of the following fields are not set:
138    /// - [`tracker_name`](crate::operation::create_tracker::builders::CreateTrackerOutputBuilder::tracker_name)
139    /// - [`tracker_arn`](crate::operation::create_tracker::builders::CreateTrackerOutputBuilder::tracker_arn)
140    /// - [`create_time`](crate::operation::create_tracker::builders::CreateTrackerOutputBuilder::create_time)
141    pub fn build(
142        self,
143    ) -> ::std::result::Result<crate::operation::create_tracker::CreateTrackerOutput, ::aws_smithy_types::error::operation::BuildError> {
144        ::std::result::Result::Ok(crate::operation::create_tracker::CreateTrackerOutput {
145            tracker_name: self.tracker_name.ok_or_else(|| {
146                ::aws_smithy_types::error::operation::BuildError::missing_field(
147                    "tracker_name",
148                    "tracker_name was not specified but it is required when building CreateTrackerOutput",
149                )
150            })?,
151            tracker_arn: self.tracker_arn.ok_or_else(|| {
152                ::aws_smithy_types::error::operation::BuildError::missing_field(
153                    "tracker_arn",
154                    "tracker_arn was not specified but it is required when building CreateTrackerOutput",
155                )
156            })?,
157            create_time: self.create_time.ok_or_else(|| {
158                ::aws_smithy_types::error::operation::BuildError::missing_field(
159                    "create_time",
160                    "create_time was not specified but it is required when building CreateTrackerOutput",
161                )
162            })?,
163            _request_id: self._request_id,
164        })
165    }
166}
167impl ::std::fmt::Debug for CreateTrackerOutputBuilder {
168    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
169        let mut formatter = f.debug_struct("CreateTrackerOutputBuilder");
170        formatter.field("tracker_name", &self.tracker_name);
171        formatter.field("tracker_arn", &self.tracker_arn);
172        formatter.field("create_time", &"*** Sensitive Data Redacted ***");
173        formatter.field("_request_id", &self._request_id);
174        formatter.finish()
175    }
176}