aws_sdk_wafv2/operation/put_managed_rule_set_versions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_managed_rule_set_versions::_put_managed_rule_set_versions_output::PutManagedRuleSetVersionsOutputBuilder;
3
4pub use crate::operation::put_managed_rule_set_versions::_put_managed_rule_set_versions_input::PutManagedRuleSetVersionsInputBuilder;
5
6impl crate::operation::put_managed_rule_set_versions::builders::PutManagedRuleSetVersionsInputBuilder {
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::put_managed_rule_set_versions::PutManagedRuleSetVersionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_managed_rule_set_versions::PutManagedRuleSetVersionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_managed_rule_set_versions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutManagedRuleSetVersions`.
24///
25/// <p>Defines the versions of your managed rule set that you are offering to the customers. Customers see your offerings as managed rule groups with versioning.</p><note>
26/// <p>This is intended for use only by vendors of managed rule sets. Vendors are Amazon Web Services and Amazon Web Services Marketplace sellers.</p>
27/// <p>Vendors, you can use the managed rule set APIs to provide controlled rollout of your versioned managed rule group offerings for your customers. The APIs are <code>ListManagedRuleSets</code>, <code>GetManagedRuleSet</code>, <code>PutManagedRuleSetVersions</code>, and <code>UpdateManagedRuleSetVersionExpiryDate</code>.</p>
28/// </note>
29/// <p>Customers retrieve their managed rule group list by calling <code>ListAvailableManagedRuleGroups</code>. The name that you provide here for your managed rule set is the name the customer sees for the corresponding managed rule group. Customers can retrieve the available versions for a managed rule group by calling <code>ListAvailableManagedRuleGroupVersions</code>. You provide a rule group specification for each version. For each managed rule set, you must specify a version that you recommend using.</p>
30/// <p>To initiate the expiration of a managed rule group version, use <code>UpdateManagedRuleSetVersionExpiryDate</code>.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct PutManagedRuleSetVersionsFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::put_managed_rule_set_versions::builders::PutManagedRuleSetVersionsInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::put_managed_rule_set_versions::PutManagedRuleSetVersionsOutput,
40        crate::operation::put_managed_rule_set_versions::PutManagedRuleSetVersionsError,
41    > for PutManagedRuleSetVersionsFluentBuilder
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::put_managed_rule_set_versions::PutManagedRuleSetVersionsOutput,
49            crate::operation::put_managed_rule_set_versions::PutManagedRuleSetVersionsError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl PutManagedRuleSetVersionsFluentBuilder {
56    /// Creates a new `PutManagedRuleSetVersionsFluentBuilder`.
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 PutManagedRuleSetVersions as a reference.
65    pub fn as_input(&self) -> &crate::operation::put_managed_rule_set_versions::builders::PutManagedRuleSetVersionsInputBuilder {
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::put_managed_rule_set_versions::PutManagedRuleSetVersionsOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::put_managed_rule_set_versions::PutManagedRuleSetVersionsError,
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::put_managed_rule_set_versions::PutManagedRuleSetVersions::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::put_managed_rule_set_versions::PutManagedRuleSetVersions::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::put_managed_rule_set_versions::PutManagedRuleSetVersionsOutput,
102        crate::operation::put_managed_rule_set_versions::PutManagedRuleSetVersionsError,
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    /// <p>The name of the managed rule set. You use this, along with the rule set ID, to identify the rule set.</p>
117    /// <p>This name is assigned to the corresponding managed rule group, which your customers can access and use.</p>
118    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.name(input.into());
120        self
121    }
122    /// <p>The name of the managed rule set. You use this, along with the rule set ID, to identify the rule set.</p>
123    /// <p>This name is assigned to the corresponding managed rule group, which your customers can access and use.</p>
124    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_name(input);
126        self
127    }
128    /// <p>The name of the managed rule set. You use this, along with the rule set ID, to identify the rule set.</p>
129    /// <p>This name is assigned to the corresponding managed rule group, which your customers can access and use.</p>
130    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_name()
132    }
133    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
134    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
135    /// <ul>
136    /// <li>
137    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
138    /// <li>
139    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
140    /// </ul>
141    pub fn scope(mut self, input: crate::types::Scope) -> Self {
142        self.inner = self.inner.scope(input);
143        self
144    }
145    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
146    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
147    /// <ul>
148    /// <li>
149    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
150    /// <li>
151    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
152    /// </ul>
153    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
154        self.inner = self.inner.set_scope(input);
155        self
156    }
157    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
158    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
159    /// <ul>
160    /// <li>
161    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
162    /// <li>
163    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
164    /// </ul>
165    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
166        self.inner.get_scope()
167    }
168    /// <p>A unique identifier for the managed rule set. The ID is returned in the responses to commands like <code>list</code>. You provide it to operations like <code>get</code> and <code>update</code>.</p>
169    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.id(input.into());
171        self
172    }
173    /// <p>A unique identifier for the managed rule set. The ID is returned in the responses to commands like <code>list</code>. You provide it to operations like <code>get</code> and <code>update</code>.</p>
174    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.inner = self.inner.set_id(input);
176        self
177    }
178    /// <p>A unique identifier for the managed rule set. The ID is returned in the responses to commands like <code>list</code>. You provide it to operations like <code>get</code> and <code>update</code>.</p>
179    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
180        self.inner.get_id()
181    }
182    /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
183    pub fn lock_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.lock_token(input.into());
185        self
186    }
187    /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
188    pub fn set_lock_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_lock_token(input);
190        self
191    }
192    /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
193    pub fn get_lock_token(&self) -> &::std::option::Option<::std::string::String> {
194        self.inner.get_lock_token()
195    }
196    /// <p>The version of the named managed rule group that you'd like your customers to choose, from among your version offerings.</p>
197    pub fn recommended_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.inner = self.inner.recommended_version(input.into());
199        self
200    }
201    /// <p>The version of the named managed rule group that you'd like your customers to choose, from among your version offerings.</p>
202    pub fn set_recommended_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.inner = self.inner.set_recommended_version(input);
204        self
205    }
206    /// <p>The version of the named managed rule group that you'd like your customers to choose, from among your version offerings.</p>
207    pub fn get_recommended_version(&self) -> &::std::option::Option<::std::string::String> {
208        self.inner.get_recommended_version()
209    }
210    ///
211    /// Adds a key-value pair to `VersionsToPublish`.
212    ///
213    /// To override the contents of this collection use [`set_versions_to_publish`](Self::set_versions_to_publish).
214    ///
215    /// <p>The versions of the named managed rule group that you want to offer to your customers.</p>
216    pub fn versions_to_publish(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::VersionToPublish) -> Self {
217        self.inner = self.inner.versions_to_publish(k.into(), v);
218        self
219    }
220    /// <p>The versions of the named managed rule group that you want to offer to your customers.</p>
221    pub fn set_versions_to_publish(
222        mut self,
223        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::VersionToPublish>>,
224    ) -> Self {
225        self.inner = self.inner.set_versions_to_publish(input);
226        self
227    }
228    /// <p>The versions of the named managed rule group that you want to offer to your customers.</p>
229    pub fn get_versions_to_publish(
230        &self,
231    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::VersionToPublish>> {
232        self.inner.get_versions_to_publish()
233    }
234}