Skip to content

get_channel_policy async

get_channel_policy(
    channel_name: __string,
    *,
    config_overrides: Optional[AsyncMediaTailorClientConfig] = None,
) -> GetChannelPolicyResponse

Returns the channel's IAM policy. IAM policies are used to control access to your channel.

Parameters:

  • channel_name (__string) –

    The name of the channel associated with this Channel Policy.

Raises:

Source code in docs_src/capo_mediatailor/_services/async_media_tailor.py
async def get_channel_policy(
    self,
    channel_name: "capo_mediatailor.types.__string.__string",
    *,
    config_overrides: Optional[AsyncMediaTailorClientConfig] = None,
) -> "capo_mediatailor.types.get_channel_policy_response.GetChannelPolicyResponse":
    """<p>Returns the channel's IAM policy. IAM policies are used to control access to your channel.</p>

    Args:
        channel_name: <p>The name of the channel associated with this Channel Policy.</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_policy_request.GetChannelPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediatailor.types.get_channel_policy_response.GetChannelPolicyResponse"
    ]:
        import capo_mediatailor._operations.media_tailor.get_channel_policy

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetChannelPolicy")
    )
    input_: capo_mediatailor.types.get_channel_policy_request.GetChannelPolicyRequest = {
        "channel_name": channel_name
    }

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