Skip to content

create_custom_entity_type async

create_custom_entity_type(
    name: NameString,
    regex_string: NameString,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    context_words: Optional[ContextWords] = None,
    tags: Optional[TagsMap] = None,
) -> CreateCustomEntityTypeResponse

Creates a custom pattern that is used to detect sensitive data across the columns and rows of your structured data.

Each custom pattern you create specifies a regular expression and an optional list of context words. If no context words are passed only a regular expression is checked.

Parameters:

  • name (NameString) –

    A name for the custom pattern that allows it to be retrieved or deleted later. This name must be unique per Amazon Web Services account.

  • regex_string (NameString) –

    A regular expression string that is used for detecting sensitive data in a custom pattern.

  • context_words (Optional[ContextWords], default: None ) –

    A list of context words. If none of these context words are found within the vicinity of the regular expression the data will not be detected as sensitive data.

    If no context words are passed only a regular expression is checked.

  • tags (Optional[TagsMap], default: None ) –

    A list of tags applied to the custom entity type.

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def create_custom_entity_type(
    self,
    name: "capo_glue.types.name_string.NameString",
    regex_string: "capo_glue.types.name_string.NameString",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    context_words: Optional["capo_glue.types.context_words.ContextWords"] = None,
    tags: Optional["capo_glue.types.tags_map.TagsMap"] = None,
) -> "capo_glue.types.create_custom_entity_type_response.CreateCustomEntityTypeResponse":
    """<p>Creates a custom pattern that is used to detect sensitive data across the columns and rows of your structured data.</p> <p>Each custom pattern you create specifies a regular expression and an optional list of context words. If no context words are passed only a regular expression is checked.</p>

    Args:
        name: <p>A name for the custom pattern that allows it to be retrieved or deleted later. This name must be unique per Amazon Web Services account.</p>
        regex_string: <p>A regular expression string that is used for detecting sensitive data in a custom pattern.</p>
        context_words: <p>A list of context words. If none of these context words are found within the vicinity of the regular expression the data will not be detected as sensitive data.</p> <p>If no context words are passed only a regular expression is checked.</p>
        tags: <p>A list of tags applied to the custom entity type.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_glue.errors.already_exists_exception.AlreadyExistsException: <p>A resource to be created or added already exists.</p>
        capo_glue.errors.idempotent_parameter_mismatch_exception.IdempotentParameterMismatchException: <p>The same unique identifier was associated with two different records.</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.resource_number_limit_exceeded_exception.ResourceNumberLimitExceededException: <p>A resource numerical limit was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.create_custom_entity_type_request.CreateCustomEntityTypeRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.create_custom_entity_type_response.CreateCustomEntityTypeResponse"
    ]:
        import capo_glue._operations.aws_glue.create_custom_entity_type

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.create_custom_entity_type.async_create_custom_entity_type(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCustomEntityType")
    )
    input_: capo_glue.types.create_custom_entity_type_request.CreateCustomEntityTypeRequest = {
        "name": name,
        "regex_string": regex_string,
    }
    if context_words is not None:
        input_["context_words"] = context_words
    if tags is not None:
        input_["tags"] = tags

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