Skip to content

test_custom_data_identifier async

test_custom_data_identifier(
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    ignore_words: Optional[__listOf__string] = None,
    keywords: Optional[__listOf__string] = None,
    maximum_match_distance: Optional[__integer] = None,
    regex: Optional[__string] = None,
    sample_text: Optional[__string] = None,
) -> TestCustomDataIdentifierResponse

Tests criteria for a custom data identifier.

Parameters:

  • ignore_words (Optional[__listOf__string], default: None ) –

    An array that lists specific character sequences (ignore words) to exclude from the results. If the text matched by the regular expression contains any string in this array, Amazon Macie ignores it. The array can contain as many as 10 ignore words. Each ignore word can contain 4-90 UTF-8 characters. Ignore words are case sensitive.

  • keywords (Optional[__listOf__string], default: None ) –

    An array that lists specific character sequences (keywords), one of which must precede and be within proximity (maximumMatchDistance) of the regular expression to match. The array can contain as many as 50 keywords. Each keyword can contain 3-90 UTF-8 characters. Keywords aren't case sensitive.

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

    The maximum number of characters that can exist between the end of at least one complete character sequence specified by the keywords array and the end of the text that matches the regex pattern. If a complete keyword precedes all the text that matches the pattern and the keyword is within the specified distance, Amazon Macie includes the result. The distance can be 1-300 characters. The default value is 50.

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

    The regular expression (regex) that defines the pattern to match. The expression can contain as many as 512 characters.

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

    The sample text to inspect by using the custom data identifier. The text can contain as many as 1,000 characters.

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 test_custom_data_identifier(
    self,
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    ignore_words: Optional[
        "capo_macie2.types.__list_of__string.__listOf__string"
    ] = None,
    keywords: Optional[
        "capo_macie2.types.__list_of__string.__listOf__string"
    ] = None,
    maximum_match_distance: Optional[
        "capo_macie2.types.__integer.__integer"
    ] = None,
    regex: Optional["capo_macie2.types.__string.__string"] = None,
    sample_text: Optional["capo_macie2.types.__string.__string"] = None,
) -> "capo_macie2.types.test_custom_data_identifier_response.TestCustomDataIdentifierResponse":
    """<p>Tests criteria for a custom data identifier.</p>

    Args:
        ignore_words: <p>An array that lists specific character sequences (<i>ignore words</i>) to exclude from the results. If the text matched by the regular expression contains any string in this array, Amazon Macie ignores it. The array can contain as many as 10 ignore words. Each ignore word can contain 4-90 UTF-8 characters. Ignore words are case sensitive.</p>
        keywords: <p>An array that lists specific character sequences (<i>keywords</i>), one of which must precede and be within proximity (maximumMatchDistance) of the regular expression to match. The array can contain as many as 50 keywords. Each keyword can contain 3-90 UTF-8 characters. Keywords aren't case sensitive.</p>
        maximum_match_distance: <p>The maximum number of characters that can exist between the end of at least one complete character sequence specified by the keywords array and the end of the text that matches the regex pattern. If a complete keyword precedes all the text that matches the pattern and the keyword is within the specified distance, Amazon Macie includes the result. The distance can be 1-300 characters. The default value is 50.</p>
        regex: <p>The regular expression (<i>regex</i>) that defines the pattern to match. The expression can contain as many as 512 characters.</p>
        sample_text: <p>The sample text to inspect by using the custom data identifier. The text can contain as many as 1,000 characters.</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.test_custom_data_identifier_request.TestCustomDataIdentifierRequest]",
    ) -> AsyncOperationResponse[
        "capo_macie2.types.test_custom_data_identifier_response.TestCustomDataIdentifierResponse"
    ]:
        import capo_macie2._operations.macie2.test_custom_data_identifier

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TestCustomDataIdentifier")
    )
    input_: capo_macie2.types.test_custom_data_identifier_request.TestCustomDataIdentifierRequest = {}
    if ignore_words is not None:
        input_["ignore_words"] = ignore_words
    if keywords is not None:
        input_["keywords"] = keywords
    if maximum_match_distance is not None:
        input_["maximum_match_distance"] = maximum_match_distance
    if regex is not None:
        input_["regex"] = regex
    if sample_text is not None:
        input_["sample_text"] = sample_text

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