Skip to content

put_actions async

put_actions(
    dataset_arn: Arn,
    actions: ActionList,
    *,
    config_overrides: Optional[AsyncPersonalizeEventsClientConfig] = None,
) -> None

Adds one or more actions to an Actions dataset. For more information see Importing actions individually.

Parameters:

  • dataset_arn (Arn) –

    The Amazon Resource Name (ARN) of the Actions dataset you are adding the action or actions to.

  • actions (ActionList) –

    A list of action data.

Raises:

Source code in docs_src/capo_personalize_events/_services/async_personalize_events.py
async def put_actions(
    self,
    dataset_arn: "capo_personalize_events.types.arn.Arn",
    actions: "capo_personalize_events.types.action_list.ActionList",
    *,
    config_overrides: Optional[AsyncPersonalizeEventsClientConfig] = None,
) -> None:
    """<p>Adds one or more actions to an Actions dataset. For more information see <a href="https://docs.aws.amazon.com/personalize/latest/dg/importing-actions.html">Importing actions individually</a>. </p>

    Args:
        dataset_arn: <p>The Amazon Resource Name (ARN) of the Actions dataset you are adding the action or actions to.</p>
        actions: <p>A list of action data.</p>

    Raises:
        capo_personalize_events.errors.invalid_input_exception.InvalidInputException: <p>Provide a valid value for the field or parameter.</p>
        capo_personalize_events.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
        capo_personalize_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>Could not find the specified resource.</p>
        capo_personalize_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_personalize_events.types.put_actions_request.PutActionsRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_personalize_events._operations.amazon_personalize_events.put_actions

        (
            output,
            http_response,
        ) = await capo_personalize_events._operations.amazon_personalize_events.put_actions.async_put_actions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_personalize_events.types.put_actions_request.PutActionsRequest",
    ) -> dict[str, Any]:
        import capo_personalize_events.types.put_actions_request

        return capo_personalize_events.types.put_actions_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutActions", redact_input=_redact_input)
    )
    input_: capo_personalize_events.types.put_actions_request.PutActionsRequest = {
        "dataset_arn": dataset_arn,
        "actions": actions,
    }

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