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 InvalidParameterValueException. May throw AccessDeniedException. May throw ResourceExistsException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ConflictException. May throw UnsupportedUserEditionException. May throw InternalFailureException.

Parameter awsAccountId : The ID of the AWS 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 {
  ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
  _s.validateStringLength(
    'awsAccountId',
    awsAccountId,
    12,
    12,
    isRequired: true,
  );
  ArgumentError.checkNotNull(templateId, 'templateId');
  _s.validateStringLength(
    'templateId',
    templateId,
    1,
    2048,
    isRequired: true,
  );
  _s.validateStringLength(
    'aliasName',
    aliasName,
    1,
    2048,
  );
  _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);
}