createStackRefactor method

Future<CreateStackRefactorOutput> createStackRefactor({
  1. required List<StackDefinition> stackDefinitions,
  2. String? description,
  3. bool? enableStackCreation,
  4. List<ResourceMapping>? resourceMappings,
})

Creates a refactor across multiple stacks, with the list of stacks and resources that are affected.

Parameter stackDefinitions : The stacks being refactored.

Parameter description : A description to help you identify the stack refactor.

Parameter enableStackCreation : Determines if a new stack is created with the refactor.

Parameter resourceMappings : The mappings for the stack resource Source and stack resource Destination.

Implementation

Future<CreateStackRefactorOutput> createStackRefactor({
  required List<StackDefinition> stackDefinitions,
  String? description,
  bool? enableStackCreation,
  List<ResourceMapping>? resourceMappings,
}) async {
  final $request = <String, String>{
    if (stackDefinitions.isEmpty)
      'StackDefinitions': ''
    else
      for (var i1 = 0; i1 < stackDefinitions.length; i1++)
        for (var e3 in stackDefinitions[i1].toQueryMap().entries)
          'StackDefinitions.member.${i1 + 1}.${e3.key}': e3.value,
    if (description != null) 'Description': description,
    if (enableStackCreation != null)
      'EnableStackCreation': enableStackCreation.toString(),
    if (resourceMappings != null)
      if (resourceMappings.isEmpty)
        'ResourceMappings': ''
      else
        for (var i1 = 0; i1 < resourceMappings.length; i1++)
          for (var e3 in resourceMappings[i1].toQueryMap().entries)
            'ResourceMappings.member.${i1 + 1}.${e3.key}': e3.value,
  };
  final $result = await _protocol.send(
    $request,
    action: 'CreateStackRefactor',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'CreateStackRefactorResult',
  );
  return CreateStackRefactorOutput.fromXml($result);
}