Skip to content

update_list async

update_list(
    name: noDashIdentifier,
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    elements: Optional[ElementsList] = None,
    description: Optional[description] = None,
    update_mode: Optional[ListUpdateMode] = None,
    variable_type: Optional[variableType] = None,
) -> UpdateListResult

Updates a list.

Parameters:

  • name (noDashIdentifier) –

    The name of the list to update.

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

    One or more list elements to add or replace. If you are providing the elements, make sure to specify the updateMode to use.

    If you are deleting all elements from the list, use REPLACE for the updateMode and provide an empty list (0 elements).

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

    The new description.

  • update_mode (Optional[ListUpdateMode], default: None ) –

    The update mode (type).

    • Use APPEND if you are adding elements to the list.

    • Use REPLACE if you replacing existing elements in the list.

    • Use REMOVE if you are removing elements from the list.

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

    The variable type you want to assign to the list.

    You cannot update a variable type of a list that already has a variable type assigned to it. You can assign a variable type to a list only if the list does not already have a variable type.

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.

  • ConflictException –

    An exception indicating there was a conflict during a delete operation.

  • InternalServerException –

    An exception indicating an internal server error.

  • ResourceNotFoundException –

    An exception indicating the specified resource was not found.

  • 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 update_list(
    self,
    name: "capo_frauddetector.types.no_dash_identifier.noDashIdentifier",
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    elements: Optional[
        "capo_frauddetector.types.elements_list.ElementsList"
    ] = None,
    description: Optional[
        "capo_frauddetector.types.description.description"
    ] = None,
    update_mode: Optional[
        "capo_frauddetector.types.list_update_mode.ListUpdateMode"
    ] = None,
    variable_type: Optional[
        "capo_frauddetector.types.variable_type.variableType"
    ] = None,
) -> "capo_frauddetector.types.update_list_result.UpdateListResult":
    """<p> Updates a list. </p>

    Args:
        name: <p> The name of the list to update. </p>
        elements: <p> One or more list elements to add or replace. If you are providing the elements, make sure to specify the <code>updateMode</code> to use. </p> <p>If you are deleting all elements from the list, use <code>REPLACE</code> for the <code>updateMode</code> and provide an empty list (0 elements).</p>
        description: <p> The new description. </p>
        update_mode: <p> The update mode (type). </p> <ul> <li> <p>Use <code>APPEND</code> if you are adding elements to the list.</p> </li> <li> <p>Use <code>REPLACE</code> if you replacing existing elements in the list.</p> </li> <li> <p>Use <code>REMOVE</code> if you are removing elements from the list.</p> </li> </ul>
        variable_type: <p> The variable type you want to assign to the list. </p> <note> <p>You cannot update a variable type of a list that already has a variable type assigned to it. You can assign a variable type to a list only if the list does not already have a variable type.</p> </note>

    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.conflict_exception.ConflictException: <p>An exception indicating there was a conflict during a delete operation.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception indicating the specified resource was not found.</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.update_list_request.UpdateListRequest]",
    ) -> AsyncOperationResponse[
        "capo_frauddetector.types.update_list_result.UpdateListResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.update_list

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

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

        return capo_frauddetector.types.update_list_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateList", redact_input=_redact_input)
    )
    input_: capo_frauddetector.types.update_list_request.UpdateListRequest = {
        "name": name
    }
    if elements is not None:
        input_["elements"] = elements
    if description is not None:
        input_["description"] = description
    if update_mode is not None:
        input_["update_mode"] = update_mode
    if variable_type is not None:
        input_["variable_type"] = variable_type

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