Skip to content

create_list async

create_list(
    name: noDashIdentifier,
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    elements: Optional[ElementsList] = None,
    variable_type: Optional[variableType] = None,
    description: Optional[description] = None,
    tags: Optional[tagList] = None,
) -> CreateListResult

Creates a list.

List is a set of input data for a variable in your event dataset. You use the input data in a rule that's associated with your detector. For more information, see Lists.

Parameters:

  • name (noDashIdentifier) –

    The name of the list.

  • elements (Optional[ElementsList], default: None ) –

    The names of the elements, if providing. You can also create an empty list and add elements later using the UpdateList API.

  • variable_type (Optional[variableType], default: None ) –

    The variable type of the list. You can only assign the variable type with String data type. For more information, see Variable types.

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

    The description of the list.

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

    A collection of the key and value pairs.

Raises:

  • AccessDeniedException –

    An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

  • InternalServerException –

    An exception indicating an internal server error.

  • ThrottlingException –

    An exception indicating a throttling error.

  • ValidationException –

    An exception indicating a specified value is not allowed.

  • UnknownServiceError –

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

Source code in docs_src/capo_frauddetector/_services/async_fraud_detector.py
async def create_list(
    self,
    name: "capo_frauddetector.types.no_dash_identifier.noDashIdentifier",
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    elements: Optional[
        "capo_frauddetector.types.elements_list.ElementsList"
    ] = None,
    variable_type: Optional[
        "capo_frauddetector.types.variable_type.variableType"
    ] = None,
    description: Optional[
        "capo_frauddetector.types.description.description"
    ] = None,
    tags: Optional["capo_frauddetector.types.tag_list.tagList"] = None,
) -> "capo_frauddetector.types.create_list_result.CreateListResult":
    """<p> Creates a list. </p> <p>List is a set of input data for a variable in your event dataset. You use the input data in a rule that's associated with your detector. For more information, see <a href="https://docs.aws.amazon.com/frauddetector/latest/ug/lists.html">Lists</a>.</p>

    Args:
        name: <p> The name of the list. </p>
        elements: <p> The names of the elements, if providing. You can also create an empty list and add elements later using the <a href="https://docs.aws.amazon.com/frauddetector/latest/api/API_Updatelist.html">UpdateList</a> API. </p>
        variable_type: <p> The variable type of the list. You can only assign the variable type with String data type. For more information, see <a href="https://docs.aws.amazon.com/frauddetector/latest/ug/create-a-variable.html#variable-types">Variable types</a>. </p>
        description: <p> The description of the list. </p>
        tags: <p> A collection of the key and value pairs. </p>

    Raises:
        capo_frauddetector.errors.access_denied_exception.AccessDeniedException: <p>An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as <code>PutExternalModel</code>, that specifies a role that is not in your account.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.throttling_exception.ThrottlingException: <p>An exception indicating a throttling error.</p>
        capo_frauddetector.errors.validation_exception.ValidationException: <p>An exception indicating a specified value is not allowed.</p>
        capo_frauddetector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_frauddetector.types.create_list_request.CreateListRequest]",
    ) -> AsyncOperationResponse[
        "capo_frauddetector.types.create_list_result.CreateListResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.create_list

        (
            output,
            http_response,
        ) = await capo_frauddetector._operations.aws_hawks_nest_service_facade.create_list.async_create_list(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_frauddetector.types.create_list_request.CreateListRequest",
    ) -> dict[str, Any]:
        import capo_frauddetector.types.create_list_request

        return capo_frauddetector.types.create_list_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateList", redact_input=_redact_input)
    )
    input_: capo_frauddetector.types.create_list_request.CreateListRequest = {
        "name": name
    }
    if elements is not None:
        input_["elements"] = elements
    if variable_type is not None:
        input_["variable_type"] = variable_type
    if description is not None:
        input_["description"] = description
    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