aws_sdk_batch/operation/terminate_job/
_terminate_job_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the parameters for <code>TerminateJob</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TerminateJobInput {
7    /// <p>The Batch job ID of the job to terminate.</p>
8    pub job_id: ::std::option::Option<::std::string::String>,
9    /// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. It is also recorded in the Batch activity logs.</p>
10    /// <p>This parameter has as limit of 1024 characters.</p>
11    pub reason: ::std::option::Option<::std::string::String>,
12}
13impl TerminateJobInput {
14    /// <p>The Batch job ID of the job to terminate.</p>
15    pub fn job_id(&self) -> ::std::option::Option<&str> {
16        self.job_id.as_deref()
17    }
18    /// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. It is also recorded in the Batch activity logs.</p>
19    /// <p>This parameter has as limit of 1024 characters.</p>
20    pub fn reason(&self) -> ::std::option::Option<&str> {
21        self.reason.as_deref()
22    }
23}
24impl TerminateJobInput {
25    /// Creates a new builder-style object to manufacture [`TerminateJobInput`](crate::operation::terminate_job::TerminateJobInput).
26    pub fn builder() -> crate::operation::terminate_job::builders::TerminateJobInputBuilder {
27        crate::operation::terminate_job::builders::TerminateJobInputBuilder::default()
28    }
29}
30
31/// A builder for [`TerminateJobInput`](crate::operation::terminate_job::TerminateJobInput).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct TerminateJobInputBuilder {
35    pub(crate) job_id: ::std::option::Option<::std::string::String>,
36    pub(crate) reason: ::std::option::Option<::std::string::String>,
37}
38impl TerminateJobInputBuilder {
39    /// <p>The Batch job ID of the job to terminate.</p>
40    /// This field is required.
41    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42        self.job_id = ::std::option::Option::Some(input.into());
43        self
44    }
45    /// <p>The Batch job ID of the job to terminate.</p>
46    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47        self.job_id = input;
48        self
49    }
50    /// <p>The Batch job ID of the job to terminate.</p>
51    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
52        &self.job_id
53    }
54    /// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. It is also recorded in the Batch activity logs.</p>
55    /// <p>This parameter has as limit of 1024 characters.</p>
56    /// This field is required.
57    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        self.reason = ::std::option::Option::Some(input.into());
59        self
60    }
61    /// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. It is also recorded in the Batch activity logs.</p>
62    /// <p>This parameter has as limit of 1024 characters.</p>
63    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.reason = input;
65        self
66    }
67    /// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. It is also recorded in the Batch activity logs.</p>
68    /// <p>This parameter has as limit of 1024 characters.</p>
69    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
70        &self.reason
71    }
72    /// Consumes the builder and constructs a [`TerminateJobInput`](crate::operation::terminate_job::TerminateJobInput).
73    pub fn build(
74        self,
75    ) -> ::std::result::Result<crate::operation::terminate_job::TerminateJobInput, ::aws_smithy_types::error::operation::BuildError> {
76        ::std::result::Result::Ok(crate::operation::terminate_job::TerminateJobInput {
77            job_id: self.job_id,
78            reason: self.reason,
79        })
80    }
81}