aws_sdk_iot/operation/cancel_job/_cancel_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 CancelJobInput {
6 /// <p>The unique identifier you assigned to this job when it was created.</p>
7 pub job_id: ::std::option::Option<::std::string::String>,
8 /// <p>(Optional)A reason code string that explains why the job was canceled.</p>
9 pub reason_code: ::std::option::Option<::std::string::String>,
10 /// <p>An optional comment string describing why the job was canceled.</p>
11 pub comment: ::std::option::Option<::std::string::String>,
12 /// <p>(Optional) If <code>true</code> job executions with status "IN_PROGRESS" and "QUEUED" are canceled, otherwise only job executions with status "QUEUED" are canceled. The default is <code>false</code>.</p>
13 /// <p>Canceling a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to update the job execution status. Use caution and ensure that each device executing a job which is canceled is able to recover to a valid state.</p>
14 pub force: ::std::option::Option<bool>,
15}
16impl CancelJobInput {
17 /// <p>The unique identifier you assigned to this job when it was created.</p>
18 pub fn job_id(&self) -> ::std::option::Option<&str> {
19 self.job_id.as_deref()
20 }
21 /// <p>(Optional)A reason code string that explains why the job was canceled.</p>
22 pub fn reason_code(&self) -> ::std::option::Option<&str> {
23 self.reason_code.as_deref()
24 }
25 /// <p>An optional comment string describing why the job was canceled.</p>
26 pub fn comment(&self) -> ::std::option::Option<&str> {
27 self.comment.as_deref()
28 }
29 /// <p>(Optional) If <code>true</code> job executions with status "IN_PROGRESS" and "QUEUED" are canceled, otherwise only job executions with status "QUEUED" are canceled. The default is <code>false</code>.</p>
30 /// <p>Canceling a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to update the job execution status. Use caution and ensure that each device executing a job which is canceled is able to recover to a valid state.</p>
31 pub fn force(&self) -> ::std::option::Option<bool> {
32 self.force
33 }
34}
35impl CancelJobInput {
36 /// Creates a new builder-style object to manufacture [`CancelJobInput`](crate::operation::cancel_job::CancelJobInput).
37 pub fn builder() -> crate::operation::cancel_job::builders::CancelJobInputBuilder {
38 crate::operation::cancel_job::builders::CancelJobInputBuilder::default()
39 }
40}
41
42/// A builder for [`CancelJobInput`](crate::operation::cancel_job::CancelJobInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CancelJobInputBuilder {
46 pub(crate) job_id: ::std::option::Option<::std::string::String>,
47 pub(crate) reason_code: ::std::option::Option<::std::string::String>,
48 pub(crate) comment: ::std::option::Option<::std::string::String>,
49 pub(crate) force: ::std::option::Option<bool>,
50}
51impl CancelJobInputBuilder {
52 /// <p>The unique identifier you assigned to this job when it was created.</p>
53 /// This field is required.
54 pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55 self.job_id = ::std::option::Option::Some(input.into());
56 self
57 }
58 /// <p>The unique identifier you assigned to this job when it was created.</p>
59 pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60 self.job_id = input;
61 self
62 }
63 /// <p>The unique identifier you assigned to this job when it was created.</p>
64 pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
65 &self.job_id
66 }
67 /// <p>(Optional)A reason code string that explains why the job was canceled.</p>
68 pub fn reason_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.reason_code = ::std::option::Option::Some(input.into());
70 self
71 }
72 /// <p>(Optional)A reason code string that explains why the job was canceled.</p>
73 pub fn set_reason_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.reason_code = input;
75 self
76 }
77 /// <p>(Optional)A reason code string that explains why the job was canceled.</p>
78 pub fn get_reason_code(&self) -> &::std::option::Option<::std::string::String> {
79 &self.reason_code
80 }
81 /// <p>An optional comment string describing why the job was canceled.</p>
82 pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.comment = ::std::option::Option::Some(input.into());
84 self
85 }
86 /// <p>An optional comment string describing why the job was canceled.</p>
87 pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.comment = input;
89 self
90 }
91 /// <p>An optional comment string describing why the job was canceled.</p>
92 pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
93 &self.comment
94 }
95 /// <p>(Optional) If <code>true</code> job executions with status "IN_PROGRESS" and "QUEUED" are canceled, otherwise only job executions with status "QUEUED" are canceled. The default is <code>false</code>.</p>
96 /// <p>Canceling a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to update the job execution status. Use caution and ensure that each device executing a job which is canceled is able to recover to a valid state.</p>
97 pub fn force(mut self, input: bool) -> Self {
98 self.force = ::std::option::Option::Some(input);
99 self
100 }
101 /// <p>(Optional) If <code>true</code> job executions with status "IN_PROGRESS" and "QUEUED" are canceled, otherwise only job executions with status "QUEUED" are canceled. The default is <code>false</code>.</p>
102 /// <p>Canceling a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to update the job execution status. Use caution and ensure that each device executing a job which is canceled is able to recover to a valid state.</p>
103 pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
104 self.force = input;
105 self
106 }
107 /// <p>(Optional) If <code>true</code> job executions with status "IN_PROGRESS" and "QUEUED" are canceled, otherwise only job executions with status "QUEUED" are canceled. The default is <code>false</code>.</p>
108 /// <p>Canceling a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to update the job execution status. Use caution and ensure that each device executing a job which is canceled is able to recover to a valid state.</p>
109 pub fn get_force(&self) -> &::std::option::Option<bool> {
110 &self.force
111 }
112 /// Consumes the builder and constructs a [`CancelJobInput`](crate::operation::cancel_job::CancelJobInput).
113 pub fn build(self) -> ::std::result::Result<crate::operation::cancel_job::CancelJobInput, ::aws_smithy_types::error::operation::BuildError> {
114 ::std::result::Result::Ok(crate::operation::cancel_job::CancelJobInput {
115 job_id: self.job_id,
116 reason_code: self.reason_code,
117 comment: self.comment,
118 force: self.force,
119 })
120 }
121}