createTemplate method

Future<CreateTemplateResponse> createTemplate({
  1. required String templateName,
  2. required TemplateSource templateSource,
  3. String? clientToken,
  4. Map<String, String>? tags,
  5. String? templateDescription,
})

Creates a migration workflow template.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter templateName : The name of the migration workflow template.

Parameter templateSource : The source of the migration workflow template.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Idempotency in the Smithy documentation.

Parameter tags : The tags to add to the migration workflow template.

Parameter templateDescription : A description of the migration workflow template.

Implementation

Future<CreateTemplateResponse> createTemplate({
  required String templateName,
  required TemplateSource templateSource,
  String? clientToken,
  Map<String, String>? tags,
  String? templateDescription,
}) async {
  final $payload = <String, dynamic>{
    'templateName': templateName,
    'templateSource': templateSource,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
    if (templateDescription != null)
      'templateDescription': templateDescription,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/template',
    exceptionFnMap: _exceptionFns,
  );
  return CreateTemplateResponse.fromJson(response);
}