Skip to content

list_solution_versions async

list_solution_versions(
    *,
    config_overrides: Optional[AsyncPersonalizeClientConfig] = None,
    solution_arn: Optional[Arn] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListSolutionVersionsResponse

Returns a list of solution versions for the given solution. When a solution is not specified, all the solution versions associated with the account are listed. The response provides the properties for each solution version, including the Amazon Resource Name (ARN).

Parameters:

  • solution_arn (Optional[Arn], default: None ) –

    The Amazon Resource Name (ARN) of the solution.

  • next_token (Optional[NextToken], default: None ) –

    A token returned from the previous call to ListSolutionVersions for getting the next set of solution versions (if they exist).

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of solution versions to return.

Raises:

Source code in docs_src/capo_personalize/_services/async_personalize.py
async def list_solution_versions(
    self,
    *,
    config_overrides: Optional[AsyncPersonalizeClientConfig] = None,
    solution_arn: Optional["capo_personalize.types.arn.Arn"] = None,
    next_token: Optional["capo_personalize.types.next_token.NextToken"] = None,
    max_results: Optional["capo_personalize.types.max_results.MaxResults"] = None,
) -> "capo_personalize.types.list_solution_versions_response.ListSolutionVersionsResponse":
    """<p>Returns a list of solution versions for the given solution. When a solution is not specified, all the solution versions associated with the account are listed. The response provides the properties for each solution version, including the Amazon Resource Name (ARN).</p>

    Args:
        solution_arn: <p>The Amazon Resource Name (ARN) of the solution.</p>
        next_token: <p>A token returned from the previous call to <code>ListSolutionVersions</code> for getting the next set of solution versions (if they exist).</p>
        max_results: <p>The maximum number of solution versions to return.</p>

    Raises:
        capo_personalize.errors.invalid_input_exception.InvalidInputException: <p>Provide a valid value for the field or parameter.</p>
        capo_personalize.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The token is not valid.</p>
        capo_personalize.errors.resource_not_found_exception.ResourceNotFoundException: <p>Could not find the specified resource.</p>
        capo_personalize.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_personalize.types.list_solution_versions_request.ListSolutionVersionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_personalize.types.list_solution_versions_response.ListSolutionVersionsResponse"
    ]:
        import capo_personalize._operations.amazon_personalize.list_solution_versions

        (
            output,
            http_response,
        ) = await capo_personalize._operations.amazon_personalize.list_solution_versions.async_list_solution_versions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSolutionVersions")
    )
    input_: capo_personalize.types.list_solution_versions_request.ListSolutionVersionsRequest = {}
    if solution_arn is not None:
        input_["solution_arn"] = solution_arn
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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