Skip to content

update_bot async

update_bot(
    bot_id: Id,
    bot_name: Name,
    role_arn: RoleArn,
    data_privacy: DataPrivacy,
    idle_session_ttl_in_seconds: SessionTTL,
    *,
    config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
    description: Optional[Description] = None,
    bot_type: Optional[BotType] = None,
    bot_members: Optional[BotMembers] = None,
    error_log_settings: Optional[ErrorLogSettings] = None,
) -> UpdateBotResponse

Updates the configuration of an existing bot.

Parameters:

  • bot_id (Id) –

    The unique identifier of the bot to update. This identifier is returned by the CreateBot operation.

  • bot_name (Name) –

    The new name of the bot. The name must be unique in the account that creates the bot.

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

    A description of the bot.

  • role_arn (RoleArn) –

    The Amazon Resource Name (ARN) of an IAM role that has permissions to access the bot.

  • data_privacy (DataPrivacy) –

    Provides information on additional privacy protections Amazon Lex should use with the bot's data.

  • idle_session_ttl_in_seconds (SessionTTL) –

    The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.

    A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.

    You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.

  • bot_type (Optional[BotType], default: None ) –

    The type of the bot to be updated.

  • bot_members (Optional[BotMembers], default: None ) –

    The list of bot members in the network associated with the update action.

  • error_log_settings (Optional[ErrorLogSettings], default: None ) –

    Allows you to modify how Amazon Lex logs errors during bot interactions, including destinations for error logs and the types of errors to be captured.

Raises:

  • ConflictException –

    The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again.

  • InternalServerException –

    The service encountered an unexpected condition. Try your request again.

  • PreconditionFailedException –

    Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.

  • ServiceQuotaExceededException –

    You have reached a quota for your bot.

  • ThrottlingException –

    Your request rate is too high. Reduce the frequency of requests.

  • ValidationException –

    One of the input parameters in your request isn't valid. Check the parameters and try your request again.

  • UnknownServiceError –

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

Source code in docs_src/capo_lex_models_v2/_services/async_lex_models_v2.py
async def update_bot(
    self,
    bot_id: "capo_lex_models_v2.types.id.Id",
    bot_name: "capo_lex_models_v2.types.name.Name",
    role_arn: "capo_lex_models_v2.types.role_arn.RoleArn",
    data_privacy: "capo_lex_models_v2.types.data_privacy.DataPrivacy",
    idle_session_ttl_in_seconds: "capo_lex_models_v2.types.session_ttl.SessionTTL",
    *,
    config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
    description: Optional[
        "capo_lex_models_v2.types.description.Description"
    ] = None,
    bot_type: Optional["capo_lex_models_v2.types.bot_type.BotType"] = None,
    bot_members: Optional["capo_lex_models_v2.types.bot_members.BotMembers"] = None,
    error_log_settings: Optional[
        "capo_lex_models_v2.types.error_log_settings.ErrorLogSettings"
    ] = None,
) -> "capo_lex_models_v2.types.update_bot_response.UpdateBotResponse":
    """<p>Updates the configuration of an existing bot. </p>

    Args:
        bot_id: <p>The unique identifier of the bot to update. This identifier is returned by the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBot.html">CreateBot</a> operation.</p>
        bot_name: <p>The new name of the bot. The name must be unique in the account that creates the bot.</p>
        description: <p>A description of the bot.</p>
        role_arn: <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the bot.</p>
        data_privacy: <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
        idle_session_ttl_in_seconds: <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p> <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.</p> <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
        bot_type: <p>The type of the bot to be updated.</p>
        bot_members: <p>The list of bot members in the network associated with the update action.</p>
        error_log_settings: <p>Allows you to modify how Amazon Lex logs errors during bot interactions, including destinations for error logs and the types of errors to be captured.</p>

    Raises:
        capo_lex_models_v2.errors.conflict_exception.ConflictException: <p>The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again. </p>
        capo_lex_models_v2.errors.internal_server_exception.InternalServerException: <p>The service encountered an unexpected condition. Try your request again.</p>
        capo_lex_models_v2.errors.precondition_failed_exception.PreconditionFailedException: <p>Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.</p>
        capo_lex_models_v2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have reached a quota for your bot. </p>
        capo_lex_models_v2.errors.throttling_exception.ThrottlingException: <p>Your request rate is too high. Reduce the frequency of requests.</p>
        capo_lex_models_v2.errors.validation_exception.ValidationException: <p>One of the input parameters in your request isn't valid. Check the parameters and try your request again.</p>
        capo_lex_models_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_models_v2.types.update_bot_request.UpdateBotRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_models_v2.types.update_bot_response.UpdateBotResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.update_bot

        (
            output,
            http_response,
        ) = await capo_lex_models_v2._operations.lex_model_building_service_v2.update_bot.async_update_bot(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateBot")
    )
    input_: capo_lex_models_v2.types.update_bot_request.UpdateBotRequest = {
        "bot_id": bot_id,
        "bot_name": bot_name,
        "role_arn": role_arn,
        "data_privacy": data_privacy,
        "idle_session_ttl_in_seconds": idle_session_ttl_in_seconds,
    }
    if description is not None:
        input_["description"] = description
    if bot_type is not None:
        input_["bot_type"] = bot_type
    if bot_members is not None:
        input_["bot_members"] = bot_members
    if error_log_settings is not None:
        input_["error_log_settings"] = error_log_settings

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