Skip to content

update_findings_filter async

update_findings_filter(
    id: __string,
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    action: Optional[FindingsFilterAction] = None,
    client_token: Optional[__string] = None,
    description: Optional[__string] = None,
    finding_criteria: Optional[FindingCriteria] = None,
    name: Optional[__string] = None,
    position: Optional[__integer] = None,
) -> UpdateFindingsFilterResponse

Updates the criteria and other settings for a findings filter.

Parameters:

  • action (Optional[FindingsFilterAction], default: None ) –

    The action to perform on findings that match the filter criteria (findingCriteria). Valid values are: ARCHIVE, suppress (automatically archive) the findings; and, NOOP, don't perform any action on the findings.

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

    A unique, case-sensitive token that you provide to ensure the idempotency of the request.

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

    A custom description of the filter. The description can contain as many as 512 characters.

    We strongly recommend that you avoid including any sensitive data in the description of a filter. Other users of your account might be able to see this description, depending on the actions that they're allowed to perform in Amazon Macie.

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

    The criteria to use to filter findings.

  • id (__string) –

    The unique identifier for the Amazon Macie resource that the request applies to.

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

    A custom name for the filter. The name must contain at least 3 characters and can contain as many as 64 characters.

    We strongly recommend that you avoid including any sensitive data in the name of a filter. Other users of your account might be able to see this name, depending on the actions that they're allowed to perform in Amazon Macie.

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

    The position of the filter in the list of saved filters on the Amazon Macie console. This value also determines the order in which the filter is applied to findings, relative to other filters that are also applied to the findings.

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/async_macie2.py
async def update_findings_filter(
    self,
    id: "capo_macie2.types.__string.__string",
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    action: Optional[
        "capo_macie2.types.findings_filter_action.FindingsFilterAction"
    ] = None,
    client_token: Optional["capo_macie2.types.__string.__string"] = None,
    description: Optional["capo_macie2.types.__string.__string"] = None,
    finding_criteria: Optional[
        "capo_macie2.types.finding_criteria.FindingCriteria"
    ] = None,
    name: Optional["capo_macie2.types.__string.__string"] = None,
    position: Optional["capo_macie2.types.__integer.__integer"] = None,
) -> (
    "capo_macie2.types.update_findings_filter_response.UpdateFindingsFilterResponse"
):
    """<p>Updates the criteria and other settings for a findings filter.</p>

    Args:
        action: <p>The action to perform on findings that match the filter criteria (findingCriteria). Valid values are: ARCHIVE, suppress (automatically archive) the findings; and, NOOP, don't perform any action on the findings.</p>
        client_token: <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
        description: <p>A custom description of the filter. The description can contain as many as 512 characters.</p> <p>We strongly recommend that you avoid including any sensitive data in the description of a filter. Other users of your account might be able to see this description, depending on the actions that they're allowed to perform in Amazon Macie.</p>
        finding_criteria: <p>The criteria to use to filter findings.</p>
        id: <p>The unique identifier for the Amazon Macie resource that the request applies to.</p>
        name: <p>A custom name for the filter. The name must contain at least 3 characters and can contain as many as 64 characters.</p> <p>We strongly recommend that you avoid including any sensitive data in the name of a filter. Other users of your account might be able to see this name, depending on the actions that they're allowed to perform in Amazon Macie.</p>
        position: <p>The position of the filter in the list of saved filters on the Amazon Macie console. This value also determines the order in which the filter is applied to findings, relative to other filters that are also applied to the findings.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_macie2.types.update_findings_filter_request.UpdateFindingsFilterRequest]",
    ) -> AsyncOperationResponse[
        "capo_macie2.types.update_findings_filter_response.UpdateFindingsFilterResponse"
    ]:
        import capo_macie2._operations.macie2.update_findings_filter

        (
            output,
            http_response,
        ) = await capo_macie2._operations.macie2.update_findings_filter.async_update_findings_filter(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFindingsFilter")
    )
    input_: capo_macie2.types.update_findings_filter_request.UpdateFindingsFilterRequest = {
        "id": id
    }
    if action is not None:
        input_["action"] = action
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if finding_criteria is not None:
        input_["finding_criteria"] = finding_criteria
    if name is not None:
        input_["name"] = name
    if position is not None:
        input_["position"] = position

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