Skip to main content

templates

Creates, updates, deletes, gets or lists a templates resource.

Overview

Nametemplates
TypeResource
Idaws.connectcases.templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the template. (pattern: <code>.*[\S]</code>)
created_timestring (date-time)Timestamp at which the resource was created.
deletedbooleanDenotes whether or not the resource has been deleted.
descriptionstringA brief description of the template.
last_modified_timestring (date-time)Timestamp at which the resource was created or last modified.
layout_configurationobjectObject to store configuration of layouts associated to the template.
required_fieldsarrayA list of fields that must contain a value for a case to be successfully created with this template.
rulesarrayA list of case rules (also known as case field conditions) on a template.
statusstringThe status of the template. (Active, Inactive)
tag_propagation_configurationsarrayDefines 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.
tagsobjectA map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.
template_arnstringThe Amazon Resource Name (ARN) of the template.
template_idstringA unique identifier of a template.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_templateselectdomain_id, template_id, regionReturns the details for the requested template. Other template APIs are: CreateTemplate DeleteTemplate ListTemplates UpdateTemplate
list_templatesselectdomain_id, regionmaxResults, nextToken, statusLists all of the templates in a Cases domain. Each list item is a condensed summary object of the template. Other template APIs are: CreateTemplate DeleteTemplate GetTemplate UpdateTemplate
create_templateinsertdomain_id, region, nameCreates a template in the Cases domain. This template is used to define the case object model (that is, to define what data can be captured on cases) in a Cases domain. A template must have a unique name within a domain, and it must reference existing field IDs and layout IDs. Additionally, multiple fields with same IDs are not allowed within the same Template. A template can be either Active or Inactive, as indicated by its status. Inactive templates cannot be used to create cases. Other template APIs are: DeleteTemplate GetTemplate ListTemplates UpdateTemplate
update_templateupdatedomain_id, template_id, regionUpdates 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: CreateTemplate DeleteTemplate GetTemplate ListTemplates
delete_templatedeletedomain_id, template_id, regionDeletes 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

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
domain_idstringThe unique identifier of the Cases domain.
regionstringAWS region (default: us-east-1)
template_idstringA unique identifier of a template.
maxResultsintegerThe maximum number of results to return per page.
nextTokenstringThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
statusarrayA list of status values to filter on.

SELECT examples

Returns the details for the requested template. Other template APIs are: CreateTemplate DeleteTemplate ListTemplates UpdateTemplate

SELECT
name,
created_time,
deleted,
description,
last_modified_time,
layout_configuration,
required_fields,
rules,
status,
tag_propagation_configurations,
tags,
template_arn,
template_id
FROM aws.connectcases.templates
WHERE domain_id = '{{ domain_id }}' -- required
AND template_id = '{{ template_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a template in the Cases domain. This template is used to define the case object model (that is, to define what data can be captured on cases) in a Cases domain. A template must have a unique name within a domain, and it must reference existing field IDs and layout IDs. Additionally, multiple fields with same IDs are not allowed within the same Template. A template can be either Active or Inactive, as indicated by its status. Inactive templates cannot be used to create cases. Other template APIs are: DeleteTemplate GetTemplate ListTemplates UpdateTemplate

INSERT INTO aws.connectcases.templates (
name,
description,
layoutConfiguration,
requiredFields,
status,
rules,
tagPropagationConfigurations,
domain_id,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ layoutConfiguration }}',
'{{ requiredFields }}',
'{{ status }}',
'{{ rules }}',
'{{ tagPropagationConfigurations }}',
'{{ domain_id }}',
'{{ region }}'
RETURNING
template_arn,
template_id
;

UPDATE examples

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: CreateTemplate DeleteTemplate GetTemplate ListTemplates

UPDATE aws.connectcases.templates
SET
name = '{{ name }}',
description = '{{ description }}',
layoutConfiguration = '{{ layoutConfiguration }}',
requiredFields = '{{ requiredFields }}',
status = '{{ status }}',
rules = '{{ rules }}',
tagPropagationConfigurations = '{{ tagPropagationConfigurations }}'
WHERE
domain_id = '{{ domain_id }}' --required
AND template_id = '{{ template_id }}' --required
AND region = '{{ region }}' --required;

DELETE examples

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.

DELETE FROM aws.connectcases.templates
WHERE domain_id = '{{ domain_id }}' --required
AND template_id = '{{ template_id }}' --required
AND region = '{{ region }}' --required
;