applyPendingMaintenanceAction method

Future<ApplyPendingMaintenanceActionResponse> applyPendingMaintenanceAction({
  1. required String applyAction,
  2. required String optInType,
  3. required String replicationInstanceArn,
})

Applies a pending maintenance action to a resource (for example, to a replication instance).

May throw ResourceNotFoundFault.

Parameter applyAction : The pending maintenance action to apply to this resource.

Parameter optInType : A value that specifies the type of opt-in request, or undoes an opt-in request. You can't undo an opt-in request of type immediate.

Valid values:

  • immediate - Apply the maintenance action immediately.
  • next-maintenance - Apply the maintenance action during the next maintenance window for the resource.
  • undo-opt-in - Cancel any existing next-maintenance opt-in requests.

Parameter replicationInstanceArn : The Amazon Resource Name (ARN) of the AWS DMS resource that the pending maintenance action applies to.

Implementation

Future<ApplyPendingMaintenanceActionResponse> applyPendingMaintenanceAction({
  required String applyAction,
  required String optInType,
  required String replicationInstanceArn,
}) async {
  ArgumentError.checkNotNull(applyAction, 'applyAction');
  ArgumentError.checkNotNull(optInType, 'optInType');
  ArgumentError.checkNotNull(
      replicationInstanceArn, 'replicationInstanceArn');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDMSv20160101.ApplyPendingMaintenanceAction'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ApplyAction': applyAction,
      'OptInType': optInType,
      'ReplicationInstanceArn': replicationInstanceArn,
    },
  );

  return ApplyPendingMaintenanceActionResponse.fromJson(jsonResponse.body);
}