aws_sdk_ec2/operation/update_security_group_rule_descriptions_egress/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_security_group_rule_descriptions_egress::_update_security_group_rule_descriptions_egress_output::UpdateSecurityGroupRuleDescriptionsEgressOutputBuilder;
3
4pub use crate::operation::update_security_group_rule_descriptions_egress::_update_security_group_rule_descriptions_egress_input::UpdateSecurityGroupRuleDescriptionsEgressInputBuilder;
5
6impl crate::operation::update_security_group_rule_descriptions_egress::builders::UpdateSecurityGroupRuleDescriptionsEgressInputBuilder {
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::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_security_group_rule_descriptions_egress();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateSecurityGroupRuleDescriptionsEgress`.
24///
25/// <p>Updates the description of an egress (outbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously. You can remove a description for a security group rule by omitting the description parameter in the request.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateSecurityGroupRuleDescriptionsEgressFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_security_group_rule_descriptions_egress::builders::UpdateSecurityGroupRuleDescriptionsEgressInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressOutput,
35        crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressError,
36    > for UpdateSecurityGroupRuleDescriptionsEgressFluentBuilder
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::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressOutput,
44            crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateSecurityGroupRuleDescriptionsEgressFluentBuilder {
51    /// Creates a new `UpdateSecurityGroupRuleDescriptionsEgressFluentBuilder`.
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 UpdateSecurityGroupRuleDescriptionsEgress as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::update_security_group_rule_descriptions_egress::builders::UpdateSecurityGroupRuleDescriptionsEgressInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins =
87            crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgress::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgress::orchestrate(
93            &runtime_plugins,
94            input,
95        )
96        .await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressOutput,
104        crate::operation::update_security_group_rule_descriptions_egress::UpdateSecurityGroupRuleDescriptionsEgressError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <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>
119    pub fn dry_run(mut self, input: bool) -> Self {
120        self.inner = self.inner.dry_run(input);
121        self
122    }
123    /// <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>
124    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
125        self.inner = self.inner.set_dry_run(input);
126        self
127    }
128    /// <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>
129    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
130        self.inner.get_dry_run()
131    }
132    /// <p>The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.</p>
133    pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.group_id(input.into());
135        self
136    }
137    /// <p>The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.</p>
138    pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_group_id(input);
140        self
141    }
142    /// <p>The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.</p>
143    pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_group_id()
145    }
146    /// <p>\[Default VPC\] The name of the security group. You must specify either the security group ID or the security group name.</p>
147    pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.group_name(input.into());
149        self
150    }
151    /// <p>\[Default VPC\] The name of the security group. You must specify either the security group ID or the security group name.</p>
152    pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_group_name(input);
154        self
155    }
156    /// <p>\[Default VPC\] The name of the security group. You must specify either the security group ID or the security group name.</p>
157    pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_group_name()
159    }
160    ///
161    /// Appends an item to `IpPermissions`.
162    ///
163    /// To override the contents of this collection use [`set_ip_permissions`](Self::set_ip_permissions).
164    ///
165    /// <p>The IP permissions for the security group rule. You must specify either the IP permissions or the description.</p>
166    pub fn ip_permissions(mut self, input: crate::types::IpPermission) -> Self {
167        self.inner = self.inner.ip_permissions(input);
168        self
169    }
170    /// <p>The IP permissions for the security group rule. You must specify either the IP permissions or the description.</p>
171    pub fn set_ip_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IpPermission>>) -> Self {
172        self.inner = self.inner.set_ip_permissions(input);
173        self
174    }
175    /// <p>The IP permissions for the security group rule. You must specify either the IP permissions or the description.</p>
176    pub fn get_ip_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IpPermission>> {
177        self.inner.get_ip_permissions()
178    }
179    ///
180    /// Appends an item to `SecurityGroupRuleDescriptions`.
181    ///
182    /// To override the contents of this collection use [`set_security_group_rule_descriptions`](Self::set_security_group_rule_descriptions).
183    ///
184    /// <p>The description for the egress security group rules. You must specify either the description or the IP permissions.</p>
185    pub fn security_group_rule_descriptions(mut self, input: crate::types::SecurityGroupRuleDescription) -> Self {
186        self.inner = self.inner.security_group_rule_descriptions(input);
187        self
188    }
189    /// <p>The description for the egress security group rules. You must specify either the description or the IP permissions.</p>
190    pub fn set_security_group_rule_descriptions(
191        mut self,
192        input: ::std::option::Option<::std::vec::Vec<crate::types::SecurityGroupRuleDescription>>,
193    ) -> Self {
194        self.inner = self.inner.set_security_group_rule_descriptions(input);
195        self
196    }
197    /// <p>The description for the egress security group rules. You must specify either the description or the IP permissions.</p>
198    pub fn get_security_group_rule_descriptions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SecurityGroupRuleDescription>> {
199        self.inner.get_security_group_rule_descriptions()
200    }
201}