Skip to content

list_leaderboards

list_leaderboards(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    max_results: Optional[LeaderboardMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListLeaderboardsResponse

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/sage_maker.py
def list_leaderboards(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = 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.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.list_leaderboards_request.ListLeaderboardsRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_leaderboards_response.ListLeaderboardsResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_leaderboards

        output, http_response = (
            capo_sagemaker._operations.sage_maker.list_leaderboards.list_leaderboards(
                req.options, req.input
            )
        )
        return OperationResponse(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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output