Skip to content

update_variable async

update_variable(
    name: string,
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    default_value: Optional[string] = None,
    description: Optional[string] = None,
    variable_type: Optional[string] = None,
) -> UpdateVariableResult

Updates a variable.

Parameters:

  • name (string) –

    The name of the variable.

  • default_value (Optional[string], default: None ) –

    The new default value of the variable.

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

    The new description.

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

    The variable type. For more information see Variable types.

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_variable(
    self,
    name: "capo_frauddetector.types.string.string",
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    default_value: Optional["capo_frauddetector.types.string.string"] = None,
    description: Optional["capo_frauddetector.types.string.string"] = None,
    variable_type: Optional["capo_frauddetector.types.string.string"] = None,
) -> "capo_frauddetector.types.update_variable_result.UpdateVariableResult":
    """<p>Updates a variable.</p>

    Args:
        name: <p>The name of the variable.</p>
        default_value: <p>The new default value of the variable.</p>
        description: <p>The new description.</p>
        variable_type: <p>The variable 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>

    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_variable_request.UpdateVariableRequest]",
    ) -> AsyncOperationResponse[
        "capo_frauddetector.types.update_variable_result.UpdateVariableResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.update_variable

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateVariable")
    )
    input_: capo_frauddetector.types.update_variable_request.UpdateVariableRequest = {
        "name": name
    }
    if default_value is not None:
        input_["default_value"] = default_value
    if description is not None:
        input_["description"] = description
    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