aws_sdk_backup/operation/stop_backup_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::stop_backup_job::_stop_backup_job_output::StopBackupJobOutputBuilder;
3
4pub use crate::operation::stop_backup_job::_stop_backup_job_input::StopBackupJobInputBuilder;
5
6impl crate::operation::stop_backup_job::builders::StopBackupJobInputBuilder {
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::stop_backup_job::StopBackupJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::stop_backup_job::StopBackupJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.stop_backup_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StopBackupJob`.
24///
25/// <p>Attempts to cancel a job to create a one-time backup of a resource.</p>
26/// <p>This action is not supported for the following services:</p>
27/// <ul>
28/// <li>
29/// <p>Amazon Aurora</p></li>
30/// <li>
31/// <p>Amazon DocumentDB (with MongoDB compatibility)</p></li>
32/// <li>
33/// <p>Amazon FSx for Lustre</p></li>
34/// <li>
35/// <p>Amazon FSx for NetApp ONTAP</p></li>
36/// <li>
37/// <p>Amazon FSx for OpenZFS</p></li>
38/// <li>
39/// <p>Amazon FSx for Windows File Server</p></li>
40/// <li>
41/// <p>Amazon Neptune</p></li>
42/// <li>
43/// <p>SAP HANA databases on Amazon EC2 instances</p></li>
44/// <li>
45/// <p>Amazon RDS</p></li>
46/// </ul>
47#[derive(::std::clone::Clone, ::std::fmt::Debug)]
48pub struct StopBackupJobFluentBuilder {
49    handle: ::std::sync::Arc<crate::client::Handle>,
50    inner: crate::operation::stop_backup_job::builders::StopBackupJobInputBuilder,
51    config_override: ::std::option::Option<crate::config::Builder>,
52}
53impl
54    crate::client::customize::internal::CustomizableSend<
55        crate::operation::stop_backup_job::StopBackupJobOutput,
56        crate::operation::stop_backup_job::StopBackupJobError,
57    > for StopBackupJobFluentBuilder
58{
59    fn send(
60        self,
61        config_override: crate::config::Builder,
62    ) -> crate::client::customize::internal::BoxFuture<
63        crate::client::customize::internal::SendResult<
64            crate::operation::stop_backup_job::StopBackupJobOutput,
65            crate::operation::stop_backup_job::StopBackupJobError,
66        >,
67    > {
68        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69    }
70}
71impl StopBackupJobFluentBuilder {
72    /// Creates a new `StopBackupJobFluentBuilder`.
73    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74        Self {
75            handle,
76            inner: ::std::default::Default::default(),
77            config_override: ::std::option::Option::None,
78        }
79    }
80    /// Access the StopBackupJob as a reference.
81    pub fn as_input(&self) -> &crate::operation::stop_backup_job::builders::StopBackupJobInputBuilder {
82        &self.inner
83    }
84    /// Sends the request and returns the response.
85    ///
86    /// If an error occurs, an `SdkError` will be returned with additional details that
87    /// can be matched against.
88    ///
89    /// By default, any retryable failures will be retried twice. Retry behavior
90    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91    /// set when configuring the client.
92    pub async fn send(
93        self,
94    ) -> ::std::result::Result<
95        crate::operation::stop_backup_job::StopBackupJobOutput,
96        ::aws_smithy_runtime_api::client::result::SdkError<
97            crate::operation::stop_backup_job::StopBackupJobError,
98            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99        >,
100    > {
101        let input = self
102            .inner
103            .build()
104            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105        let runtime_plugins = crate::operation::stop_backup_job::StopBackupJob::operation_runtime_plugins(
106            self.handle.runtime_plugins.clone(),
107            &self.handle.conf,
108            self.config_override,
109        );
110        crate::operation::stop_backup_job::StopBackupJob::orchestrate(&runtime_plugins, input).await
111    }
112
113    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114    pub fn customize(
115        self,
116    ) -> crate::client::customize::CustomizableOperation<
117        crate::operation::stop_backup_job::StopBackupJobOutput,
118        crate::operation::stop_backup_job::StopBackupJobError,
119        Self,
120    > {
121        crate::client::customize::CustomizableOperation::new(self)
122    }
123    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
124        self.set_config_override(::std::option::Option::Some(config_override.into()));
125        self
126    }
127
128    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
129        self.config_override = config_override;
130        self
131    }
132    /// <p>Uniquely identifies a request to Backup to back up a resource.</p>
133    pub fn backup_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.backup_job_id(input.into());
135        self
136    }
137    /// <p>Uniquely identifies a request to Backup to back up a resource.</p>
138    pub fn set_backup_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_backup_job_id(input);
140        self
141    }
142    /// <p>Uniquely identifies a request to Backup to back up a resource.</p>
143    pub fn get_backup_job_id(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_backup_job_id()
145    }
146}