templates
Creates, updates, deletes, gets or lists a templates resource.
Overview
| Name | templates |
| Type | Resource |
| Id | aws.connectcases.templates |
Fields
The following fields are returned by SELECT queries:
- get_template
- list_templates
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the template. (pattern: <code>.*[\S]</code>) |
created_time | string (date-time) | Timestamp at which the resource was created. |
deleted | boolean | Denotes whether or not the resource has been deleted. |
description | string | A brief description of the template. |
last_modified_time | string (date-time) | Timestamp at which the resource was created or last modified. |
layout_configuration | object | Object to store configuration of layouts associated to the template. |
required_fields | array | A list of fields that must contain a value for a case to be successfully created with this template. |
rules | array | A list of case rules (also known as case field conditions) on a template. |
status | string | The status of the template. (Active, Inactive) |
tag_propagation_configurations | array | 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. |
tags | object | A 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_arn | string | The Amazon Resource Name (ARN) of the template. |
template_id | string | A unique identifier of a template. |
| Name | Datatype | Description |
|---|---|---|
next_token | string | The token for the next set of results. This is null if there are no more results to return. |
templates | array | List of template summary objects. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_template | select | domain_id, template_id, region | Returns the details for the requested template. Other template APIs are: CreateTemplate DeleteTemplate ListTemplates UpdateTemplate | |
list_templates | select | domain_id, region | maxResults, nextToken, status | Lists 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_template | insert | domain_id, region, name | 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 | |
update_template | update | domain_id, template_id, region | 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 | |
delete_template | delete | domain_id, template_id, region | 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
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.
| Name | Datatype | Description |
|---|---|---|
domain_id | string | The unique identifier of the Cases domain. |
region | string | AWS region (default: us-east-1) |
template_id | string | A unique identifier of a template. |
maxResults | integer | The maximum number of results to return per page. |
nextToken | string | The 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. |
status | array | A list of status values to filter on. |
SELECT examples
- get_template
- list_templates
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
;
Lists 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
SELECT
next_token,
templates
FROM aws.connectcases.templates
WHERE domain_id = '{{ domain_id }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
AND status = '{{ status }}'
;
INSERT examples
- create_template
- Manifest
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
;
# Description fields are for documentation purposes
- name: templates
props:
- name: domain_id
value: "{{ domain_id }}"
description: Required parameter for the templates resource.
- name: region
value: "{{ region }}"
description: Required parameter for the templates resource.
- name: name
value: "{{ name }}"
- name: description
value: "{{ description }}"
- name: layoutConfiguration
description: |
Object to store configuration of layouts associated to the template.
value:
defaultLayout: "{{ defaultLayout }}"
- name: requiredFields
value:
- fieldId: "{{ fieldId }}"
- name: status
value: "{{ status }}"
valid_values: ['Active', 'Inactive']
- name: rules
value:
- caseRuleId: "{{ caseRuleId }}"
fieldId: "{{ fieldId }}"
- name: tagPropagationConfigurations
value:
- resourceType: "{{ resourceType }}"
tagMap: "{{ tagMap }}"
UPDATE examples
- update_template
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
- delete_template
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
;