// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_contact_task_template::_update_contact_task_template_input::UpdateContactTaskTemplateInputBuilder;
pub use crate::operation::update_contact_task_template::_update_contact_task_template_output::UpdateContactTaskTemplateOutputBuilder;
impl crate::operation::update_contact_task_template::builders::UpdateContactTaskTemplateInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::update_contact_task_template::UpdateContactTaskTemplateOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_contact_task_template::UpdateContactTaskTemplateError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.update_contact_task_template();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `UpdateContactTaskTemplate`.
///
/// <p>Updates the task template association on an existing task contact. You can update the task template on a contact before assignment to support tasks that are created without a template (for example <a href="https://docs.aws.amazon.com/connect/latest/adminguide/connect-rules.html">Rules</a> or <a href="https://docs.aws.amazon.com/connect/latest/adminguide/set-disconnect-flow.html">disconnect flows</a>) or change the agent interaction form to represent the latest task data (for example an initial request that was submitted as a refund gets updated to an account cancellation and requires a new template).</p>
/// <p>This operation can only be used with task contacts that are in progress and not connected to an agent. A task template can be updated a maximum of 5 times per contact.</p>
/// <p>The task's references must be compatible with the fields of the target task template. If the target template has a required field, the task must have a corresponding reference with a matching name and compatible type. The following task template field types map to reference types:</p>
/// <ul>
/// <li>
/// <p><code>TEXT</code>, <code>TEXT_AREA</code>, <code>BOOLEAN</code>, and <code>SINGLE_SELECT</code> map to references of type <code>STRING</code>.</p></li>
/// <li>
/// <p><code>NUMBER</code> maps to references of type <code>NUMBER</code>.</p></li>
/// <li>
/// <p><code>DATE_TIME</code> maps to references of type <code>DATE</code>.</p></li>
/// <li>
/// <p><code>URL</code> maps to references of type <code>URL</code>.</p></li>
/// <li>
/// <p><code>EMAIL</code> maps to references of type <code>EMAIL</code>.</p></li>
/// </ul>
/// <p>References corresponding to <code>TEXT</code> fields must be fewer than 512 characters. <code>TEXT_AREA</code> fields must be fewer than 4,096 characters. <code>BOOLEAN</code> fields must have a value of <code>true</code> or <code>false</code>.</p>
/// <p>An <code>InvalidRequestException</code> occurs when <code>UpdateContactTaskTemplate</code> is called on a connected or terminated task, when it is called on non-task contacts, and when the task contact already uses the provided task template. A <code>PropertyValidationException</code> occurs when the task's references conflict with the task template's fields, for example if the task is missing a reference that matches a required field, or if the task has a reference that matches a required field's name but not its datatype.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateContactTaskTemplateFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::update_contact_task_template::builders::UpdateContactTaskTemplateInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::update_contact_task_template::UpdateContactTaskTemplateOutput,
crate::operation::update_contact_task_template::UpdateContactTaskTemplateError,
> for UpdateContactTaskTemplateFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::update_contact_task_template::UpdateContactTaskTemplateOutput,
crate::operation::update_contact_task_template::UpdateContactTaskTemplateError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl UpdateContactTaskTemplateFluentBuilder {
/// Creates a new `UpdateContactTaskTemplateFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the UpdateContactTaskTemplate as a reference.
pub fn as_input(&self) -> &crate::operation::update_contact_task_template::builders::UpdateContactTaskTemplateInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::update_contact_task_template::UpdateContactTaskTemplateOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_contact_task_template::UpdateContactTaskTemplateError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::update_contact_task_template::UpdateContactTaskTemplate::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::update_contact_task_template::UpdateContactTaskTemplate::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::update_contact_task_template::UpdateContactTaskTemplateOutput,
crate::operation::update_contact_task_template::UpdateContactTaskTemplateError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The identifier of the Connect Customer 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>
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.instance_id(input.into());
self
}
/// <p>The identifier of the Connect Customer 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>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_instance_id(input);
self
}
/// <p>The identifier of the Connect Customer 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>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_instance_id()
}
/// <p>A unique identifier for the task template. For more information about task templates, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/task-templates.html">Task templates</a> in the <i>Connect Customer Administrator Guide</i>.</p>
pub fn task_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.task_template_id(input.into());
self
}
/// <p>A unique identifier for the task template. For more information about task templates, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/task-templates.html">Task templates</a> in the <i>Connect Customer Administrator Guide</i>.</p>
pub fn set_task_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_task_template_id(input);
self
}
/// <p>A unique identifier for the task template. For more information about task templates, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/task-templates.html">Task templates</a> in the <i>Connect Customer Administrator Guide</i>.</p>
pub fn get_task_template_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_task_template_id()
}
/// <p>The identifier of the contact in this instance of Connect Customer.</p>
pub fn contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.contact_id(input.into());
self
}
/// <p>The identifier of the contact in this instance of Connect Customer.</p>
pub fn set_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_contact_id(input);
self
}
/// <p>The identifier of the contact in this instance of Connect Customer.</p>
pub fn get_contact_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_contact_id()
}
}