Skip to content

get_evidence_content

get_evidence_content(
    environment_arn: EnvironmentArn,
    evidence_id: str,
    project: ProjectName,
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    evidence_version: Optional[int] = None,
) -> GetEvidenceContentOutput

Returns the content of an evidence item.

Parameters:

  • environment_arn (EnvironmentArn) –

    The Amazon Resource Name (ARN) of this governance environment.

  • evidence_id (str) –

    The unique identifier of the evidence item.

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

    The version of the evidence to get. To get the latest version, omit this parameter.

  • project (ProjectName) –

    The name of the project.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.

  • IntegrityException –

    The evidence item failed integrity verification. The evidence content might have been modified or the version might no longer be available. Verify the evidence item and try your request again.

  • InternalServerException –

    An internal server error occurred.

  • ResourceNotFoundException –

    The requested resource was not found.

  • ThrottlingException –

    The request was throttled.

  • ValidationException –

    The request failed validation.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Get evidence content Gets the file content of the user access review evidence for offline review.

>>> client.get_evidence_content(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', evidence_id='assurance://PCI-DSS-user-access-review.pdf', project='payments-prod')
Source code in docs_src/capo_assurance/_services/assurance.py
def get_evidence_content(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    evidence_id: str,
    project: "capo_assurance.types.project_name.ProjectName",
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    evidence_version: Optional[int] = None,
) -> "capo_assurance.types.get_evidence_content_output.GetEvidenceContentOutput":
    """<p>Returns the content of an evidence item.</p>

    Args:
        environment_arn: <p>The Amazon Resource Name (ARN) of this governance environment.</p>
        evidence_id: <p>The unique identifier of the evidence item.</p>
        evidence_version: <p>The version of the evidence to get. To get the latest version, omit this parameter.</p>
        project: <p>The name of the project.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.integrity_exception.IntegrityException: <p>The evidence item failed integrity verification. The evidence content might have been modified or the version might no longer be available. Verify the evidence item and try your request again.</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Get evidence content
        Gets the file content of the user access review evidence for offline review.

        >>> client.get_evidence_content(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', evidence_id='assurance://PCI-DSS-user-access-review.pdf', project='payments-prod')
    """

    def _handler(
        req: "OperationRequest[capo_assurance.types.get_evidence_content_input.GetEvidenceContentInput]",
    ) -> OperationResponse[
        "capo_assurance.types.get_evidence_content_output.GetEvidenceContentOutput"
    ]:
        import capo_assurance._operations.assurance.get_evidence_content

        output, http_response = (
            capo_assurance._operations.assurance.get_evidence_content.get_evidence_content(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_assurance.types.get_evidence_content_output.GetEvidenceContentOutput",
    ) -> dict[str, Any]:
        import capo_assurance.types.get_evidence_content_output

        return capo_assurance.types.get_evidence_content_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetEvidenceContent", redact_output=_redact_output),
    )
    input_: capo_assurance.types.get_evidence_content_input.GetEvidenceContentInput = {
        "environment_arn": environment_arn,
        "evidence_id": evidence_id,
        "project": project,
    }
    if evidence_version is not None:
        input_["evidence_version"] = evidence_version

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output