createConfiguration method

Future<CreateConfigurationResponse> createConfiguration({
  1. required String name,
  2. required Uint8List serverProperties,
  3. String? description,
  4. List<String>? kafkaVersions,
})

Creates a new MSK configuration.

May throw BadRequestException. May throw InternalServerErrorException. May throw UnauthorizedException. May throw ForbiddenException. May throw ServiceUnavailableException. May throw TooManyRequestsException. May throw ConflictException.

Parameter name :

The name of the configuration.

Parameter serverProperties :

Contents of the file. When using the API, you must ensure that the contents of the file are base64 encoded. When using the AWS Management Console, the SDK, or the AWS CLI, the contents of can be in plaintext.

Parameter description :

The description of the configuration.

Parameter kafkaVersions :

The versions of Apache Kafka with which you can use this MSK configuration.

Implementation

Future<CreateConfigurationResponse> createConfiguration({
  required String name,
  required Uint8List serverProperties,
  String? description,
  List<String>? kafkaVersions,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  ArgumentError.checkNotNull(serverProperties, 'serverProperties');
  final $payload = <String, dynamic>{
    'name': name,
    'serverProperties': base64Encode(serverProperties),
    if (description != null) 'description': description,
    if (kafkaVersions != null) 'kafkaVersions': kafkaVersions,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/configurations',
    exceptionFnMap: _exceptionFns,
  );
  return CreateConfigurationResponse.fromJson(response);
}