aws_sdk_backup/operation/start_scan_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_scan_job::_start_scan_job_output::StartScanJobOutputBuilder;
3
4pub use crate::operation::start_scan_job::_start_scan_job_input::StartScanJobInputBuilder;
5
6impl crate::operation::start_scan_job::builders::StartScanJobInputBuilder {
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_scan_job::StartScanJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_scan_job::StartScanJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_scan_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartScanJob`.
24///
25/// <p>Starts scanning jobs for specific resources.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct StartScanJobFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::start_scan_job::builders::StartScanJobInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::start_scan_job::StartScanJobOutput,
35        crate::operation::start_scan_job::StartScanJobError,
36    > for StartScanJobFluentBuilder
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_scan_job::StartScanJobOutput,
44            crate::operation::start_scan_job::StartScanJobError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl StartScanJobFluentBuilder {
51    /// Creates a new `StartScanJobFluentBuilder`.
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 StartScanJob as a reference.
60    pub fn as_input(&self) -> &crate::operation::start_scan_job::builders::StartScanJobInputBuilder {
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_scan_job::StartScanJobOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::start_scan_job::StartScanJobError,
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_scan_job::StartScanJob::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::start_scan_job::StartScanJob::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_scan_job::StartScanJobOutput,
97        crate::operation::start_scan_job::StartScanJobError,
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    /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\]{2,50}$</code></p>
113    pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.backup_vault_name(input.into());
115        self
116    }
117    /// <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>
118    /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\]{2,50}$</code></p>
119    pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_backup_vault_name(input);
121        self
122    }
123    /// <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>
124    /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\]{2,50}$</code></p>
125    pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_backup_vault_name()
127    }
128    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
129    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.iam_role_arn(input.into());
131        self
132    }
133    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
134    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_iam_role_arn(input);
136        self
137    }
138    /// <p>Specifies the IAM role ARN used to create the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
139    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_iam_role_arn()
141    }
142    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>StartScanJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
143    pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.idempotency_token(input.into());
145        self
146    }
147    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>StartScanJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
148    pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_idempotency_token(input);
150        self
151    }
152    /// <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>StartScanJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
153    pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_idempotency_token()
155    }
156    /// <p>Specifies the malware scanner used during the scan job. Currently only supports <code>GUARDDUTY</code>.</p>
157    pub fn malware_scanner(mut self, input: crate::types::MalwareScanner) -> Self {
158        self.inner = self.inner.malware_scanner(input);
159        self
160    }
161    /// <p>Specifies the malware scanner used during the scan job. Currently only supports <code>GUARDDUTY</code>.</p>
162    pub fn set_malware_scanner(mut self, input: ::std::option::Option<crate::types::MalwareScanner>) -> Self {
163        self.inner = self.inner.set_malware_scanner(input);
164        self
165    }
166    /// <p>Specifies the malware scanner used during the scan job. Currently only supports <code>GUARDDUTY</code>.</p>
167    pub fn get_malware_scanner(&self) -> &::std::option::Option<crate::types::MalwareScanner> {
168        self.inner.get_malware_scanner()
169    }
170    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a recovery point. This is your target recovery point for a full scan. If you are running an incremental scan, this will be your a recovery point which has been created after your base recovery point selection.</p>
171    pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.recovery_point_arn(input.into());
173        self
174    }
175    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a recovery point. This is your target recovery point for a full scan. If you are running an incremental scan, this will be your a recovery point which has been created after your base recovery point selection.</p>
176    pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_recovery_point_arn(input);
178        self
179    }
180    /// <p>An Amazon Resource Name (ARN) that uniquely identifies a recovery point. This is your target recovery point for a full scan. If you are running an incremental scan, this will be your a recovery point which has been created after your base recovery point selection.</p>
181    pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_recovery_point_arn()
183    }
184    /// <p>An ARN that uniquely identifies the base recovery point to be used for incremental scanning.</p>
185    pub fn scan_base_recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.inner = self.inner.scan_base_recovery_point_arn(input.into());
187        self
188    }
189    /// <p>An ARN that uniquely identifies the base recovery point to be used for incremental scanning.</p>
190    pub fn set_scan_base_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.inner = self.inner.set_scan_base_recovery_point_arn(input);
192        self
193    }
194    /// <p>An ARN that uniquely identifies the base recovery point to be used for incremental scanning.</p>
195    pub fn get_scan_base_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_scan_base_recovery_point_arn()
197    }
198    /// <p>Specifies the scan type use for the scan job.</p>
199    /// <p>Includes:</p>
200    /// <ul>
201    /// <li>
202    /// <p><code>FULL_SCAN</code> will scan the entire data lineage within the backup.</p></li>
203    /// <li>
204    /// <p><code>INCREMENTAL_SCAN</code> will scan the data difference between the target recovery point and base recovery point ARN.</p></li>
205    /// </ul>
206    pub fn scan_mode(mut self, input: crate::types::ScanMode) -> Self {
207        self.inner = self.inner.scan_mode(input);
208        self
209    }
210    /// <p>Specifies the scan type use for the scan job.</p>
211    /// <p>Includes:</p>
212    /// <ul>
213    /// <li>
214    /// <p><code>FULL_SCAN</code> will scan the entire data lineage within the backup.</p></li>
215    /// <li>
216    /// <p><code>INCREMENTAL_SCAN</code> will scan the data difference between the target recovery point and base recovery point ARN.</p></li>
217    /// </ul>
218    pub fn set_scan_mode(mut self, input: ::std::option::Option<crate::types::ScanMode>) -> Self {
219        self.inner = self.inner.set_scan_mode(input);
220        self
221    }
222    /// <p>Specifies the scan type use for the scan job.</p>
223    /// <p>Includes:</p>
224    /// <ul>
225    /// <li>
226    /// <p><code>FULL_SCAN</code> will scan the entire data lineage within the backup.</p></li>
227    /// <li>
228    /// <p><code>INCREMENTAL_SCAN</code> will scan the data difference between the target recovery point and base recovery point ARN.</p></li>
229    /// </ul>
230    pub fn get_scan_mode(&self) -> &::std::option::Option<crate::types::ScanMode> {
231        self.inner.get_scan_mode()
232    }
233    /// <p>Specified the IAM scanner role ARN.</p>
234    pub fn scanner_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.inner = self.inner.scanner_role_arn(input.into());
236        self
237    }
238    /// <p>Specified the IAM scanner role ARN.</p>
239    pub fn set_scanner_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.inner = self.inner.set_scanner_role_arn(input);
241        self
242    }
243    /// <p>Specified the IAM scanner role ARN.</p>
244    pub fn get_scanner_role_arn(&self) -> &::std::option::Option<::std::string::String> {
245        self.inner.get_scanner_role_arn()
246    }
247}