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>The ARN of a logically air-gapped vault. ARN must be in the same account and Region. If provided, supported fully managed resources back up directly to logically air-gapped vault, while other supported resources create a temporary (billable) snapshot in backup vault, then copy it to logically air-gapped vault. Unsupported resources only back up to the specified backup vault.</p>
126    pub fn logically_air_gapped_backup_vault_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.logically_air_gapped_backup_vault_arn(input.into());
128        self
129    }
130    /// <p>The ARN of a logically air-gapped vault. ARN must be in the same account and Region. If provided, supported fully managed resources back up directly to logically air-gapped vault, while other supported resources create a temporary (billable) snapshot in backup vault, then copy it to logically air-gapped vault. Unsupported resources only back up to the specified backup vault.</p>
131    pub fn set_logically_air_gapped_backup_vault_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_logically_air_gapped_backup_vault_arn(input);
133        self
134    }
135    /// <p>The ARN of a logically air-gapped vault. ARN must be in the same account and Region. If provided, supported fully managed resources back up directly to logically air-gapped vault, while other supported resources create a temporary (billable) snapshot in backup vault, then copy it to logically air-gapped vault. Unsupported resources only back up to the specified backup vault.</p>
136    pub fn get_logically_air_gapped_backup_vault_arn(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_logically_air_gapped_backup_vault_arn()
138    }
139    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
140    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.resource_arn(input.into());
142        self
143    }
144    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
145    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_resource_arn(input);
147        self
148    }
149    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.</p>
150    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_resource_arn()
152    }
153    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
154    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.iam_role_arn(input.into());
156        self
157    }
158    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
159    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_iam_role_arn(input);
161        self
162    }
163    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
164    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_iam_role_arn()
166    }
167    /// <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>
168    pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.idempotency_token(input.into());
170        self
171    }
172    /// <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>
173    pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_idempotency_token(input);
175        self
176    }
177    /// <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>
178    pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_idempotency_token()
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 start_window_minutes(mut self, input: i64) -> Self {
185        self.inner = self.inner.start_window_minutes(input);
186        self
187    }
188    /// <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>
189    /// <p>This parameter has a maximum value of 100 years (52,560,000 minutes).</p>
190    /// <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>
191    pub fn set_start_window_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
192        self.inner = self.inner.set_start_window_minutes(input);
193        self
194    }
195    /// <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>
196    /// <p>This parameter has a maximum value of 100 years (52,560,000 minutes).</p>
197    /// <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>
198    pub fn get_start_window_minutes(&self) -> &::std::option::Option<i64> {
199        self.inner.get_start_window_minutes()
200    }
201    /// <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>
202    /// <p>Like <code>StartWindowMinutes</code>, this parameter has a maximum value of 100 years (52,560,000 minutes).</p>
203    pub fn complete_window_minutes(mut self, input: i64) -> Self {
204        self.inner = self.inner.complete_window_minutes(input);
205        self
206    }
207    /// <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>
208    /// <p>Like <code>StartWindowMinutes</code>, this parameter has a maximum value of 100 years (52,560,000 minutes).</p>
209    pub fn set_complete_window_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
210        self.inner = self.inner.set_complete_window_minutes(input);
211        self
212    }
213    /// <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>
214    /// <p>Like <code>StartWindowMinutes</code>, this parameter has a maximum value of 100 years (52,560,000 minutes).</p>
215    pub fn get_complete_window_minutes(&self) -> &::std::option::Option<i64> {
216        self.inner.get_complete_window_minutes()
217    }
218    /// <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>
219    /// <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>
220    /// <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>
221    /// <p>This parameter has a maximum value of 100 years (36,500 days).</p>
222    pub fn lifecycle(mut self, input: crate::types::Lifecycle) -> Self {
223        self.inner = self.inner.lifecycle(input);
224        self
225    }
226    /// <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>
227    /// <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>
228    /// <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>
229    /// <p>This parameter has a maximum value of 100 years (36,500 days).</p>
230    pub fn set_lifecycle(mut self, input: ::std::option::Option<crate::types::Lifecycle>) -> Self {
231        self.inner = self.inner.set_lifecycle(input);
232        self
233    }
234    /// <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>
235    /// <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>
236    /// <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>
237    /// <p>This parameter has a maximum value of 100 years (36,500 days).</p>
238    pub fn get_lifecycle(&self) -> &::std::option::Option<crate::types::Lifecycle> {
239        self.inner.get_lifecycle()
240    }
241    ///
242    /// Adds a key-value pair to `RecoveryPointTags`.
243    ///
244    /// To override the contents of this collection use [`set_recovery_point_tags`](Self::set_recovery_point_tags).
245    ///
246    /// <p>The tags to assign to the resources.</p>
247    pub fn recovery_point_tags(
248        mut self,
249        k: impl ::std::convert::Into<::std::string::String>,
250        v: impl ::std::convert::Into<::std::string::String>,
251    ) -> Self {
252        self.inner = self.inner.recovery_point_tags(k.into(), v.into());
253        self
254    }
255    /// <p>The tags to assign to the resources.</p>
256    pub fn set_recovery_point_tags(
257        mut self,
258        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
259    ) -> Self {
260        self.inner = self.inner.set_recovery_point_tags(input);
261        self
262    }
263    /// <p>The tags to assign to the resources.</p>
264    pub fn get_recovery_point_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
265        self.inner.get_recovery_point_tags()
266    }
267    ///
268    /// Adds a key-value pair to `BackupOptions`.
269    ///
270    /// To override the contents of this collection use [`set_backup_options`](Self::set_backup_options).
271    ///
272    /// <p>The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
273    /// <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>
274    pub fn backup_options(
275        mut self,
276        k: impl ::std::convert::Into<::std::string::String>,
277        v: impl ::std::convert::Into<::std::string::String>,
278    ) -> Self {
279        self.inner = self.inner.backup_options(k.into(), v.into());
280        self
281    }
282    /// <p>The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
283    /// <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>
284    pub fn set_backup_options(
285        mut self,
286        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
287    ) -> Self {
288        self.inner = self.inner.set_backup_options(input);
289        self
290    }
291    /// <p>The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
292    /// <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>
293    pub fn get_backup_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
294        self.inner.get_backup_options()
295    }
296    /// <p>Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.</p>
297    /// <p>Resource types that support backup indexes include:</p>
298    /// <ul>
299    /// <li>
300    /// <p><code>EBS</code> for Amazon Elastic Block Store</p></li>
301    /// <li>
302    /// <p><code>S3</code> for Amazon Simple Storage Service (Amazon S3)</p></li>
303    /// </ul>
304    /// <p>Index can have 1 of 2 possible values, either <code>ENABLED</code> or <code>DISABLED</code>.</p>
305    /// <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>
306    /// <p>To delete a backup index, set value to <code>DISABLED</code>.</p>
307    pub fn index(mut self, input: crate::types::Index) -> Self {
308        self.inner = self.inner.index(input);
309        self
310    }
311    /// <p>Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.</p>
312    /// <p>Resource types that support backup indexes include:</p>
313    /// <ul>
314    /// <li>
315    /// <p><code>EBS</code> for Amazon Elastic Block Store</p></li>
316    /// <li>
317    /// <p><code>S3</code> for Amazon Simple Storage Service (Amazon S3)</p></li>
318    /// </ul>
319    /// <p>Index can have 1 of 2 possible values, either <code>ENABLED</code> or <code>DISABLED</code>.</p>
320    /// <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>
321    /// <p>To delete a backup index, set value to <code>DISABLED</code>.</p>
322    pub fn set_index(mut self, input: ::std::option::Option<crate::types::Index>) -> Self {
323        self.inner = self.inner.set_index(input);
324        self
325    }
326    /// <p>Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.</p>
327    /// <p>Resource types that support backup indexes include:</p>
328    /// <ul>
329    /// <li>
330    /// <p><code>EBS</code> for Amazon Elastic Block Store</p></li>
331    /// <li>
332    /// <p><code>S3</code> for Amazon Simple Storage Service (Amazon S3)</p></li>
333    /// </ul>
334    /// <p>Index can have 1 of 2 possible values, either <code>ENABLED</code> or <code>DISABLED</code>.</p>
335    /// <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>
336    /// <p>To delete a backup index, set value to <code>DISABLED</code>.</p>
337    pub fn get_index(&self) -> &::std::option::Option<crate::types::Index> {
338        self.inner.get_index()
339    }
340}