promoteReadReplica method
May throw InvalidDBInstanceStateFault. May throw DBInstanceNotFoundFault.
Implementation
Future<PromoteReadReplicaResult> promoteReadReplica({
required String dBInstanceIdentifier,
int? backupRetentionPeriod,
String? preferredBackupWindow,
}) async {
ArgumentError.checkNotNull(dBInstanceIdentifier, 'dBInstanceIdentifier');
final $request = <String, dynamic>{};
$request['DBInstanceIdentifier'] = dBInstanceIdentifier;
backupRetentionPeriod
?.also((arg) => $request['BackupRetentionPeriod'] = arg);
preferredBackupWindow
?.also((arg) => $request['PreferredBackupWindow'] = arg);
final $result = await _protocol.send(
$request,
action: 'PromoteReadReplica',
version: '2013-02-12',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['PromoteReadReplicaMessage'],
shapes: shapes,
resultWrapper: 'PromoteReadReplicaResult',
);
return PromoteReadReplicaResult.fromXml($result);
}