aws_sdk_pinpointsmsvoicev2/operation/update_protect_configuration_country_rule_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_protect_configuration_country_rule_set::_update_protect_configuration_country_rule_set_output::UpdateProtectConfigurationCountryRuleSetOutputBuilder;
3
4pub use crate::operation::update_protect_configuration_country_rule_set::_update_protect_configuration_country_rule_set_input::UpdateProtectConfigurationCountryRuleSetInputBuilder;
5
6impl crate::operation::update_protect_configuration_country_rule_set::builders::UpdateProtectConfigurationCountryRuleSetInputBuilder {
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_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_protect_configuration_country_rule_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateProtectConfigurationCountryRuleSet`.
24///
25/// <p>Update a country rule set to <code>ALLOW</code>, <code>BLOCK</code>, <code>MONITOR</code>, or <code>FILTER</code> messages to be sent to the specified destination counties. You can update one or multiple countries at a time. The updates are only applied to the specified NumberCapability type.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateProtectConfigurationCountryRuleSetFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_protect_configuration_country_rule_set::builders::UpdateProtectConfigurationCountryRuleSetInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetOutput,
35        crate::operation::update_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetError,
36    > for UpdateProtectConfigurationCountryRuleSetFluentBuilder
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_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetOutput,
44            crate::operation::update_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateProtectConfigurationCountryRuleSetFluentBuilder {
51    /// Creates a new `UpdateProtectConfigurationCountryRuleSetFluentBuilder`.
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 UpdateProtectConfigurationCountryRuleSet as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::update_protect_configuration_country_rule_set::builders::UpdateProtectConfigurationCountryRuleSetInputBuilder {
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_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::update_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetError,
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_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSet::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::update_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSet::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_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetOutput,
104        crate::operation::update_protect_configuration_country_rule_set::UpdateProtectConfigurationCountryRuleSetError,
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>The unique identifier for the protect configuration.</p>
119    pub fn protect_configuration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.protect_configuration_id(input.into());
121        self
122    }
123    /// <p>The unique identifier for the protect configuration.</p>
124    pub fn set_protect_configuration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_protect_configuration_id(input);
126        self
127    }
128    /// <p>The unique identifier for the protect configuration.</p>
129    pub fn get_protect_configuration_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_protect_configuration_id()
131    }
132    /// <p>The number capability to apply the CountryRuleSetUpdates updates to.</p>
133    pub fn number_capability(mut self, input: crate::types::NumberCapability) -> Self {
134        self.inner = self.inner.number_capability(input);
135        self
136    }
137    /// <p>The number capability to apply the CountryRuleSetUpdates updates to.</p>
138    pub fn set_number_capability(mut self, input: ::std::option::Option<crate::types::NumberCapability>) -> Self {
139        self.inner = self.inner.set_number_capability(input);
140        self
141    }
142    /// <p>The number capability to apply the CountryRuleSetUpdates updates to.</p>
143    pub fn get_number_capability(&self) -> &::std::option::Option<crate::types::NumberCapability> {
144        self.inner.get_number_capability()
145    }
146    ///
147    /// Adds a key-value pair to `CountryRuleSetUpdates`.
148    ///
149    /// To override the contents of this collection use [`set_country_rule_set_updates`](Self::set_country_rule_set_updates).
150    ///
151    /// <p>A map of ProtectConfigurationCountryRuleSetInformation objects that contain the details for the requested NumberCapability. The Key is the two-letter ISO country code. For a list of supported ISO country codes, see <a href="https://docs.aws.amazon.com/sms-voice/latest/userguide/phone-numbers-sms-by-country.html">Supported countries and regions (SMS channel)</a> in the End User MessagingSMS User Guide.</p>
152    /// <p>For example, to set the United States as allowed and Canada as blocked, the <code>CountryRuleSetUpdates</code> would be formatted as: <code>"CountryRuleSetUpdates": { "US" : { "ProtectStatus": "ALLOW" } "CA" : { "ProtectStatus": "BLOCK" } }</code></p>
153    pub fn country_rule_set_updates(
154        mut self,
155        k: impl ::std::convert::Into<::std::string::String>,
156        v: crate::types::ProtectConfigurationCountryRuleSetInformation,
157    ) -> Self {
158        self.inner = self.inner.country_rule_set_updates(k.into(), v);
159        self
160    }
161    /// <p>A map of ProtectConfigurationCountryRuleSetInformation objects that contain the details for the requested NumberCapability. The Key is the two-letter ISO country code. For a list of supported ISO country codes, see <a href="https://docs.aws.amazon.com/sms-voice/latest/userguide/phone-numbers-sms-by-country.html">Supported countries and regions (SMS channel)</a> in the End User MessagingSMS User Guide.</p>
162    /// <p>For example, to set the United States as allowed and Canada as blocked, the <code>CountryRuleSetUpdates</code> would be formatted as: <code>"CountryRuleSetUpdates": { "US" : { "ProtectStatus": "ALLOW" } "CA" : { "ProtectStatus": "BLOCK" } }</code></p>
163    pub fn set_country_rule_set_updates(
164        mut self,
165        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ProtectConfigurationCountryRuleSetInformation>>,
166    ) -> Self {
167        self.inner = self.inner.set_country_rule_set_updates(input);
168        self
169    }
170    /// <p>A map of ProtectConfigurationCountryRuleSetInformation objects that contain the details for the requested NumberCapability. The Key is the two-letter ISO country code. For a list of supported ISO country codes, see <a href="https://docs.aws.amazon.com/sms-voice/latest/userguide/phone-numbers-sms-by-country.html">Supported countries and regions (SMS channel)</a> in the End User MessagingSMS User Guide.</p>
171    /// <p>For example, to set the United States as allowed and Canada as blocked, the <code>CountryRuleSetUpdates</code> would be formatted as: <code>"CountryRuleSetUpdates": { "US" : { "ProtectStatus": "ALLOW" } "CA" : { "ProtectStatus": "BLOCK" } }</code></p>
172    pub fn get_country_rule_set_updates(
173        &self,
174    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ProtectConfigurationCountryRuleSetInformation>> {
175        self.inner.get_country_rule_set_updates()
176    }
177}