Skip to content

update_channel async

update_channel(
    id: __string,
    *,
    config_overrides: Optional[AsyncMediaPackageClientConfig] = None,
    description: Optional[__string] = None,
) -> UpdateChannelResponse

Updates an existing Channel.

Parameters:

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

    A short text description of the Channel.

  • id (__string) –

    The ID of the Channel to update.

Raises:

Source code in docs_src/capo_mediapackage/_services/async_media_package.py
async def update_channel(
    self,
    id: "capo_mediapackage.types.__string.__string",
    *,
    config_overrides: Optional[AsyncMediaPackageClientConfig] = None,
    description: Optional["capo_mediapackage.types.__string.__string"] = None,
) -> "capo_mediapackage.types.update_channel_response.UpdateChannelResponse":
    """Updates an existing Channel.

    Args:
        description: A short text description of the Channel.
        id: The ID of the Channel to update.

    Raises:
        capo_mediapackage.errors.forbidden_exception.ForbiddenException: The client is not authorized to access the requested resource.
        capo_mediapackage.errors.internal_server_error_exception.InternalServerErrorException: An unexpected error occurred.
        capo_mediapackage.errors.not_found_exception.NotFoundException: The requested resource does not exist.
        capo_mediapackage.errors.service_unavailable_exception.ServiceUnavailableException: An unexpected error occurred.
        capo_mediapackage.errors.too_many_requests_exception.TooManyRequestsException: The client has exceeded their resource or throttling limits.
        capo_mediapackage.errors.unprocessable_entity_exception.UnprocessableEntityException: The parameters sent in the request are not valid.
        capo_mediapackage.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediapackage.types.update_channel_request.UpdateChannelRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediapackage.types.update_channel_response.UpdateChannelResponse"
    ]:
        import capo_mediapackage._operations.media_package.update_channel

        (
            output,
            http_response,
        ) = await capo_mediapackage._operations.media_package.update_channel.async_update_channel(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_mediapackage.types.update_channel_response.UpdateChannelResponse",
    ) -> dict[str, Any]:
        import capo_mediapackage.types.update_channel_response

        return capo_mediapackage.types.update_channel_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateChannel", redact_output=_redact_output),
    )
    input_: capo_mediapackage.types.update_channel_request.UpdateChannelRequest = {
        "id": id
    }
    if description is not None:
        input_["description"] = description

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