createUser method

Future<void> createUser({
  1. required String brokerId,
  2. required String password,
  3. required String username,
  4. bool? consoleAccess,
  5. List<String>? groups,
  6. bool? replicationUser,
})

Creates an ActiveMQ user.

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

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

Parameter password : Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).

Parameter username : The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.

Parameter consoleAccess : Enables access to the ActiveMQ Web Console for the ActiveMQ user.

Parameter groups : The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.

Parameter replicationUser : Defines if this user is intended for CRDR replication purposes.

Implementation

Future<void> createUser({
  required String brokerId,
  required String password,
  required String username,
  bool? consoleAccess,
  List<String>? groups,
  bool? replicationUser,
}) async {
  final $payload = <String, dynamic>{
    'password': password,
    if (consoleAccess != null) 'consoleAccess': consoleAccess,
    if (groups != null) 'groups': groups,
    if (replicationUser != null) 'replicationUser': replicationUser,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/v1/brokers/${Uri.encodeComponent(brokerId)}/users/${Uri.encodeComponent(username)}',
    exceptionFnMap: _exceptionFns,
  );
}