createChannel method

Future<CreateChannelResponse> createChannel({
  1. required String channelName,
  2. required List<RequestOutputItem> outputs,
  3. required PlaybackMode playbackMode,
  4. List<String>? audiences,
  5. SlateSource? fillerSlate,
  6. Map<String, String>? tags,
  7. Tier? tier,
  8. TimeShiftConfiguration? timeShiftConfiguration,
})

Creates a channel. For information about MediaTailor channels, see Working with channels in the MediaTailor User Guide.

Parameter channelName : The name of the channel.

Parameter outputs : The channel's output properties.

Parameter playbackMode : The type of playback mode to use for this channel.

LINEAR - The programs in the schedule play once back-to-back in the schedule.

LOOP - The programs in the schedule play back-to-back in an endless loop. When the last program in the schedule stops playing, playback loops back to the first program in the schedule.

Parameter audiences : The list of audiences defined in channel.

Parameter fillerSlate : The slate used to fill gaps between programs in the schedule. You must configure filler slate if your channel uses the LINEAR PlaybackMode. MediaTailor doesn't support filler slate for channels using the LOOP PlaybackMode.

Parameter tags : The tags to assign to the channel. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see Tagging AWS Elemental MediaTailor Resources.

Parameter tier : The tier of the channel.

Parameter timeShiftConfiguration : The time-shifted viewing configuration you want to associate to the channel.

Implementation

Future<CreateChannelResponse> createChannel({
  required String channelName,
  required List<RequestOutputItem> outputs,
  required PlaybackMode playbackMode,
  List<String>? audiences,
  SlateSource? fillerSlate,
  Map<String, String>? tags,
  Tier? tier,
  TimeShiftConfiguration? timeShiftConfiguration,
}) async {
  final $payload = <String, dynamic>{
    'Outputs': outputs,
    'PlaybackMode': playbackMode.value,
    if (audiences != null) 'Audiences': audiences,
    if (fillerSlate != null) 'FillerSlate': fillerSlate,
    if (tags != null) 'tags': tags,
    if (tier != null) 'Tier': tier.value,
    if (timeShiftConfiguration != null)
      'TimeShiftConfiguration': timeShiftConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/channel/${Uri.encodeComponent(channelName)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateChannelResponse.fromJson(response);
}