createChannel method

Future<CreateChannelResponse> createChannel({
  1. CdiInputSpecification? cdiInputSpecification,
  2. ChannelClass? channelClass,
  3. List<OutputDestination>? destinations,
  4. EncoderSettings? encoderSettings,
  5. List<InputAttachment>? inputAttachments,
  6. InputSpecification? inputSpecification,
  7. LogLevel? logLevel,
  8. String? name,
  9. String? requestId,
  10. String? reserved,
  11. String? roleArn,
  12. Map<String, String>? tags,
})

Creates a new channel

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 cdiInputSpecification : Specification of CDI inputs for this channel

Parameter channelClass : The class for this channel. STANDARD for a channel with two pipelines or SINGLE_PIPELINE for a channel with one pipeline.

Parameter inputAttachments : List of input attachments for channel.

Parameter inputSpecification : Specification of network and file inputs for this channel

Parameter logLevel : The log level to write to CloudWatch Logs.

Parameter name : Name of channel.

Parameter requestId : Unique request ID to be specified. This is needed to prevent retries from creating multiple resources.

Parameter reserved : Deprecated field that's only usable by whitelisted customers.

Parameter roleArn : An optional Amazon Resource Name (ARN) of the role to assume when running the Channel.

Parameter tags : A collection of key-value pairs.

Implementation

Future<CreateChannelResponse> createChannel({
  CdiInputSpecification? cdiInputSpecification,
  ChannelClass? channelClass,
  List<OutputDestination>? destinations,
  EncoderSettings? encoderSettings,
  List<InputAttachment>? inputAttachments,
  InputSpecification? inputSpecification,
  LogLevel? logLevel,
  String? name,
  String? requestId,
  String? reserved,
  String? roleArn,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    if (cdiInputSpecification != null)
      'cdiInputSpecification': cdiInputSpecification,
    if (channelClass != null) 'channelClass': channelClass.toValue(),
    if (destinations != null) 'destinations': destinations,
    if (encoderSettings != null) 'encoderSettings': encoderSettings,
    if (inputAttachments != null) 'inputAttachments': inputAttachments,
    if (inputSpecification != null) 'inputSpecification': inputSpecification,
    if (logLevel != null) 'logLevel': logLevel.toValue(),
    if (name != null) 'name': name,
    'requestId': requestId ?? _s.generateIdempotencyToken(),
    if (reserved != null) 'reserved': reserved,
    if (roleArn != null) 'roleArn': roleArn,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/prod/channels',
    exceptionFnMap: _exceptionFns,
  );
  return CreateChannelResponse.fromJson(response);
}