aws_sdk_iot/operation/delete_job/
_delete_job_input.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 DeleteJobInput {
6    /// <p>The ID of the job to be deleted.</p>
7    /// <p>After a job deletion is completed, you may reuse this jobId when you create a new job. However, this is not recommended, and you must ensure that your devices are not using the jobId to refer to the deleted job.</p>
8    pub job_id: ::std::option::Option<::std::string::String>,
9    /// <p>(Optional) When true, you can delete a job which is "IN_PROGRESS". Otherwise, you can only delete a job which is in a terminal state ("COMPLETED" or "CANCELED") or an exception will occur. The default is false.</p><note>
10    /// <p>Deleting a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to access job information or update the job execution status. Use caution and ensure that each device executing a job which is deleted is able to recover to a valid state.</p>
11    /// </note>
12    pub force: ::std::option::Option<bool>,
13    /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
14    /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
15    /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
16    /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
17    /// </note>
18    pub namespace_id: ::std::option::Option<::std::string::String>,
19}
20impl DeleteJobInput {
21    /// <p>The ID of the job to be deleted.</p>
22    /// <p>After a job deletion is completed, you may reuse this jobId when you create a new job. However, this is not recommended, and you must ensure that your devices are not using the jobId to refer to the deleted job.</p>
23    pub fn job_id(&self) -> ::std::option::Option<&str> {
24        self.job_id.as_deref()
25    }
26    /// <p>(Optional) When true, you can delete a job which is "IN_PROGRESS". Otherwise, you can only delete a job which is in a terminal state ("COMPLETED" or "CANCELED") or an exception will occur. The default is false.</p><note>
27    /// <p>Deleting a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to access job information or update the job execution status. Use caution and ensure that each device executing a job which is deleted is able to recover to a valid state.</p>
28    /// </note>
29    pub fn force(&self) -> ::std::option::Option<bool> {
30        self.force
31    }
32    /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
33    /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
34    /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
35    /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
36    /// </note>
37    pub fn namespace_id(&self) -> ::std::option::Option<&str> {
38        self.namespace_id.as_deref()
39    }
40}
41impl DeleteJobInput {
42    /// Creates a new builder-style object to manufacture [`DeleteJobInput`](crate::operation::delete_job::DeleteJobInput).
43    pub fn builder() -> crate::operation::delete_job::builders::DeleteJobInputBuilder {
44        crate::operation::delete_job::builders::DeleteJobInputBuilder::default()
45    }
46}
47
48/// A builder for [`DeleteJobInput`](crate::operation::delete_job::DeleteJobInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct DeleteJobInputBuilder {
52    pub(crate) job_id: ::std::option::Option<::std::string::String>,
53    pub(crate) force: ::std::option::Option<bool>,
54    pub(crate) namespace_id: ::std::option::Option<::std::string::String>,
55}
56impl DeleteJobInputBuilder {
57    /// <p>The ID of the job to be deleted.</p>
58    /// <p>After a job deletion is completed, you may reuse this jobId when you create a new job. However, this is not recommended, and you must ensure that your devices are not using the jobId to refer to the deleted job.</p>
59    /// This field is required.
60    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.job_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The ID of the job to be deleted.</p>
65    /// <p>After a job deletion is completed, you may reuse this jobId when you create a new job. However, this is not recommended, and you must ensure that your devices are not using the jobId to refer to the deleted job.</p>
66    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.job_id = input;
68        self
69    }
70    /// <p>The ID of the job to be deleted.</p>
71    /// <p>After a job deletion is completed, you may reuse this jobId when you create a new job. However, this is not recommended, and you must ensure that your devices are not using the jobId to refer to the deleted job.</p>
72    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.job_id
74    }
75    /// <p>(Optional) When true, you can delete a job which is "IN_PROGRESS". Otherwise, you can only delete a job which is in a terminal state ("COMPLETED" or "CANCELED") or an exception will occur. The default is false.</p><note>
76    /// <p>Deleting a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to access job information or update the job execution status. Use caution and ensure that each device executing a job which is deleted is able to recover to a valid state.</p>
77    /// </note>
78    pub fn force(mut self, input: bool) -> Self {
79        self.force = ::std::option::Option::Some(input);
80        self
81    }
82    /// <p>(Optional) When true, you can delete a job which is "IN_PROGRESS". Otherwise, you can only delete a job which is in a terminal state ("COMPLETED" or "CANCELED") or an exception will occur. The default is false.</p><note>
83    /// <p>Deleting a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to access job information or update the job execution status. Use caution and ensure that each device executing a job which is deleted is able to recover to a valid state.</p>
84    /// </note>
85    pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
86        self.force = input;
87        self
88    }
89    /// <p>(Optional) When true, you can delete a job which is "IN_PROGRESS". Otherwise, you can only delete a job which is in a terminal state ("COMPLETED" or "CANCELED") or an exception will occur. The default is false.</p><note>
90    /// <p>Deleting a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to access job information or update the job execution status. Use caution and ensure that each device executing a job which is deleted is able to recover to a valid state.</p>
91    /// </note>
92    pub fn get_force(&self) -> &::std::option::Option<bool> {
93        &self.force
94    }
95    /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
96    /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
97    /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
98    /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
99    /// </note>
100    pub fn namespace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.namespace_id = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
105    /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
106    /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
107    /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
108    /// </note>
109    pub fn set_namespace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.namespace_id = input;
111        self
112    }
113    /// <p>The namespace used to indicate that a job is a customer-managed job.</p>
114    /// <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p>
115    /// <p><code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code></p><note>
116    /// <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a></p>
117    /// </note>
118    pub fn get_namespace_id(&self) -> &::std::option::Option<::std::string::String> {
119        &self.namespace_id
120    }
121    /// Consumes the builder and constructs a [`DeleteJobInput`](crate::operation::delete_job::DeleteJobInput).
122    pub fn build(self) -> ::std::result::Result<crate::operation::delete_job::DeleteJobInput, ::aws_smithy_types::error::operation::BuildError> {
123        ::std::result::Result::Ok(crate::operation::delete_job::DeleteJobInput {
124            job_id: self.job_id,
125            force: self.force,
126            namespace_id: self.namespace_id,
127        })
128    }
129}