createMultiplexProgram method

Future<CreateMultiplexProgramResponse> createMultiplexProgram({
  1. required String multiplexId,
  2. required MultiplexProgramSettings multiplexProgramSettings,
  3. required String programName,
  4. String? requestId,
})

Create a new program in the 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 multiplexId : ID of the multiplex where the program is to be created.

Parameter multiplexProgramSettings : The settings for this multiplex program.

Parameter programName : Name of multiplex program.

Parameter requestId : Unique request ID. This prevents retries from creating multiple resources.

Implementation

Future<CreateMultiplexProgramResponse> createMultiplexProgram({
  required String multiplexId,
  required MultiplexProgramSettings multiplexProgramSettings,
  required String programName,
  String? requestId,
}) async {
  ArgumentError.checkNotNull(multiplexId, 'multiplexId');
  ArgumentError.checkNotNull(
      multiplexProgramSettings, 'multiplexProgramSettings');
  ArgumentError.checkNotNull(programName, 'programName');
  final $payload = <String, dynamic>{
    'multiplexProgramSettings': multiplexProgramSettings,
    'programName': programName,
    'requestId': requestId ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/prod/multiplexes/${Uri.encodeComponent(multiplexId)}/programs',
    exceptionFnMap: _exceptionFns,
  );
  return CreateMultiplexProgramResponse.fromJson(response);
}