aws_sdk_resourcegroups/operation/list_groups/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_groups::_list_groups_input::ListGroupsInputBuilder;
3
4pub use crate::operation::list_groups::_list_groups_output::ListGroupsOutputBuilder;
5
6impl crate::operation::list_groups::builders::ListGroupsInputBuilder {
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_groups::ListGroupsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_groups::ListGroupsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_groups();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListGroups`.
24///
25/// <p>Returns a list of existing Resource Groups in your account.</p>
26/// <p><b>Minimum permissions</b></p>
27/// <p>To run this command, you must have the following permissions:</p>
28/// <ul>
29/// <li>
30/// <p><code>resource-groups:ListGroups</code></p></li>
31/// </ul>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct ListGroupsFluentBuilder {
34 handle: ::std::sync::Arc<crate::client::Handle>,
35 inner: crate::operation::list_groups::builders::ListGroupsInputBuilder,
36 config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39 crate::client::customize::internal::CustomizableSend<
40 crate::operation::list_groups::ListGroupsOutput,
41 crate::operation::list_groups::ListGroupsError,
42 > for ListGroupsFluentBuilder
43{
44 fn send(
45 self,
46 config_override: crate::config::Builder,
47 ) -> crate::client::customize::internal::BoxFuture<
48 crate::client::customize::internal::SendResult<
49 crate::operation::list_groups::ListGroupsOutput,
50 crate::operation::list_groups::ListGroupsError,
51 >,
52 > {
53 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54 }
55}
56impl ListGroupsFluentBuilder {
57 /// Creates a new `ListGroupsFluentBuilder`.
58 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59 Self {
60 handle,
61 inner: ::std::default::Default::default(),
62 config_override: ::std::option::Option::None,
63 }
64 }
65 /// Access the ListGroups as a reference.
66 pub fn as_input(&self) -> &crate::operation::list_groups::builders::ListGroupsInputBuilder {
67 &self.inner
68 }
69 /// Sends the request and returns the response.
70 ///
71 /// If an error occurs, an `SdkError` will be returned with additional details that
72 /// can be matched against.
73 ///
74 /// By default, any retryable failures will be retried twice. Retry behavior
75 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76 /// set when configuring the client.
77 pub async fn send(
78 self,
79 ) -> ::std::result::Result<
80 crate::operation::list_groups::ListGroupsOutput,
81 ::aws_smithy_runtime_api::client::result::SdkError<
82 crate::operation::list_groups::ListGroupsError,
83 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84 >,
85 > {
86 let input = self
87 .inner
88 .build()
89 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90 let runtime_plugins = crate::operation::list_groups::ListGroups::operation_runtime_plugins(
91 self.handle.runtime_plugins.clone(),
92 &self.handle.conf,
93 self.config_override,
94 );
95 crate::operation::list_groups::ListGroups::orchestrate(&runtime_plugins, input).await
96 }
97
98 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99 pub fn customize(
100 self,
101 ) -> crate::client::customize::CustomizableOperation<
102 crate::operation::list_groups::ListGroupsOutput,
103 crate::operation::list_groups::ListGroupsError,
104 Self,
105 > {
106 crate::client::customize::CustomizableOperation::new(self)
107 }
108 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109 self.set_config_override(::std::option::Option::Some(config_override.into()));
110 self
111 }
112
113 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114 self.config_override = config_override;
115 self
116 }
117 /// Create a paginator for this request
118 ///
119 /// Paginators are used by calling [`send().await`](crate::operation::list_groups::paginator::ListGroupsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
120 pub fn into_paginator(self) -> crate::operation::list_groups::paginator::ListGroupsPaginator {
121 crate::operation::list_groups::paginator::ListGroupsPaginator::new(self.handle, self.inner)
122 }
123 ///
124 /// Appends an item to `Filters`.
125 ///
126 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
127 ///
128 /// <p>Filters, formatted as <code>GroupFilter</code> objects, that you want to apply to a <code>ListGroups</code> operation.</p>
129 /// <ul>
130 /// <li>
131 /// <p><code>resource-type</code> - Filter the results to include only those resource groups that have the specified resource type in their <code>ResourceTypeFilter</code>. For example, <code>AWS::EC2::Instance</code> would return any resource group with a <code>ResourceTypeFilter</code> that includes <code>AWS::EC2::Instance</code>.</p></li>
132 /// <li>
133 /// <p><code>configuration-type</code> - Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:</p>
134 /// <ul>
135 /// <li>
136 /// <p><code>AWS::ResourceGroups::ApplicationGroup</code></p></li>
137 /// <li>
138 /// <p><code>AWS::AppRegistry::Application</code></p></li>
139 /// <li>
140 /// <p><code>AWS::AppRegistry::ApplicationResourceGroup</code></p></li>
141 /// <li>
142 /// <p><code>AWS::CloudFormation::Stack</code></p></li>
143 /// <li>
144 /// <p><code>AWS::EC2::CapacityReservationPool</code></p></li>
145 /// <li>
146 /// <p><code>AWS::EC2::HostManagement</code></p></li>
147 /// <li>
148 /// <p><code>AWS::NetworkFirewall::RuleGroup</code></p></li>
149 /// </ul></li>
150 /// </ul>
151 pub fn filters(mut self, input: crate::types::GroupFilter) -> Self {
152 self.inner = self.inner.filters(input);
153 self
154 }
155 /// <p>Filters, formatted as <code>GroupFilter</code> objects, that you want to apply to a <code>ListGroups</code> operation.</p>
156 /// <ul>
157 /// <li>
158 /// <p><code>resource-type</code> - Filter the results to include only those resource groups that have the specified resource type in their <code>ResourceTypeFilter</code>. For example, <code>AWS::EC2::Instance</code> would return any resource group with a <code>ResourceTypeFilter</code> that includes <code>AWS::EC2::Instance</code>.</p></li>
159 /// <li>
160 /// <p><code>configuration-type</code> - Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:</p>
161 /// <ul>
162 /// <li>
163 /// <p><code>AWS::ResourceGroups::ApplicationGroup</code></p></li>
164 /// <li>
165 /// <p><code>AWS::AppRegistry::Application</code></p></li>
166 /// <li>
167 /// <p><code>AWS::AppRegistry::ApplicationResourceGroup</code></p></li>
168 /// <li>
169 /// <p><code>AWS::CloudFormation::Stack</code></p></li>
170 /// <li>
171 /// <p><code>AWS::EC2::CapacityReservationPool</code></p></li>
172 /// <li>
173 /// <p><code>AWS::EC2::HostManagement</code></p></li>
174 /// <li>
175 /// <p><code>AWS::NetworkFirewall::RuleGroup</code></p></li>
176 /// </ul></li>
177 /// </ul>
178 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GroupFilter>>) -> Self {
179 self.inner = self.inner.set_filters(input);
180 self
181 }
182 /// <p>Filters, formatted as <code>GroupFilter</code> objects, that you want to apply to a <code>ListGroups</code> operation.</p>
183 /// <ul>
184 /// <li>
185 /// <p><code>resource-type</code> - Filter the results to include only those resource groups that have the specified resource type in their <code>ResourceTypeFilter</code>. For example, <code>AWS::EC2::Instance</code> would return any resource group with a <code>ResourceTypeFilter</code> that includes <code>AWS::EC2::Instance</code>.</p></li>
186 /// <li>
187 /// <p><code>configuration-type</code> - Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:</p>
188 /// <ul>
189 /// <li>
190 /// <p><code>AWS::ResourceGroups::ApplicationGroup</code></p></li>
191 /// <li>
192 /// <p><code>AWS::AppRegistry::Application</code></p></li>
193 /// <li>
194 /// <p><code>AWS::AppRegistry::ApplicationResourceGroup</code></p></li>
195 /// <li>
196 /// <p><code>AWS::CloudFormation::Stack</code></p></li>
197 /// <li>
198 /// <p><code>AWS::EC2::CapacityReservationPool</code></p></li>
199 /// <li>
200 /// <p><code>AWS::EC2::HostManagement</code></p></li>
201 /// <li>
202 /// <p><code>AWS::NetworkFirewall::RuleGroup</code></p></li>
203 /// </ul></li>
204 /// </ul>
205 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GroupFilter>> {
206 self.inner.get_filters()
207 }
208 /// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
209 pub fn max_results(mut self, input: i32) -> Self {
210 self.inner = self.inner.max_results(input);
211 self
212 }
213 /// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
214 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
215 self.inner = self.inner.set_max_results(input);
216 self
217 }
218 /// <p>The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the <code>NextToken</code> response element is present and has a value (is not null). Include that value as the <code>NextToken</code> request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check <code>NextToken</code> after every operation to ensure that you receive all of the results.</p>
219 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
220 self.inner.get_max_results()
221 }
222 /// <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
223 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224 self.inner = self.inner.next_token(input.into());
225 self
226 }
227 /// <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
228 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229 self.inner = self.inner.set_next_token(input);
230 self
231 }
232 /// <p>The parameter for receiving additional results if you receive a <code>NextToken</code> response in a previous request. A <code>NextToken</code> response indicates that more output is available. Set this parameter to the value provided by a previous call's <code>NextToken</code> response to indicate where the output should continue from.</p>
233 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
234 self.inner.get_next_token()
235 }
236}