updateTemplate method
Updates a template from an existing Amazon Quick Sight analysis or another template.
May throw ConflictException.
May throw InternalFailureException.
May throw InvalidParameterValueException.
May throw LimitExceededException.
May throw ResourceExistsException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw UnsupportedUserEditionException.
Parameter awsAccountId :
The ID of the Amazon Web Services account that contains the template that
you're updating.
Parameter templateId :
The ID for the template.
Parameter definition :
The definition of a template.
A definition is the data model of all features in a Dashboard, Template, or Analysis.
Parameter name :
The name for the template.
Parameter sourceEntity :
The entity that you are using as a source when you update the template. In
SourceEntity, you specify the type of object you're using as
source: SourceTemplate for a template or
SourceAnalysis for an analysis. Both of these require an
Amazon Resource Name (ARN). For SourceTemplate, specify the
ARN of the source template. For SourceAnalysis, specify the
ARN of the source analysis. The SourceTemplate ARN can
contain any Amazon Web Services account and any Quick Sight-supported
Amazon Web Services Region;.
Use the DataSetReferences entity within
SourceTemplate or SourceAnalysis to list the
replacement datasets for the placeholders listed in the original. The
schema in each dataset must match its placeholder.
Parameter validationStrategy :
The option to relax the validation needed to update a template with
definition objects. This skips the validation step for specific errors.
Parameter versionDescription :
A description of the current template version that is being updated. Every
time you call UpdateTemplate, you create a new version of the
template. Each version of the template maintains a description of the
version in the VersionDescription field.
Implementation
Future<UpdateTemplateResponse> updateTemplate({
required String awsAccountId,
required String templateId,
TemplateVersionDefinition? definition,
String? name,
TemplateSourceEntity? sourceEntity,
ValidationStrategy? validationStrategy,
String? versionDescription,
}) async {
final $payload = <String, dynamic>{
if (definition != null) 'Definition': definition,
if (name != null) 'Name': name,
if (sourceEntity != null) 'SourceEntity': sourceEntity,
if (validationStrategy != null) 'ValidationStrategy': validationStrategy,
if (versionDescription != null) 'VersionDescription': versionDescription,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/accounts/${Uri.encodeComponent(awsAccountId)}/templates/${Uri.encodeComponent(templateId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateTemplateResponse.fromJson(response);
}