aws_sdk_elastictranscoder/operation/cancel_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::cancel_job::_cancel_job_output::CancelJobOutputBuilder;
3
4pub use crate::operation::cancel_job::_cancel_job_input::CancelJobInputBuilder;
5
6impl crate::operation::cancel_job::builders::CancelJobInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::cancel_job::CancelJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::cancel_job::CancelJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.cancel_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CancelJob`.
24///
25/// <p>The CancelJob operation cancels an unfinished job.</p><note>
26/// <p>You can only cancel a job that has a status of <code>Submitted</code>. To prevent a pipeline from starting to process a job while you're getting the job identifier, use <code>UpdatePipelineStatus</code> to temporarily pause the pipeline.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CancelJobFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::cancel_job::builders::CancelJobInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl crate::client::customize::internal::CustomizableSend<crate::operation::cancel_job::CancelJobOutput, crate::operation::cancel_job::CancelJobError>
35    for CancelJobFluentBuilder
36{
37    fn send(
38        self,
39        config_override: crate::config::Builder,
40    ) -> crate::client::customize::internal::BoxFuture<
41        crate::client::customize::internal::SendResult<crate::operation::cancel_job::CancelJobOutput, crate::operation::cancel_job::CancelJobError>,
42    > {
43        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
44    }
45}
46impl CancelJobFluentBuilder {
47    /// Creates a new `CancelJobFluentBuilder`.
48    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
49        Self {
50            handle,
51            inner: ::std::default::Default::default(),
52            config_override: ::std::option::Option::None,
53        }
54    }
55    /// Access the CancelJob as a reference.
56    pub fn as_input(&self) -> &crate::operation::cancel_job::builders::CancelJobInputBuilder {
57        &self.inner
58    }
59    /// Sends the request and returns the response.
60    ///
61    /// If an error occurs, an `SdkError` will be returned with additional details that
62    /// can be matched against.
63    ///
64    /// By default, any retryable failures will be retried twice. Retry behavior
65    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
66    /// set when configuring the client.
67    pub async fn send(
68        self,
69    ) -> ::std::result::Result<
70        crate::operation::cancel_job::CancelJobOutput,
71        ::aws_smithy_runtime_api::client::result::SdkError<
72            crate::operation::cancel_job::CancelJobError,
73            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
74        >,
75    > {
76        let input = self
77            .inner
78            .build()
79            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
80        let runtime_plugins = crate::operation::cancel_job::CancelJob::operation_runtime_plugins(
81            self.handle.runtime_plugins.clone(),
82            &self.handle.conf,
83            self.config_override,
84        );
85        crate::operation::cancel_job::CancelJob::orchestrate(&runtime_plugins, input).await
86    }
87
88    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
89    pub fn customize(
90        self,
91    ) -> crate::client::customize::CustomizableOperation<
92        crate::operation::cancel_job::CancelJobOutput,
93        crate::operation::cancel_job::CancelJobError,
94        Self,
95    > {
96        crate::client::customize::CustomizableOperation::new(self)
97    }
98    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
99        self.set_config_override(::std::option::Option::Some(config_override.into()));
100        self
101    }
102
103    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
104        self.config_override = config_override;
105        self
106    }
107    /// <p>The identifier of the job that you want to cancel.</p>
108    /// <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>
109    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.inner = self.inner.id(input.into());
111        self
112    }
113    /// <p>The identifier of the job that you want to cancel.</p>
114    /// <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>
115    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.inner = self.inner.set_id(input);
117        self
118    }
119    /// <p>The identifier of the job that you want to cancel.</p>
120    /// <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>
121    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
122        self.inner.get_id()
123    }
124}