Skip to content

update_task_template async

update_task_template(
    task_template_id: TaskTemplateId,
    instance_id: InstanceId,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    name: Optional[TaskTemplateName] = None,
    description: Optional[TaskTemplateDescription] = None,
    contact_flow_id: Optional[ContactFlowId] = None,
    self_assign_flow_id: Optional[ContactFlowId] = None,
    constraints: Optional[TaskTemplateConstraints] = None,
    defaults: Optional[TaskTemplateDefaults] = None,
    status: Optional[TaskTemplateStatus] = None,
    fields: Optional[TaskTemplateFields] = None,
) -> UpdateTaskTemplateResponse

Updates details about a specific task template in the specified Connect Customer instance. This operation does not support partial updates. Instead it does a full update of template content.

Parameters:

  • task_template_id (TaskTemplateId) –

    A unique identifier for the task template.

  • instance_id (InstanceId) –

    The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • name (Optional[TaskTemplateName], default: None ) –

    The name of the task template.

  • description (Optional[TaskTemplateDescription], default: None ) –

    The description of the task template.

  • contact_flow_id (Optional[ContactFlowId], default: None ) –

    The identifier of the flow that runs by default when a task is created by referencing this template.

    Although this parameter is marked as optional, the request must contain either a ContactFlowId or a field of type QUICK_CONNECT.

  • self_assign_flow_id (Optional[ContactFlowId], default: None ) –

    The ContactFlowId for the flow that will be run if this template is used to create a self-assigned task.

  • constraints (Optional[TaskTemplateConstraints], default: None ) –

    Constraints that are applicable to the fields listed. Although this parameter is marked as optional in the API model, the service requires it when calling CreateTaskTemplate or UpdateTaskTemplate. The RequiredFields array must contain at least one element, and the field of type NAME must be included in RequiredFields.

  • defaults (Optional[TaskTemplateDefaults], default: None ) –

    The default values for fields when a task is created by referencing this template.

  • status (Optional[TaskTemplateStatus], default: None ) –

    Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be created from ACTIVE templates. If a template is marked as INACTIVE, then a task that refers to this template cannot be created.

    Although this parameter is marked as optional, the service requires it when calling UpdateTaskTemplate.

  • fields (Optional[TaskTemplateFields], default: None ) –

    Fields that are part of the template.

    The request must contain exactly one field of type NAME. This field must also be listed in the RequiredFields array within the Constraints parameter.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def update_task_template(
    self,
    task_template_id: "capo_connect.types.task_template_id.TaskTemplateId",
    instance_id: "capo_connect.types.instance_id.InstanceId",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    name: Optional["capo_connect.types.task_template_name.TaskTemplateName"] = None,
    description: Optional[
        "capo_connect.types.task_template_description.TaskTemplateDescription"
    ] = None,
    contact_flow_id: Optional[
        "capo_connect.types.contact_flow_id.ContactFlowId"
    ] = None,
    self_assign_flow_id: Optional[
        "capo_connect.types.contact_flow_id.ContactFlowId"
    ] = None,
    constraints: Optional[
        "capo_connect.types.task_template_constraints.TaskTemplateConstraints"
    ] = None,
    defaults: Optional[
        "capo_connect.types.task_template_defaults.TaskTemplateDefaults"
    ] = None,
    status: Optional[
        "capo_connect.types.task_template_status.TaskTemplateStatus"
    ] = None,
    fields: Optional[
        "capo_connect.types.task_template_fields.TaskTemplateFields"
    ] = None,
) -> "capo_connect.types.update_task_template_response.UpdateTaskTemplateResponse":
    """<p>Updates details about a specific task template in the specified Connect Customer instance. This operation does not support partial updates. Instead it does a full update of template content.</p>

    Args:
        task_template_id: <p>A unique identifier for the task template.</p>
        instance_id: <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>
        name: <p>The name of the task template.</p>
        description: <p>The description of the task template.</p>
        contact_flow_id: <p>The identifier of the flow that runs by default when a task is created by referencing this template.</p> <p>Although this parameter is marked as optional, the request must contain either a <code>ContactFlowId</code> or a field of type <code>QUICK_CONNECT</code>.</p>
        self_assign_flow_id: <p>The ContactFlowId for the flow that will be run if this template is used to create a self-assigned task.</p>
        constraints: <p>Constraints that are applicable to the fields listed. Although this parameter is marked as optional in the API model, the service requires it when calling <code>CreateTaskTemplate</code> or <code>UpdateTaskTemplate</code>. The <code>RequiredFields</code> array must contain at least one element, and the field of type <code>NAME</code> must be included in <code>RequiredFields</code>.</p>
        defaults: <p>The default values for fields when a task is created by referencing this template.</p>
        status: <p>Marks a template as <code>ACTIVE</code> or <code>INACTIVE</code> for a task to refer to it. Tasks can only be created from <code>ACTIVE</code> templates. If a template is marked as <code>INACTIVE</code>, then a task that refers to this template cannot be created.</p> <p>Although this parameter is marked as optional, the service requires it when calling <code>UpdateTaskTemplate</code>.</p>
        fields: <p>Fields that are part of the template.</p> <p>The request must contain exactly one field of type <code>NAME</code>. This field must also be listed in the <code>RequiredFields</code> array within the <code>Constraints</code> parameter.</p>

    Raises:
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.property_validation_exception.PropertyValidationException: <p>The property is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.update_task_template_request.UpdateTaskTemplateRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.update_task_template_response.UpdateTaskTemplateResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.update_task_template

        (
            output,
            http_response,
        ) = await capo_connect._operations.amazon_connect_service.update_task_template.async_update_task_template(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTaskTemplate")
    )
    input_: capo_connect.types.update_task_template_request.UpdateTaskTemplateRequest = {
        "task_template_id": task_template_id,
        "instance_id": instance_id,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if contact_flow_id is not None:
        input_["contact_flow_id"] = contact_flow_id
    if self_assign_flow_id is not None:
        input_["self_assign_flow_id"] = self_assign_flow_id
    if constraints is not None:
        input_["constraints"] = constraints
    if defaults is not None:
        input_["defaults"] = defaults
    if status is not None:
        input_["status"] = status
    if fields is not None:
        input_["fields"] = fields

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output