async def list_channels(
self,
*,
config_overrides: Optional[AsyncMediaPackageClientConfig] = None,
max_results: Optional["capo_mediapackage.types.max_results.MaxResults"] = None,
next_token: Optional["capo_mediapackage.types.__string.__string"] = None,
) -> "capo_mediapackage.types.list_channels_response.ListChannelsResponse":
"""Returns a collection of Channels.
Args:
max_results: Upper bound on number of records to return.
next_token: A token used to resume pagination from the end of a previous request.
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.list_channels_request.ListChannelsRequest]",
) -> AsyncOperationResponse[
"capo_mediapackage.types.list_channels_response.ListChannelsResponse"
]:
import capo_mediapackage._operations.media_package.list_channels
(
output,
http_response,
) = await capo_mediapackage._operations.media_package.list_channels.async_list_channels(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_mediapackage.types.list_channels_response.ListChannelsResponse",
) -> dict[str, Any]:
import capo_mediapackage.types.list_channels_response
return capo_mediapackage.types.list_channels_response.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("ListChannels", redact_output=_redact_output),
)
input_: capo_mediapackage.types.list_channels_request.ListChannelsRequest = {}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output