Skip to content

list_access_previews async

list_access_previews(
    analyzer_arn: AnalyzerArn,
    *,
    config_overrides: Optional[AsyncAccessAnalyzerClientConfig] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[int] = None,
) -> ListAccessPreviewsResponse

Retrieves a list of access previews for the specified analyzer.

Parameters:

  • analyzer_arn (AnalyzerArn) –

    The ARN of the analyzer used to generate the access preview.

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

    A token used for pagination of results returned.

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

    The maximum number of results to return in the response.

Raises:

Source code in docs_src/capo_accessanalyzer/_services/async_access_analyzer.py
async def list_access_previews(
    self,
    analyzer_arn: "capo_accessanalyzer.types.analyzer_arn.AnalyzerArn",
    *,
    config_overrides: Optional[AsyncAccessAnalyzerClientConfig] = None,
    next_token: Optional["capo_accessanalyzer.types.token.Token"] = None,
    max_results: Optional[int] = None,
) -> "capo_accessanalyzer.types.list_access_previews_response.ListAccessPreviewsResponse":
    """<p>Retrieves a list of access previews for the specified analyzer.</p>

    Args:
        analyzer_arn: <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> used to generate the access preview.</p>
        next_token: <p>A token used for pagination of results returned.</p>
        max_results: <p>The maximum number of results to return in the response.</p>

    Raises:
        capo_accessanalyzer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_accessanalyzer.errors.internal_server_exception.InternalServerException: <p>Internal server error.</p>
        capo_accessanalyzer.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_accessanalyzer.errors.throttling_exception.ThrottlingException: <p>Throttling limit exceeded error.</p>
        capo_accessanalyzer.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
        capo_accessanalyzer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_accessanalyzer.types.list_access_previews_request.ListAccessPreviewsRequest]",
    ) -> AsyncOperationResponse[
        "capo_accessanalyzer.types.list_access_previews_response.ListAccessPreviewsResponse"
    ]:
        import capo_accessanalyzer._operations.access_analyzer.list_access_previews

        (
            output,
            http_response,
        ) = await capo_accessanalyzer._operations.access_analyzer.list_access_previews.async_list_access_previews(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAccessPreviews")
    )
    input_: capo_accessanalyzer.types.list_access_previews_request.ListAccessPreviewsRequest = {
        "analyzer_arn": analyzer_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