createProgram method

Future<CreateProgramResponse> createProgram({
  1. required String channelName,
  2. required String programName,
  3. required ScheduleConfiguration scheduleConfiguration,
  4. required String sourceLocationName,
  5. List<AdBreak>? adBreaks,
  6. List<AudienceMedia>? audienceMedia,
  7. String? liveSourceName,
  8. Map<String, String>? tags,
  9. String? vodSourceName,
})

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

Parameter channelName : The name of the channel for this Program.

Parameter programName : The name of the Program.

Parameter scheduleConfiguration : The schedule configuration settings.

Parameter sourceLocationName : The name of the source location.

Parameter adBreaks : The ad break configuration settings.

Parameter audienceMedia : The list of AudienceMedia defined in program.

Parameter liveSourceName : The name of the LiveSource for this Program.

Parameter tags : The tags to assign to the program. 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 vodSourceName : The name that's used to refer to a VOD source.

Implementation

Future<CreateProgramResponse> createProgram({
  required String channelName,
  required String programName,
  required ScheduleConfiguration scheduleConfiguration,
  required String sourceLocationName,
  List<AdBreak>? adBreaks,
  List<AudienceMedia>? audienceMedia,
  String? liveSourceName,
  Map<String, String>? tags,
  String? vodSourceName,
}) async {
  final $payload = <String, dynamic>{
    'ScheduleConfiguration': scheduleConfiguration,
    'SourceLocationName': sourceLocationName,
    if (adBreaks != null) 'AdBreaks': adBreaks,
    if (audienceMedia != null) 'AudienceMedia': audienceMedia,
    if (liveSourceName != null) 'LiveSourceName': liveSourceName,
    if (tags != null) 'tags': tags,
    if (vodSourceName != null) 'VodSourceName': vodSourceName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/channel/${Uri.encodeComponent(channelName)}/program/${Uri.encodeComponent(programName)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateProgramResponse.fromJson(response);
}