Skip to main content

aws_sdk_endusermessaging/operation/send_notify_code_verification/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::send_notify_code_verification::_send_notify_code_verification_input::SendNotifyCodeVerificationInputBuilder;
3
4pub use crate::operation::send_notify_code_verification::_send_notify_code_verification_output::SendNotifyCodeVerificationOutputBuilder;
5
6impl crate::operation::send_notify_code_verification::builders::SendNotifyCodeVerificationInputBuilder {
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::send_notify_code_verification::SendNotifyCodeVerificationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.send_notify_code_verification();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SendNotifyCodeVerification`.
24///
25/// <p>Generates a one-time passcode and delivers it to a recipient over the requested channel. The passcode policy is captured from the referenced notify code configuration at the time of the request, so later updates to the configuration do not affect verifications that are already in progress.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SendNotifyCodeVerificationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::send_notify_code_verification::builders::SendNotifyCodeVerificationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::send_notify_code_verification::SendNotifyCodeVerificationOutput,
35        crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
36    > for SendNotifyCodeVerificationFluentBuilder
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::send_notify_code_verification::SendNotifyCodeVerificationOutput,
44            crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl SendNotifyCodeVerificationFluentBuilder {
51    /// Creates a new `SendNotifyCodeVerificationFluentBuilder`.
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 SendNotifyCodeVerification as a reference.
60    pub fn as_input(&self) -> &crate::operation::send_notify_code_verification::builders::SendNotifyCodeVerificationInputBuilder {
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::send_notify_code_verification::SendNotifyCodeVerificationOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
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::send_notify_code_verification::SendNotifyCodeVerification::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::send_notify_code_verification::SendNotifyCodeVerification::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::send_notify_code_verification::SendNotifyCodeVerificationOutput,
97        crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
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 channel used to deliver the one-time passcode to the recipient.</p>
112    pub fn channel(mut self, input: crate::types::NotifyChannel) -> Self {
113        self.inner = self.inner.channel(input);
114        self
115    }
116    /// <p>The channel used to deliver the one-time passcode to the recipient.</p>
117    pub fn set_channel(mut self, input: ::std::option::Option<crate::types::NotifyChannel>) -> Self {
118        self.inner = self.inner.set_channel(input);
119        self
120    }
121    /// <p>The channel used to deliver the one-time passcode to the recipient.</p>
122    pub fn get_channel(&self) -> &::std::option::Option<crate::types::NotifyChannel> {
123        self.inner.get_channel()
124    }
125    /// <p>The recipient identifier. For the TEXT and VOICE channels, specify an E.164 phone number. For the WhatsApp channel, specify a WhatsApp address.</p>
126    pub fn destination_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.destination_identity(input.into());
128        self
129    }
130    /// <p>The recipient identifier. For the TEXT and VOICE channels, specify an E.164 phone number. For the WhatsApp channel, specify a WhatsApp address.</p>
131    pub fn set_destination_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_destination_identity(input);
133        self
134    }
135    /// <p>The recipient identifier. For the TEXT and VOICE channels, specify an E.164 phone number. For the WhatsApp channel, specify a WhatsApp address.</p>
136    pub fn get_destination_identity(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_destination_identity()
138    }
139    /// <p>The identity used to send the message, such as a phone number, sender ID, or pool that is owned by your account.</p>
140    pub fn origination_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.origination_identity(input.into());
142        self
143    }
144    /// <p>The identity used to send the message, such as a phone number, sender ID, or pool that is owned by your account.</p>
145    pub fn set_origination_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_origination_identity(input);
147        self
148    }
149    /// <p>The identity used to send the message, such as a phone number, sender ID, or pool that is owned by your account.</p>
150    pub fn get_origination_identity(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_origination_identity()
152    }
153    /// <p>The identifier or Amazon Resource Name (ARN) of the notify code configuration that supplies the passcode policy and template defaults. When you do not specify a configuration, you must supply the template in the request.</p>
154    pub fn notify_code_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.notify_code_configuration(input.into());
156        self
157    }
158    /// <p>The identifier or Amazon Resource Name (ARN) of the notify code configuration that supplies the passcode policy and template defaults. When you do not specify a configuration, you must supply the template in the request.</p>
159    pub fn set_notify_code_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_notify_code_configuration(input);
161        self
162    }
163    /// <p>The identifier or Amazon Resource Name (ARN) of the notify code configuration that supplies the passcode policy and template defaults. When you do not specify a configuration, you must supply the template in the request.</p>
164    pub fn get_notify_code_configuration(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_notify_code_configuration()
166    }
167    /// <p>The channel-specific parameters used to render and deliver the one-time passcode for this request. The route that is derived from the channel and the origination identity selects the matching channel. When you do not specify channel parameters, the service uses the parameters from the referenced notify code configuration.</p>
168    pub fn override_channel_parameters(mut self, input: crate::types::ChannelParameters) -> Self {
169        self.inner = self.inner.override_channel_parameters(input);
170        self
171    }
172    /// <p>The channel-specific parameters used to render and deliver the one-time passcode for this request. The route that is derived from the channel and the origination identity selects the matching channel. When you do not specify channel parameters, the service uses the parameters from the referenced notify code configuration.</p>
173    pub fn set_override_channel_parameters(mut self, input: ::std::option::Option<crate::types::ChannelParameters>) -> Self {
174        self.inner = self.inner.set_override_channel_parameters(input);
175        self
176    }
177    /// <p>The channel-specific parameters used to render and deliver the one-time passcode for this request. The route that is derived from the channel and the origination identity selects the matching channel. When you do not specify channel parameters, the service uses the parameters from the referenced notify code configuration.</p>
178    pub fn get_override_channel_parameters(&self) -> &::std::option::Option<crate::types::ChannelParameters> {
179        self.inner.get_override_channel_parameters()
180    }
181    /// <p>The per-send overrides for the passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. These values override the values from the referenced notify code configuration. When you do not specify a value, the value from the configuration is used, and if neither is set, the service default applies.</p>
182    pub fn override_code_configuration_parameters(mut self, input: crate::types::CodeConfigurationParameters) -> Self {
183        self.inner = self.inner.override_code_configuration_parameters(input);
184        self
185    }
186    /// <p>The per-send overrides for the passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. These values override the values from the referenced notify code configuration. When you do not specify a value, the value from the configuration is used, and if neither is set, the service default applies.</p>
187    pub fn set_override_code_configuration_parameters(mut self, input: ::std::option::Option<crate::types::CodeConfigurationParameters>) -> Self {
188        self.inner = self.inner.set_override_code_configuration_parameters(input);
189        self
190    }
191    /// <p>The per-send overrides for the passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. These values override the values from the referenced notify code configuration. When you do not specify a value, the value from the configuration is used, and if neither is set, the service default applies.</p>
192    pub fn get_override_code_configuration_parameters(&self) -> &::std::option::Option<crate::types::CodeConfigurationParameters> {
193        self.inner.get_override_code_configuration_parameters()
194    }
195    /// <p>The name of the configuration set used to control how delivery events for the message are handled.</p>
196    pub fn configuration_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.configuration_set_name(input.into());
198        self
199    }
200    /// <p>The name of the configuration set used to control how delivery events for the message are handled.</p>
201    pub fn set_configuration_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_configuration_set_name(input);
203        self
204    }
205    /// <p>The name of the configuration set used to control how delivery events for the message are handled.</p>
206    pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_configuration_set_name()
208    }
209    ///
210    /// Adds a key-value pair to `context`.
211    ///
212    /// To override the contents of this collection use [`set_context`](Self::set_context).
213    ///
214    /// <p>A map of custom key and value pairs that are propagated to the delivery events for this verification.</p>
215    pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.inner = self.inner.context(k.into(), v.into());
217        self
218    }
219    /// <p>A map of custom key and value pairs that are propagated to the delivery events for this verification.</p>
220    pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
221        self.inner = self.inner.set_context(input);
222        self
223    }
224    /// <p>A map of custom key and value pairs that are propagated to the delivery events for this verification.</p>
225    pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
226        self.inner.get_context()
227    }
228    /// <p>A caller-supplied reference identifier that binds a send request to a later validate request. Specify the same value in both requests.</p>
229    pub fn reference_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.inner = self.inner.reference_id(input.into());
231        self
232    }
233    /// <p>A caller-supplied reference identifier that binds a send request to a later validate request. Specify the same value in both requests.</p>
234    pub fn set_reference_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.inner = self.inner.set_reference_id(input);
236        self
237    }
238    /// <p>A caller-supplied reference identifier that binds a send request to a later validate request. Specify the same value in both requests.</p>
239    pub fn get_reference_id(&self) -> &::std::option::Option<::std::string::String> {
240        self.inner.get_reference_id()
241    }
242}