aws_sdk_backup/operation/list_copy_job_summaries/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_copy_job_summaries::_list_copy_job_summaries_output::ListCopyJobSummariesOutputBuilder;
3
4pub use crate::operation::list_copy_job_summaries::_list_copy_job_summaries_input::ListCopyJobSummariesInputBuilder;
5
6impl crate::operation::list_copy_job_summaries::builders::ListCopyJobSummariesInputBuilder {
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_copy_job_summaries::ListCopyJobSummariesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_copy_job_summaries::ListCopyJobSummariesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_copy_job_summaries();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListCopyJobSummaries`.
24///
25/// <p>This request obtains a list of copy jobs created or running within the 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, RestourceType, MessageCategory, StartTime, EndTime, and Count of included jobs.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct ListCopyJobSummariesFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::list_copy_job_summaries::builders::ListCopyJobSummariesInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::list_copy_job_summaries::ListCopyJobSummariesOutput,
36        crate::operation::list_copy_job_summaries::ListCopyJobSummariesError,
37    > for ListCopyJobSummariesFluentBuilder
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_copy_job_summaries::ListCopyJobSummariesOutput,
45            crate::operation::list_copy_job_summaries::ListCopyJobSummariesError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl ListCopyJobSummariesFluentBuilder {
52    /// Creates a new `ListCopyJobSummariesFluentBuilder`.
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 ListCopyJobSummaries as a reference.
61    pub fn as_input(&self) -> &crate::operation::list_copy_job_summaries::builders::ListCopyJobSummariesInputBuilder {
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_copy_job_summaries::ListCopyJobSummariesOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::list_copy_job_summaries::ListCopyJobSummariesError,
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_copy_job_summaries::ListCopyJobSummaries::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::list_copy_job_summaries::ListCopyJobSummaries::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_copy_job_summaries::ListCopyJobSummariesOutput,
98        crate::operation::list_copy_job_summaries::ListCopyJobSummariesError,
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_copy_job_summaries::paginator::ListCopyJobSummariesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
115    pub fn into_paginator(self) -> crate::operation::list_copy_job_summaries::paginator::ListCopyJobSummariesPaginator {
116        crate::operation::list_copy_job_summaries::paginator::ListCopyJobSummariesPaginator::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    pub fn state(mut self, input: crate::types::CopyJobStatus) -> Self {
145        self.inner = self.inner.state(input);
146        self
147    }
148    /// <p>This parameter returns the job count for jobs with the specified state.</p>
149    /// <p>The the value ANY returns count of all states.</p>
150    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all states and returns the sum.</p>
151    pub fn set_state(mut self, input: ::std::option::Option<crate::types::CopyJobStatus>) -> Self {
152        self.inner = self.inner.set_state(input);
153        self
154    }
155    /// <p>This parameter returns the job count for jobs with the specified state.</p>
156    /// <p>The the value ANY returns count of all states.</p>
157    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all states and returns the sum.</p>
158    pub fn get_state(&self) -> &::std::option::Option<crate::types::CopyJobStatus> {
159        self.inner.get_state()
160    }
161    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
162    /// <p>The the value ANY returns count of all resource types.</p>
163    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
164    /// <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>
165    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.inner = self.inner.resource_type(input.into());
167        self
168    }
169    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
170    /// <p>The the value ANY returns count of all resource types.</p>
171    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
172    /// <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>
173    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_resource_type(input);
175        self
176    }
177    /// <p>Returns the job count for the specified resource type. Use request <code>GetSupportedResourceTypes</code> to obtain strings for supported resource types.</p>
178    /// <p>The the value ANY returns count of all resource types.</p>
179    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all resource types and returns the sum.</p>
180    /// <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>
181    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_resource_type()
183    }
184    /// <p>This parameter returns the job count for the specified message category.</p>
185    /// <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>
186    /// <p>The the value ANY returns count of all message categories.</p>
187    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all message categories and returns the sum.</p>
188    pub fn message_category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189        self.inner = self.inner.message_category(input.into());
190        self
191    }
192    /// <p>This parameter returns the job count for the specified message category.</p>
193    /// <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>
194    /// <p>The the value ANY returns count of all message categories.</p>
195    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all message categories and returns the sum.</p>
196    pub fn set_message_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_message_category(input);
198        self
199    }
200    /// <p>This parameter returns the job count for the specified message category.</p>
201    /// <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>
202    /// <p>The the value ANY returns count of all message categories.</p>
203    /// <p><code>AGGREGATE_ALL</code> aggregates job counts for all message categories and returns the sum.</p>
204    pub fn get_message_category(&self) -> &::std::option::Option<::std::string::String> {
205        self.inner.get_message_category()
206    }
207    /// <p>The period for the returned results.</p>
208    /// <ul>
209    /// <li>
210    /// <p><code>ONE_DAY</code> - The daily job count for the prior 14 days.</p></li>
211    /// <li>
212    /// <p><code>SEVEN_DAYS</code> - The aggregated job count for the prior 7 days.</p></li>
213    /// <li>
214    /// <p><code>FOURTEEN_DAYS</code> - The aggregated job count for prior 14 days.</p></li>
215    /// </ul>
216    pub fn aggregation_period(mut self, input: crate::types::AggregationPeriod) -> Self {
217        self.inner = self.inner.aggregation_period(input);
218        self
219    }
220    /// <p>The period for the returned results.</p>
221    /// <ul>
222    /// <li>
223    /// <p><code>ONE_DAY</code> - The daily job count for the prior 14 days.</p></li>
224    /// <li>
225    /// <p><code>SEVEN_DAYS</code> - The aggregated job count for the prior 7 days.</p></li>
226    /// <li>
227    /// <p><code>FOURTEEN_DAYS</code> - The aggregated job count for prior 14 days.</p></li>
228    /// </ul>
229    pub fn set_aggregation_period(mut self, input: ::std::option::Option<crate::types::AggregationPeriod>) -> Self {
230        self.inner = self.inner.set_aggregation_period(input);
231        self
232    }
233    /// <p>The period for the returned results.</p>
234    /// <ul>
235    /// <li>
236    /// <p><code>ONE_DAY</code> - The daily job count for the prior 14 days.</p></li>
237    /// <li>
238    /// <p><code>SEVEN_DAYS</code> - The aggregated job count for the prior 7 days.</p></li>
239    /// <li>
240    /// <p><code>FOURTEEN_DAYS</code> - The aggregated job count for prior 14 days.</p></li>
241    /// </ul>
242    pub fn get_aggregation_period(&self) -> &::std::option::Option<crate::types::AggregationPeriod> {
243        self.inner.get_aggregation_period()
244    }
245    /// <p>This parameter sets the maximum number of items to be returned.</p>
246    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
247    pub fn max_results(mut self, input: i32) -> Self {
248        self.inner = self.inner.max_results(input);
249        self
250    }
251    /// <p>This parameter sets the maximum number of items to be returned.</p>
252    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
253    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
254        self.inner = self.inner.set_max_results(input);
255        self
256    }
257    /// <p>This parameter sets the maximum number of items to be returned.</p>
258    /// <p>The value is an integer. Range of accepted values is from 1 to 500.</p>
259    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
260        self.inner.get_max_results()
261    }
262    /// <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>
263    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
264        self.inner = self.inner.next_token(input.into());
265        self
266    }
267    /// <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>
268    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
269        self.inner = self.inner.set_next_token(input);
270        self
271    }
272    /// <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>
273    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
274        self.inner.get_next_token()
275    }
276}