aws_sdk_ec2/operation/describe_store_image_tasks/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_store_image_tasks::_describe_store_image_tasks_output::DescribeStoreImageTasksOutputBuilder;
3
4pub use crate::operation::describe_store_image_tasks::_describe_store_image_tasks_input::DescribeStoreImageTasksInputBuilder;
5
6impl crate::operation::describe_store_image_tasks::builders::DescribeStoreImageTasksInputBuilder {
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::describe_store_image_tasks::DescribeStoreImageTasksOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_store_image_tasks::DescribeStoreImageTasksError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_store_image_tasks();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeStoreImageTasks`.
24///
25/// <p>Describes the progress of the AMI store tasks. You can describe the store tasks for specified AMIs. If you don't specify the AMIs, you get a paginated list of store tasks from the last 31 days.</p>
26/// <p>For each AMI task, the response indicates if the task is <code>InProgress</code>, <code>Completed</code>, or <code>Failed</code>. For tasks <code>InProgress</code>, the response shows the estimated progress as a percentage.</p>
27/// <p>Tasks are listed in reverse chronological order. Currently, only tasks from the past 31 days can be viewed.</p>
28/// <p>To use this API, you must have the required permissions. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-ami-store-restore.html#ami-s3-permissions">Permissions for storing and restoring AMIs using S3</a> in the <i>Amazon EC2 User Guide</i>.</p>
29/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html">Store and restore an AMI using S3</a> in the <i>Amazon EC2 User Guide</i>.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct DescribeStoreImageTasksFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::describe_store_image_tasks::builders::DescribeStoreImageTasksInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::describe_store_image_tasks::DescribeStoreImageTasksOutput,
39        crate::operation::describe_store_image_tasks::DescribeStoreImageTasksError,
40    > for DescribeStoreImageTasksFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::describe_store_image_tasks::DescribeStoreImageTasksOutput,
48            crate::operation::describe_store_image_tasks::DescribeStoreImageTasksError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl DescribeStoreImageTasksFluentBuilder {
55    /// Creates a new `DescribeStoreImageTasksFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the DescribeStoreImageTasks as a reference.
64    pub fn as_input(&self) -> &crate::operation::describe_store_image_tasks::builders::DescribeStoreImageTasksInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::describe_store_image_tasks::DescribeStoreImageTasksOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::describe_store_image_tasks::DescribeStoreImageTasksError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::describe_store_image_tasks::DescribeStoreImageTasks::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::describe_store_image_tasks::DescribeStoreImageTasks::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::describe_store_image_tasks::DescribeStoreImageTasksOutput,
101        crate::operation::describe_store_image_tasks::DescribeStoreImageTasksError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// Create a paginator for this request
116    ///
117    /// Paginators are used by calling [`send().await`](crate::operation::describe_store_image_tasks::paginator::DescribeStoreImageTasksPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
118    pub fn into_paginator(self) -> crate::operation::describe_store_image_tasks::paginator::DescribeStoreImageTasksPaginator {
119        crate::operation::describe_store_image_tasks::paginator::DescribeStoreImageTasksPaginator::new(self.handle, self.inner)
120    }
121    ///
122    /// Appends an item to `ImageIds`.
123    ///
124    /// To override the contents of this collection use [`set_image_ids`](Self::set_image_ids).
125    ///
126    /// <p>The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a request.</p>
127    pub fn image_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.image_ids(input.into());
129        self
130    }
131    /// <p>The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a request.</p>
132    pub fn set_image_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
133        self.inner = self.inner.set_image_ids(input);
134        self
135    }
136    /// <p>The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a request.</p>
137    pub fn get_image_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
138        self.inner.get_image_ids()
139    }
140    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
141    pub fn dry_run(mut self, input: bool) -> Self {
142        self.inner = self.inner.dry_run(input);
143        self
144    }
145    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
146    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
147        self.inner = self.inner.set_dry_run(input);
148        self
149    }
150    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
151    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
152        self.inner.get_dry_run()
153    }
154    ///
155    /// Appends an item to `Filters`.
156    ///
157    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
158    ///
159    /// <p>The filters.</p>
160    /// <ul>
161    /// <li>
162    /// <p><code>task-state</code> - Returns tasks in a certain state (<code>InProgress</code> | <code>Completed</code> | <code>Failed</code>)</p></li>
163    /// <li>
164    /// <p><code>bucket</code> - Returns task information for tasks that targeted a specific bucket. For the filter value, specify the bucket name.</p></li>
165    /// </ul><note>
166    /// <p>When you specify the <code>ImageIds</code> parameter, any filters that you specify are ignored. To use the filters, you must remove the <code>ImageIds</code> parameter.</p>
167    /// </note>
168    pub fn filters(mut self, input: crate::types::Filter) -> Self {
169        self.inner = self.inner.filters(input);
170        self
171    }
172    /// <p>The filters.</p>
173    /// <ul>
174    /// <li>
175    /// <p><code>task-state</code> - Returns tasks in a certain state (<code>InProgress</code> | <code>Completed</code> | <code>Failed</code>)</p></li>
176    /// <li>
177    /// <p><code>bucket</code> - Returns task information for tasks that targeted a specific bucket. For the filter value, specify the bucket name.</p></li>
178    /// </ul><note>
179    /// <p>When you specify the <code>ImageIds</code> parameter, any filters that you specify are ignored. To use the filters, you must remove the <code>ImageIds</code> parameter.</p>
180    /// </note>
181    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
182        self.inner = self.inner.set_filters(input);
183        self
184    }
185    /// <p>The filters.</p>
186    /// <ul>
187    /// <li>
188    /// <p><code>task-state</code> - Returns tasks in a certain state (<code>InProgress</code> | <code>Completed</code> | <code>Failed</code>)</p></li>
189    /// <li>
190    /// <p><code>bucket</code> - Returns task information for tasks that targeted a specific bucket. For the filter value, specify the bucket name.</p></li>
191    /// </ul><note>
192    /// <p>When you specify the <code>ImageIds</code> parameter, any filters that you specify are ignored. To use the filters, you must remove the <code>ImageIds</code> parameter.</p>
193    /// </note>
194    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
195        self.inner.get_filters()
196    }
197    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
198    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.next_token(input.into());
200        self
201    }
202    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
203    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_next_token(input);
205        self
206    }
207    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
208    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_next_token()
210    }
211    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
212    /// <p>You cannot specify this parameter and the <code>ImageIds</code> parameter in the same call.</p>
213    pub fn max_results(mut self, input: i32) -> Self {
214        self.inner = self.inner.max_results(input);
215        self
216    }
217    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
218    /// <p>You cannot specify this parameter and the <code>ImageIds</code> parameter in the same call.</p>
219    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
220        self.inner = self.inner.set_max_results(input);
221        self
222    }
223    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
224    /// <p>You cannot specify this parameter and the <code>ImageIds</code> parameter in the same call.</p>
225    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
226        self.inner.get_max_results()
227    }
228}