updateTemplate method
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:
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter domainId :
The unique identifier of the Cases domain.
Parameter templateId :
A unique identifier for the template.
Parameter description :
A brief description of the template.
Parameter layoutConfiguration :
Configuration of layouts associated to the template.
Parameter name :
The name of the template. It must be unique per domain.
Parameter requiredFields :
A list of fields that must contain a value for a case to be successfully
created with this template.
Parameter rules :
A list of case rules (also known as case
field conditions) on a template.
Parameter status :
The status of the template.
Parameter tagPropagationConfigurations :
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.
Implementation
Future<void> updateTemplate({
required String domainId,
required String templateId,
String? description,
LayoutConfiguration? layoutConfiguration,
String? name,
List<RequiredField>? requiredFields,
List<TemplateRule>? rules,
TemplateStatus? status,
List<TagPropagationConfiguration>? tagPropagationConfigurations,
}) async {
final $payload = <String, dynamic>{
if (description != null) 'description': description,
if (layoutConfiguration != null)
'layoutConfiguration': layoutConfiguration,
if (name != null) 'name': name,
if (requiredFields != null) 'requiredFields': requiredFields,
if (rules != null) 'rules': rules,
if (status != null) 'status': status.value,
if (tagPropagationConfigurations != null)
'tagPropagationConfigurations': tagPropagationConfigurations,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/domains/${Uri.encodeComponent(domainId)}/templates/${Uri.encodeComponent(templateId)}',
exceptionFnMap: _exceptionFns,
);
}