Skip to content

get_credential_report async

get_credential_report(
    *, config_overrides: Optional[AsyncIAMClientConfig] = None
) -> GetCredentialReportResponse

Retrieves a credential report for the Amazon Web Services account. For more information about the credential report, see Getting credential reports in the IAM User Guide.

Raises:

Source code in docs_src/capo_iam/_services/async_iam.py
async def get_credential_report(
    self, *, config_overrides: Optional[AsyncIAMClientConfig] = None
) -> "capo_iam.types.get_credential_report_response.GetCredentialReportResponse":
    """<p> Retrieves a credential report for the Amazon Web Services account. For more information about the credential report, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html">Getting credential reports</a> in the <i>IAM User Guide</i>.</p>

    Raises:
        capo_iam.errors.credential_report_expired_exception.CredentialReportExpiredException: <p>The request was rejected because the most recent credential report has expired. To generate a new credential report, use <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GenerateCredentialReport.html">GenerateCredentialReport</a>. For more information about credential report expiration, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html">Getting credential reports</a> in the <i>IAM User Guide</i>.</p>
        capo_iam.errors.credential_report_not_present_exception.CredentialReportNotPresentException: <p>The request was rejected because the credential report does not exist. To generate a credential report, use <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GenerateCredentialReport.html">GenerateCredentialReport</a>.</p>
        capo_iam.errors.credential_report_not_ready_exception.CredentialReportNotReadyException: <p>The request was rejected because the credential report is still being generated.</p>
        capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[None]",
    ) -> AsyncOperationResponse[
        "capo_iam.types.get_credential_report_response.GetCredentialReportResponse"
    ]:
        import capo_iam._operations.aws_identity_management_v20100508.get_credential_report

        (
            output,
            http_response,
        ) = await capo_iam._operations.aws_identity_management_v20100508.get_credential_report.async_get_credential_report(
            req.options
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCredentialReport")
    )

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