aws_sdk_connect/operation/create_contact/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_contact::_create_contact_output::CreateContactOutputBuilder;
3
4pub use crate::operation::create_contact::_create_contact_input::CreateContactInputBuilder;
5
6impl crate::operation::create_contact::builders::CreateContactInputBuilder {
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_contact::CreateContactOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_contact::CreateContactError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_contact();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateContact`.
24///
25/// <important>
26/// <p>Only the EMAIL channel is supported. The supported initiation methods are: OUTBOUND, AGENT_REPLY, and FLOW.</p>
27/// </important>
28/// <p>Creates a new EMAIL contact.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateContactFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_contact::builders::CreateContactInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_contact::CreateContactOutput,
38 crate::operation::create_contact::CreateContactError,
39 > for CreateContactFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_contact::CreateContactOutput,
47 crate::operation::create_contact::CreateContactError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateContactFluentBuilder {
54 /// Creates a new `CreateContactFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateContact as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_contact::builders::CreateContactInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_contact::CreateContactOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_contact::CreateContactError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_contact::CreateContact::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_contact::CreateContact::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::create_contact::CreateContactOutput,
100 crate::operation::create_contact::CreateContactError,
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 identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
115 pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.instance_id(input.into());
117 self
118 }
119 /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
120 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_instance_id(input);
122 self
123 }
124 /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
125 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_instance_id()
127 }
128 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
129 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.client_token(input.into());
131 self
132 }
133 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
134 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_client_token(input);
136 self
137 }
138 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
139 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_client_token()
141 }
142 /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
143 pub fn related_contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.related_contact_id(input.into());
145 self
146 }
147 /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
148 pub fn set_related_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.inner = self.inner.set_related_contact_id(input);
150 self
151 }
152 /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
153 pub fn get_related_contact_id(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_related_contact_id()
155 }
156 ///
157 /// Adds a key-value pair to `Attributes`.
158 ///
159 /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
160 ///
161 /// <p>A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in flows just like any other contact attributes.</p>
162 /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.</p>
163 pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
164 self.inner = self.inner.attributes(k.into(), v.into());
165 self
166 }
167 /// <p>A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in flows just like any other contact attributes.</p>
168 /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.</p>
169 pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
170 self.inner = self.inner.set_attributes(input);
171 self
172 }
173 /// <p>A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in flows just like any other contact attributes.</p>
174 /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.</p>
175 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
176 self.inner.get_attributes()
177 }
178 ///
179 /// Adds a key-value pair to `References`.
180 ///
181 /// To override the contents of this collection use [`set_references`](Self::set_references).
182 ///
183 /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the following reference types at the time of creation: URL | NUMBER | STRING | DATE | EMAIL | ATTACHMENT.</p>
184 pub fn references(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Reference) -> Self {
185 self.inner = self.inner.references(k.into(), v);
186 self
187 }
188 /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the following reference types at the time of creation: URL | NUMBER | STRING | DATE | EMAIL | ATTACHMENT.</p>
189 pub fn set_references(
190 mut self,
191 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Reference>>,
192 ) -> Self {
193 self.inner = self.inner.set_references(input);
194 self
195 }
196 /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the following reference types at the time of creation: URL | NUMBER | STRING | DATE | EMAIL | ATTACHMENT.</p>
197 pub fn get_references(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Reference>> {
198 self.inner.get_references()
199 }
200 /// <p>The channel for the contact</p><important>
201 /// <p>CreateContact only supports the EMAIL channel. The following information that states other channels are supported is incorrect. We are working to update this topic.</p>
202 /// </important>
203 pub fn channel(mut self, input: crate::types::Channel) -> Self {
204 self.inner = self.inner.channel(input);
205 self
206 }
207 /// <p>The channel for the contact</p><important>
208 /// <p>CreateContact only supports the EMAIL channel. The following information that states other channels are supported is incorrect. We are working to update this topic.</p>
209 /// </important>
210 pub fn set_channel(mut self, input: ::std::option::Option<crate::types::Channel>) -> Self {
211 self.inner = self.inner.set_channel(input);
212 self
213 }
214 /// <p>The channel for the contact</p><important>
215 /// <p>CreateContact only supports the EMAIL channel. The following information that states other channels are supported is incorrect. We are working to update this topic.</p>
216 /// </important>
217 pub fn get_channel(&self) -> &::std::option::Option<crate::types::Channel> {
218 self.inner.get_channel()
219 }
220 /// <p>Indicates how the contact was initiated.</p><important>
221 /// <p>CreateContact only supports the following initiation methods: OUTBOUND, AGENT_REPLY, and FLOW. The following information that states other initiation methods are supported is incorrect. We are working to update this topic.</p>
222 /// </important>
223 pub fn initiation_method(mut self, input: crate::types::ContactInitiationMethod) -> Self {
224 self.inner = self.inner.initiation_method(input);
225 self
226 }
227 /// <p>Indicates how the contact was initiated.</p><important>
228 /// <p>CreateContact only supports the following initiation methods: OUTBOUND, AGENT_REPLY, and FLOW. The following information that states other initiation methods are supported is incorrect. We are working to update this topic.</p>
229 /// </important>
230 pub fn set_initiation_method(mut self, input: ::std::option::Option<crate::types::ContactInitiationMethod>) -> Self {
231 self.inner = self.inner.set_initiation_method(input);
232 self
233 }
234 /// <p>Indicates how the contact was initiated.</p><important>
235 /// <p>CreateContact only supports the following initiation methods: OUTBOUND, AGENT_REPLY, and FLOW. The following information that states other initiation methods are supported is incorrect. We are working to update this topic.</p>
236 /// </important>
237 pub fn get_initiation_method(&self) -> &::std::option::Option<crate::types::ContactInitiationMethod> {
238 self.inner.get_initiation_method()
239 }
240 /// <p>Number of minutes the contact will be active for before expiring</p>
241 pub fn expiry_duration_in_minutes(mut self, input: i32) -> Self {
242 self.inner = self.inner.expiry_duration_in_minutes(input);
243 self
244 }
245 /// <p>Number of minutes the contact will be active for before expiring</p>
246 pub fn set_expiry_duration_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
247 self.inner = self.inner.set_expiry_duration_in_minutes(input);
248 self
249 }
250 /// <p>Number of minutes the contact will be active for before expiring</p>
251 pub fn get_expiry_duration_in_minutes(&self) -> &::std::option::Option<i32> {
252 self.inner.get_expiry_duration_in_minutes()
253 }
254 /// <p>User details for the contact</p>
255 pub fn user_info(mut self, input: crate::types::UserInfo) -> Self {
256 self.inner = self.inner.user_info(input);
257 self
258 }
259 /// <p>User details for the contact</p>
260 pub fn set_user_info(mut self, input: ::std::option::Option<crate::types::UserInfo>) -> Self {
261 self.inner = self.inner.set_user_info(input);
262 self
263 }
264 /// <p>User details for the contact</p>
265 pub fn get_user_info(&self) -> &::std::option::Option<crate::types::UserInfo> {
266 self.inner.get_user_info()
267 }
268 /// <p>Initial state of the contact when it's created</p>
269 pub fn initiate_as(mut self, input: crate::types::InitiateAs) -> Self {
270 self.inner = self.inner.initiate_as(input);
271 self
272 }
273 /// <p>Initial state of the contact when it's created</p>
274 pub fn set_initiate_as(mut self, input: ::std::option::Option<crate::types::InitiateAs>) -> Self {
275 self.inner = self.inner.set_initiate_as(input);
276 self
277 }
278 /// <p>Initial state of the contact when it's created</p>
279 pub fn get_initiate_as(&self) -> &::std::option::Option<crate::types::InitiateAs> {
280 self.inner.get_initiate_as()
281 }
282 /// <p>The name of a the contact.</p>
283 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
284 self.inner = self.inner.name(input.into());
285 self
286 }
287 /// <p>The name of a the contact.</p>
288 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
289 self.inner = self.inner.set_name(input);
290 self
291 }
292 /// <p>The name of a the contact.</p>
293 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
294 self.inner.get_name()
295 }
296 /// <p>A description of the contact.</p>
297 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
298 self.inner = self.inner.description(input.into());
299 self
300 }
301 /// <p>A description of the contact.</p>
302 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
303 self.inner = self.inner.set_description(input);
304 self
305 }
306 /// <p>A description of the contact.</p>
307 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
308 self.inner.get_description()
309 }
310 ///
311 /// Adds a key-value pair to `SegmentAttributes`.
312 ///
313 /// To override the contents of this collection use [`set_segment_attributes`](Self::set_segment_attributes).
314 ///
315 /// <p>A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
316 /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
317 /// <p>This field can be used to set Segment Contact Expiry as a duration in minutes.</p><note>
318 /// <p>To set contact expiry, a ValueMap must be specified containing the integer number of minutes the contact will be active for before expiring, with <code>SegmentAttributes</code> like { <code> "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger": 135}}}}</code>.</p>
319 /// </note>
320 pub fn segment_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::SegmentAttributeValue) -> Self {
321 self.inner = self.inner.segment_attributes(k.into(), v);
322 self
323 }
324 /// <p>A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
325 /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
326 /// <p>This field can be used to set Segment Contact Expiry as a duration in minutes.</p><note>
327 /// <p>To set contact expiry, a ValueMap must be specified containing the integer number of minutes the contact will be active for before expiring, with <code>SegmentAttributes</code> like { <code> "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger": 135}}}}</code>.</p>
328 /// </note>
329 pub fn set_segment_attributes(
330 mut self,
331 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SegmentAttributeValue>>,
332 ) -> Self {
333 self.inner = self.inner.set_segment_attributes(input);
334 self
335 }
336 /// <p>A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
337 /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
338 /// <p>This field can be used to set Segment Contact Expiry as a duration in minutes.</p><note>
339 /// <p>To set contact expiry, a ValueMap must be specified containing the integer number of minutes the contact will be active for before expiring, with <code>SegmentAttributes</code> like { <code> "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger": 135}}}}</code>.</p>
340 /// </note>
341 pub fn get_segment_attributes(
342 &self,
343 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SegmentAttributeValue>> {
344 self.inner.get_segment_attributes()
345 }
346}