updateTemplate method

Future<UpdateTemplateResponse> updateTemplate({
  1. required String awsAccountId,
  2. required TemplateSourceEntity sourceEntity,
  3. required String templateId,
  4. String? name,
  5. String? versionDescription,
})

Updates a template from an existing Amazon QuickSight analysis or another template.

May throw InvalidParameterValueException. May throw ResourceExistsException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ConflictException. May throw LimitExceededException. May throw UnsupportedUserEditionException. May throw InternalFailureException.

Parameter awsAccountId : The ID of the AWS account that contains the template that you're updating.

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 AWS Account and any QuickSight-supported AWS 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 templateId : The ID for the template.

Parameter name : The name for the template.

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 TemplateSourceEntity sourceEntity,
  required String templateId,
  String? name,
  String? versionDescription,
}) async {
  ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
  _s.validateStringLength(
    'awsAccountId',
    awsAccountId,
    12,
    12,
    isRequired: true,
  );
  ArgumentError.checkNotNull(sourceEntity, 'sourceEntity');
  ArgumentError.checkNotNull(templateId, 'templateId');
  _s.validateStringLength(
    'templateId',
    templateId,
    1,
    2048,
    isRequired: true,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    2048,
  );
  _s.validateStringLength(
    'versionDescription',
    versionDescription,
    1,
    512,
  );
  final $payload = <String, dynamic>{
    'SourceEntity': sourceEntity,
    if (name != null) 'Name': name,
    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);
}