Skip to content

delete_template

delete_template(
    domain_id: DomainId,
    template_id: TemplateId,
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
) -> DeleteTemplateResponse

Deletes a cases template. You can delete up to 100 templates per domain.

After a cases template is deleted:

  • You can still retrieve the template by calling GetTemplate.

  • You cannot update the template.

  • You cannot create a case by using the deleted template.

  • Deleted templates are not included in the ListTemplates response.

Parameters:

  • domain_id (DomainId) –

    The unique identifier of the Cases domain.

  • template_id (TemplateId) –

    A unique identifier of a template.

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.

  • 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 delete_template(
    self,
    domain_id: "capo_connectcases.types.domain_id.DomainId",
    template_id: "capo_connectcases.types.template_id.TemplateId",
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
) -> "capo_connectcases.types.delete_template_response.DeleteTemplateResponse":
    """<p>Deletes a cases template. You can delete up to 100 templates per domain.</p> <p>After a cases template is deleted:</p> <ul> <li> <p>You can still retrieve the template by calling <code>GetTemplate</code>.</p> </li> <li> <p>You cannot update the template. </p> </li> <li> <p>You cannot create a case by using the deleted template.</p> </li> <li> <p>Deleted templates are not included in the <code>ListTemplates</code> response.</p> </li> </ul>

    Args:
        domain_id: <p>The unique identifier of the Cases domain.</p>
        template_id: <p>A unique identifier of a template.</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.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.delete_template_request.DeleteTemplateRequest]",
    ) -> OperationResponse[
        "capo_connectcases.types.delete_template_response.DeleteTemplateResponse"
    ]:
        import capo_connectcases._operations.amazon_connect_cases.delete_template

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteTemplate")
    )
    input_: capo_connectcases.types.delete_template_request.DeleteTemplateRequest = {
        "domain_id": domain_id,
        "template_id": template_id,
    }

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