aws_sdk_imagebuilder/operation/list_components/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_components::_list_components_output::ListComponentsOutputBuilder;
3
4pub use crate::operation::list_components::_list_components_input::ListComponentsInputBuilder;
5
6impl crate::operation::list_components::builders::ListComponentsInputBuilder {
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_components::ListComponentsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_components::ListComponentsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_components();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListComponents`.
24///
25/// <p>Returns the list of components that can be filtered by name, or by using the listed <code>filters</code> to streamline results. Newly created components can take up to two minutes to appear in the ListComponents API Results.</p><note>
26/// <p>The semantic version has four nodes: <major>
27/// .
28/// <minor>
29/// .
30/// <patch>
31/// /
32/// <build>
33/// . You can assign values for the first three, and can filter on all of them.
34/// </build>
35/// </patch>
36/// </minor>
37/// </major></p>
38/// <p><b>Filtering:</b> With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.</p>
39/// </note>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct ListComponentsFluentBuilder {
42 handle: ::std::sync::Arc<crate::client::Handle>,
43 inner: crate::operation::list_components::builders::ListComponentsInputBuilder,
44 config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47 crate::client::customize::internal::CustomizableSend<
48 crate::operation::list_components::ListComponentsOutput,
49 crate::operation::list_components::ListComponentsError,
50 > for ListComponentsFluentBuilder
51{
52 fn send(
53 self,
54 config_override: crate::config::Builder,
55 ) -> crate::client::customize::internal::BoxFuture<
56 crate::client::customize::internal::SendResult<
57 crate::operation::list_components::ListComponentsOutput,
58 crate::operation::list_components::ListComponentsError,
59 >,
60 > {
61 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62 }
63}
64impl ListComponentsFluentBuilder {
65 /// Creates a new `ListComponentsFluentBuilder`.
66 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67 Self {
68 handle,
69 inner: ::std::default::Default::default(),
70 config_override: ::std::option::Option::None,
71 }
72 }
73 /// Access the ListComponents as a reference.
74 pub fn as_input(&self) -> &crate::operation::list_components::builders::ListComponentsInputBuilder {
75 &self.inner
76 }
77 /// Sends the request and returns the response.
78 ///
79 /// If an error occurs, an `SdkError` will be returned with additional details that
80 /// can be matched against.
81 ///
82 /// By default, any retryable failures will be retried twice. Retry behavior
83 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84 /// set when configuring the client.
85 pub async fn send(
86 self,
87 ) -> ::std::result::Result<
88 crate::operation::list_components::ListComponentsOutput,
89 ::aws_smithy_runtime_api::client::result::SdkError<
90 crate::operation::list_components::ListComponentsError,
91 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92 >,
93 > {
94 let input = self
95 .inner
96 .build()
97 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98 let runtime_plugins = crate::operation::list_components::ListComponents::operation_runtime_plugins(
99 self.handle.runtime_plugins.clone(),
100 &self.handle.conf,
101 self.config_override,
102 );
103 crate::operation::list_components::ListComponents::orchestrate(&runtime_plugins, input).await
104 }
105
106 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107 pub fn customize(
108 self,
109 ) -> crate::client::customize::CustomizableOperation<
110 crate::operation::list_components::ListComponentsOutput,
111 crate::operation::list_components::ListComponentsError,
112 Self,
113 > {
114 crate::client::customize::CustomizableOperation::new(self)
115 }
116 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117 self.set_config_override(::std::option::Option::Some(config_override.into()));
118 self
119 }
120
121 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122 self.config_override = config_override;
123 self
124 }
125 /// Create a paginator for this request
126 ///
127 /// Paginators are used by calling [`send().await`](crate::operation::list_components::paginator::ListComponentsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
128 pub fn into_paginator(self) -> crate::operation::list_components::paginator::ListComponentsPaginator {
129 crate::operation::list_components::paginator::ListComponentsPaginator::new(self.handle, self.inner)
130 }
131 /// <p>Filters results based on the type of owner for the component. By default, this request returns a list of components that your account owns. To see results for other types of owners, you can specify components that Amazon manages, third party components, or components that other accounts have shared with you.</p>
132 pub fn owner(mut self, input: crate::types::Ownership) -> Self {
133 self.inner = self.inner.owner(input);
134 self
135 }
136 /// <p>Filters results based on the type of owner for the component. By default, this request returns a list of components that your account owns. To see results for other types of owners, you can specify components that Amazon manages, third party components, or components that other accounts have shared with you.</p>
137 pub fn set_owner(mut self, input: ::std::option::Option<crate::types::Ownership>) -> Self {
138 self.inner = self.inner.set_owner(input);
139 self
140 }
141 /// <p>Filters results based on the type of owner for the component. By default, this request returns a list of components that your account owns. To see results for other types of owners, you can specify components that Amazon manages, third party components, or components that other accounts have shared with you.</p>
142 pub fn get_owner(&self) -> &::std::option::Option<crate::types::Ownership> {
143 self.inner.get_owner()
144 }
145 ///
146 /// Appends an item to `filters`.
147 ///
148 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
149 ///
150 /// <p>Use the following filters to streamline results:</p>
151 /// <ul>
152 /// <li>
153 /// <p><code>description</code></p></li>
154 /// <li>
155 /// <p><code>name</code></p></li>
156 /// <li>
157 /// <p><code>platform</code></p></li>
158 /// <li>
159 /// <p><code>supportedOsVersion</code></p></li>
160 /// <li>
161 /// <p><code>type</code></p></li>
162 /// <li>
163 /// <p><code>version</code></p></li>
164 /// </ul>
165 pub fn filters(mut self, input: crate::types::Filter) -> Self {
166 self.inner = self.inner.filters(input);
167 self
168 }
169 /// <p>Use the following filters to streamline results:</p>
170 /// <ul>
171 /// <li>
172 /// <p><code>description</code></p></li>
173 /// <li>
174 /// <p><code>name</code></p></li>
175 /// <li>
176 /// <p><code>platform</code></p></li>
177 /// <li>
178 /// <p><code>supportedOsVersion</code></p></li>
179 /// <li>
180 /// <p><code>type</code></p></li>
181 /// <li>
182 /// <p><code>version</code></p></li>
183 /// </ul>
184 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
185 self.inner = self.inner.set_filters(input);
186 self
187 }
188 /// <p>Use the following filters to streamline results:</p>
189 /// <ul>
190 /// <li>
191 /// <p><code>description</code></p></li>
192 /// <li>
193 /// <p><code>name</code></p></li>
194 /// <li>
195 /// <p><code>platform</code></p></li>
196 /// <li>
197 /// <p><code>supportedOsVersion</code></p></li>
198 /// <li>
199 /// <p><code>type</code></p></li>
200 /// <li>
201 /// <p><code>version</code></p></li>
202 /// </ul>
203 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
204 self.inner.get_filters()
205 }
206 /// <p>Returns the list of components for the specified name.</p>
207 pub fn by_name(mut self, input: bool) -> Self {
208 self.inner = self.inner.by_name(input);
209 self
210 }
211 /// <p>Returns the list of components for the specified name.</p>
212 pub fn set_by_name(mut self, input: ::std::option::Option<bool>) -> Self {
213 self.inner = self.inner.set_by_name(input);
214 self
215 }
216 /// <p>Returns the list of components for the specified name.</p>
217 pub fn get_by_name(&self) -> &::std::option::Option<bool> {
218 self.inner.get_by_name()
219 }
220 /// <p>The maximum items to return in a request.</p>
221 pub fn max_results(mut self, input: i32) -> Self {
222 self.inner = self.inner.max_results(input);
223 self
224 }
225 /// <p>The maximum items to return in a request.</p>
226 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
227 self.inner = self.inner.set_max_results(input);
228 self
229 }
230 /// <p>The maximum items to return in a request.</p>
231 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
232 self.inner.get_max_results()
233 }
234 /// <p>A token to specify where to start paginating. This is the nextToken from a previously truncated response.</p>
235 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236 self.inner = self.inner.next_token(input.into());
237 self
238 }
239 /// <p>A token to specify where to start paginating. This is the nextToken from a previously truncated response.</p>
240 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241 self.inner = self.inner.set_next_token(input);
242 self
243 }
244 /// <p>A token to specify where to start paginating. This is the nextToken from a previously truncated response.</p>
245 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
246 self.inner.get_next_token()
247 }
248}