Skip to content

create_program

create_program(
    channel_name: __string,
    program_name: __string,
    schedule_configuration: ScheduleConfiguration,
    source_location_name: __string,
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
    ad_breaks: Optional[__listOfAdBreak] = None,
    live_source_name: Optional[__string] = None,
    vod_source_name: Optional[__string] = None,
    audience_media: Optional[__listOfAudienceMedia] = None,
    tags: Optional[__mapOf__string] = None,
) -> CreateProgramResponse

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

Parameters:

  • ad_breaks (Optional[__listOfAdBreak], default: None ) –

    The ad break configuration settings.

  • channel_name (__string) –

    The name of the channel for this Program.

  • live_source_name (Optional[__string], default: None ) –

    The name of the LiveSource for this Program.

  • program_name (__string) –

    The name of the Program.

  • schedule_configuration (ScheduleConfiguration) –

    The schedule configuration settings.

  • source_location_name (__string) –

    The name of the source location.

  • vod_source_name (Optional[__string], default: None ) –

    The name that's used to refer to a VOD source.

  • audience_media (Optional[__listOfAudienceMedia], default: None ) –

    The list of AudienceMedia defined in program.

  • tags (Optional[__mapOf__string], default: None ) –

    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.

Raises:

Source code in docs_src/capo_mediatailor/_services/media_tailor.py
def create_program(
    self,
    channel_name: "capo_mediatailor.types.__string.__string",
    program_name: "capo_mediatailor.types.__string.__string",
    schedule_configuration: "capo_mediatailor.types.schedule_configuration.ScheduleConfiguration",
    source_location_name: "capo_mediatailor.types.__string.__string",
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
    ad_breaks: Optional[
        "capo_mediatailor.types.__list_of_ad_break.__listOfAdBreak"
    ] = None,
    live_source_name: Optional["capo_mediatailor.types.__string.__string"] = None,
    vod_source_name: Optional["capo_mediatailor.types.__string.__string"] = None,
    audience_media: Optional[
        "capo_mediatailor.types.__list_of_audience_media.__listOfAudienceMedia"
    ] = None,
    tags: Optional[
        "capo_mediatailor.types.__map_of__string.__mapOf__string"
    ] = None,
) -> "capo_mediatailor.types.create_program_response.CreateProgramResponse":
    """<p>Creates a program within a channel. For information about programs, see <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-programs.html">Working with programs</a> in the <i>MediaTailor User Guide</i>.</p>

    Args:
        ad_breaks: <p>The ad break configuration settings.</p>
        channel_name: <p>The name of the channel for this Program.</p>
        live_source_name: <p>The name of the LiveSource for this Program.</p>
        program_name: <p>The name of the Program.</p>
        schedule_configuration: <p>The schedule configuration settings.</p>
        source_location_name: <p>The name of the source location.</p>
        vod_source_name: <p>The name that's used to refer to a VOD source.</p>
        audience_media: <p>The list of AudienceMedia defined in program.</p>
        tags: <p>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 <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html">Tagging AWS Elemental MediaTailor Resources</a>.</p>

    Raises:
        capo_mediatailor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mediatailor.types.create_program_request.CreateProgramRequest]",
    ) -> OperationResponse[
        "capo_mediatailor.types.create_program_response.CreateProgramResponse"
    ]:
        import capo_mediatailor._operations.media_tailor.create_program

        output, http_response = (
            capo_mediatailor._operations.media_tailor.create_program.create_program(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateProgram")
    )
    input_: capo_mediatailor.types.create_program_request.CreateProgramRequest = {
        "channel_name": channel_name,
        "program_name": program_name,
        "schedule_configuration": schedule_configuration,
        "source_location_name": source_location_name,
    }
    if ad_breaks is not None:
        input_["ad_breaks"] = ad_breaks
    if live_source_name is not None:
        input_["live_source_name"] = live_source_name
    if vod_source_name is not None:
        input_["vod_source_name"] = vod_source_name
    if audience_media is not None:
        input_["audience_media"] = audience_media
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output