Skip to content

get_channel_schedule async

get_channel_schedule(
    channel_name: __string,
    *,
    config_overrides: Optional[AsyncMediaTailorClientConfig] = None,
    duration_minutes: Optional[__string] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[__string] = None,
    audience: Optional[__string] = None,
) -> GetChannelScheduleResponse

Retrieves information about your channel's schedule.

Parameters:

  • channel_name (__string) –

    The name of the channel associated with this Channel Schedule.

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

    The duration in minutes of the channel schedule.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of channel schedules that you want MediaTailor to return in response to the current request. If there are more than MaxResults channel schedules, use the value of NextToken in the response to get the next page of results.

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

    (Optional) If the playback configuration has more than MaxResults channel schedules, use NextToken to get the second and subsequent pages of results.

    For the first GetChannelScheduleRequest request, omit this value.

    For the second and subsequent requests, get the value of NextToken from the previous response and specify that value for NextToken in the request.

    If the previous response didn't include a NextToken element, there are no more channel schedules to get.

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

    The single audience for GetChannelScheduleRequest.

Raises:

Source code in docs_src/capo_mediatailor/_services/async_media_tailor.py
async def get_channel_schedule(
    self,
    channel_name: "capo_mediatailor.types.__string.__string",
    *,
    config_overrides: Optional[AsyncMediaTailorClientConfig] = None,
    duration_minutes: Optional["capo_mediatailor.types.__string.__string"] = None,
    max_results: Optional["capo_mediatailor.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_mediatailor.types.__string.__string"] = None,
    audience: Optional["capo_mediatailor.types.__string.__string"] = None,
) -> "capo_mediatailor.types.get_channel_schedule_response.GetChannelScheduleResponse":
    """<p>Retrieves information about your channel's schedule.</p>

    Args:
        channel_name: <p>The name of the channel associated with this Channel Schedule.</p>
        duration_minutes: <p>The duration in minutes of the channel schedule.</p>
        max_results: <p>The maximum number of channel schedules that you want MediaTailor to return in response to the current request. If there are more than <code>MaxResults</code> channel schedules, use the value of <code>NextToken</code> in the response to get the next page of results.</p>
        next_token: <p>(Optional) If the playback configuration has more than <code>MaxResults</code> channel schedules, use <code>NextToken</code> to get the second and subsequent pages of results.</p> <p>For the first <code>GetChannelScheduleRequest</code> request, omit this value.</p> <p>For the second and subsequent requests, get the value of <code>NextToken</code> from the previous response and specify that value for <code>NextToken</code> in the request.</p> <p>If the previous response didn't include a <code>NextToken</code> element, there are no more channel schedules to get.</p>
        audience: <p>The single audience for GetChannelScheduleRequest.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_mediatailor.types.get_channel_schedule_request.GetChannelScheduleRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediatailor.types.get_channel_schedule_response.GetChannelScheduleResponse"
    ]:
        import capo_mediatailor._operations.media_tailor.get_channel_schedule

        (
            output,
            http_response,
        ) = await capo_mediatailor._operations.media_tailor.get_channel_schedule.async_get_channel_schedule(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetChannelSchedule")
    )
    input_: capo_mediatailor.types.get_channel_schedule_request.GetChannelScheduleRequest = {
        "channel_name": channel_name
    }
    if duration_minutes is not None:
        input_["duration_minutes"] = duration_minutes
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if audience is not None:
        input_["audience"] = audience

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output