updatePlan method

Future<UpdatePlanResponse> updatePlan({
  1. required String arn,
  2. required String executionRole,
  3. required List<Workflow> workflows,
  4. Map<String, AssociatedAlarm>? associatedAlarms,
  5. String? description,
  6. int? recoveryTimeObjectiveMinutes,
  7. ReportConfiguration? reportConfiguration,
  8. List<Trigger>? triggers,
})

Updates an existing Region switch plan. You can modify the plan's description, workflows, execution role, recovery time objective, associated alarms, and triggers.

May throw ResourceNotFoundException.

Parameter arn : The Amazon Resource Name (ARN) of the plan.

Parameter executionRole : The updated IAM role ARN that grants Region switch the permissions needed to execute the plan steps.

Parameter workflows : The updated workflows for the Region switch plan.

Parameter associatedAlarms : The updated CloudWatch alarms associated with the plan.

Parameter description : The updated description for the Region switch plan.

Parameter recoveryTimeObjectiveMinutes : The updated target recovery time objective (RTO) in minutes for the plan.

Parameter reportConfiguration : The updated report configuration for the plan.

Parameter triggers : The updated conditions that can automatically trigger the execution of the plan.

Implementation

Future<UpdatePlanResponse> updatePlan({
  required String arn,
  required String executionRole,
  required List<Workflow> workflows,
  Map<String, AssociatedAlarm>? associatedAlarms,
  String? description,
  int? recoveryTimeObjectiveMinutes,
  ReportConfiguration? reportConfiguration,
  List<Trigger>? triggers,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'ArcRegionSwitch.UpdatePlan'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'arn': arn,
      'executionRole': executionRole,
      'workflows': workflows,
      if (associatedAlarms != null) 'associatedAlarms': associatedAlarms,
      if (description != null) 'description': description,
      if (recoveryTimeObjectiveMinutes != null)
        'recoveryTimeObjectiveMinutes': recoveryTimeObjectiveMinutes,
      if (reportConfiguration != null)
        'reportConfiguration': reportConfiguration,
      if (triggers != null) 'triggers': triggers,
    },
  );

  return UpdatePlanResponse.fromJson(jsonResponse.body);
}