aws_sdk_iot/operation/get_command/
_get_command_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, ::std::fmt::Debug)]
5pub struct GetCommandOutput {
6    /// <p>The unique identifier of the command.</p>
7    pub command_id: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Number (ARN) of the command. For example, <code>arn:aws:iot:<region>
9    /// :
10    /// <accountid>
11    /// :command/
12    /// <commandid></commandid>
13    /// </accountid>
14    /// </region></code></p>
15    pub command_arn: ::std::option::Option<::std::string::String>,
16    /// <p>The namespace of the command.</p>
17    pub namespace: ::std::option::Option<crate::types::CommandNamespace>,
18    /// <p>The user-friendly name in the console for the command.</p>
19    pub display_name: ::std::option::Option<::std::string::String>,
20    /// <p>A short text description of the command.</p>
21    pub description: ::std::option::Option<::std::string::String>,
22    /// <p>A list of parameters for the command created.</p>
23    pub mandatory_parameters: ::std::option::Option<::std::vec::Vec<crate::types::CommandParameter>>,
24    /// <p>The payload object that you provided for the command.</p>
25    pub payload: ::std::option::Option<crate::types::CommandPayload>,
26    /// <p>The IAM role that you provided when creating the command with <code>AWS-IoT-FleetWise</code> as the namespace.</p>
27    pub role_arn: ::std::option::Option<::std::string::String>,
28    /// <p>The timestamp, when the command was created.</p>
29    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
30    /// <p>The timestamp, when the command was last updated.</p>
31    pub last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
32    /// <p>Indicates whether the command has been deprecated.</p>
33    pub deprecated: ::std::option::Option<bool>,
34    /// <p>Indicates whether the command is being deleted.</p>
35    pub pending_deletion: ::std::option::Option<bool>,
36    _request_id: Option<String>,
37}
38impl GetCommandOutput {
39    /// <p>The unique identifier of the command.</p>
40    pub fn command_id(&self) -> ::std::option::Option<&str> {
41        self.command_id.as_deref()
42    }
43    /// <p>The Amazon Resource Number (ARN) of the command. For example, <code>arn:aws:iot:<region>
44    /// :
45    /// <accountid>
46    /// :command/
47    /// <commandid></commandid>
48    /// </accountid>
49    /// </region></code></p>
50    pub fn command_arn(&self) -> ::std::option::Option<&str> {
51        self.command_arn.as_deref()
52    }
53    /// <p>The namespace of the command.</p>
54    pub fn namespace(&self) -> ::std::option::Option<&crate::types::CommandNamespace> {
55        self.namespace.as_ref()
56    }
57    /// <p>The user-friendly name in the console for the command.</p>
58    pub fn display_name(&self) -> ::std::option::Option<&str> {
59        self.display_name.as_deref()
60    }
61    /// <p>A short text description of the command.</p>
62    pub fn description(&self) -> ::std::option::Option<&str> {
63        self.description.as_deref()
64    }
65    /// <p>A list of parameters for the command created.</p>
66    ///
67    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mandatory_parameters.is_none()`.
68    pub fn mandatory_parameters(&self) -> &[crate::types::CommandParameter] {
69        self.mandatory_parameters.as_deref().unwrap_or_default()
70    }
71    /// <p>The payload object that you provided for the command.</p>
72    pub fn payload(&self) -> ::std::option::Option<&crate::types::CommandPayload> {
73        self.payload.as_ref()
74    }
75    /// <p>The IAM role that you provided when creating the command with <code>AWS-IoT-FleetWise</code> as the namespace.</p>
76    pub fn role_arn(&self) -> ::std::option::Option<&str> {
77        self.role_arn.as_deref()
78    }
79    /// <p>The timestamp, when the command was created.</p>
80    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
81        self.created_at.as_ref()
82    }
83    /// <p>The timestamp, when the command was last updated.</p>
84    pub fn last_updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
85        self.last_updated_at.as_ref()
86    }
87    /// <p>Indicates whether the command has been deprecated.</p>
88    pub fn deprecated(&self) -> ::std::option::Option<bool> {
89        self.deprecated
90    }
91    /// <p>Indicates whether the command is being deleted.</p>
92    pub fn pending_deletion(&self) -> ::std::option::Option<bool> {
93        self.pending_deletion
94    }
95}
96impl ::aws_types::request_id::RequestId for GetCommandOutput {
97    fn request_id(&self) -> Option<&str> {
98        self._request_id.as_deref()
99    }
100}
101impl GetCommandOutput {
102    /// Creates a new builder-style object to manufacture [`GetCommandOutput`](crate::operation::get_command::GetCommandOutput).
103    pub fn builder() -> crate::operation::get_command::builders::GetCommandOutputBuilder {
104        crate::operation::get_command::builders::GetCommandOutputBuilder::default()
105    }
106}
107
108/// A builder for [`GetCommandOutput`](crate::operation::get_command::GetCommandOutput).
109#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
110#[non_exhaustive]
111pub struct GetCommandOutputBuilder {
112    pub(crate) command_id: ::std::option::Option<::std::string::String>,
113    pub(crate) command_arn: ::std::option::Option<::std::string::String>,
114    pub(crate) namespace: ::std::option::Option<crate::types::CommandNamespace>,
115    pub(crate) display_name: ::std::option::Option<::std::string::String>,
116    pub(crate) description: ::std::option::Option<::std::string::String>,
117    pub(crate) mandatory_parameters: ::std::option::Option<::std::vec::Vec<crate::types::CommandParameter>>,
118    pub(crate) payload: ::std::option::Option<crate::types::CommandPayload>,
119    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
120    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
121    pub(crate) last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
122    pub(crate) deprecated: ::std::option::Option<bool>,
123    pub(crate) pending_deletion: ::std::option::Option<bool>,
124    _request_id: Option<String>,
125}
126impl GetCommandOutputBuilder {
127    /// <p>The unique identifier of the command.</p>
128    pub fn command_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.command_id = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// <p>The unique identifier of the command.</p>
133    pub fn set_command_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.command_id = input;
135        self
136    }
137    /// <p>The unique identifier of the command.</p>
138    pub fn get_command_id(&self) -> &::std::option::Option<::std::string::String> {
139        &self.command_id
140    }
141    /// <p>The Amazon Resource Number (ARN) of the command. For example, <code>arn:aws:iot:<region>
142    /// :
143    /// <accountid>
144    /// :command/
145    /// <commandid></commandid>
146    /// </accountid>
147    /// </region></code></p>
148    pub fn command_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.command_arn = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>The Amazon Resource Number (ARN) of the command. For example, <code>arn:aws:iot:<region>
153    /// :
154    /// <accountid>
155    /// :command/
156    /// <commandid></commandid>
157    /// </accountid>
158    /// </region></code></p>
159    pub fn set_command_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.command_arn = input;
161        self
162    }
163    /// <p>The Amazon Resource Number (ARN) of the command. For example, <code>arn:aws:iot:<region>
164    /// :
165    /// <accountid>
166    /// :command/
167    /// <commandid></commandid>
168    /// </accountid>
169    /// </region></code></p>
170    pub fn get_command_arn(&self) -> &::std::option::Option<::std::string::String> {
171        &self.command_arn
172    }
173    /// <p>The namespace of the command.</p>
174    pub fn namespace(mut self, input: crate::types::CommandNamespace) -> Self {
175        self.namespace = ::std::option::Option::Some(input);
176        self
177    }
178    /// <p>The namespace of the command.</p>
179    pub fn set_namespace(mut self, input: ::std::option::Option<crate::types::CommandNamespace>) -> Self {
180        self.namespace = input;
181        self
182    }
183    /// <p>The namespace of the command.</p>
184    pub fn get_namespace(&self) -> &::std::option::Option<crate::types::CommandNamespace> {
185        &self.namespace
186    }
187    /// <p>The user-friendly name in the console for the command.</p>
188    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189        self.display_name = ::std::option::Option::Some(input.into());
190        self
191    }
192    /// <p>The user-friendly name in the console for the command.</p>
193    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.display_name = input;
195        self
196    }
197    /// <p>The user-friendly name in the console for the command.</p>
198    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
199        &self.display_name
200    }
201    /// <p>A short text description of the command.</p>
202    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203        self.description = ::std::option::Option::Some(input.into());
204        self
205    }
206    /// <p>A short text description of the command.</p>
207    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208        self.description = input;
209        self
210    }
211    /// <p>A short text description of the command.</p>
212    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
213        &self.description
214    }
215    /// Appends an item to `mandatory_parameters`.
216    ///
217    /// To override the contents of this collection use [`set_mandatory_parameters`](Self::set_mandatory_parameters).
218    ///
219    /// <p>A list of parameters for the command created.</p>
220    pub fn mandatory_parameters(mut self, input: crate::types::CommandParameter) -> Self {
221        let mut v = self.mandatory_parameters.unwrap_or_default();
222        v.push(input);
223        self.mandatory_parameters = ::std::option::Option::Some(v);
224        self
225    }
226    /// <p>A list of parameters for the command created.</p>
227    pub fn set_mandatory_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CommandParameter>>) -> Self {
228        self.mandatory_parameters = input;
229        self
230    }
231    /// <p>A list of parameters for the command created.</p>
232    pub fn get_mandatory_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CommandParameter>> {
233        &self.mandatory_parameters
234    }
235    /// <p>The payload object that you provided for the command.</p>
236    pub fn payload(mut self, input: crate::types::CommandPayload) -> Self {
237        self.payload = ::std::option::Option::Some(input);
238        self
239    }
240    /// <p>The payload object that you provided for the command.</p>
241    pub fn set_payload(mut self, input: ::std::option::Option<crate::types::CommandPayload>) -> Self {
242        self.payload = input;
243        self
244    }
245    /// <p>The payload object that you provided for the command.</p>
246    pub fn get_payload(&self) -> &::std::option::Option<crate::types::CommandPayload> {
247        &self.payload
248    }
249    /// <p>The IAM role that you provided when creating the command with <code>AWS-IoT-FleetWise</code> as the namespace.</p>
250    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
251        self.role_arn = ::std::option::Option::Some(input.into());
252        self
253    }
254    /// <p>The IAM role that you provided when creating the command with <code>AWS-IoT-FleetWise</code> as the namespace.</p>
255    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
256        self.role_arn = input;
257        self
258    }
259    /// <p>The IAM role that you provided when creating the command with <code>AWS-IoT-FleetWise</code> as the namespace.</p>
260    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
261        &self.role_arn
262    }
263    /// <p>The timestamp, when the command was created.</p>
264    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
265        self.created_at = ::std::option::Option::Some(input);
266        self
267    }
268    /// <p>The timestamp, when the command was created.</p>
269    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
270        self.created_at = input;
271        self
272    }
273    /// <p>The timestamp, when the command was created.</p>
274    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
275        &self.created_at
276    }
277    /// <p>The timestamp, when the command was last updated.</p>
278    pub fn last_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
279        self.last_updated_at = ::std::option::Option::Some(input);
280        self
281    }
282    /// <p>The timestamp, when the command was last updated.</p>
283    pub fn set_last_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
284        self.last_updated_at = input;
285        self
286    }
287    /// <p>The timestamp, when the command was last updated.</p>
288    pub fn get_last_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
289        &self.last_updated_at
290    }
291    /// <p>Indicates whether the command has been deprecated.</p>
292    pub fn deprecated(mut self, input: bool) -> Self {
293        self.deprecated = ::std::option::Option::Some(input);
294        self
295    }
296    /// <p>Indicates whether the command has been deprecated.</p>
297    pub fn set_deprecated(mut self, input: ::std::option::Option<bool>) -> Self {
298        self.deprecated = input;
299        self
300    }
301    /// <p>Indicates whether the command has been deprecated.</p>
302    pub fn get_deprecated(&self) -> &::std::option::Option<bool> {
303        &self.deprecated
304    }
305    /// <p>Indicates whether the command is being deleted.</p>
306    pub fn pending_deletion(mut self, input: bool) -> Self {
307        self.pending_deletion = ::std::option::Option::Some(input);
308        self
309    }
310    /// <p>Indicates whether the command is being deleted.</p>
311    pub fn set_pending_deletion(mut self, input: ::std::option::Option<bool>) -> Self {
312        self.pending_deletion = input;
313        self
314    }
315    /// <p>Indicates whether the command is being deleted.</p>
316    pub fn get_pending_deletion(&self) -> &::std::option::Option<bool> {
317        &self.pending_deletion
318    }
319    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
320        self._request_id = Some(request_id.into());
321        self
322    }
323
324    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
325        self._request_id = request_id;
326        self
327    }
328    /// Consumes the builder and constructs a [`GetCommandOutput`](crate::operation::get_command::GetCommandOutput).
329    pub fn build(self) -> crate::operation::get_command::GetCommandOutput {
330        crate::operation::get_command::GetCommandOutput {
331            command_id: self.command_id,
332            command_arn: self.command_arn,
333            namespace: self.namespace,
334            display_name: self.display_name,
335            description: self.description,
336            mandatory_parameters: self.mandatory_parameters,
337            payload: self.payload,
338            role_arn: self.role_arn,
339            created_at: self.created_at,
340            last_updated_at: self.last_updated_at,
341            deprecated: self.deprecated,
342            pending_deletion: self.pending_deletion,
343            _request_id: self._request_id,
344        }
345    }
346}