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