aws_sdk_customerprofiles/operation/create_profile/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_profile::_create_profile_output::CreateProfileOutputBuilder;
3
4pub use crate::operation::create_profile::_create_profile_input::CreateProfileInputBuilder;
5
6impl crate::operation::create_profile::builders::CreateProfileInputBuilder {
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::create_profile::CreateProfileOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_profile::CreateProfileError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_profile();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateProfile`.
24///
25/// <p>Creates a standard profile.</p>
26/// <p>A standard profile represents the following attributes for a customer profile in a domain.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateProfileFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_profile::builders::CreateProfileInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_profile::CreateProfileOutput,
36        crate::operation::create_profile::CreateProfileError,
37    > for CreateProfileFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_profile::CreateProfileOutput,
45            crate::operation::create_profile::CreateProfileError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateProfileFluentBuilder {
52    /// Creates a new `CreateProfileFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateProfile as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_profile::builders::CreateProfileInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_profile::CreateProfileOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_profile::CreateProfileError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_profile::CreateProfile::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_profile::CreateProfile::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_profile::CreateProfileOutput,
98        crate::operation::create_profile::CreateProfileError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The unique name of the domain.</p>
113    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.domain_name(input.into());
115        self
116    }
117    /// <p>The unique name of the domain.</p>
118    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_domain_name(input);
120        self
121    }
122    /// <p>The unique name of the domain.</p>
123    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_domain_name()
125    }
126    /// <p>An account number that you have assigned to the customer.</p>
127    pub fn account_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.account_number(input.into());
129        self
130    }
131    /// <p>An account number that you have assigned to the customer.</p>
132    pub fn set_account_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_account_number(input);
134        self
135    }
136    /// <p>An account number that you have assigned to the customer.</p>
137    pub fn get_account_number(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_account_number()
139    }
140    /// <p>Any additional information relevant to the customer’s profile.</p>
141    pub fn additional_information(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.additional_information(input.into());
143        self
144    }
145    /// <p>Any additional information relevant to the customer’s profile.</p>
146    pub fn set_additional_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_additional_information(input);
148        self
149    }
150    /// <p>Any additional information relevant to the customer’s profile.</p>
151    pub fn get_additional_information(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_additional_information()
153    }
154    /// <p>The type of profile used to describe the customer.</p>
155    pub fn party_type(mut self, input: crate::types::PartyType) -> Self {
156        self.inner = self.inner.party_type(input);
157        self
158    }
159    /// <p>The type of profile used to describe the customer.</p>
160    pub fn set_party_type(mut self, input: ::std::option::Option<crate::types::PartyType>) -> Self {
161        self.inner = self.inner.set_party_type(input);
162        self
163    }
164    /// <p>The type of profile used to describe the customer.</p>
165    pub fn get_party_type(&self) -> &::std::option::Option<crate::types::PartyType> {
166        self.inner.get_party_type()
167    }
168    /// <p>The name of the customer’s business.</p>
169    pub fn business_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.business_name(input.into());
171        self
172    }
173    /// <p>The name of the customer’s business.</p>
174    pub fn set_business_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.inner = self.inner.set_business_name(input);
176        self
177    }
178    /// <p>The name of the customer’s business.</p>
179    pub fn get_business_name(&self) -> &::std::option::Option<::std::string::String> {
180        self.inner.get_business_name()
181    }
182    /// <p>The customer’s first name.</p>
183    pub fn first_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.first_name(input.into());
185        self
186    }
187    /// <p>The customer’s first name.</p>
188    pub fn set_first_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_first_name(input);
190        self
191    }
192    /// <p>The customer’s first name.</p>
193    pub fn get_first_name(&self) -> &::std::option::Option<::std::string::String> {
194        self.inner.get_first_name()
195    }
196    /// <p>The customer’s middle name.</p>
197    pub fn middle_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.inner = self.inner.middle_name(input.into());
199        self
200    }
201    /// <p>The customer’s middle name.</p>
202    pub fn set_middle_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.inner = self.inner.set_middle_name(input);
204        self
205    }
206    /// <p>The customer’s middle name.</p>
207    pub fn get_middle_name(&self) -> &::std::option::Option<::std::string::String> {
208        self.inner.get_middle_name()
209    }
210    /// <p>The customer’s last name.</p>
211    pub fn last_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.last_name(input.into());
213        self
214    }
215    /// <p>The customer’s last name.</p>
216    pub fn set_last_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217        self.inner = self.inner.set_last_name(input);
218        self
219    }
220    /// <p>The customer’s last name.</p>
221    pub fn get_last_name(&self) -> &::std::option::Option<::std::string::String> {
222        self.inner.get_last_name()
223    }
224    /// <p>The customer’s birth date.</p>
225    pub fn birth_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226        self.inner = self.inner.birth_date(input.into());
227        self
228    }
229    /// <p>The customer’s birth date.</p>
230    pub fn set_birth_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231        self.inner = self.inner.set_birth_date(input);
232        self
233    }
234    /// <p>The customer’s birth date.</p>
235    pub fn get_birth_date(&self) -> &::std::option::Option<::std::string::String> {
236        self.inner.get_birth_date()
237    }
238    /// <p>The gender with which the customer identifies.</p>
239    pub fn gender(mut self, input: crate::types::Gender) -> Self {
240        self.inner = self.inner.gender(input);
241        self
242    }
243    /// <p>The gender with which the customer identifies.</p>
244    pub fn set_gender(mut self, input: ::std::option::Option<crate::types::Gender>) -> Self {
245        self.inner = self.inner.set_gender(input);
246        self
247    }
248    /// <p>The gender with which the customer identifies.</p>
249    pub fn get_gender(&self) -> &::std::option::Option<crate::types::Gender> {
250        self.inner.get_gender()
251    }
252    /// <p>The customer’s phone number, which has not been specified as a mobile, home, or business number.</p>
253    pub fn phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254        self.inner = self.inner.phone_number(input.into());
255        self
256    }
257    /// <p>The customer’s phone number, which has not been specified as a mobile, home, or business number.</p>
258    pub fn set_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
259        self.inner = self.inner.set_phone_number(input);
260        self
261    }
262    /// <p>The customer’s phone number, which has not been specified as a mobile, home, or business number.</p>
263    pub fn get_phone_number(&self) -> &::std::option::Option<::std::string::String> {
264        self.inner.get_phone_number()
265    }
266    /// <p>The customer’s mobile phone number.</p>
267    pub fn mobile_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        self.inner = self.inner.mobile_phone_number(input.into());
269        self
270    }
271    /// <p>The customer’s mobile phone number.</p>
272    pub fn set_mobile_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
273        self.inner = self.inner.set_mobile_phone_number(input);
274        self
275    }
276    /// <p>The customer’s mobile phone number.</p>
277    pub fn get_mobile_phone_number(&self) -> &::std::option::Option<::std::string::String> {
278        self.inner.get_mobile_phone_number()
279    }
280    /// <p>The customer’s home phone number.</p>
281    pub fn home_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282        self.inner = self.inner.home_phone_number(input.into());
283        self
284    }
285    /// <p>The customer’s home phone number.</p>
286    pub fn set_home_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287        self.inner = self.inner.set_home_phone_number(input);
288        self
289    }
290    /// <p>The customer’s home phone number.</p>
291    pub fn get_home_phone_number(&self) -> &::std::option::Option<::std::string::String> {
292        self.inner.get_home_phone_number()
293    }
294    /// <p>The customer’s business phone number.</p>
295    pub fn business_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
296        self.inner = self.inner.business_phone_number(input.into());
297        self
298    }
299    /// <p>The customer’s business phone number.</p>
300    pub fn set_business_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301        self.inner = self.inner.set_business_phone_number(input);
302        self
303    }
304    /// <p>The customer’s business phone number.</p>
305    pub fn get_business_phone_number(&self) -> &::std::option::Option<::std::string::String> {
306        self.inner.get_business_phone_number()
307    }
308    /// <p>The customer’s email address, which has not been specified as a personal or business address.</p>
309    pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
310        self.inner = self.inner.email_address(input.into());
311        self
312    }
313    /// <p>The customer’s email address, which has not been specified as a personal or business address.</p>
314    pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
315        self.inner = self.inner.set_email_address(input);
316        self
317    }
318    /// <p>The customer’s email address, which has not been specified as a personal or business address.</p>
319    pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
320        self.inner.get_email_address()
321    }
322    /// <p>The customer’s personal email address.</p>
323    pub fn personal_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
324        self.inner = self.inner.personal_email_address(input.into());
325        self
326    }
327    /// <p>The customer’s personal email address.</p>
328    pub fn set_personal_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
329        self.inner = self.inner.set_personal_email_address(input);
330        self
331    }
332    /// <p>The customer’s personal email address.</p>
333    pub fn get_personal_email_address(&self) -> &::std::option::Option<::std::string::String> {
334        self.inner.get_personal_email_address()
335    }
336    /// <p>The customer’s business email address.</p>
337    pub fn business_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
338        self.inner = self.inner.business_email_address(input.into());
339        self
340    }
341    /// <p>The customer’s business email address.</p>
342    pub fn set_business_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
343        self.inner = self.inner.set_business_email_address(input);
344        self
345    }
346    /// <p>The customer’s business email address.</p>
347    pub fn get_business_email_address(&self) -> &::std::option::Option<::std::string::String> {
348        self.inner.get_business_email_address()
349    }
350    /// <p>A generic address associated with the customer that is not mailing, shipping, or billing.</p>
351    pub fn address(mut self, input: crate::types::Address) -> Self {
352        self.inner = self.inner.address(input);
353        self
354    }
355    /// <p>A generic address associated with the customer that is not mailing, shipping, or billing.</p>
356    pub fn set_address(mut self, input: ::std::option::Option<crate::types::Address>) -> Self {
357        self.inner = self.inner.set_address(input);
358        self
359    }
360    /// <p>A generic address associated with the customer that is not mailing, shipping, or billing.</p>
361    pub fn get_address(&self) -> &::std::option::Option<crate::types::Address> {
362        self.inner.get_address()
363    }
364    /// <p>The customer’s shipping address.</p>
365    pub fn shipping_address(mut self, input: crate::types::Address) -> Self {
366        self.inner = self.inner.shipping_address(input);
367        self
368    }
369    /// <p>The customer’s shipping address.</p>
370    pub fn set_shipping_address(mut self, input: ::std::option::Option<crate::types::Address>) -> Self {
371        self.inner = self.inner.set_shipping_address(input);
372        self
373    }
374    /// <p>The customer’s shipping address.</p>
375    pub fn get_shipping_address(&self) -> &::std::option::Option<crate::types::Address> {
376        self.inner.get_shipping_address()
377    }
378    /// <p>The customer’s mailing address.</p>
379    pub fn mailing_address(mut self, input: crate::types::Address) -> Self {
380        self.inner = self.inner.mailing_address(input);
381        self
382    }
383    /// <p>The customer’s mailing address.</p>
384    pub fn set_mailing_address(mut self, input: ::std::option::Option<crate::types::Address>) -> Self {
385        self.inner = self.inner.set_mailing_address(input);
386        self
387    }
388    /// <p>The customer’s mailing address.</p>
389    pub fn get_mailing_address(&self) -> &::std::option::Option<crate::types::Address> {
390        self.inner.get_mailing_address()
391    }
392    /// <p>The customer’s billing address.</p>
393    pub fn billing_address(mut self, input: crate::types::Address) -> Self {
394        self.inner = self.inner.billing_address(input);
395        self
396    }
397    /// <p>The customer’s billing address.</p>
398    pub fn set_billing_address(mut self, input: ::std::option::Option<crate::types::Address>) -> Self {
399        self.inner = self.inner.set_billing_address(input);
400        self
401    }
402    /// <p>The customer’s billing address.</p>
403    pub fn get_billing_address(&self) -> &::std::option::Option<crate::types::Address> {
404        self.inner.get_billing_address()
405    }
406    ///
407    /// Adds a key-value pair to `Attributes`.
408    ///
409    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
410    ///
411    /// <p>A key value pair of attributes of a customer profile.</p>
412    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
413        self.inner = self.inner.attributes(k.into(), v.into());
414        self
415    }
416    /// <p>A key value pair of attributes of a customer profile.</p>
417    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
418        self.inner = self.inner.set_attributes(input);
419        self
420    }
421    /// <p>A key value pair of attributes of a customer profile.</p>
422    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
423        self.inner.get_attributes()
424    }
425    /// <p>An alternative to <code>PartyType</code> which accepts any string as input.</p>
426    pub fn party_type_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
427        self.inner = self.inner.party_type_string(input.into());
428        self
429    }
430    /// <p>An alternative to <code>PartyType</code> which accepts any string as input.</p>
431    pub fn set_party_type_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
432        self.inner = self.inner.set_party_type_string(input);
433        self
434    }
435    /// <p>An alternative to <code>PartyType</code> which accepts any string as input.</p>
436    pub fn get_party_type_string(&self) -> &::std::option::Option<::std::string::String> {
437        self.inner.get_party_type_string()
438    }
439    /// <p>An alternative to <code>Gender</code> which accepts any string as input.</p>
440    pub fn gender_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
441        self.inner = self.inner.gender_string(input.into());
442        self
443    }
444    /// <p>An alternative to <code>Gender</code> which accepts any string as input.</p>
445    pub fn set_gender_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
446        self.inner = self.inner.set_gender_string(input);
447        self
448    }
449    /// <p>An alternative to <code>Gender</code> which accepts any string as input.</p>
450    pub fn get_gender_string(&self) -> &::std::option::Option<::std::string::String> {
451        self.inner.get_gender_string()
452    }
453    /// <p>The type of the profile.</p>
454    pub fn profile_type(mut self, input: crate::types::ProfileType) -> Self {
455        self.inner = self.inner.profile_type(input);
456        self
457    }
458    /// <p>The type of the profile.</p>
459    pub fn set_profile_type(mut self, input: ::std::option::Option<crate::types::ProfileType>) -> Self {
460        self.inner = self.inner.set_profile_type(input);
461        self
462    }
463    /// <p>The type of the profile.</p>
464    pub fn get_profile_type(&self) -> &::std::option::Option<crate::types::ProfileType> {
465        self.inner.get_profile_type()
466    }
467    /// <p>Object that defines the preferred methods of engagement, per channel.</p>
468    pub fn engagement_preferences(mut self, input: crate::types::EngagementPreferences) -> Self {
469        self.inner = self.inner.engagement_preferences(input);
470        self
471    }
472    /// <p>Object that defines the preferred methods of engagement, per channel.</p>
473    pub fn set_engagement_preferences(mut self, input: ::std::option::Option<crate::types::EngagementPreferences>) -> Self {
474        self.inner = self.inner.set_engagement_preferences(input);
475        self
476    }
477    /// <p>Object that defines the preferred methods of engagement, per channel.</p>
478    pub fn get_engagement_preferences(&self) -> &::std::option::Option<crate::types::EngagementPreferences> {
479        self.inner.get_engagement_preferences()
480    }
481}