aws_sdk_ec2/operation/describe_bundle_tasks/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_bundle_tasks::_describe_bundle_tasks_output::DescribeBundleTasksOutputBuilder;
3
4pub use crate::operation::describe_bundle_tasks::_describe_bundle_tasks_input::DescribeBundleTasksInputBuilder;
5
6impl crate::operation::describe_bundle_tasks::builders::DescribeBundleTasksInputBuilder {
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_bundle_tasks::DescribeBundleTasksOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_bundle_tasks::DescribeBundleTasksError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_bundle_tasks();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeBundleTasks`.
24///
25/// <p>Describes the specified bundle tasks or all of your bundle tasks.</p><note>
26/// <p>Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the list, you can still register an AMI from it. Just use <code>RegisterImage</code> with the Amazon S3 bucket name and image manifest name you provided to the bundle task.</p>
27/// </note> <note>
28/// <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p>
29/// </note>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct DescribeBundleTasksFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::describe_bundle_tasks::builders::DescribeBundleTasksInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::describe_bundle_tasks::DescribeBundleTasksOutput,
39        crate::operation::describe_bundle_tasks::DescribeBundleTasksError,
40    > for DescribeBundleTasksFluentBuilder
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_bundle_tasks::DescribeBundleTasksOutput,
48            crate::operation::describe_bundle_tasks::DescribeBundleTasksError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl DescribeBundleTasksFluentBuilder {
55    /// Creates a new `DescribeBundleTasksFluentBuilder`.
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 DescribeBundleTasks as a reference.
64    pub fn as_input(&self) -> &crate::operation::describe_bundle_tasks::builders::DescribeBundleTasksInputBuilder {
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_bundle_tasks::DescribeBundleTasksOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::describe_bundle_tasks::DescribeBundleTasksError,
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_bundle_tasks::DescribeBundleTasks::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::describe_bundle_tasks::DescribeBundleTasks::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_bundle_tasks::DescribeBundleTasksOutput,
101        crate::operation::describe_bundle_tasks::DescribeBundleTasksError,
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    ///
116    /// Appends an item to `BundleIds`.
117    ///
118    /// To override the contents of this collection use [`set_bundle_ids`](Self::set_bundle_ids).
119    ///
120    /// <p>The bundle task IDs.</p>
121    /// <p>Default: Describes all your bundle tasks.</p>
122    pub fn bundle_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.bundle_ids(input.into());
124        self
125    }
126    /// <p>The bundle task IDs.</p>
127    /// <p>Default: Describes all your bundle tasks.</p>
128    pub fn set_bundle_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
129        self.inner = self.inner.set_bundle_ids(input);
130        self
131    }
132    /// <p>The bundle task IDs.</p>
133    /// <p>Default: Describes all your bundle tasks.</p>
134    pub fn get_bundle_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
135        self.inner.get_bundle_ids()
136    }
137    /// <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>
138    pub fn dry_run(mut self, input: bool) -> Self {
139        self.inner = self.inner.dry_run(input);
140        self
141    }
142    /// <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>
143    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
144        self.inner = self.inner.set_dry_run(input);
145        self
146    }
147    /// <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>
148    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
149        self.inner.get_dry_run()
150    }
151    ///
152    /// Appends an item to `Filters`.
153    ///
154    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
155    ///
156    /// <p>The filters.</p>
157    /// <ul>
158    /// <li>
159    /// <p><code>bundle-id</code> - The ID of the bundle task.</p></li>
160    /// <li>
161    /// <p><code>error-code</code> - If the task failed, the error code returned.</p></li>
162    /// <li>
163    /// <p><code>error-message</code> - If the task failed, the error message returned.</p></li>
164    /// <li>
165    /// <p><code>instance-id</code> - The ID of the instance.</p></li>
166    /// <li>
167    /// <p><code>progress</code> - The level of task completion, as a percentage (for example, 20%).</p></li>
168    /// <li>
169    /// <p><code>s3-bucket</code> - The Amazon S3 bucket to store the AMI.</p></li>
170    /// <li>
171    /// <p><code>s3-prefix</code> - The beginning of the AMI name.</p></li>
172    /// <li>
173    /// <p><code>start-time</code> - The time the task started (for example, 2013-09-15T17:15:20.000Z).</p></li>
174    /// <li>
175    /// <p><code>state</code> - The state of the task (<code>pending</code> | <code>waiting-for-shutdown</code> | <code>bundling</code> | <code>storing</code> | <code>cancelling</code> | <code>complete</code> | <code>failed</code>).</p></li>
176    /// <li>
177    /// <p><code>update-time</code> - The time of the most recent update for the task.</p></li>
178    /// </ul>
179    pub fn filters(mut self, input: crate::types::Filter) -> Self {
180        self.inner = self.inner.filters(input);
181        self
182    }
183    /// <p>The filters.</p>
184    /// <ul>
185    /// <li>
186    /// <p><code>bundle-id</code> - The ID of the bundle task.</p></li>
187    /// <li>
188    /// <p><code>error-code</code> - If the task failed, the error code returned.</p></li>
189    /// <li>
190    /// <p><code>error-message</code> - If the task failed, the error message returned.</p></li>
191    /// <li>
192    /// <p><code>instance-id</code> - The ID of the instance.</p></li>
193    /// <li>
194    /// <p><code>progress</code> - The level of task completion, as a percentage (for example, 20%).</p></li>
195    /// <li>
196    /// <p><code>s3-bucket</code> - The Amazon S3 bucket to store the AMI.</p></li>
197    /// <li>
198    /// <p><code>s3-prefix</code> - The beginning of the AMI name.</p></li>
199    /// <li>
200    /// <p><code>start-time</code> - The time the task started (for example, 2013-09-15T17:15:20.000Z).</p></li>
201    /// <li>
202    /// <p><code>state</code> - The state of the task (<code>pending</code> | <code>waiting-for-shutdown</code> | <code>bundling</code> | <code>storing</code> | <code>cancelling</code> | <code>complete</code> | <code>failed</code>).</p></li>
203    /// <li>
204    /// <p><code>update-time</code> - The time of the most recent update for the task.</p></li>
205    /// </ul>
206    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
207        self.inner = self.inner.set_filters(input);
208        self
209    }
210    /// <p>The filters.</p>
211    /// <ul>
212    /// <li>
213    /// <p><code>bundle-id</code> - The ID of the bundle task.</p></li>
214    /// <li>
215    /// <p><code>error-code</code> - If the task failed, the error code returned.</p></li>
216    /// <li>
217    /// <p><code>error-message</code> - If the task failed, the error message returned.</p></li>
218    /// <li>
219    /// <p><code>instance-id</code> - The ID of the instance.</p></li>
220    /// <li>
221    /// <p><code>progress</code> - The level of task completion, as a percentage (for example, 20%).</p></li>
222    /// <li>
223    /// <p><code>s3-bucket</code> - The Amazon S3 bucket to store the AMI.</p></li>
224    /// <li>
225    /// <p><code>s3-prefix</code> - The beginning of the AMI name.</p></li>
226    /// <li>
227    /// <p><code>start-time</code> - The time the task started (for example, 2013-09-15T17:15:20.000Z).</p></li>
228    /// <li>
229    /// <p><code>state</code> - The state of the task (<code>pending</code> | <code>waiting-for-shutdown</code> | <code>bundling</code> | <code>storing</code> | <code>cancelling</code> | <code>complete</code> | <code>failed</code>).</p></li>
230    /// <li>
231    /// <p><code>update-time</code> - The time of the most recent update for the task.</p></li>
232    /// </ul>
233    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
234        self.inner.get_filters()
235    }
236}