promote method

Future<PromoteResponse> promote({
  1. required String brokerId,
  2. required PromoteMode mode,
})

Promotes a data replication replica broker to the primary broker role.

May throw BadRequestException. May throw ForbiddenException. May throw InternalServerErrorException. May throw NotFoundException.

Parameter brokerId : The unique ID that Amazon MQ generates for the broker.

Parameter mode : The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.

Implementation

Future<PromoteResponse> promote({
  required String brokerId,
  required PromoteMode mode,
}) async {
  final $payload = <String, dynamic>{
    'mode': mode.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/brokers/${Uri.encodeComponent(brokerId)}/promote',
    exceptionFnMap: _exceptionFns,
  );
  return PromoteResponse.fromJson(response);
}