aws_sdk_quicksight/operation/update_ip_restriction/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_ip_restriction::_update_ip_restriction_output::UpdateIpRestrictionOutputBuilder;
3
4pub use crate::operation::update_ip_restriction::_update_ip_restriction_input::UpdateIpRestrictionInputBuilder;
5
6impl crate::operation::update_ip_restriction::builders::UpdateIpRestrictionInputBuilder {
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_ip_restriction::UpdateIpRestrictionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_ip_restriction::UpdateIpRestrictionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_ip_restriction();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateIpRestriction`.
24///
25/// <p>Updates the content and status of IP rules. Traffic from a source is allowed when the source satisfies either the <code>IpRestrictionRule</code>, <code>VpcIdRestrictionRule</code>, or <code>VpcEndpointIdRestrictionRule</code>. To use this operation, you must provide the entire map of rules. You can use the <code>DescribeIpRestriction</code> operation to get the current rule map.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateIpRestrictionFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_ip_restriction::builders::UpdateIpRestrictionInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_ip_restriction::UpdateIpRestrictionOutput,
35        crate::operation::update_ip_restriction::UpdateIpRestrictionError,
36    > for UpdateIpRestrictionFluentBuilder
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_ip_restriction::UpdateIpRestrictionOutput,
44            crate::operation::update_ip_restriction::UpdateIpRestrictionError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateIpRestrictionFluentBuilder {
51    /// Creates a new `UpdateIpRestrictionFluentBuilder`.
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 UpdateIpRestriction as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_ip_restriction::builders::UpdateIpRestrictionInputBuilder {
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::update_ip_restriction::UpdateIpRestrictionOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_ip_restriction::UpdateIpRestrictionError,
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::update_ip_restriction::UpdateIpRestriction::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_ip_restriction::UpdateIpRestriction::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::update_ip_restriction::UpdateIpRestrictionOutput,
97        crate::operation::update_ip_restriction::UpdateIpRestrictionError,
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    /// <p>The ID of the Amazon Web Services account that contains the IP rules.</p>
112    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.aws_account_id(input.into());
114        self
115    }
116    /// <p>The ID of the Amazon Web Services account that contains the IP rules.</p>
117    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_aws_account_id(input);
119        self
120    }
121    /// <p>The ID of the Amazon Web Services account that contains the IP rules.</p>
122    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_aws_account_id()
124    }
125    ///
126    /// Adds a key-value pair to `IpRestrictionRuleMap`.
127    ///
128    /// To override the contents of this collection use [`set_ip_restriction_rule_map`](Self::set_ip_restriction_rule_map).
129    ///
130    /// <p>A map that describes the updated IP rules with CIDR ranges and descriptions.</p>
131    pub fn ip_restriction_rule_map(
132        mut self,
133        k: impl ::std::convert::Into<::std::string::String>,
134        v: impl ::std::convert::Into<::std::string::String>,
135    ) -> Self {
136        self.inner = self.inner.ip_restriction_rule_map(k.into(), v.into());
137        self
138    }
139    /// <p>A map that describes the updated IP rules with CIDR ranges and descriptions.</p>
140    pub fn set_ip_restriction_rule_map(
141        mut self,
142        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
143    ) -> Self {
144        self.inner = self.inner.set_ip_restriction_rule_map(input);
145        self
146    }
147    /// <p>A map that describes the updated IP rules with CIDR ranges and descriptions.</p>
148    pub fn get_ip_restriction_rule_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
149        self.inner.get_ip_restriction_rule_map()
150    }
151    ///
152    /// Adds a key-value pair to `VpcIdRestrictionRuleMap`.
153    ///
154    /// To override the contents of this collection use [`set_vpc_id_restriction_rule_map`](Self::set_vpc_id_restriction_rule_map).
155    ///
156    /// <p>A map of VPC IDs and their corresponding rules. When you configure this parameter, traffic from all VPC endpoints that are present in the specified VPC is allowed.</p>
157    pub fn vpc_id_restriction_rule_map(
158        mut self,
159        k: impl ::std::convert::Into<::std::string::String>,
160        v: impl ::std::convert::Into<::std::string::String>,
161    ) -> Self {
162        self.inner = self.inner.vpc_id_restriction_rule_map(k.into(), v.into());
163        self
164    }
165    /// <p>A map of VPC IDs and their corresponding rules. When you configure this parameter, traffic from all VPC endpoints that are present in the specified VPC is allowed.</p>
166    pub fn set_vpc_id_restriction_rule_map(
167        mut self,
168        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
169    ) -> Self {
170        self.inner = self.inner.set_vpc_id_restriction_rule_map(input);
171        self
172    }
173    /// <p>A map of VPC IDs and their corresponding rules. When you configure this parameter, traffic from all VPC endpoints that are present in the specified VPC is allowed.</p>
174    pub fn get_vpc_id_restriction_rule_map(
175        &self,
176    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
177        self.inner.get_vpc_id_restriction_rule_map()
178    }
179    ///
180    /// Adds a key-value pair to `VpcEndpointIdRestrictionRuleMap`.
181    ///
182    /// To override the contents of this collection use [`set_vpc_endpoint_id_restriction_rule_map`](Self::set_vpc_endpoint_id_restriction_rule_map).
183    ///
184    /// <p>A map of allowed VPC endpoint IDs and their corresponding rule descriptions.</p>
185    pub fn vpc_endpoint_id_restriction_rule_map(
186        mut self,
187        k: impl ::std::convert::Into<::std::string::String>,
188        v: impl ::std::convert::Into<::std::string::String>,
189    ) -> Self {
190        self.inner = self.inner.vpc_endpoint_id_restriction_rule_map(k.into(), v.into());
191        self
192    }
193    /// <p>A map of allowed VPC endpoint IDs and their corresponding rule descriptions.</p>
194    pub fn set_vpc_endpoint_id_restriction_rule_map(
195        mut self,
196        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
197    ) -> Self {
198        self.inner = self.inner.set_vpc_endpoint_id_restriction_rule_map(input);
199        self
200    }
201    /// <p>A map of allowed VPC endpoint IDs and their corresponding rule descriptions.</p>
202    pub fn get_vpc_endpoint_id_restriction_rule_map(
203        &self,
204    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
205        self.inner.get_vpc_endpoint_id_restriction_rule_map()
206    }
207    /// <p>A value that specifies whether IP rules are turned on.</p>
208    pub fn enabled(mut self, input: bool) -> Self {
209        self.inner = self.inner.enabled(input);
210        self
211    }
212    /// <p>A value that specifies whether IP rules are turned on.</p>
213    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
214        self.inner = self.inner.set_enabled(input);
215        self
216    }
217    /// <p>A value that specifies whether IP rules are turned on.</p>
218    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
219        self.inner.get_enabled()
220    }
221}