Skip to content

list_findings

list_findings(
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    finding_criteria: Optional[FindingCriteria] = None,
    max_results: Optional[__integer] = None,
    next_token: Optional[__string] = None,
    sort_criteria: Optional[SortCriteria] = None,
) -> ListFindingsResponse

Retrieves a subset of information about one or more findings.

Parameters:

  • finding_criteria (Optional[FindingCriteria], default: None ) –

    The criteria to use to filter the results.

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

    The maximum number of items to include in each page of the response.

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

    The nextToken string that specifies which page of results to return in a paginated response.

  • sort_criteria (Optional[SortCriteria], default: None ) –

    The criteria to use to sort the results.

Raises:

  • AccessDeniedException –

    Provides information about an error that occurred due to insufficient access to a specified resource.

  • ConflictException –

    Provides information about an error that occurred due to a versioning conflict for a specified resource.

  • InternalServerException –

    Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

  • ResourceNotFoundException –

    Provides information about an error that occurred because a specified resource wasn't found.

  • ServiceQuotaExceededException –

    Provides information about an error that occurred due to one or more service quotas for an account.

  • ThrottlingException –

    Provides information about an error that occurred because too many requests were sent during a certain amount of time.

  • ValidationException –

    Provides information about an error that occurred due to a syntax error in a request.

  • UnknownServiceError –

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

Source code in docs_src/capo_macie2/_services/macie2.py
def list_findings(
    self,
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    finding_criteria: Optional[
        "capo_macie2.types.finding_criteria.FindingCriteria"
    ] = None,
    max_results: Optional["capo_macie2.types.__integer.__integer"] = None,
    next_token: Optional["capo_macie2.types.__string.__string"] = None,
    sort_criteria: Optional["capo_macie2.types.sort_criteria.SortCriteria"] = None,
) -> "capo_macie2.types.list_findings_response.ListFindingsResponse":
    """<p>Retrieves a subset of information about one or more findings.</p>

    Args:
        finding_criteria: <p>The criteria to use to filter the results.</p>
        max_results: <p>The maximum number of items to include in each page of the response.</p>
        next_token: <p>The nextToken string that specifies which page of results to return in a paginated response.</p>
        sort_criteria: <p>The criteria to use to sort the results.</p>

    Raises:
        capo_macie2.errors.access_denied_exception.AccessDeniedException: <p>Provides information about an error that occurred due to insufficient access to a specified resource.</p>
        capo_macie2.errors.conflict_exception.ConflictException: <p>Provides information about an error that occurred due to a versioning conflict for a specified resource.</p>
        capo_macie2.errors.internal_server_exception.InternalServerException: <p>Provides information about an error that occurred due to an unknown internal server error, exception, or failure.</p>
        capo_macie2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Provides information about an error that occurred because a specified resource wasn't found.</p>
        capo_macie2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Provides information about an error that occurred due to one or more service quotas for an account.</p>
        capo_macie2.errors.throttling_exception.ThrottlingException: <p>Provides information about an error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_macie2.errors.validation_exception.ValidationException: <p>Provides information about an error that occurred due to a syntax error in a request.</p>
        capo_macie2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_macie2.types.list_findings_request.ListFindingsRequest]",
    ) -> OperationResponse[
        "capo_macie2.types.list_findings_response.ListFindingsResponse"
    ]:
        import capo_macie2._operations.macie2.list_findings

        output, http_response = (
            capo_macie2._operations.macie2.list_findings.list_findings(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFindings")
    )
    input_: capo_macie2.types.list_findings_request.ListFindingsRequest = {}
    if finding_criteria is not None:
        input_["finding_criteria"] = finding_criteria
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if sort_criteria is not None:
        input_["sort_criteria"] = sort_criteria

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