aws_sdk_backup/operation/list_backup_job_summaries/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_backup_job_summaries::_list_backup_job_summaries_output::ListBackupJobSummariesOutputBuilder;
3
4pub use crate::operation::list_backup_job_summaries::_list_backup_job_summaries_input::ListBackupJobSummariesInputBuilder;
5
6impl crate::operation::list_backup_job_summaries::builders::ListBackupJobSummariesInputBuilder {
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_backup_job_summaries::ListBackupJobSummariesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_backup_job_summaries::ListBackupJobSummariesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_backup_job_summaries();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListBackupJobSummaries`.
24///
25/// <p>This is a request for a summary of backup jobs created or running within the most recent 30 days. You can include parameters AccountID, State, ResourceType, MessageCategory, AggregationPeriod, MaxResults, or NextToken to filter results.</p>
26/// <p>This request returns a summary that contains Region, Account, State, ResourceType, MessageCategory, StartTime, EndTime, and Count of included jobs.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct ListBackupJobSummariesFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::list_backup_job_summaries::builders::ListBackupJobSummariesInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::list_backup_job_summaries::ListBackupJobSummariesOutput,
36        crate::operation::list_backup_job_summaries::ListBackupJobSummariesError,
37    > for ListBackupJobSummariesFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::list_backup_job_summaries::ListBackupJobSummariesOutput,
45            crate::operation::list_backup_job_summaries::ListBackupJobSummariesError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl ListBackupJobSummariesFluentBuilder {
52    /// Creates a new `ListBackupJobSummariesFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the ListBackupJobSummaries as a reference.
61    pub fn as_input(&self) -> &crate::operation::list_backup_job_summaries::builders::ListBackupJobSummariesInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::list_backup_job_summaries::ListBackupJobSummariesOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::list_backup_job_summaries::ListBackupJobSummariesError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::list_backup_job_summaries::ListBackupJobSummaries::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::list_backup_job_summaries::ListBackupJobSummaries::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::list_backup_job_summaries::ListBackupJobSummariesOutput,
98        crate::operation::list_backup_job_summaries::ListBackupJobSummariesError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// Create a paginator for this request
113    ///
114    /// Paginators are used by calling [`send().await`](crate::operation::list_backup_job_summaries::paginator::ListBackupJobSummariesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
115    pub fn into_paginator(self) -> crate::operation::list_backup_job_summaries::paginator::ListBackupJobSummariesPaginator {
116        crate::operation::list_backup_job_summaries::paginator::ListBackupJobSummariesPaginator::new(self.handle, self.inner)
117    }
118    /// <p>Returns the job count for the specified account.</p>
119    /// <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>
120    /// <p>Root, admin, and delegated administrator accounts can use the value ANY to return job counts from every account in the organization.</p>
121    /// <p><code>AGGREGATE_ALL</code> aggregates job counts from all accounts within the authenticated organization, then returns the sum.</p>
122    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.account_id(input.into());
124        self
125    }
126    /// <p>Returns the job count for the specified account.</p>
127    /// <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>
128    /// <p>Root, admin, and delegated administrator accounts can use the value ANY to return job counts from every account in the organization.</p>
129    /// <p><code>AGGREGATE_ALL</code> aggregates job counts from all accounts within the authenticated organization, then returns the sum.</p>
130    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_account_id(input);
132        self
133    }
134    /// <p>Returns the job count for the specified account.</p>
135    /// <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>
136    /// <p>Root, admin, and delegated administrator accounts can use the value ANY to return job counts from every account in the organization.</p>
137    /// <p><code>AGGREGATE_ALL</code> aggregates job counts from all accounts within the authenticated organization, then returns the sum.</p>
138    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_account_id()
140    }
141    /// <p>This parameter returns the job count for jobs with the specified state.</p>
142    /// <p>The the value ANY returns count of all states.</p>
143    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all states and returns the sum.</p>
144    /// <p><code>Completed with issues</code> is a status found only in the Backup console. For API, this status refers to jobs with a state of <code>COMPLETED</code> and a <code>MessageCategory</code> with a value other than <code>SUCCESS</code>; that is, the status is completed but comes with a status message. To obtain the job count for <code>Completed with issues</code>, run two GET requests, and subtract the second, smaller number:</p>
145    /// <p>GET /audit/backup-job-summaries?AggregationPeriod=FOURTEEN_DAYS&amp;State=COMPLETED</p>
146    /// <p>GET /audit/backup-job-summaries?AggregationPeriod=FOURTEEN_DAYS&amp;MessageCategory=SUCCESS&amp;State=COMPLETED</p>
147    pub fn state(mut self, input: crate::types::BackupJobStatus) -> Self {
148        self.inner = self.inner.state(input);
149        self
150    }
151    /// <p>This parameter returns the job count for jobs with the specified state.</p>
152    /// <p>The the value ANY returns count of all states.</p>
153    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all states and returns the sum.</p>
154    /// <p><code>Completed with issues</code> is a status found only in the Backup console. For API, this status refers to jobs with a state of <code>COMPLETED</code> and a <code>MessageCategory</code> with a value other than <code>SUCCESS</code>; that is, the status is completed but comes with a status message. To obtain the job count for <code>Completed with issues</code>, run two GET requests, and subtract the second, smaller number:</p>
155    /// <p>GET /audit/backup-job-summaries?AggregationPeriod=FOURTEEN_DAYS&amp;State=COMPLETED</p>
156    /// <p>GET /audit/backup-job-summaries?AggregationPeriod=FOURTEEN_DAYS&amp;MessageCategory=SUCCESS&amp;State=COMPLETED</p>
157    pub fn set_state(mut self, input: ::std::option::Option<crate::types::BackupJobStatus>) -> Self {
158        self.inner = self.inner.set_state(input);
159        self
160    }
161    /// <p>This parameter returns the job count for jobs with the specified state.</p>
162    /// <p>The the value ANY returns count of all states.</p>
163    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all states and returns the sum.</p>
164    /// <p><code>Completed with issues</code> is a status found only in the Backup console. For API, this status refers to jobs with a state of <code>COMPLETED</code> and a <code>MessageCategory</code> with a value other than <code>SUCCESS</code>; that is, the status is completed but comes with a status message. To obtain the job count for <code>Completed with issues</code>, run two GET requests, and subtract the second, smaller number:</p>
165    /// <p>GET /audit/backup-job-summaries?AggregationPeriod=FOURTEEN_DAYS&amp;State=COMPLETED</p>
166    /// <p>GET /audit/backup-job-summaries?AggregationPeriod=FOURTEEN_DAYS&amp;MessageCategory=SUCCESS&amp;State=COMPLETED</p>
167    pub fn get_state(&self) -> &::std::option::Option<crate::types::BackupJobStatus> {
168        self.inner.get_state()
169    }
170    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
171    /// <p>The the value ANY returns count of all resource types.</p>
172    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
173    /// <p>The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.</p>
174    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.inner = self.inner.resource_type(input.into());
176        self
177    }
178    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
179    /// <p>The the value ANY returns count of all resource types.</p>
180    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
181    /// <p>The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.</p>
182    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_resource_type(input);
184        self
185    }
186    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
187    /// <p>The the value ANY returns count of all resource types.</p>
188    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
189    /// <p>The type of Amazon Web Services resource to be backed up; for example, an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon RDS) database.</p>
190    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
191        self.inner.get_resource_type()
192    }
193    /// <p>This parameter returns the job count for the specified message category.</p>
194    /// <p>Example accepted strings include <code>AccessDenied</code>, <code>Success</code>, and <code>InvalidParameters</code>. See <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/monitoring.html">Monitoring</a> for a list of accepted MessageCategory strings.</p>
195    /// <p>The the value ANY returns count of all message categories.</p>
196    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all message categories and returns the sum.</p>
197    pub fn message_category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.inner = self.inner.message_category(input.into());
199        self
200    }
201    /// <p>This parameter returns the job count for the specified message category.</p>
202    /// <p>Example accepted strings include <code>AccessDenied</code>, <code>Success</code>, and <code>InvalidParameters</code>. See <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/monitoring.html">Monitoring</a> for a list of accepted MessageCategory strings.</p>
203    /// <p>The the value ANY returns count of all message categories.</p>
204    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all message categories and returns the sum.</p>
205    pub fn set_message_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206        self.inner = self.inner.set_message_category(input);
207        self
208    }
209    /// <p>This parameter returns the job count for the specified message category.</p>
210    /// <p>Example accepted strings include <code>AccessDenied</code>, <code>Success</code>, and <code>InvalidParameters</code>. See <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/monitoring.html">Monitoring</a> for a list of accepted MessageCategory strings.</p>
211    /// <p>The the value ANY returns count of all message categories.</p>
212    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all message categories and returns the sum.</p>
213    pub fn get_message_category(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_message_category()
215    }
216    /// <p>The period for the returned results.</p>
217    /// <ul>
218    /// <li>
219    /// <p><code>ONE_DAY</code> - The daily job count for the prior 14 days.</p></li>
220    /// <li>
221    /// <p><code>SEVEN_DAYS</code> - The aggregated job count for the prior 7 days.</p></li>
222    /// <li>
223    /// <p><code>FOURTEEN_DAYS</code> - The aggregated job count for prior 14 days.</p></li>
224    /// </ul>
225    pub fn aggregation_period(mut self, input: crate::types::AggregationPeriod) -> Self {
226        self.inner = self.inner.aggregation_period(input);
227        self
228    }
229    /// <p>The period for the returned results.</p>
230    /// <ul>
231    /// <li>
232    /// <p><code>ONE_DAY</code> - The daily job count for the prior 14 days.</p></li>
233    /// <li>
234    /// <p><code>SEVEN_DAYS</code> - The aggregated job count for the prior 7 days.</p></li>
235    /// <li>
236    /// <p><code>FOURTEEN_DAYS</code> - The aggregated job count for prior 14 days.</p></li>
237    /// </ul>
238    pub fn set_aggregation_period(mut self, input: ::std::option::Option<crate::types::AggregationPeriod>) -> Self {
239        self.inner = self.inner.set_aggregation_period(input);
240        self
241    }
242    /// <p>The period for the returned results.</p>
243    /// <ul>
244    /// <li>
245    /// <p><code>ONE_DAY</code> - The daily job count for the prior 14 days.</p></li>
246    /// <li>
247    /// <p><code>SEVEN_DAYS</code> - The aggregated job count for the prior 7 days.</p></li>
248    /// <li>
249    /// <p><code>FOURTEEN_DAYS</code> - The aggregated job count for prior 14 days.</p></li>
250    /// </ul>
251    pub fn get_aggregation_period(&self) -> &::std::option::Option<crate::types::AggregationPeriod> {
252        self.inner.get_aggregation_period()
253    }
254    /// <p>The maximum number of items to be returned.</p>
255    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
256    pub fn max_results(mut self, input: i32) -> Self {
257        self.inner = self.inner.max_results(input);
258        self
259    }
260    /// <p>The maximum number of items to be returned.</p>
261    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
262    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
263        self.inner = self.inner.set_max_results(input);
264        self
265    }
266    /// <p>The maximum number of items to be returned.</p>
267    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
268    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
269        self.inner.get_max_results()
270    }
271    /// <p>The next item following a partial list of returned resources. For example, if a request is made to return <code>MaxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>
272    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.inner = self.inner.next_token(input.into());
274        self
275    }
276    /// <p>The next item following a partial list of returned resources. For example, if a request is made to return <code>MaxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>
277    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.inner = self.inner.set_next_token(input);
279        self
280    }
281    /// <p>The next item following a partial list of returned resources. For example, if a request is made to return <code>MaxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>
282    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
283        self.inner.get_next_token()
284    }
285}