describeTemplate method

Future<DescribeTemplateResponse> describeTemplate({
  1. required String awsAccountId,
  2. required String templateId,
  3. String? aliasName,
  4. int? versionNumber,
})

Describes a template's metadata.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. 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 describing.

Parameter templateId : The ID for the template.

Parameter aliasName : The alias of the template that you want to describe. If you name a specific alias, you describe the version that the alias points to. You can specify the latest version of the template by providing the keyword $LATEST in the AliasName parameter. The keyword $PUBLISHED doesn't apply to templates.

Parameter versionNumber : (Optional) The number for the version to describe. If a VersionNumber parameter value isn't provided, the latest version of the template is described.

Implementation

Future<DescribeTemplateResponse> describeTemplate({
  required String awsAccountId,
  required String templateId,
  String? aliasName,
  int? versionNumber,
}) async {
  _s.validateNumRange(
    'versionNumber',
    versionNumber,
    1,
    1152921504606846976,
  );
  final $query = <String, List<String>>{
    if (aliasName != null) 'alias-name': [aliasName],
    if (versionNumber != null) 'version-number': [versionNumber.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/templates/${Uri.encodeComponent(templateId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeTemplateResponse.fromJson(response);
}