aws_sdk_iot/client/
cancel_job_execution.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CancelJobExecution`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`job_id(impl Into<String>)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::job_id) / [`set_job_id(Option<String>)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::set_job_id):<br>required: **true**<br><p>The ID of the job to be canceled.</p><br>
7    ///   - [`thing_name(impl Into<String>)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::thing_name) / [`set_thing_name(Option<String>)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::set_thing_name):<br>required: **true**<br><p>The name of the thing whose execution of the job will be canceled.</p><br>
8    ///   - [`force(bool)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::force) / [`set_force(Option<bool>)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::set_force):<br>required: **false**<br><p>(Optional) If <code>true</code> the job execution will be canceled if it has status IN_PROGRESS or QUEUED, otherwise the job execution will be canceled only if it has status QUEUED. If you attempt to cancel a job execution that is IN_PROGRESS, and you do not set <code>force</code> to <code>true</code>, then an <code>InvalidStateTransitionException</code> will be thrown. The default is <code>false</code>.</p> <p>Canceling a job execution which is "IN_PROGRESS", will cause the device to be unable to update the job execution status. Use caution and ensure that the device is able to recover to a valid state.</p><br>
9    ///   - [`expected_version(i64)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::expected_version) / [`set_expected_version(Option<i64>)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::set_expected_version):<br>required: **false**<br><p>(Optional) The expected current version of the job execution. Each time you update the job execution, its version is incremented. If the version of the job execution stored in Jobs does not match, the update is rejected with a VersionMismatch error, and an ErrorResponse that contains the current job execution status data is returned. (This makes it unnecessary to perform a separate DescribeJobExecution request in order to obtain the job execution status data.)</p><br>
10    ///   - [`status_details(impl Into<String>, impl Into<String>)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::status_details) / [`set_status_details(Option<HashMap::<String, String>>)`](crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::set_status_details):<br>required: **false**<br><p>A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged. You can specify at most 10 name/value pairs.</p><br>
11    /// - On success, responds with [`CancelJobExecutionOutput`](crate::operation::cancel_job_execution::CancelJobExecutionOutput)
12    /// - On failure, responds with [`SdkError<CancelJobExecutionError>`](crate::operation::cancel_job_execution::CancelJobExecutionError)
13    pub fn cancel_job_execution(&self) -> crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder {
14        crate::operation::cancel_job_execution::builders::CancelJobExecutionFluentBuilder::new(self.handle.clone())
15    }
16}