aws_sdk_ec2/operation/describe_security_groups/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_security_groups::_describe_security_groups_output::DescribeSecurityGroupsOutputBuilder;
3
4pub use crate::operation::describe_security_groups::_describe_security_groups_input::DescribeSecurityGroupsInputBuilder;
5
6impl crate::operation::describe_security_groups::builders::DescribeSecurityGroupsInputBuilder {
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_security_groups::DescribeSecurityGroupsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_security_groups::DescribeSecurityGroupsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_security_groups();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeSecurityGroups`.
24///
25/// <p>Describes the specified security groups or all of your security groups.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DescribeSecurityGroupsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::describe_security_groups::builders::DescribeSecurityGroupsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::describe_security_groups::DescribeSecurityGroupsOutput,
35        crate::operation::describe_security_groups::DescribeSecurityGroupsError,
36    > for DescribeSecurityGroupsFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::describe_security_groups::DescribeSecurityGroupsOutput,
44            crate::operation::describe_security_groups::DescribeSecurityGroupsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl DescribeSecurityGroupsFluentBuilder {
51    /// Creates a new `DescribeSecurityGroupsFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the DescribeSecurityGroups as a reference.
60    pub fn as_input(&self) -> &crate::operation::describe_security_groups::builders::DescribeSecurityGroupsInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::describe_security_groups::DescribeSecurityGroupsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::describe_security_groups::DescribeSecurityGroupsError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::describe_security_groups::DescribeSecurityGroups::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::describe_security_groups::DescribeSecurityGroups::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::describe_security_groups::DescribeSecurityGroupsOutput,
97        crate::operation::describe_security_groups::DescribeSecurityGroupsError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::describe_security_groups::paginator::DescribeSecurityGroupsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::describe_security_groups::paginator::DescribeSecurityGroupsPaginator {
115        crate::operation::describe_security_groups::paginator::DescribeSecurityGroupsPaginator::new(self.handle, self.inner)
116    }
117    ///
118    /// Appends an item to `GroupIds`.
119    ///
120    /// To override the contents of this collection use [`set_group_ids`](Self::set_group_ids).
121    ///
122    /// <p>The IDs of the security groups. Required for security groups in a nondefault VPC.</p>
123    /// <p>Default: Describes all of your security groups.</p>
124    pub fn group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.group_ids(input.into());
126        self
127    }
128    /// <p>The IDs of the security groups. Required for security groups in a nondefault VPC.</p>
129    /// <p>Default: Describes all of your security groups.</p>
130    pub fn set_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
131        self.inner = self.inner.set_group_ids(input);
132        self
133    }
134    /// <p>The IDs of the security groups. Required for security groups in a nondefault VPC.</p>
135    /// <p>Default: Describes all of your security groups.</p>
136    pub fn get_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
137        self.inner.get_group_ids()
138    }
139    ///
140    /// Appends an item to `GroupNames`.
141    ///
142    /// To override the contents of this collection use [`set_group_names`](Self::set_group_names).
143    ///
144    /// <p>\[Default VPC\] The names of the security groups. You can specify either the security group name or the security group ID.</p>
145    /// <p>Default: Describes all of your security groups.</p>
146    pub fn group_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.group_names(input.into());
148        self
149    }
150    /// <p>\[Default VPC\] The names of the security groups. You can specify either the security group name or the security group ID.</p>
151    /// <p>Default: Describes all of your security groups.</p>
152    pub fn set_group_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
153        self.inner = self.inner.set_group_names(input);
154        self
155    }
156    /// <p>\[Default VPC\] The names of the security groups. You can specify either the security group name or the security group ID.</p>
157    /// <p>Default: Describes all of your security groups.</p>
158    pub fn get_group_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
159        self.inner.get_group_names()
160    }
161    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
162    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.next_token(input.into());
164        self
165    }
166    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
167    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_next_token(input);
169        self
170    }
171    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
172    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_next_token()
174    }
175    /// <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. This value can be between 5 and 1000. If this parameter is not specified, then all items are returned. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
176    pub fn max_results(mut self, input: i32) -> Self {
177        self.inner = self.inner.max_results(input);
178        self
179    }
180    /// <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. This value can be between 5 and 1000. If this parameter is not specified, then all items are returned. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
181    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
182        self.inner = self.inner.set_max_results(input);
183        self
184    }
185    /// <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. This value can be between 5 and 1000. If this parameter is not specified, then all items are returned. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
186    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
187        self.inner.get_max_results()
188    }
189    /// <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>
190    pub fn dry_run(mut self, input: bool) -> Self {
191        self.inner = self.inner.dry_run(input);
192        self
193    }
194    /// <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>
195    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
196        self.inner = self.inner.set_dry_run(input);
197        self
198    }
199    /// <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>
200    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
201        self.inner.get_dry_run()
202    }
203    ///
204    /// Appends an item to `Filters`.
205    ///
206    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
207    ///
208    /// <p>The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.</p>
209    /// <ul>
210    /// <li>
211    /// <p><code>description</code> - The description of the security group.</p></li>
212    /// <li>
213    /// <p><code>egress.ip-permission.cidr</code> - An IPv4 CIDR block for an outbound security group rule.</p></li>
214    /// <li>
215    /// <p><code>egress.ip-permission.from-port</code> - For an outbound rule, the start of port range for the TCP and UDP protocols, or an ICMP type number.</p></li>
216    /// <li>
217    /// <p><code>egress.ip-permission.group-id</code> - The ID of a security group that has been referenced in an outbound security group rule.</p></li>
218    /// <li>
219    /// <p><code>egress.ip-permission.group-name</code> - The name of a security group that is referenced in an outbound security group rule.</p></li>
220    /// <li>
221    /// <p><code>egress.ip-permission.ipv6-cidr</code> - An IPv6 CIDR block for an outbound security group rule.</p></li>
222    /// <li>
223    /// <p><code>egress.ip-permission.prefix-list-id</code> - The ID of a prefix list to which a security group rule allows outbound access.</p></li>
224    /// <li>
225    /// <p><code>egress.ip-permission.protocol</code> - The IP protocol for an outbound security group rule (<code>tcp</code> | <code>udp</code> | <code>icmp</code>, a protocol number, or -1 for all protocols).</p></li>
226    /// <li>
227    /// <p><code>egress.ip-permission.to-port</code> - For an outbound rule, the end of port range for the TCP and UDP protocols, or an ICMP code.</p></li>
228    /// <li>
229    /// <p><code>egress.ip-permission.user-id</code> - The ID of an Amazon Web Services account that has been referenced in an outbound security group rule.</p></li>
230    /// <li>
231    /// <p><code>group-id</code> - The ID of the security group.</p></li>
232    /// <li>
233    /// <p><code>group-name</code> - The name of the security group.</p></li>
234    /// <li>
235    /// <p><code>ip-permission.cidr</code> - An IPv4 CIDR block for an inbound security group rule.</p></li>
236    /// <li>
237    /// <p><code>ip-permission.from-port</code> - For an inbound rule, the start of port range for the TCP and UDP protocols, or an ICMP type number.</p></li>
238    /// <li>
239    /// <p><code>ip-permission.group-id</code> - The ID of a security group that has been referenced in an inbound security group rule.</p></li>
240    /// <li>
241    /// <p><code>ip-permission.group-name</code> - The name of a security group that is referenced in an inbound security group rule.</p></li>
242    /// <li>
243    /// <p><code>ip-permission.ipv6-cidr</code> - An IPv6 CIDR block for an inbound security group rule.</p></li>
244    /// <li>
245    /// <p><code>ip-permission.prefix-list-id</code> - The ID of a prefix list from which a security group rule allows inbound access.</p></li>
246    /// <li>
247    /// <p><code>ip-permission.protocol</code> - The IP protocol for an inbound security group rule (<code>tcp</code> | <code>udp</code> | <code>icmp</code>, a protocol number, or -1 for all protocols).</p></li>
248    /// <li>
249    /// <p><code>ip-permission.to-port</code> - For an inbound rule, the end of port range for the TCP and UDP protocols, or an ICMP code.</p></li>
250    /// <li>
251    /// <p><code>ip-permission.user-id</code> - The ID of an Amazon Web Services account that has been referenced in an inbound security group rule.</p></li>
252    /// <li>
253    /// <p><code>owner-id</code> - The Amazon Web Services account ID of the owner of the security group.</p></li>
254    /// <li>
255    /// <p><code>tag</code>:<key>
256    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
257    /// <code>Owner</code> and the value
258    /// <code>TeamA</code>, specify
259    /// <code>tag:Owner</code> for the filter name and
260    /// <code>TeamA</code> for the filter value.
261    /// </key></p></li>
262    /// <li>
263    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
264    /// <li>
265    /// <p><code>vpc-id</code> - The ID of the VPC specified when the security group was created.</p></li>
266    /// </ul>
267    pub fn filters(mut self, input: crate::types::Filter) -> Self {
268        self.inner = self.inner.filters(input);
269        self
270    }
271    /// <p>The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.</p>
272    /// <ul>
273    /// <li>
274    /// <p><code>description</code> - The description of the security group.</p></li>
275    /// <li>
276    /// <p><code>egress.ip-permission.cidr</code> - An IPv4 CIDR block for an outbound security group rule.</p></li>
277    /// <li>
278    /// <p><code>egress.ip-permission.from-port</code> - For an outbound rule, the start of port range for the TCP and UDP protocols, or an ICMP type number.</p></li>
279    /// <li>
280    /// <p><code>egress.ip-permission.group-id</code> - The ID of a security group that has been referenced in an outbound security group rule.</p></li>
281    /// <li>
282    /// <p><code>egress.ip-permission.group-name</code> - The name of a security group that is referenced in an outbound security group rule.</p></li>
283    /// <li>
284    /// <p><code>egress.ip-permission.ipv6-cidr</code> - An IPv6 CIDR block for an outbound security group rule.</p></li>
285    /// <li>
286    /// <p><code>egress.ip-permission.prefix-list-id</code> - The ID of a prefix list to which a security group rule allows outbound access.</p></li>
287    /// <li>
288    /// <p><code>egress.ip-permission.protocol</code> - The IP protocol for an outbound security group rule (<code>tcp</code> | <code>udp</code> | <code>icmp</code>, a protocol number, or -1 for all protocols).</p></li>
289    /// <li>
290    /// <p><code>egress.ip-permission.to-port</code> - For an outbound rule, the end of port range for the TCP and UDP protocols, or an ICMP code.</p></li>
291    /// <li>
292    /// <p><code>egress.ip-permission.user-id</code> - The ID of an Amazon Web Services account that has been referenced in an outbound security group rule.</p></li>
293    /// <li>
294    /// <p><code>group-id</code> - The ID of the security group.</p></li>
295    /// <li>
296    /// <p><code>group-name</code> - The name of the security group.</p></li>
297    /// <li>
298    /// <p><code>ip-permission.cidr</code> - An IPv4 CIDR block for an inbound security group rule.</p></li>
299    /// <li>
300    /// <p><code>ip-permission.from-port</code> - For an inbound rule, the start of port range for the TCP and UDP protocols, or an ICMP type number.</p></li>
301    /// <li>
302    /// <p><code>ip-permission.group-id</code> - The ID of a security group that has been referenced in an inbound security group rule.</p></li>
303    /// <li>
304    /// <p><code>ip-permission.group-name</code> - The name of a security group that is referenced in an inbound security group rule.</p></li>
305    /// <li>
306    /// <p><code>ip-permission.ipv6-cidr</code> - An IPv6 CIDR block for an inbound security group rule.</p></li>
307    /// <li>
308    /// <p><code>ip-permission.prefix-list-id</code> - The ID of a prefix list from which a security group rule allows inbound access.</p></li>
309    /// <li>
310    /// <p><code>ip-permission.protocol</code> - The IP protocol for an inbound security group rule (<code>tcp</code> | <code>udp</code> | <code>icmp</code>, a protocol number, or -1 for all protocols).</p></li>
311    /// <li>
312    /// <p><code>ip-permission.to-port</code> - For an inbound rule, the end of port range for the TCP and UDP protocols, or an ICMP code.</p></li>
313    /// <li>
314    /// <p><code>ip-permission.user-id</code> - The ID of an Amazon Web Services account that has been referenced in an inbound security group rule.</p></li>
315    /// <li>
316    /// <p><code>owner-id</code> - The Amazon Web Services account ID of the owner of the security group.</p></li>
317    /// <li>
318    /// <p><code>tag</code>:<key>
319    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
320    /// <code>Owner</code> and the value
321    /// <code>TeamA</code>, specify
322    /// <code>tag:Owner</code> for the filter name and
323    /// <code>TeamA</code> for the filter value.
324    /// </key></p></li>
325    /// <li>
326    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
327    /// <li>
328    /// <p><code>vpc-id</code> - The ID of the VPC specified when the security group was created.</p></li>
329    /// </ul>
330    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
331        self.inner = self.inner.set_filters(input);
332        self
333    }
334    /// <p>The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.</p>
335    /// <ul>
336    /// <li>
337    /// <p><code>description</code> - The description of the security group.</p></li>
338    /// <li>
339    /// <p><code>egress.ip-permission.cidr</code> - An IPv4 CIDR block for an outbound security group rule.</p></li>
340    /// <li>
341    /// <p><code>egress.ip-permission.from-port</code> - For an outbound rule, the start of port range for the TCP and UDP protocols, or an ICMP type number.</p></li>
342    /// <li>
343    /// <p><code>egress.ip-permission.group-id</code> - The ID of a security group that has been referenced in an outbound security group rule.</p></li>
344    /// <li>
345    /// <p><code>egress.ip-permission.group-name</code> - The name of a security group that is referenced in an outbound security group rule.</p></li>
346    /// <li>
347    /// <p><code>egress.ip-permission.ipv6-cidr</code> - An IPv6 CIDR block for an outbound security group rule.</p></li>
348    /// <li>
349    /// <p><code>egress.ip-permission.prefix-list-id</code> - The ID of a prefix list to which a security group rule allows outbound access.</p></li>
350    /// <li>
351    /// <p><code>egress.ip-permission.protocol</code> - The IP protocol for an outbound security group rule (<code>tcp</code> | <code>udp</code> | <code>icmp</code>, a protocol number, or -1 for all protocols).</p></li>
352    /// <li>
353    /// <p><code>egress.ip-permission.to-port</code> - For an outbound rule, the end of port range for the TCP and UDP protocols, or an ICMP code.</p></li>
354    /// <li>
355    /// <p><code>egress.ip-permission.user-id</code> - The ID of an Amazon Web Services account that has been referenced in an outbound security group rule.</p></li>
356    /// <li>
357    /// <p><code>group-id</code> - The ID of the security group.</p></li>
358    /// <li>
359    /// <p><code>group-name</code> - The name of the security group.</p></li>
360    /// <li>
361    /// <p><code>ip-permission.cidr</code> - An IPv4 CIDR block for an inbound security group rule.</p></li>
362    /// <li>
363    /// <p><code>ip-permission.from-port</code> - For an inbound rule, the start of port range for the TCP and UDP protocols, or an ICMP type number.</p></li>
364    /// <li>
365    /// <p><code>ip-permission.group-id</code> - The ID of a security group that has been referenced in an inbound security group rule.</p></li>
366    /// <li>
367    /// <p><code>ip-permission.group-name</code> - The name of a security group that is referenced in an inbound security group rule.</p></li>
368    /// <li>
369    /// <p><code>ip-permission.ipv6-cidr</code> - An IPv6 CIDR block for an inbound security group rule.</p></li>
370    /// <li>
371    /// <p><code>ip-permission.prefix-list-id</code> - The ID of a prefix list from which a security group rule allows inbound access.</p></li>
372    /// <li>
373    /// <p><code>ip-permission.protocol</code> - The IP protocol for an inbound security group rule (<code>tcp</code> | <code>udp</code> | <code>icmp</code>, a protocol number, or -1 for all protocols).</p></li>
374    /// <li>
375    /// <p><code>ip-permission.to-port</code> - For an inbound rule, the end of port range for the TCP and UDP protocols, or an ICMP code.</p></li>
376    /// <li>
377    /// <p><code>ip-permission.user-id</code> - The ID of an Amazon Web Services account that has been referenced in an inbound security group rule.</p></li>
378    /// <li>
379    /// <p><code>owner-id</code> - The Amazon Web Services account ID of the owner of the security group.</p></li>
380    /// <li>
381    /// <p><code>tag</code>:<key>
382    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
383    /// <code>Owner</code> and the value
384    /// <code>TeamA</code>, specify
385    /// <code>tag:Owner</code> for the filter name and
386    /// <code>TeamA</code> for the filter value.
387    /// </key></p></li>
388    /// <li>
389    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
390    /// <li>
391    /// <p><code>vpc-id</code> - The ID of the VPC specified when the security group was created.</p></li>
392    /// </ul>
393    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
394        self.inner.get_filters()
395    }
396}