aws_sdk_backup/operation/start_backup_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_backup_job::_start_backup_job_output::StartBackupJobOutputBuilder;
3
4pub use crate::operation::start_backup_job::_start_backup_job_input::StartBackupJobInputBuilder;
5
6impl crate::operation::start_backup_job::builders::StartBackupJobInputBuilder {
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::start_backup_job::StartBackupJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_backup_job::StartBackupJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_backup_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartBackupJob`.
24///
25/// <p>Starts an on-demand backup job for the specified resource.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct StartBackupJobFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::start_backup_job::builders::StartBackupJobInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::start_backup_job::StartBackupJobOutput,
35        crate::operation::start_backup_job::StartBackupJobError,
36    > for StartBackupJobFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::start_backup_job::StartBackupJobOutput,
44            crate::operation::start_backup_job::StartBackupJobError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl StartBackupJobFluentBuilder {
51    /// Creates a new `StartBackupJobFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the StartBackupJob as a reference.
60    pub fn as_input(&self) -> &crate::operation::start_backup_job::builders::StartBackupJobInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::start_backup_job::StartBackupJobOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::start_backup_job::StartBackupJobError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::start_backup_job::StartBackupJob::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::start_backup_job::StartBackupJob::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::start_backup_job::StartBackupJobOutput,
97        crate::operation::start_backup_job::StartBackupJobError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.</p>
112    pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.backup_vault_name(input.into());
114        self
115    }
116    /// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.</p>
117    pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_backup_vault_name(input);
119        self
120    }
121    /// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.</p>
122    pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_backup_vault_name()
124    }
125    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
126    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.resource_arn(input.into());
128        self
129    }
130    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
131    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_resource_arn(input);
133        self
134    }
135    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
136    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_resource_arn()
138    }
139    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
140    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.iam_role_arn(input.into());
142        self
143    }
144    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
145    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_iam_role_arn(input);
147        self
148    }
149    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
150    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_iam_role_arn()
152    }
153    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>StartBackupJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
154    pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.idempotency_token(input.into());
156        self
157    }
158    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>StartBackupJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
159    pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_idempotency_token(input);
161        self
162    }
163    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>StartBackupJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
164    pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_idempotency_token()
166    }
167    /// <p>A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start successfully. This value is optional, and the default is 8 hours. If this value is included, it must be at least 60 minutes to avoid errors.</p>
168    /// <p>This parameter has a maximum value of 100 years (52,560,000 minutes).</p>
169    /// <p>During the start window, the backup job status remains in <code>CREATED</code> status until it has successfully begun or until the start window time has run out. If within the start window time Backup receives an error that allows the job to be retried, Backup will automatically retry to begin the job at least every 10 minutes until the backup successfully begins (the job status changes to <code>RUNNING</code>) or until the job status changes to <code>EXPIRED</code> (which is expected to occur when the start window time is over).</p>
170    pub fn start_window_minutes(mut self, input: i64) -> Self {
171        self.inner = self.inner.start_window_minutes(input);
172        self
173    }
174    /// <p>A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start successfully. This value is optional, and the default is 8 hours. If this value is included, it must be at least 60 minutes to avoid errors.</p>
175    /// <p>This parameter has a maximum value of 100 years (52,560,000 minutes).</p>
176    /// <p>During the start window, the backup job status remains in <code>CREATED</code> status until it has successfully begun or until the start window time has run out. If within the start window time Backup receives an error that allows the job to be retried, Backup will automatically retry to begin the job at least every 10 minutes until the backup successfully begins (the job status changes to <code>RUNNING</code>) or until the job status changes to <code>EXPIRED</code> (which is expected to occur when the start window time is over).</p>
177    pub fn set_start_window_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
178        self.inner = self.inner.set_start_window_minutes(input);
179        self
180    }
181    /// <p>A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start successfully. This value is optional, and the default is 8 hours. If this value is included, it must be at least 60 minutes to avoid errors.</p>
182    /// <p>This parameter has a maximum value of 100 years (52,560,000 minutes).</p>
183    /// <p>During the start window, the backup job status remains in <code>CREATED</code> status until it has successfully begun or until the start window time has run out. If within the start window time Backup receives an error that allows the job to be retried, Backup will automatically retry to begin the job at least every 10 minutes until the backup successfully begins (the job status changes to <code>RUNNING</code>) or until the job status changes to <code>EXPIRED</code> (which is expected to occur when the start window time is over).</p>
184    pub fn get_start_window_minutes(&self) -> &::std::option::Option<i64> {
185        self.inner.get_start_window_minutes()
186    }
187    /// <p>A value in minutes during which a successfully started backup must complete, or else Backup will cancel the job. This value is optional. This value begins counting down from when the backup was scheduled. It does not add additional time for <code>StartWindowMinutes</code>, or if the backup started later than scheduled.</p>
188    /// <p>Like <code>StartWindowMinutes</code>, this parameter has a maximum value of 100 years (52,560,000 minutes).</p>
189    pub fn complete_window_minutes(mut self, input: i64) -> Self {
190        self.inner = self.inner.complete_window_minutes(input);
191        self
192    }
193    /// <p>A value in minutes during which a successfully started backup must complete, or else Backup will cancel the job. This value is optional. This value begins counting down from when the backup was scheduled. It does not add additional time for <code>StartWindowMinutes</code>, or if the backup started later than scheduled.</p>
194    /// <p>Like <code>StartWindowMinutes</code>, this parameter has a maximum value of 100 years (52,560,000 minutes).</p>
195    pub fn set_complete_window_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
196        self.inner = self.inner.set_complete_window_minutes(input);
197        self
198    }
199    /// <p>A value in minutes during which a successfully started backup must complete, or else Backup will cancel the job. This value is optional. This value begins counting down from when the backup was scheduled. It does not add additional time for <code>StartWindowMinutes</code>, or if the backup started later than scheduled.</p>
200    /// <p>Like <code>StartWindowMinutes</code>, this parameter has a maximum value of 100 years (52,560,000 minutes).</p>
201    pub fn get_complete_window_minutes(&self) -> &::std::option::Option<i64> {
202        self.inner.get_complete_window_minutes()
203    }
204    /// <p>The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. Backup will transition and expire backups automatically according to the lifecycle that you define.</p>
205    /// <p>Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “retention” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.</p>
206    /// <p>Resource types that can transition to cold storage are listed in the <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/backup-feature-availability.html#features-by-resource">Feature availability by resource</a> table. Backup ignores this expression for other resource types.</p>
207    /// <p>This parameter has a maximum value of 100 years (36,500 days).</p>
208    pub fn lifecycle(mut self, input: crate::types::Lifecycle) -> Self {
209        self.inner = self.inner.lifecycle(input);
210        self
211    }
212    /// <p>The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. Backup will transition and expire backups automatically according to the lifecycle that you define.</p>
213    /// <p>Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “retention” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.</p>
214    /// <p>Resource types that can transition to cold storage are listed in the <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/backup-feature-availability.html#features-by-resource">Feature availability by resource</a> table. Backup ignores this expression for other resource types.</p>
215    /// <p>This parameter has a maximum value of 100 years (36,500 days).</p>
216    pub fn set_lifecycle(mut self, input: ::std::option::Option<crate::types::Lifecycle>) -> Self {
217        self.inner = self.inner.set_lifecycle(input);
218        self
219    }
220    /// <p>The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. Backup will transition and expire backups automatically according to the lifecycle that you define.</p>
221    /// <p>Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “retention” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.</p>
222    /// <p>Resource types that can transition to cold storage are listed in the <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/backup-feature-availability.html#features-by-resource">Feature availability by resource</a> table. Backup ignores this expression for other resource types.</p>
223    /// <p>This parameter has a maximum value of 100 years (36,500 days).</p>
224    pub fn get_lifecycle(&self) -> &::std::option::Option<crate::types::Lifecycle> {
225        self.inner.get_lifecycle()
226    }
227    ///
228    /// Adds a key-value pair to `RecoveryPointTags`.
229    ///
230    /// To override the contents of this collection use [`set_recovery_point_tags`](Self::set_recovery_point_tags).
231    ///
232    /// <p>The tags to assign to the resources.</p>
233    pub fn recovery_point_tags(
234        mut self,
235        k: impl ::std::convert::Into<::std::string::String>,
236        v: impl ::std::convert::Into<::std::string::String>,
237    ) -> Self {
238        self.inner = self.inner.recovery_point_tags(k.into(), v.into());
239        self
240    }
241    /// <p>The tags to assign to the resources.</p>
242    pub fn set_recovery_point_tags(
243        mut self,
244        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
245    ) -> Self {
246        self.inner = self.inner.set_recovery_point_tags(input);
247        self
248    }
249    /// <p>The tags to assign to the resources.</p>
250    pub fn get_recovery_point_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
251        self.inner.get_recovery_point_tags()
252    }
253    ///
254    /// Adds a key-value pair to `BackupOptions`.
255    ///
256    /// To override the contents of this collection use [`set_backup_options`](Self::set_backup_options).
257    ///
258    /// <p>The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
259    /// <p>Valid values: Set to <code>"WindowsVSS":"enabled"</code> to enable the <code>WindowsVSS</code> backup option and create a Windows VSS backup. Set to <code>"WindowsVSS""disabled"</code> to create a regular backup. The <code>WindowsVSS</code> option is not enabled by default.</p>
260    pub fn backup_options(
261        mut self,
262        k: impl ::std::convert::Into<::std::string::String>,
263        v: impl ::std::convert::Into<::std::string::String>,
264    ) -> Self {
265        self.inner = self.inner.backup_options(k.into(), v.into());
266        self
267    }
268    /// <p>The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
269    /// <p>Valid values: Set to <code>"WindowsVSS":"enabled"</code> to enable the <code>WindowsVSS</code> backup option and create a Windows VSS backup. Set to <code>"WindowsVSS""disabled"</code> to create a regular backup. The <code>WindowsVSS</code> option is not enabled by default.</p>
270    pub fn set_backup_options(
271        mut self,
272        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
273    ) -> Self {
274        self.inner = self.inner.set_backup_options(input);
275        self
276    }
277    /// <p>The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
278    /// <p>Valid values: Set to <code>"WindowsVSS":"enabled"</code> to enable the <code>WindowsVSS</code> backup option and create a Windows VSS backup. Set to <code>"WindowsVSS""disabled"</code> to create a regular backup. The <code>WindowsVSS</code> option is not enabled by default.</p>
279    pub fn get_backup_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
280        self.inner.get_backup_options()
281    }
282    /// <p>Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.</p>
283    /// <p>Resource types that support backup indexes include:</p>
284    /// <ul>
285    /// <li>
286    /// <p><code>EBS</code> for Amazon Elastic Block Store</p></li>
287    /// <li>
288    /// <p><code>S3</code> for Amazon Simple Storage Service (Amazon S3)</p></li>
289    /// </ul>
290    /// <p>Index can have 1 of 2 possible values, either <code>ENABLED</code> or <code>DISABLED</code>.</p>
291    /// <p>To create a backup index for an eligible <code>ACTIVE</code> recovery point that does not yet have a backup index, set value to <code>ENABLED</code>.</p>
292    /// <p>To delete a backup index, set value to <code>DISABLED</code>.</p>
293    pub fn index(mut self, input: crate::types::Index) -> Self {
294        self.inner = self.inner.index(input);
295        self
296    }
297    /// <p>Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.</p>
298    /// <p>Resource types that support backup indexes include:</p>
299    /// <ul>
300    /// <li>
301    /// <p><code>EBS</code> for Amazon Elastic Block Store</p></li>
302    /// <li>
303    /// <p><code>S3</code> for Amazon Simple Storage Service (Amazon S3)</p></li>
304    /// </ul>
305    /// <p>Index can have 1 of 2 possible values, either <code>ENABLED</code> or <code>DISABLED</code>.</p>
306    /// <p>To create a backup index for an eligible <code>ACTIVE</code> recovery point that does not yet have a backup index, set value to <code>ENABLED</code>.</p>
307    /// <p>To delete a backup index, set value to <code>DISABLED</code>.</p>
308    pub fn set_index(mut self, input: ::std::option::Option<crate::types::Index>) -> Self {
309        self.inner = self.inner.set_index(input);
310        self
311    }
312    /// <p>Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.</p>
313    /// <p>Resource types that support backup indexes include:</p>
314    /// <ul>
315    /// <li>
316    /// <p><code>EBS</code> for Amazon Elastic Block Store</p></li>
317    /// <li>
318    /// <p><code>S3</code> for Amazon Simple Storage Service (Amazon S3)</p></li>
319    /// </ul>
320    /// <p>Index can have 1 of 2 possible values, either <code>ENABLED</code> or <code>DISABLED</code>.</p>
321    /// <p>To create a backup index for an eligible <code>ACTIVE</code> recovery point that does not yet have a backup index, set value to <code>ENABLED</code>.</p>
322    /// <p>To delete a backup index, set value to <code>DISABLED</code>.</p>
323    pub fn get_index(&self) -> &::std::option::Option<crate::types::Index> {
324        self.inner.get_index()
325    }
326}