aws_sdk_backup/operation/list_scan_jobs/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_scan_jobs::_list_scan_jobs_output::ListScanJobsOutputBuilder;
3
4pub use crate::operation::list_scan_jobs::_list_scan_jobs_input::ListScanJobsInputBuilder;
5
6impl crate::operation::list_scan_jobs::builders::ListScanJobsInputBuilder {
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::list_scan_jobs::ListScanJobsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_scan_jobs::ListScanJobsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_scan_jobs();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListScanJobs`.
24///
25/// <p>Returns a list of existing scan jobs for an authenticated account for the last 30 days.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListScanJobsFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::list_scan_jobs::builders::ListScanJobsInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::list_scan_jobs::ListScanJobsOutput,
35 crate::operation::list_scan_jobs::ListScanJobsError,
36 > for ListScanJobsFluentBuilder
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::list_scan_jobs::ListScanJobsOutput,
44 crate::operation::list_scan_jobs::ListScanJobsError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl ListScanJobsFluentBuilder {
51 /// Creates a new `ListScanJobsFluentBuilder`.
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 ListScanJobs as a reference.
60 pub fn as_input(&self) -> &crate::operation::list_scan_jobs::builders::ListScanJobsInputBuilder {
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::list_scan_jobs::ListScanJobsOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::list_scan_jobs::ListScanJobsError,
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::list_scan_jobs::ListScanJobs::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::list_scan_jobs::ListScanJobs::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::list_scan_jobs::ListScanJobsOutput,
97 crate::operation::list_scan_jobs::ListScanJobsError,
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 /// Create a paginator for this request
112 ///
113 /// Paginators are used by calling [`send().await`](crate::operation::list_scan_jobs::paginator::ListScanJobsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114 pub fn into_paginator(self) -> crate::operation::list_scan_jobs::paginator::ListScanJobsPaginator {
115 crate::operation::list_scan_jobs::paginator::ListScanJobsPaginator::new(self.handle, self.inner)
116 }
117 /// <p>The account ID to list the jobs from. Returns only backup jobs associated with the specified account ID.</p>
118 /// <p>If used from an Amazon Web Services Organizations management account, passing <code>*</code> returns all jobs across the organization.</p>
119 /// <p>Pattern: <code>^\[0-9\]{12}$</code></p>
120 pub fn by_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.by_account_id(input.into());
122 self
123 }
124 /// <p>The account ID to list the jobs from. Returns only backup jobs associated with the specified account ID.</p>
125 /// <p>If used from an Amazon Web Services Organizations management account, passing <code>*</code> returns all jobs across the organization.</p>
126 /// <p>Pattern: <code>^\[0-9\]{12}$</code></p>
127 pub fn set_by_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.inner = self.inner.set_by_account_id(input);
129 self
130 }
131 /// <p>The account ID to list the jobs from. Returns only backup jobs associated with the specified account ID.</p>
132 /// <p>If used from an Amazon Web Services Organizations management account, passing <code>*</code> returns all jobs across the organization.</p>
133 /// <p>Pattern: <code>^\[0-9\]{12}$</code></p>
134 pub fn get_by_account_id(&self) -> &::std::option::Option<::std::string::String> {
135 self.inner.get_by_account_id()
136 }
137 /// <p>Returns only scan jobs that will be stored in the specified backup vault. 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>
138 /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\.\]{2,50}$</code></p>
139 pub fn by_backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.inner = self.inner.by_backup_vault_name(input.into());
141 self
142 }
143 /// <p>Returns only scan jobs that will be stored in the specified backup vault. 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>
144 /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\.\]{2,50}$</code></p>
145 pub fn set_by_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146 self.inner = self.inner.set_by_backup_vault_name(input);
147 self
148 }
149 /// <p>Returns only scan jobs that will be stored in the specified backup vault. 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>
150 /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\.\]{2,50}$</code></p>
151 pub fn get_by_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> {
152 self.inner.get_by_backup_vault_name()
153 }
154 /// <p>Returns only scan jobs completed after a date expressed in Unix format and Coordinated Universal Time (UTC).</p>
155 pub fn by_complete_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
156 self.inner = self.inner.by_complete_after(input);
157 self
158 }
159 /// <p>Returns only scan jobs completed after a date expressed in Unix format and Coordinated Universal Time (UTC).</p>
160 pub fn set_by_complete_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
161 self.inner = self.inner.set_by_complete_after(input);
162 self
163 }
164 /// <p>Returns only scan jobs completed after a date expressed in Unix format and Coordinated Universal Time (UTC).</p>
165 pub fn get_by_complete_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
166 self.inner.get_by_complete_after()
167 }
168 /// <p>Returns only backup jobs completed before a date expressed in Unix format and Coordinated Universal Time (UTC).</p>
169 pub fn by_complete_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
170 self.inner = self.inner.by_complete_before(input);
171 self
172 }
173 /// <p>Returns only backup jobs completed before a date expressed in Unix format and Coordinated Universal Time (UTC).</p>
174 pub fn set_by_complete_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
175 self.inner = self.inner.set_by_complete_before(input);
176 self
177 }
178 /// <p>Returns only backup jobs completed before a date expressed in Unix format and Coordinated Universal Time (UTC).</p>
179 pub fn get_by_complete_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
180 self.inner.get_by_complete_before()
181 }
182 /// <p>Returns only the scan jobs for the specified malware scanner. Currently only supports <code>GUARDDUTY</code>.</p>
183 pub fn by_malware_scanner(mut self, input: crate::types::MalwareScanner) -> Self {
184 self.inner = self.inner.by_malware_scanner(input);
185 self
186 }
187 /// <p>Returns only the scan jobs for the specified malware scanner. Currently only supports <code>GUARDDUTY</code>.</p>
188 pub fn set_by_malware_scanner(mut self, input: ::std::option::Option<crate::types::MalwareScanner>) -> Self {
189 self.inner = self.inner.set_by_malware_scanner(input);
190 self
191 }
192 /// <p>Returns only the scan jobs for the specified malware scanner. Currently only supports <code>GUARDDUTY</code>.</p>
193 pub fn get_by_malware_scanner(&self) -> &::std::option::Option<crate::types::MalwareScanner> {
194 self.inner.get_by_malware_scanner()
195 }
196 /// <p>Returns only the scan jobs that are ran against the specified recovery point.</p>
197 pub fn by_recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198 self.inner = self.inner.by_recovery_point_arn(input.into());
199 self
200 }
201 /// <p>Returns only the scan jobs that are ran against the specified recovery point.</p>
202 pub fn set_by_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.inner = self.inner.set_by_recovery_point_arn(input);
204 self
205 }
206 /// <p>Returns only the scan jobs that are ran against the specified recovery point.</p>
207 pub fn get_by_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> {
208 self.inner.get_by_recovery_point_arn()
209 }
210 /// <p>Returns only scan jobs that match the specified resource Amazon Resource Name (ARN).</p>
211 pub fn by_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212 self.inner = self.inner.by_resource_arn(input.into());
213 self
214 }
215 /// <p>Returns only scan jobs that match the specified resource Amazon Resource Name (ARN).</p>
216 pub fn set_by_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217 self.inner = self.inner.set_by_resource_arn(input);
218 self
219 }
220 /// <p>Returns only scan jobs that match the specified resource Amazon Resource Name (ARN).</p>
221 pub fn get_by_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
222 self.inner.get_by_resource_arn()
223 }
224 /// <p>Returns restore testing selections by the specified restore testing plan name.</p>
225 /// <ul>
226 /// <li>
227 /// <p><code>EBS</code>for Amazon Elastic Block Store</p></li>
228 /// <li>
229 /// <p><code>EC2</code>for Amazon Elastic Compute Cloud</p></li>
230 /// <li>
231 /// <p><code>S3</code>for Amazon Simple Storage Service (Amazon S3)</p></li>
232 /// </ul>
233 /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\.\]{1,50}$</code></p>
234 pub fn by_resource_type(mut self, input: crate::types::ScanResourceType) -> Self {
235 self.inner = self.inner.by_resource_type(input);
236 self
237 }
238 /// <p>Returns restore testing selections by the specified restore testing plan name.</p>
239 /// <ul>
240 /// <li>
241 /// <p><code>EBS</code>for Amazon Elastic Block Store</p></li>
242 /// <li>
243 /// <p><code>EC2</code>for Amazon Elastic Compute Cloud</p></li>
244 /// <li>
245 /// <p><code>S3</code>for Amazon Simple Storage Service (Amazon S3)</p></li>
246 /// </ul>
247 /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\.\]{1,50}$</code></p>
248 pub fn set_by_resource_type(mut self, input: ::std::option::Option<crate::types::ScanResourceType>) -> Self {
249 self.inner = self.inner.set_by_resource_type(input);
250 self
251 }
252 /// <p>Returns restore testing selections by the specified restore testing plan name.</p>
253 /// <ul>
254 /// <li>
255 /// <p><code>EBS</code>for Amazon Elastic Block Store</p></li>
256 /// <li>
257 /// <p><code>EC2</code>for Amazon Elastic Compute Cloud</p></li>
258 /// <li>
259 /// <p><code>S3</code>for Amazon Simple Storage Service (Amazon S3)</p></li>
260 /// </ul>
261 /// <p>Pattern: <code>^\[a-zA-Z0-9\-\_\.\]{1,50}$</code></p>
262 pub fn get_by_resource_type(&self) -> &::std::option::Option<crate::types::ScanResourceType> {
263 self.inner.get_by_resource_type()
264 }
265 /// <p>Returns only the scan jobs for the specified scan results:</p>
266 /// <ul>
267 /// <li>
268 /// <p><code>THREATS_FOUND</code></p></li>
269 /// <li>
270 /// <p><code>NO_THREATS_FOUND</code></p></li>
271 /// </ul>
272 pub fn by_scan_result_status(mut self, input: crate::types::ScanResultStatus) -> Self {
273 self.inner = self.inner.by_scan_result_status(input);
274 self
275 }
276 /// <p>Returns only the scan jobs for the specified scan results:</p>
277 /// <ul>
278 /// <li>
279 /// <p><code>THREATS_FOUND</code></p></li>
280 /// <li>
281 /// <p><code>NO_THREATS_FOUND</code></p></li>
282 /// </ul>
283 pub fn set_by_scan_result_status(mut self, input: ::std::option::Option<crate::types::ScanResultStatus>) -> Self {
284 self.inner = self.inner.set_by_scan_result_status(input);
285 self
286 }
287 /// <p>Returns only the scan jobs for the specified scan results:</p>
288 /// <ul>
289 /// <li>
290 /// <p><code>THREATS_FOUND</code></p></li>
291 /// <li>
292 /// <p><code>NO_THREATS_FOUND</code></p></li>
293 /// </ul>
294 pub fn get_by_scan_result_status(&self) -> &::std::option::Option<crate::types::ScanResultStatus> {
295 self.inner.get_by_scan_result_status()
296 }
297 /// <p>Returns only the scan jobs for the specified scanning job state.</p>
298 pub fn by_state(mut self, input: crate::types::ScanState) -> Self {
299 self.inner = self.inner.by_state(input);
300 self
301 }
302 /// <p>Returns only the scan jobs for the specified scanning job state.</p>
303 pub fn set_by_state(mut self, input: ::std::option::Option<crate::types::ScanState>) -> Self {
304 self.inner = self.inner.set_by_state(input);
305 self
306 }
307 /// <p>Returns only the scan jobs for the specified scanning job state.</p>
308 pub fn get_by_state(&self) -> &::std::option::Option<crate::types::ScanState> {
309 self.inner.get_by_state()
310 }
311 /// <p>The maximum number of items to be returned.</p>
312 /// <p>Valid Range: Minimum value of 1. Maximum value of 1000.</p>
313 pub fn max_results(mut self, input: i32) -> Self {
314 self.inner = self.inner.max_results(input);
315 self
316 }
317 /// <p>The maximum number of items to be returned.</p>
318 /// <p>Valid Range: Minimum value of 1. Maximum value of 1000.</p>
319 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
320 self.inner = self.inner.set_max_results(input);
321 self
322 }
323 /// <p>The maximum number of items to be returned.</p>
324 /// <p>Valid Range: Minimum value of 1. Maximum value of 1000.</p>
325 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
326 self.inner.get_max_results()
327 }
328 /// <p>The next item following a partial list of returned items. For example, if a request is made to return <code>MaxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>
329 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
330 self.inner = self.inner.next_token(input.into());
331 self
332 }
333 /// <p>The next item following a partial list of returned items. For example, if a request is made to return <code>MaxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>
334 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
335 self.inner = self.inner.set_next_token(input);
336 self
337 }
338 /// <p>The next item following a partial list of returned items. For example, if a request is made to return <code>MaxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>
339 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
340 self.inner.get_next_token()
341 }
342}