aws_sdk_ec2/operation/authorize_security_group_egress/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::authorize_security_group_egress::_authorize_security_group_egress_output::AuthorizeSecurityGroupEgressOutputBuilder;
3
4pub use crate::operation::authorize_security_group_egress::_authorize_security_group_egress_input::AuthorizeSecurityGroupEgressInputBuilder;
5
6impl crate::operation::authorize_security_group_egress::builders::AuthorizeSecurityGroupEgressInputBuilder {
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::authorize_security_group_egress::AuthorizeSecurityGroupEgressOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.authorize_security_group_egress();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AuthorizeSecurityGroupEgress`.
24///
25/// <p>Adds the specified outbound (egress) rules to a security group.</p>
26/// <p>An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 address ranges, the IP address ranges specified by a prefix list, or the instances that are associated with a source security group. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html">Security group rules</a>.</p>
27/// <p>You must specify exactly one of the following destinations: an IPv4 or IPv6 address range, a prefix list, or a security group. You must specify a protocol for each rule (for example, TCP). If the protocol is TCP or UDP, you must also specify a port or port range. If the protocol is ICMP or ICMPv6, you must also specify the ICMP type and code.</p>
28/// <p>Rule changes are propagated to instances associated with the security group as quickly as possible. However, a small delay might occur.</p>
29/// <p>For examples of rules that you can add to security groups for specific access scenarios, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html">Security group rules for different use cases</a> in the <i>Amazon EC2 User Guide</i>.</p>
30/// <p>For information about security group quotas, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html">Amazon VPC quotas</a> in the <i>Amazon VPC User Guide</i>.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct AuthorizeSecurityGroupEgressFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::authorize_security_group_egress::builders::AuthorizeSecurityGroupEgressInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressOutput,
40        crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressError,
41    > for AuthorizeSecurityGroupEgressFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressOutput,
49            crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl AuthorizeSecurityGroupEgressFluentBuilder {
56    /// Creates a new `AuthorizeSecurityGroupEgressFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the AuthorizeSecurityGroupEgress as a reference.
65    pub fn as_input(&self) -> &crate::operation::authorize_security_group_egress::builders::AuthorizeSecurityGroupEgressInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgress::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgress::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressOutput,
102        crate::operation::authorize_security_group_egress::AuthorizeSecurityGroupEgressError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    ///
117    /// Appends an item to `TagSpecifications`.
118    ///
119    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
120    ///
121    /// <p>The tags applied to the security group rule.</p>
122    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
123        self.inner = self.inner.tag_specifications(input);
124        self
125    }
126    /// <p>The tags applied to the security group rule.</p>
127    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
128        self.inner = self.inner.set_tag_specifications(input);
129        self
130    }
131    /// <p>The tags applied to the security group rule.</p>
132    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
133        self.inner.get_tag_specifications()
134    }
135    /// <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>
136    pub fn dry_run(mut self, input: bool) -> Self {
137        self.inner = self.inner.dry_run(input);
138        self
139    }
140    /// <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>
141    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
142        self.inner = self.inner.set_dry_run(input);
143        self
144    }
145    /// <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>
146    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
147        self.inner.get_dry_run()
148    }
149    /// <p>The ID of the security group.</p>
150    pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.group_id(input.into());
152        self
153    }
154    /// <p>The ID of the security group.</p>
155    pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_group_id(input);
157        self
158    }
159    /// <p>The ID of the security group.</p>
160    pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_group_id()
162    }
163    /// <p>Not supported. Use IP permissions instead.</p>
164    pub fn source_security_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.source_security_group_name(input.into());
166        self
167    }
168    /// <p>Not supported. Use IP permissions instead.</p>
169    pub fn set_source_security_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_source_security_group_name(input);
171        self
172    }
173    /// <p>Not supported. Use IP permissions instead.</p>
174    pub fn get_source_security_group_name(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_source_security_group_name()
176    }
177    /// <p>Not supported. Use IP permissions instead.</p>
178    pub fn source_security_group_owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.source_security_group_owner_id(input.into());
180        self
181    }
182    /// <p>Not supported. Use IP permissions instead.</p>
183    pub fn set_source_security_group_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.inner = self.inner.set_source_security_group_owner_id(input);
185        self
186    }
187    /// <p>Not supported. Use IP permissions instead.</p>
188    pub fn get_source_security_group_owner_id(&self) -> &::std::option::Option<::std::string::String> {
189        self.inner.get_source_security_group_owner_id()
190    }
191    /// <p>Not supported. Use IP permissions instead.</p>
192    pub fn ip_protocol(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.ip_protocol(input.into());
194        self
195    }
196    /// <p>Not supported. Use IP permissions instead.</p>
197    pub fn set_ip_protocol(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.inner = self.inner.set_ip_protocol(input);
199        self
200    }
201    /// <p>Not supported. Use IP permissions instead.</p>
202    pub fn get_ip_protocol(&self) -> &::std::option::Option<::std::string::String> {
203        self.inner.get_ip_protocol()
204    }
205    /// <p>Not supported. Use IP permissions instead.</p>
206    pub fn from_port(mut self, input: i32) -> Self {
207        self.inner = self.inner.from_port(input);
208        self
209    }
210    /// <p>Not supported. Use IP permissions instead.</p>
211    pub fn set_from_port(mut self, input: ::std::option::Option<i32>) -> Self {
212        self.inner = self.inner.set_from_port(input);
213        self
214    }
215    /// <p>Not supported. Use IP permissions instead.</p>
216    pub fn get_from_port(&self) -> &::std::option::Option<i32> {
217        self.inner.get_from_port()
218    }
219    /// <p>Not supported. Use IP permissions instead.</p>
220    pub fn to_port(mut self, input: i32) -> Self {
221        self.inner = self.inner.to_port(input);
222        self
223    }
224    /// <p>Not supported. Use IP permissions instead.</p>
225    pub fn set_to_port(mut self, input: ::std::option::Option<i32>) -> Self {
226        self.inner = self.inner.set_to_port(input);
227        self
228    }
229    /// <p>Not supported. Use IP permissions instead.</p>
230    pub fn get_to_port(&self) -> &::std::option::Option<i32> {
231        self.inner.get_to_port()
232    }
233    /// <p>Not supported. Use IP permissions instead.</p>
234    pub fn cidr_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.inner = self.inner.cidr_ip(input.into());
236        self
237    }
238    /// <p>Not supported. Use IP permissions instead.</p>
239    pub fn set_cidr_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.inner = self.inner.set_cidr_ip(input);
241        self
242    }
243    /// <p>Not supported. Use IP permissions instead.</p>
244    pub fn get_cidr_ip(&self) -> &::std::option::Option<::std::string::String> {
245        self.inner.get_cidr_ip()
246    }
247    ///
248    /// Appends an item to `IpPermissions`.
249    ///
250    /// To override the contents of this collection use [`set_ip_permissions`](Self::set_ip_permissions).
251    ///
252    /// <p>The permissions for the security group rules.</p>
253    pub fn ip_permissions(mut self, input: crate::types::IpPermission) -> Self {
254        self.inner = self.inner.ip_permissions(input);
255        self
256    }
257    /// <p>The permissions for the security group rules.</p>
258    pub fn set_ip_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IpPermission>>) -> Self {
259        self.inner = self.inner.set_ip_permissions(input);
260        self
261    }
262    /// <p>The permissions for the security group rules.</p>
263    pub fn get_ip_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IpPermission>> {
264        self.inner.get_ip_permissions()
265    }
266}