aws_sdk_pinpointsmsvoicev2/operation/update_pool/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_pool::_update_pool_output::UpdatePoolOutputBuilder;
3
4pub use crate::operation::update_pool::_update_pool_input::UpdatePoolInputBuilder;
5
6impl crate::operation::update_pool::builders::UpdatePoolInputBuilder {
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_pool::UpdatePoolOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_pool::UpdatePoolError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_pool();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdatePool`.
24///
25/// <p>Updates the configuration of an existing pool. You can update the opt-out list, enable or disable two-way messaging, change the <code>TwoWayChannelArn</code>, enable or disable self-managed opt-outs, enable or disable deletion protection, and enable or disable shared routes.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdatePoolFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_pool::builders::UpdatePoolInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_pool::UpdatePoolOutput,
35        crate::operation::update_pool::UpdatePoolError,
36    > for UpdatePoolFluentBuilder
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_pool::UpdatePoolOutput,
44            crate::operation::update_pool::UpdatePoolError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdatePoolFluentBuilder {
51    /// Creates a new `UpdatePoolFluentBuilder`.
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 UpdatePool as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_pool::builders::UpdatePoolInputBuilder {
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_pool::UpdatePoolOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_pool::UpdatePoolError,
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_pool::UpdatePool::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_pool::UpdatePool::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_pool::UpdatePoolOutput,
97        crate::operation::update_pool::UpdatePoolError,
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 unique identifier of the pool to update. Valid values are either the PoolId or PoolArn.</p><important>
112    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
113    /// </important>
114    pub fn pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.pool_id(input.into());
116        self
117    }
118    /// <p>The unique identifier of the pool to update. Valid values are either the PoolId or PoolArn.</p><important>
119    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
120    /// </important>
121    pub fn set_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_pool_id(input);
123        self
124    }
125    /// <p>The unique identifier of the pool to update. Valid values are either the PoolId or PoolArn.</p><important>
126    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
127    /// </important>
128    pub fn get_pool_id(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_pool_id()
130    }
131    /// <p>By default this is set to false. When set to true you can receive incoming text messages from your end recipients.</p>
132    pub fn two_way_enabled(mut self, input: bool) -> Self {
133        self.inner = self.inner.two_way_enabled(input);
134        self
135    }
136    /// <p>By default this is set to false. When set to true you can receive incoming text messages from your end recipients.</p>
137    pub fn set_two_way_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
138        self.inner = self.inner.set_two_way_enabled(input);
139        self
140    }
141    /// <p>By default this is set to false. When set to true you can receive incoming text messages from your end recipients.</p>
142    pub fn get_two_way_enabled(&self) -> &::std::option::Option<bool> {
143        self.inner.get_two_way_enabled()
144    }
145    /// <p>The Amazon Resource Name (ARN) of the two way channel.</p>
146    pub fn two_way_channel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.two_way_channel_arn(input.into());
148        self
149    }
150    /// <p>The Amazon Resource Name (ARN) of the two way channel.</p>
151    pub fn set_two_way_channel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_two_way_channel_arn(input);
153        self
154    }
155    /// <p>The Amazon Resource Name (ARN) of the two way channel.</p>
156    pub fn get_two_way_channel_arn(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_two_way_channel_arn()
158    }
159    /// <p>An optional IAM Role Arn for a service to assume, to be able to post inbound SMS messages.</p>
160    pub fn two_way_channel_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.two_way_channel_role(input.into());
162        self
163    }
164    /// <p>An optional IAM Role Arn for a service to assume, to be able to post inbound SMS messages.</p>
165    pub fn set_two_way_channel_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_two_way_channel_role(input);
167        self
168    }
169    /// <p>An optional IAM Role Arn for a service to assume, to be able to post inbound SMS messages.</p>
170    pub fn get_two_way_channel_role(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_two_way_channel_role()
172    }
173    /// <p>By default this is set to false. When set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User MessagingSMS automatically replies with a customizable message and adds the end recipient to the OptOutList. When set to true you're responsible for responding to HELP and STOP requests. You're also responsible for tracking and honoring opt-out requests.</p>
174    pub fn self_managed_opt_outs_enabled(mut self, input: bool) -> Self {
175        self.inner = self.inner.self_managed_opt_outs_enabled(input);
176        self
177    }
178    /// <p>By default this is set to false. When set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User MessagingSMS automatically replies with a customizable message and adds the end recipient to the OptOutList. When set to true you're responsible for responding to HELP and STOP requests. You're also responsible for tracking and honoring opt-out requests.</p>
179    pub fn set_self_managed_opt_outs_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
180        self.inner = self.inner.set_self_managed_opt_outs_enabled(input);
181        self
182    }
183    /// <p>By default this is set to false. When set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User MessagingSMS automatically replies with a customizable message and adds the end recipient to the OptOutList. When set to true you're responsible for responding to HELP and STOP requests. You're also responsible for tracking and honoring opt-out requests.</p>
184    pub fn get_self_managed_opt_outs_enabled(&self) -> &::std::option::Option<bool> {
185        self.inner.get_self_managed_opt_outs_enabled()
186    }
187    /// <p>The OptOutList to associate with the pool. Valid values are either OptOutListName or OptOutListArn.</p><important>
188    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
189    /// </important>
190    pub fn opt_out_list_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.opt_out_list_name(input.into());
192        self
193    }
194    /// <p>The OptOutList to associate with the pool. Valid values are either OptOutListName or OptOutListArn.</p><important>
195    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
196    /// </important>
197    pub fn set_opt_out_list_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.inner = self.inner.set_opt_out_list_name(input);
199        self
200    }
201    /// <p>The OptOutList to associate with the pool. Valid values are either OptOutListName or OptOutListArn.</p><important>
202    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
203    /// </important>
204    pub fn get_opt_out_list_name(&self) -> &::std::option::Option<::std::string::String> {
205        self.inner.get_opt_out_list_name()
206    }
207    /// <p>Indicates whether shared routes are enabled for the pool.</p>
208    pub fn shared_routes_enabled(mut self, input: bool) -> Self {
209        self.inner = self.inner.shared_routes_enabled(input);
210        self
211    }
212    /// <p>Indicates whether shared routes are enabled for the pool.</p>
213    pub fn set_shared_routes_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
214        self.inner = self.inner.set_shared_routes_enabled(input);
215        self
216    }
217    /// <p>Indicates whether shared routes are enabled for the pool.</p>
218    pub fn get_shared_routes_enabled(&self) -> &::std::option::Option<bool> {
219        self.inner.get_shared_routes_enabled()
220    }
221    /// <p>When set to true the pool can't be deleted.</p>
222    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
223        self.inner = self.inner.deletion_protection_enabled(input);
224        self
225    }
226    /// <p>When set to true the pool can't be deleted.</p>
227    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
228        self.inner = self.inner.set_deletion_protection_enabled(input);
229        self
230    }
231    /// <p>When set to true the pool can't be deleted.</p>
232    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
233        self.inner.get_deletion_protection_enabled()
234    }
235}