aws_sdk_ec2/operation/revoke_security_group_egress/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::revoke_security_group_egress::_revoke_security_group_egress_output::RevokeSecurityGroupEgressOutputBuilder;
3
4pub use crate::operation::revoke_security_group_egress::_revoke_security_group_egress_input::RevokeSecurityGroupEgressInputBuilder;
5
6impl crate::operation::revoke_security_group_egress::builders::RevokeSecurityGroupEgressInputBuilder {
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::revoke_security_group_egress::RevokeSecurityGroupEgressOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::revoke_security_group_egress::RevokeSecurityGroupEgressError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.revoke_security_group_egress();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RevokeSecurityGroupEgress`.
24///
25/// <p>Removes the specified outbound (egress) rules from the specified security group.</p>
26/// <p>You can specify rules using either rule IDs or security group rule properties. If you use rule properties, the values that you specify (for example, ports) must match the existing rule's values exactly. Each rule has a protocol, from and to ports, and destination (CIDR range, security group, or prefix list). For the TCP and UDP protocols, you must also specify the destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type and code. If the security group rule has a description, you do not need to specify the description to revoke the rule.</p>
27/// <p>For a default VPC, if the values you specify do not match the existing rule's values, no error is returned, and the output describes the security group rules that were not revoked.</p>
28/// <p>Amazon Web Services recommends that you describe the security group to verify that the rules were removed.</p>
29/// <p>Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct RevokeSecurityGroupEgressFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::revoke_security_group_egress::builders::RevokeSecurityGroupEgressInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::revoke_security_group_egress::RevokeSecurityGroupEgressOutput,
39        crate::operation::revoke_security_group_egress::RevokeSecurityGroupEgressError,
40    > for RevokeSecurityGroupEgressFluentBuilder
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::revoke_security_group_egress::RevokeSecurityGroupEgressOutput,
48            crate::operation::revoke_security_group_egress::RevokeSecurityGroupEgressError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl RevokeSecurityGroupEgressFluentBuilder {
55    /// Creates a new `RevokeSecurityGroupEgressFluentBuilder`.
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 RevokeSecurityGroupEgress as a reference.
64    pub fn as_input(&self) -> &crate::operation::revoke_security_group_egress::builders::RevokeSecurityGroupEgressInputBuilder {
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::revoke_security_group_egress::RevokeSecurityGroupEgressOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::revoke_security_group_egress::RevokeSecurityGroupEgressError,
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::revoke_security_group_egress::RevokeSecurityGroupEgress::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::revoke_security_group_egress::RevokeSecurityGroupEgress::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::revoke_security_group_egress::RevokeSecurityGroupEgressOutput,
101        crate::operation::revoke_security_group_egress::RevokeSecurityGroupEgressError,
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 `SecurityGroupRuleIds`.
117    ///
118    /// To override the contents of this collection use [`set_security_group_rule_ids`](Self::set_security_group_rule_ids).
119    ///
120    /// <p>The IDs of the security group rules.</p>
121    pub fn security_group_rule_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.security_group_rule_ids(input.into());
123        self
124    }
125    /// <p>The IDs of the security group rules.</p>
126    pub fn set_security_group_rule_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
127        self.inner = self.inner.set_security_group_rule_ids(input);
128        self
129    }
130    /// <p>The IDs of the security group rules.</p>
131    pub fn get_security_group_rule_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
132        self.inner.get_security_group_rule_ids()
133    }
134    /// <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>
135    pub fn dry_run(mut self, input: bool) -> Self {
136        self.inner = self.inner.dry_run(input);
137        self
138    }
139    /// <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>
140    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
141        self.inner = self.inner.set_dry_run(input);
142        self
143    }
144    /// <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>
145    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
146        self.inner.get_dry_run()
147    }
148    /// <p>The ID of the security group.</p>
149    pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.group_id(input.into());
151        self
152    }
153    /// <p>The ID of the security group.</p>
154    pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_group_id(input);
156        self
157    }
158    /// <p>The ID of the security group.</p>
159    pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_group_id()
161    }
162    /// <p>Not supported. Use a set of IP permissions to specify a destination security group.</p>
163    pub fn source_security_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.source_security_group_name(input.into());
165        self
166    }
167    /// <p>Not supported. Use a set of IP permissions to specify a destination security group.</p>
168    pub fn set_source_security_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.inner = self.inner.set_source_security_group_name(input);
170        self
171    }
172    /// <p>Not supported. Use a set of IP permissions to specify a destination security group.</p>
173    pub fn get_source_security_group_name(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_source_security_group_name()
175    }
176    /// <p>Not supported. Use a set of IP permissions to specify a destination security group.</p>
177    pub fn source_security_group_owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.source_security_group_owner_id(input.into());
179        self
180    }
181    /// <p>Not supported. Use a set of IP permissions to specify a destination security group.</p>
182    pub fn set_source_security_group_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_source_security_group_owner_id(input);
184        self
185    }
186    /// <p>Not supported. Use a set of IP permissions to specify a destination security group.</p>
187    pub fn get_source_security_group_owner_id(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_source_security_group_owner_id()
189    }
190    /// <p>Not supported. Use a set of IP permissions to specify the protocol name or number.</p>
191    pub fn ip_protocol(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.inner = self.inner.ip_protocol(input.into());
193        self
194    }
195    /// <p>Not supported. Use a set of IP permissions to specify the protocol name or number.</p>
196    pub fn set_ip_protocol(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_ip_protocol(input);
198        self
199    }
200    /// <p>Not supported. Use a set of IP permissions to specify the protocol name or number.</p>
201    pub fn get_ip_protocol(&self) -> &::std::option::Option<::std::string::String> {
202        self.inner.get_ip_protocol()
203    }
204    /// <p>Not supported. Use a set of IP permissions to specify the port.</p>
205    pub fn from_port(mut self, input: i32) -> Self {
206        self.inner = self.inner.from_port(input);
207        self
208    }
209    /// <p>Not supported. Use a set of IP permissions to specify the port.</p>
210    pub fn set_from_port(mut self, input: ::std::option::Option<i32>) -> Self {
211        self.inner = self.inner.set_from_port(input);
212        self
213    }
214    /// <p>Not supported. Use a set of IP permissions to specify the port.</p>
215    pub fn get_from_port(&self) -> &::std::option::Option<i32> {
216        self.inner.get_from_port()
217    }
218    /// <p>Not supported. Use a set of IP permissions to specify the port.</p>
219    pub fn to_port(mut self, input: i32) -> Self {
220        self.inner = self.inner.to_port(input);
221        self
222    }
223    /// <p>Not supported. Use a set of IP permissions to specify the port.</p>
224    pub fn set_to_port(mut self, input: ::std::option::Option<i32>) -> Self {
225        self.inner = self.inner.set_to_port(input);
226        self
227    }
228    /// <p>Not supported. Use a set of IP permissions to specify the port.</p>
229    pub fn get_to_port(&self) -> &::std::option::Option<i32> {
230        self.inner.get_to_port()
231    }
232    /// <p>Not supported. Use a set of IP permissions to specify the CIDR.</p>
233    pub fn cidr_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234        self.inner = self.inner.cidr_ip(input.into());
235        self
236    }
237    /// <p>Not supported. Use a set of IP permissions to specify the CIDR.</p>
238    pub fn set_cidr_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
239        self.inner = self.inner.set_cidr_ip(input);
240        self
241    }
242    /// <p>Not supported. Use a set of IP permissions to specify the CIDR.</p>
243    pub fn get_cidr_ip(&self) -> &::std::option::Option<::std::string::String> {
244        self.inner.get_cidr_ip()
245    }
246    ///
247    /// Appends an item to `IpPermissions`.
248    ///
249    /// To override the contents of this collection use [`set_ip_permissions`](Self::set_ip_permissions).
250    ///
251    /// <p>The sets of IP permissions. You can't specify a destination security group and a CIDR IP address range in the same set of permissions.</p>
252    pub fn ip_permissions(mut self, input: crate::types::IpPermission) -> Self {
253        self.inner = self.inner.ip_permissions(input);
254        self
255    }
256    /// <p>The sets of IP permissions. You can't specify a destination security group and a CIDR IP address range in the same set of permissions.</p>
257    pub fn set_ip_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IpPermission>>) -> Self {
258        self.inner = self.inner.set_ip_permissions(input);
259        self
260    }
261    /// <p>The sets of IP permissions. You can't specify a destination security group and a CIDR IP address range in the same set of permissions.</p>
262    pub fn get_ip_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IpPermission>> {
263        self.inner.get_ip_permissions()
264    }
265}