Lists the leaderboards in the caller's account and Region.
Parameters:
-
max_results
(Optional[LeaderboardMaxResults], default:
None
)
–
The maximum number of leaderboards to return in the response. The default is 20.
-
next_token
(Optional[NextToken], default:
None
)
–
If the result of the previous ListLeaderboards request was truncated, the response includes a NextToken. To retrieve the next set of leaderboards, use the token in the next request.
Raises:
Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
| async def list_leaderboards(
self,
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = None,
max_results: Optional[
"capo_sagemaker.types.leaderboard_max_results.LeaderboardMaxResults"
] = None,
next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
) -> "capo_sagemaker.types.list_leaderboards_response.ListLeaderboardsResponse":
"""Lists the leaderboards in the caller's account and Region.
Args:
max_results: <p>The maximum number of leaderboards to return in the response. The default is 20.</p>
next_token: <p>If the result of the previous <code>ListLeaderboards</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of leaderboards, use the token in the next request.</p>
Raises:
capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sagemaker.types.list_leaderboards_request.ListLeaderboardsRequest]",
) -> AsyncOperationResponse[
"capo_sagemaker.types.list_leaderboards_response.ListLeaderboardsResponse"
]:
import capo_sagemaker._operations.sage_maker.list_leaderboards
(
output,
http_response,
) = await capo_sagemaker._operations.sage_maker.list_leaderboards.async_list_leaderboards(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListLeaderboards")
)
input_: capo_sagemaker.types.list_leaderboards_request.ListLeaderboardsRequest = {}
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
|