createMultiplex method
Create a new multiplex.
May throw BadRequestException. May throw UnprocessableEntityException. May throw InternalServerErrorException. May throw ForbiddenException. May throw BadGatewayException. May throw GatewayTimeoutException. May throw TooManyRequestsException. May throw ConflictException.
Parameter availabilityZones
:
A list of availability zones for the multiplex. You must specify exactly
two.
Parameter multiplexSettings
:
Configuration for a multiplex event.
Parameter name
:
Name of multiplex.
Parameter requestId
:
Unique request ID. This prevents retries from creating multiple
resources.
Parameter tags
:
A collection of key-value pairs.
Implementation
Future<CreateMultiplexResponse> createMultiplex({
required List<String> availabilityZones,
required MultiplexSettings multiplexSettings,
required String name,
String? requestId,
Map<String, String>? tags,
}) async {
ArgumentError.checkNotNull(availabilityZones, 'availabilityZones');
ArgumentError.checkNotNull(multiplexSettings, 'multiplexSettings');
ArgumentError.checkNotNull(name, 'name');
final $payload = <String, dynamic>{
'availabilityZones': availabilityZones,
'multiplexSettings': multiplexSettings,
'name': name,
'requestId': requestId ?? _s.generateIdempotencyToken(),
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/prod/multiplexes',
exceptionFnMap: _exceptionFns,
);
return CreateMultiplexResponse.fromJson(response);
}