aws_sdk_pinpointsmsvoicev2/operation/send_destination_number_verification_code/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::send_destination_number_verification_code::_send_destination_number_verification_code_output::SendDestinationNumberVerificationCodeOutputBuilder;
3
4pub use crate::operation::send_destination_number_verification_code::_send_destination_number_verification_code_input::SendDestinationNumberVerificationCodeInputBuilder;
5
6impl crate::operation::send_destination_number_verification_code::builders::SendDestinationNumberVerificationCodeInputBuilder {
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_destination_number_verification_code::SendDestinationNumberVerificationCodeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::send_destination_number_verification_code::SendDestinationNumberVerificationCodeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.send_destination_number_verification_code();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SendDestinationNumberVerificationCode`.
24///
25/// <p>Before you can send test messages to a verified destination phone number you need to opt-in the verified destination phone number. Creates a new text message with a verification code and send it to a verified destination phone number. Once you have the verification code use <code>VerifyDestinationNumber</code> to opt-in the verified destination phone number to receive messages.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SendDestinationNumberVerificationCodeFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::send_destination_number_verification_code::builders::SendDestinationNumberVerificationCodeInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::send_destination_number_verification_code::SendDestinationNumberVerificationCodeOutput,
35        crate::operation::send_destination_number_verification_code::SendDestinationNumberVerificationCodeError,
36    > for SendDestinationNumberVerificationCodeFluentBuilder
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_destination_number_verification_code::SendDestinationNumberVerificationCodeOutput,
44            crate::operation::send_destination_number_verification_code::SendDestinationNumberVerificationCodeError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl SendDestinationNumberVerificationCodeFluentBuilder {
51    /// Creates a new `SendDestinationNumberVerificationCodeFluentBuilder`.
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 SendDestinationNumberVerificationCode as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::send_destination_number_verification_code::builders::SendDestinationNumberVerificationCodeInputBuilder {
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::send_destination_number_verification_code::SendDestinationNumberVerificationCodeOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::send_destination_number_verification_code::SendDestinationNumberVerificationCodeError,
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::send_destination_number_verification_code::SendDestinationNumberVerificationCode::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::send_destination_number_verification_code::SendDestinationNumberVerificationCode::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::send_destination_number_verification_code::SendDestinationNumberVerificationCodeOutput,
100        crate::operation::send_destination_number_verification_code::SendDestinationNumberVerificationCodeError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The unique identifier for the verified destination phone number.</p>
115    pub fn verified_destination_number_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.verified_destination_number_id(input.into());
117        self
118    }
119    /// <p>The unique identifier for the verified destination phone number.</p>
120    pub fn set_verified_destination_number_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_verified_destination_number_id(input);
122        self
123    }
124    /// <p>The unique identifier for the verified destination phone number.</p>
125    pub fn get_verified_destination_number_id(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_verified_destination_number_id()
127    }
128    /// <p>Choose to send the verification code as an SMS or voice message.</p>
129    pub fn verification_channel(mut self, input: crate::types::VerificationChannel) -> Self {
130        self.inner = self.inner.verification_channel(input);
131        self
132    }
133    /// <p>Choose to send the verification code as an SMS or voice message.</p>
134    pub fn set_verification_channel(mut self, input: ::std::option::Option<crate::types::VerificationChannel>) -> Self {
135        self.inner = self.inner.set_verification_channel(input);
136        self
137    }
138    /// <p>Choose to send the verification code as an SMS or voice message.</p>
139    pub fn get_verification_channel(&self) -> &::std::option::Option<crate::types::VerificationChannel> {
140        self.inner.get_verification_channel()
141    }
142    /// <p>Choose the language to use for the message.</p>
143    pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
144        self.inner = self.inner.language_code(input);
145        self
146    }
147    /// <p>Choose the language to use for the message.</p>
148    pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::LanguageCode>) -> Self {
149        self.inner = self.inner.set_language_code(input);
150        self
151    }
152    /// <p>Choose the language to use for the message.</p>
153    pub fn get_language_code(&self) -> &::std::option::Option<crate::types::LanguageCode> {
154        self.inner.get_language_code()
155    }
156    /// <p>The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.</p><important>
157    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
158    /// </important>
159    pub fn origination_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.origination_identity(input.into());
161        self
162    }
163    /// <p>The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.</p><important>
164    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
165    /// </important>
166    pub fn set_origination_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_origination_identity(input);
168        self
169    }
170    /// <p>The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.</p><important>
171    /// <p>If you are using a shared End User MessagingSMS resource then you must use the full Amazon Resource Name(ARN).</p>
172    /// </important>
173    pub fn get_origination_identity(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_origination_identity()
175    }
176    /// <p>The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.</p>
177    pub fn configuration_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.configuration_set_name(input.into());
179        self
180    }
181    /// <p>The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.</p>
182    pub fn set_configuration_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_configuration_set_name(input);
184        self
185    }
186    /// <p>The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.</p>
187    pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_configuration_set_name()
189    }
190    ///
191    /// Adds a key-value pair to `Context`.
192    ///
193    /// To override the contents of this collection use [`set_context`](Self::set_context).
194    ///
195    /// <p>You can specify custom data in this field. If you do, that data is logged to the event destination.</p>
196    pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.context(k.into(), v.into());
198        self
199    }
200    /// <p>You can specify custom data in this field. If you do, that data is logged to the event destination.</p>
201    pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
202        self.inner = self.inner.set_context(input);
203        self
204    }
205    /// <p>You can specify custom data in this field. If you do, that data is logged to the event destination.</p>
206    pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
207        self.inner.get_context()
208    }
209    ///
210    /// Adds a key-value pair to `DestinationCountryParameters`.
211    ///
212    /// To override the contents of this collection use [`set_destination_country_parameters`](Self::set_destination_country_parameters).
213    ///
214    /// <p>This field is used for any country-specific registration requirements. Currently, this setting is only used when you send messages to recipients in India using a sender ID. For more information see <a href="https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-senderid-india.html">Special requirements for sending SMS messages to recipients in India</a>.</p>
215    pub fn destination_country_parameters(
216        mut self,
217        k: crate::types::DestinationCountryParameterKey,
218        v: impl ::std::convert::Into<::std::string::String>,
219    ) -> Self {
220        self.inner = self.inner.destination_country_parameters(k, v.into());
221        self
222    }
223    /// <p>This field is used for any country-specific registration requirements. Currently, this setting is only used when you send messages to recipients in India using a sender ID. For more information see <a href="https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-senderid-india.html">Special requirements for sending SMS messages to recipients in India</a>.</p>
224    pub fn set_destination_country_parameters(
225        mut self,
226        input: ::std::option::Option<::std::collections::HashMap<crate::types::DestinationCountryParameterKey, ::std::string::String>>,
227    ) -> Self {
228        self.inner = self.inner.set_destination_country_parameters(input);
229        self
230    }
231    /// <p>This field is used for any country-specific registration requirements. Currently, this setting is only used when you send messages to recipients in India using a sender ID. For more information see <a href="https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-senderid-india.html">Special requirements for sending SMS messages to recipients in India</a>.</p>
232    pub fn get_destination_country_parameters(
233        &self,
234    ) -> &::std::option::Option<::std::collections::HashMap<crate::types::DestinationCountryParameterKey, ::std::string::String>> {
235        self.inner.get_destination_country_parameters()
236    }
237}