generateTemplate method

Future<GenerateTemplateResponse> generateTemplate({
  1. String? appId,
  2. OutputFormat? templateFormat,
})

Generates an AWS CloudFormation template based on the current launch configuration and writes it to an Amazon S3 object in the customer’s Amazon S3 bucket.

May throw UnauthorizedOperationException. May throw InvalidParameterException. May throw MissingRequiredParameterException. May throw InternalError. May throw OperationNotPermittedException.

Parameter appId : The ID of the application associated with the AWS CloudFormation template.

Parameter templateFormat : The format for generating the AWS CloudFormation template.

Implementation

Future<GenerateTemplateResponse> generateTemplate({
  String? appId,
  OutputFormat? templateFormat,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSServerMigrationService_V2016_10_24.GenerateTemplate'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (appId != null) 'appId': appId,
      if (templateFormat != null) 'templateFormat': templateFormat.toValue(),
    },
  );

  return GenerateTemplateResponse.fromJson(jsonResponse.body);
}