aws_sdk_backup/operation/list_scan_job_summaries/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_scan_job_summaries::_list_scan_job_summaries_output::ListScanJobSummariesOutputBuilder;
3
4pub use crate::operation::list_scan_job_summaries::_list_scan_job_summaries_input::ListScanJobSummariesInputBuilder;
5
6impl crate::operation::list_scan_job_summaries::builders::ListScanJobSummariesInputBuilder {
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_job_summaries::ListScanJobSummariesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_scan_job_summaries::ListScanJobSummariesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_scan_job_summaries();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListScanJobSummaries`.
24///
25/// <p>This is a request for a summary of scan jobs created or running within the most recent 30 days.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListScanJobSummariesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_scan_job_summaries::builders::ListScanJobSummariesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_scan_job_summaries::ListScanJobSummariesOutput,
35        crate::operation::list_scan_job_summaries::ListScanJobSummariesError,
36    > for ListScanJobSummariesFluentBuilder
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_job_summaries::ListScanJobSummariesOutput,
44            crate::operation::list_scan_job_summaries::ListScanJobSummariesError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListScanJobSummariesFluentBuilder {
51    /// Creates a new `ListScanJobSummariesFluentBuilder`.
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 ListScanJobSummaries as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_scan_job_summaries::builders::ListScanJobSummariesInputBuilder {
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_job_summaries::ListScanJobSummariesOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_scan_job_summaries::ListScanJobSummariesError,
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_job_summaries::ListScanJobSummaries::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_scan_job_summaries::ListScanJobSummaries::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_job_summaries::ListScanJobSummariesOutput,
97        crate::operation::list_scan_job_summaries::ListScanJobSummariesError,
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_job_summaries::paginator::ListScanJobSummariesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_scan_job_summaries::paginator::ListScanJobSummariesPaginator {
115        crate::operation::list_scan_job_summaries::paginator::ListScanJobSummariesPaginator::new(self.handle, self.inner)
116    }
117    /// <p>Returns the job count for the specified account.</p>
118    /// <p>If the request is sent from a member account or an account not part of Amazon Web Services Organizations, jobs within requestor's account will be returned.</p>
119    /// <p>Root, admin, and delegated administrator accounts can use the value <code>ANY</code> to return job counts from every account in the organization.</p>
120    /// <p><code>AGGREGATE_ALL</code> aggregates job counts from all accounts within the authenticated organization, then returns the sum.</p>
121    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.account_id(input.into());
123        self
124    }
125    /// <p>Returns the job count for the specified account.</p>
126    /// <p>If the request is sent from a member account or an account not part of Amazon Web Services Organizations, jobs within requestor's account will be returned.</p>
127    /// <p>Root, admin, and delegated administrator accounts can use the value <code>ANY</code> to return job counts from every account in the organization.</p>
128    /// <p><code>AGGREGATE_ALL</code> aggregates job counts from all accounts within the authenticated organization, then returns the sum.</p>
129    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_account_id(input);
131        self
132    }
133    /// <p>Returns the job count for the specified account.</p>
134    /// <p>If the request is sent from a member account or an account not part of Amazon Web Services Organizations, jobs within requestor's account will be returned.</p>
135    /// <p>Root, admin, and delegated administrator accounts can use the value <code>ANY</code> to return job counts from every account in the organization.</p>
136    /// <p><code>AGGREGATE_ALL</code> aggregates job counts from all accounts within the authenticated organization, then returns the sum.</p>
137    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_account_id()
139    }
140    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
141    /// <p>The the value <code>ANY</code> returns count of all resource types.</p>
142    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
143    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.resource_type(input.into());
145        self
146    }
147    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
148    /// <p>The the value <code>ANY</code> returns count of all resource types.</p>
149    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
150    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_resource_type(input);
152        self
153    }
154    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
155    /// <p>The the value <code>ANY</code> returns count of all resource types.</p>
156    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
157    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_resource_type()
159    }
160    /// <p>Returns only the scan jobs for the specified malware scanner. Currently the only MalwareScanner is <code>GUARDDUTY</code>. But the field also supports <code>ANY</code>, and <code>AGGREGATE_ALL</code>.</p>
161    pub fn malware_scanner(mut self, input: crate::types::MalwareScanner) -> Self {
162        self.inner = self.inner.malware_scanner(input);
163        self
164    }
165    /// <p>Returns only the scan jobs for the specified malware scanner. Currently the only MalwareScanner is <code>GUARDDUTY</code>. But the field also supports <code>ANY</code>, and <code>AGGREGATE_ALL</code>.</p>
166    pub fn set_malware_scanner(mut self, input: ::std::option::Option<crate::types::MalwareScanner>) -> Self {
167        self.inner = self.inner.set_malware_scanner(input);
168        self
169    }
170    /// <p>Returns only the scan jobs for the specified malware scanner. Currently the only MalwareScanner is <code>GUARDDUTY</code>. But the field also supports <code>ANY</code>, and <code>AGGREGATE_ALL</code>.</p>
171    pub fn get_malware_scanner(&self) -> &::std::option::Option<crate::types::MalwareScanner> {
172        self.inner.get_malware_scanner()
173    }
174    /// <p>Returns only the scan jobs for the specified scan results.</p>
175    pub fn scan_result_status(mut self, input: crate::types::ScanResultStatus) -> Self {
176        self.inner = self.inner.scan_result_status(input);
177        self
178    }
179    /// <p>Returns only the scan jobs for the specified scan results.</p>
180    pub fn set_scan_result_status(mut self, input: ::std::option::Option<crate::types::ScanResultStatus>) -> Self {
181        self.inner = self.inner.set_scan_result_status(input);
182        self
183    }
184    /// <p>Returns only the scan jobs for the specified scan results.</p>
185    pub fn get_scan_result_status(&self) -> &::std::option::Option<crate::types::ScanResultStatus> {
186        self.inner.get_scan_result_status()
187    }
188    /// <p>Returns only the scan jobs for the specified scanning job state.</p>
189    pub fn state(mut self, input: crate::types::ScanJobStatus) -> Self {
190        self.inner = self.inner.state(input);
191        self
192    }
193    /// <p>Returns only the scan jobs for the specified scanning job state.</p>
194    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ScanJobStatus>) -> Self {
195        self.inner = self.inner.set_state(input);
196        self
197    }
198    /// <p>Returns only the scan jobs for the specified scanning job state.</p>
199    pub fn get_state(&self) -> &::std::option::Option<crate::types::ScanJobStatus> {
200        self.inner.get_state()
201    }
202    /// <p>The period for the returned results.</p>
203    /// <ul>
204    /// <li>
205    /// <p><code>ONE_DAY</code>The daily job count for the prior 1 day.</p></li>
206    /// <li>
207    /// <p><code>SEVEN_DAYS</code>The daily job count for the prior 7 days.</p></li>
208    /// <li>
209    /// <p><code>FOURTEEN_DAYS</code>The daily job count for the prior 14 days.</p></li>
210    /// </ul>
211    pub fn aggregation_period(mut self, input: crate::types::AggregationPeriod) -> Self {
212        self.inner = self.inner.aggregation_period(input);
213        self
214    }
215    /// <p>The period for the returned results.</p>
216    /// <ul>
217    /// <li>
218    /// <p><code>ONE_DAY</code>The daily job count for the prior 1 day.</p></li>
219    /// <li>
220    /// <p><code>SEVEN_DAYS</code>The daily job count for the prior 7 days.</p></li>
221    /// <li>
222    /// <p><code>FOURTEEN_DAYS</code>The daily job count for the prior 14 days.</p></li>
223    /// </ul>
224    pub fn set_aggregation_period(mut self, input: ::std::option::Option<crate::types::AggregationPeriod>) -> Self {
225        self.inner = self.inner.set_aggregation_period(input);
226        self
227    }
228    /// <p>The period for the returned results.</p>
229    /// <ul>
230    /// <li>
231    /// <p><code>ONE_DAY</code>The daily job count for the prior 1 day.</p></li>
232    /// <li>
233    /// <p><code>SEVEN_DAYS</code>The daily job count for the prior 7 days.</p></li>
234    /// <li>
235    /// <p><code>FOURTEEN_DAYS</code>The daily job count for the prior 14 days.</p></li>
236    /// </ul>
237    pub fn get_aggregation_period(&self) -> &::std::option::Option<crate::types::AggregationPeriod> {
238        self.inner.get_aggregation_period()
239    }
240    /// <p>The maximum number of items to be returned.</p>
241    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
242    pub fn max_results(mut self, input: i32) -> Self {
243        self.inner = self.inner.max_results(input);
244        self
245    }
246    /// <p>The maximum number of items to be returned.</p>
247    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
248    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
249        self.inner = self.inner.set_max_results(input);
250        self
251    }
252    /// <p>The maximum number of items to be returned.</p>
253    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
254    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
255        self.inner.get_max_results()
256    }
257    /// <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>
258    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259        self.inner = self.inner.next_token(input.into());
260        self
261    }
262    /// <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>
263    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264        self.inner = self.inner.set_next_token(input);
265        self
266    }
267    /// <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>
268    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
269        self.inner.get_next_token()
270    }
271}