aws_sdk_networkfirewall/operation/update_proxy_rule/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_proxy_rule::_update_proxy_rule_output::UpdateProxyRuleOutputBuilder;
3
4pub use crate::operation::update_proxy_rule::_update_proxy_rule_input::UpdateProxyRuleInputBuilder;
5
6impl crate::operation::update_proxy_rule::builders::UpdateProxyRuleInputBuilder {
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_proxy_rule::UpdateProxyRuleOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_proxy_rule::UpdateProxyRuleError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_proxy_rule();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateProxyRule`.
24///
25/// <p>Updates the properties of the specified proxy rule.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateProxyRuleFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_proxy_rule::builders::UpdateProxyRuleInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_proxy_rule::UpdateProxyRuleOutput,
35 crate::operation::update_proxy_rule::UpdateProxyRuleError,
36 > for UpdateProxyRuleFluentBuilder
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_proxy_rule::UpdateProxyRuleOutput,
44 crate::operation::update_proxy_rule::UpdateProxyRuleError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateProxyRuleFluentBuilder {
51 /// Creates a new `UpdateProxyRuleFluentBuilder`.
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 UpdateProxyRule as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_proxy_rule::builders::UpdateProxyRuleInputBuilder {
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_proxy_rule::UpdateProxyRuleOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_proxy_rule::UpdateProxyRuleError,
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_proxy_rule::UpdateProxyRule::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_proxy_rule::UpdateProxyRule::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_proxy_rule::UpdateProxyRuleOutput,
97 crate::operation::update_proxy_rule::UpdateProxyRuleError,
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 descriptive name of the proxy rule group. You can't change the name of a proxy rule group after you create it.</p>
112 /// <p>You must specify the ARN or the name, and you can specify both.</p>
113 pub fn proxy_rule_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.proxy_rule_group_name(input.into());
115 self
116 }
117 /// <p>The descriptive name of the proxy rule group. You can't change the name of a proxy rule group after you create it.</p>
118 /// <p>You must specify the ARN or the name, and you can specify both.</p>
119 pub fn set_proxy_rule_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_proxy_rule_group_name(input);
121 self
122 }
123 /// <p>The descriptive name of the proxy rule group. You can't change the name of a proxy rule group after you create it.</p>
124 /// <p>You must specify the ARN or the name, and you can specify both.</p>
125 pub fn get_proxy_rule_group_name(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_proxy_rule_group_name()
127 }
128 /// <p>The Amazon Resource Name (ARN) of a proxy rule group.</p>
129 /// <p>You must specify the ARN or the name, and you can specify both.</p>
130 pub fn proxy_rule_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.inner = self.inner.proxy_rule_group_arn(input.into());
132 self
133 }
134 /// <p>The Amazon Resource Name (ARN) of a proxy rule group.</p>
135 /// <p>You must specify the ARN or the name, and you can specify both.</p>
136 pub fn set_proxy_rule_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.inner = self.inner.set_proxy_rule_group_arn(input);
138 self
139 }
140 /// <p>The Amazon Resource Name (ARN) of a proxy rule group.</p>
141 /// <p>You must specify the ARN or the name, and you can specify both.</p>
142 pub fn get_proxy_rule_group_arn(&self) -> &::std::option::Option<::std::string::String> {
143 self.inner.get_proxy_rule_group_arn()
144 }
145 /// <p>The descriptive name of the proxy rule. You can't change the name of a proxy rule after you create it.</p>
146 pub fn proxy_rule_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.inner = self.inner.proxy_rule_name(input.into());
148 self
149 }
150 /// <p>The descriptive name of the proxy rule. You can't change the name of a proxy rule after you create it.</p>
151 pub fn set_proxy_rule_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.inner = self.inner.set_proxy_rule_name(input);
153 self
154 }
155 /// <p>The descriptive name of the proxy rule. You can't change the name of a proxy rule after you create it.</p>
156 pub fn get_proxy_rule_name(&self) -> &::std::option::Option<::std::string::String> {
157 self.inner.get_proxy_rule_name()
158 }
159 /// <p>A description of the proxy rule.</p>
160 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.description(input.into());
162 self
163 }
164 /// <p>A description of the proxy rule.</p>
165 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.inner = self.inner.set_description(input);
167 self
168 }
169 /// <p>A description of the proxy rule.</p>
170 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_description()
172 }
173 /// <p>Depending on the match action, the proxy either stops the evaluation (if the action is terminal - allow or deny), or continues it (if the action is alert) until it matches a rule with a terminal action.</p>
174 pub fn action(mut self, input: crate::types::ProxyRulePhaseAction) -> Self {
175 self.inner = self.inner.action(input);
176 self
177 }
178 /// <p>Depending on the match action, the proxy either stops the evaluation (if the action is terminal - allow or deny), or continues it (if the action is alert) until it matches a rule with a terminal action.</p>
179 pub fn set_action(mut self, input: ::std::option::Option<crate::types::ProxyRulePhaseAction>) -> Self {
180 self.inner = self.inner.set_action(input);
181 self
182 }
183 /// <p>Depending on the match action, the proxy either stops the evaluation (if the action is terminal - allow or deny), or continues it (if the action is alert) until it matches a rule with a terminal action.</p>
184 pub fn get_action(&self) -> &::std::option::Option<crate::types::ProxyRulePhaseAction> {
185 self.inner.get_action()
186 }
187 ///
188 /// Appends an item to `AddConditions`.
189 ///
190 /// To override the contents of this collection use [`set_add_conditions`](Self::set_add_conditions).
191 ///
192 /// <p>Proxy rule conditions to add. Match criteria that specify what traffic attributes to examine. Conditions include operators (StringEquals, StringLike) and values to match against.</p>
193 pub fn add_conditions(mut self, input: crate::types::ProxyRuleCondition) -> Self {
194 self.inner = self.inner.add_conditions(input);
195 self
196 }
197 /// <p>Proxy rule conditions to add. Match criteria that specify what traffic attributes to examine. Conditions include operators (StringEquals, StringLike) and values to match against.</p>
198 pub fn set_add_conditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProxyRuleCondition>>) -> Self {
199 self.inner = self.inner.set_add_conditions(input);
200 self
201 }
202 /// <p>Proxy rule conditions to add. Match criteria that specify what traffic attributes to examine. Conditions include operators (StringEquals, StringLike) and values to match against.</p>
203 pub fn get_add_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProxyRuleCondition>> {
204 self.inner.get_add_conditions()
205 }
206 ///
207 /// Appends an item to `RemoveConditions`.
208 ///
209 /// To override the contents of this collection use [`set_remove_conditions`](Self::set_remove_conditions).
210 ///
211 /// <p>Proxy rule conditions to remove. Match criteria that specify what traffic attributes to examine. Conditions include operators (StringEquals, StringLike) and values to match against.</p>
212 pub fn remove_conditions(mut self, input: crate::types::ProxyRuleCondition) -> Self {
213 self.inner = self.inner.remove_conditions(input);
214 self
215 }
216 /// <p>Proxy rule conditions to remove. Match criteria that specify what traffic attributes to examine. Conditions include operators (StringEquals, StringLike) and values to match against.</p>
217 pub fn set_remove_conditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProxyRuleCondition>>) -> Self {
218 self.inner = self.inner.set_remove_conditions(input);
219 self
220 }
221 /// <p>Proxy rule conditions to remove. Match criteria that specify what traffic attributes to examine. Conditions include operators (StringEquals, StringLike) and values to match against.</p>
222 pub fn get_remove_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProxyRuleCondition>> {
223 self.inner.get_remove_conditions()
224 }
225 /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the proxy rule. The token marks the state of the proxy rule resource at the time of the request.</p>
226 /// <p>To make changes to the proxy rule, you provide the token in your request. Network Firewall uses the token to ensure that the proxy rule hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the proxy rule again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
227 pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228 self.inner = self.inner.update_token(input.into());
229 self
230 }
231 /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the proxy rule. The token marks the state of the proxy rule resource at the time of the request.</p>
232 /// <p>To make changes to the proxy rule, you provide the token in your request. Network Firewall uses the token to ensure that the proxy rule hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the proxy rule again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
233 pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234 self.inner = self.inner.set_update_token(input);
235 self
236 }
237 /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the proxy rule. The token marks the state of the proxy rule resource at the time of the request.</p>
238 /// <p>To make changes to the proxy rule, you provide the token in your request. Network Firewall uses the token to ensure that the proxy rule hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the proxy rule again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
239 pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
240 self.inner.get_update_token()
241 }
242}