updateChannel method

Future<UpdateChannelResponse> updateChannel({
  1. required String channelName,
  2. required List<RequestOutputItem> outputs,
  3. List<String>? audiences,
  4. SlateSource? fillerSlate,
  5. TimeShiftConfiguration? timeShiftConfiguration,
})

Updates 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 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 timeShiftConfiguration : The time-shifted viewing configuration you want to associate to the channel.

Implementation

Future<UpdateChannelResponse> updateChannel({
  required String channelName,
  required List<RequestOutputItem> outputs,
  List<String>? audiences,
  SlateSource? fillerSlate,
  TimeShiftConfiguration? timeShiftConfiguration,
}) async {
  final $payload = <String, dynamic>{
    'Outputs': outputs,
    if (audiences != null) 'Audiences': audiences,
    if (fillerSlate != null) 'FillerSlate': fillerSlate,
    if (timeShiftConfiguration != null)
      'TimeShiftConfiguration': timeShiftConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/channel/${Uri.encodeComponent(channelName)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateChannelResponse.fromJson(response);
}