Lists the portals in your account.
Parameters:
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of results to return in one page, from 1 to 100.
-
next_token
(Optional[NextToken], default:
None
)
–
The pagination token returned by a previous call. Omit it to get the first page.
Raises:
-
AccessDeniedException
–
You do not have permission to perform this operation.
-
BadRequestException
–
The request is not valid. The message identifies the field or value that failed validation.
-
LimitExceededException
–
The request rate or a service quota was exceeded. Reduce the request rate or the number of resources and try again.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_apiportal/_services/async_api_portal.py
| async def list_portals(
self,
*,
config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
max_results: Optional["capo_apiportal.types.max_results.MaxResults"] = None,
next_token: Optional["capo_apiportal.types.next_token.NextToken"] = None,
) -> "capo_apiportal.types.list_portals_response.ListPortalsResponse":
"""Lists the portals in your account.
Args:
max_results: The maximum number of results to return in one page, from 1 to 100.
next_token: The pagination token returned by a previous call. Omit it to get the first page.
Raises:
capo_apiportal.errors.access_denied_exception.AccessDeniedException: You do not have permission to perform this operation.
capo_apiportal.errors.bad_request_exception.BadRequestException: The request is not valid. The message identifies the field or value that failed validation.
capo_apiportal.errors.limit_exceeded_exception.LimitExceededException: The request rate or a service quota was exceeded. Reduce the request rate or the number of resources and try again.
capo_apiportal.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_apiportal.types.list_portals_request.ListPortalsRequest]",
) -> AsyncOperationResponse[
"capo_apiportal.types.list_portals_response.ListPortalsResponse"
]:
import capo_apiportal._operations.api_portal_control_service.list_portals
(
output,
http_response,
) = await capo_apiportal._operations.api_portal_control_service.list_portals.async_list_portals(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListPortals")
)
input_: capo_apiportal.types.list_portals_request.ListPortalsRequest = {}
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
|