Skip to content

update_template

update_template(
    domain_id: DomainId,
    template_id: TemplateId,
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
    name: Optional[TemplateName] = None,
    description: Optional[TemplateDescription] = None,
    layout_configuration: Optional[LayoutConfiguration] = None,
    required_fields: Optional[RequiredFieldList] = None,
    status: Optional[TemplateStatus] = None,
    rules: Optional[TemplateCaseRuleList] = None,
    tag_propagation_configurations: Optional[TagPropagationConfigurationList] = None,
) -> UpdateTemplateResponse

Updates the attributes of an existing template. The template attributes that can be modified include name, description, layoutConfiguration, requiredFields, and status. At least one of these attributes must not be null. If a null value is provided for a given attribute, that attribute is ignored and its current value is preserved.

Other template APIs are:

Parameters:

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.

  • InternalServerException –

    We couldn't process your request because of an issue with the server. Try again later.

  • ResourceNotFoundException –

    We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.

  • ServiceQuotaExceededException –

    The service quota has been exceeded. For a list of service quotas, see Amazon Connect Service Quotas in the Amazon Connect Administrator Guide.

  • ThrottlingException –

    The rate has been exceeded for this API. Please try again after a few minutes.

  • ValidationException –

    The request isn't valid. Check the syntax and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_connectcases/_services/connect_cases.py
def update_template(
    self,
    domain_id: "capo_connectcases.types.domain_id.DomainId",
    template_id: "capo_connectcases.types.template_id.TemplateId",
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
    name: Optional["capo_connectcases.types.template_name.TemplateName"] = None,
    description: Optional[
        "capo_connectcases.types.template_description.TemplateDescription"
    ] = None,
    layout_configuration: Optional[
        "capo_connectcases.types.layout_configuration.LayoutConfiguration"
    ] = None,
    required_fields: Optional[
        "capo_connectcases.types.required_field_list.RequiredFieldList"
    ] = None,
    status: Optional[
        "capo_connectcases.types.template_status.TemplateStatus"
    ] = None,
    rules: Optional[
        "capo_connectcases.types.template_case_rule_list.TemplateCaseRuleList"
    ] = None,
    tag_propagation_configurations: Optional[
        "capo_connectcases.types.tag_propagation_configuration_list.TagPropagationConfigurationList"
    ] = None,
) -> "capo_connectcases.types.update_template_response.UpdateTemplateResponse":
    """<p>Updates the attributes of an existing template. The template attributes that can be modified include <code>name</code>, <code>description</code>, <code>layoutConfiguration</code>, <code>requiredFields</code>, and <code>status</code>. At least one of these attributes must not be null. If a null value is provided for a given attribute, that attribute is ignored and its current value is preserved.</p> <p>Other template APIs are:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_CreateTemplate.html">CreateTemplate</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_DeleteTemplate.html">DeleteTemplate</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_GetTemplate.html">GetTemplate</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_ListTemplates.html">ListTemplates</a> </p> </li> </ul>

    Args:
        domain_id: <p>The unique identifier of the Cases domain. </p>
        template_id: <p>A unique identifier for the template.</p>
        name: <p>The name of the template. It must be unique per domain.</p>
        description: <p>A brief description of the template.</p>
        layout_configuration: <p>Configuration of layouts associated to the template.</p>
        required_fields: <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
        status: <p>The status of the template.</p>
        rules: <p>A list of case rules (also known as <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html">case field conditions</a>) on a template.</p>
        tag_propagation_configurations: <p>Defines tag propagation configuration for resources created within a domain. Tags specified here will be automatically applied to resources being created for the specified resource type.</p>

    Raises:
        capo_connectcases.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_connectcases.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.</p>
        capo_connectcases.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
        capo_connectcases.errors.resource_not_found_exception.ResourceNotFoundException: <p>We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.</p>
        capo_connectcases.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded. For a list of service quotas, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html">Amazon Connect Service Quotas</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
        capo_connectcases.errors.throttling_exception.ThrottlingException: <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
        capo_connectcases.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
        capo_connectcases.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connectcases.types.update_template_request.UpdateTemplateRequest]",
    ) -> OperationResponse[
        "capo_connectcases.types.update_template_response.UpdateTemplateResponse"
    ]:
        import capo_connectcases._operations.amazon_connect_cases.update_template

        output, http_response = (
            capo_connectcases._operations.amazon_connect_cases.update_template.update_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTemplate")
    )
    input_: capo_connectcases.types.update_template_request.UpdateTemplateRequest = {
        "domain_id": domain_id,
        "template_id": template_id,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if layout_configuration is not None:
        input_["layout_configuration"] = layout_configuration
    if required_fields is not None:
        input_["required_fields"] = required_fields
    if status is not None:
        input_["status"] = status
    if rules is not None:
        input_["rules"] = rules
    if tag_propagation_configurations is not None:
        input_["tag_propagation_configurations"] = tag_propagation_configurations

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output