aws_sdk_elastictranscoder/operation/cancel_job/
_cancel_job_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The <code>CancelJobRequest</code> structure.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CancelJobInput {
7    /// <p>The identifier of the job that you want to cancel.</p>
8    /// <p>To get a list of the jobs (including their <code>jobId</code>) that have a status of <code>Submitted</code>, use the <code>ListJobsByStatus</code> API action.</p>
9    pub id: ::std::option::Option<::std::string::String>,
10}
11impl CancelJobInput {
12    /// <p>The identifier of the job that you want to cancel.</p>
13    /// <p>To get a list of the jobs (including their <code>jobId</code>) that have a status of <code>Submitted</code>, use the <code>ListJobsByStatus</code> API action.</p>
14    pub fn id(&self) -> ::std::option::Option<&str> {
15        self.id.as_deref()
16    }
17}
18impl CancelJobInput {
19    /// Creates a new builder-style object to manufacture [`CancelJobInput`](crate::operation::cancel_job::CancelJobInput).
20    pub fn builder() -> crate::operation::cancel_job::builders::CancelJobInputBuilder {
21        crate::operation::cancel_job::builders::CancelJobInputBuilder::default()
22    }
23}
24
25/// A builder for [`CancelJobInput`](crate::operation::cancel_job::CancelJobInput).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct CancelJobInputBuilder {
29    pub(crate) id: ::std::option::Option<::std::string::String>,
30}
31impl CancelJobInputBuilder {
32    /// <p>The identifier of the job that you want to cancel.</p>
33    /// <p>To get a list of the jobs (including their <code>jobId</code>) that have a status of <code>Submitted</code>, use the <code>ListJobsByStatus</code> API action.</p>
34    /// This field is required.
35    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
36        self.id = ::std::option::Option::Some(input.into());
37        self
38    }
39    /// <p>The identifier of the job that you want to cancel.</p>
40    /// <p>To get a list of the jobs (including their <code>jobId</code>) that have a status of <code>Submitted</code>, use the <code>ListJobsByStatus</code> API action.</p>
41    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
42        self.id = input;
43        self
44    }
45    /// <p>The identifier of the job that you want to cancel.</p>
46    /// <p>To get a list of the jobs (including their <code>jobId</code>) that have a status of <code>Submitted</code>, use the <code>ListJobsByStatus</code> API action.</p>
47    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
48        &self.id
49    }
50    /// Consumes the builder and constructs a [`CancelJobInput`](crate::operation::cancel_job::CancelJobInput).
51    pub fn build(self) -> ::std::result::Result<crate::operation::cancel_job::CancelJobInput, ::aws_smithy_types::error::operation::BuildError> {
52        ::std::result::Result::Ok(crate::operation::cancel_job::CancelJobInput { id: self.id })
53    }
54}