- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateBotCommand
Updates the configuration of an existing bot.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { LexModelsV2Client, UpdateBotCommand } from "@aws-sdk/client-lex-models-v2"; // ES Modules import
// const { LexModelsV2Client, UpdateBotCommand } = require("@aws-sdk/client-lex-models-v2"); // CommonJS import
const client = new LexModelsV2Client(config);
const input = { // UpdateBotRequest
botId: "STRING_VALUE", // required
botName: "STRING_VALUE", // required
description: "STRING_VALUE",
roleArn: "STRING_VALUE", // required
dataPrivacy: { // DataPrivacy
childDirected: true || false, // required
},
idleSessionTTLInSeconds: Number("int"), // required
botType: "Bot" || "BotNetwork",
botMembers: [ // BotMembers
{ // BotMember
botMemberId: "STRING_VALUE", // required
botMemberName: "STRING_VALUE", // required
botMemberAliasId: "STRING_VALUE", // required
botMemberAliasName: "STRING_VALUE", // required
botMemberVersion: "STRING_VALUE", // required
},
],
errorLogSettings: { // ErrorLogSettings
enabled: true || false, // required
},
};
const command = new UpdateBotCommand(input);
const response = await client.send(command);
// { // UpdateBotResponse
// botId: "STRING_VALUE",
// botName: "STRING_VALUE",
// description: "STRING_VALUE",
// roleArn: "STRING_VALUE",
// dataPrivacy: { // DataPrivacy
// childDirected: true || false, // required
// },
// idleSessionTTLInSeconds: Number("int"),
// botStatus: "Creating" || "Available" || "Inactive" || "Deleting" || "Failed" || "Versioning" || "Importing" || "Updating",
// creationDateTime: new Date("TIMESTAMP"),
// lastUpdatedDateTime: new Date("TIMESTAMP"),
// botType: "Bot" || "BotNetwork",
// botMembers: [ // BotMembers
// { // BotMember
// botMemberId: "STRING_VALUE", // required
// botMemberName: "STRING_VALUE", // required
// botMemberAliasId: "STRING_VALUE", // required
// botMemberAliasName: "STRING_VALUE", // required
// botMemberVersion: "STRING_VALUE", // required
// },
// ],
// errorLogSettings: { // ErrorLogSettings
// enabled: true || false, // required
// },
// };
UpdateBotCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
botId Required | string | undefined | The unique identifier of the bot to update. This identifier is returned by the CreateBot operation. |
botName Required | string | undefined | The new name of the bot. The name must be unique in the account that creates the bot. |
dataPrivacy Required | DataPrivacy | undefined | Provides information on additional privacy protections Amazon Lex should use with the bot's data. |
idleSessionTTLInSeconds Required | number | undefined | 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. |
roleArn Required | string | undefined | The Amazon Resource Name (ARN) of an IAM role that has permissions to access the bot. |
botMembers | BotMember[] | undefined | The list of bot members in the network associated with the update action. |
botType | BotType | undefined | The type of the bot to be updated. |
description | string | undefined | A description of the bot. |
errorLogSettings | ErrorLogSettings | undefined | 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. |
UpdateBotCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
botId | string | undefined | The unique identifier of the bot that was updated. |
botMembers | BotMember[] | undefined | The list of bot members in the network that was updated. |
botName | string | undefined | The name of the bot after the update. |
botStatus | BotStatus | undefined | Shows the current status of the bot. The bot is first in the |
botType | BotType | undefined | The type of the bot that was updated. |
creationDateTime | Date | undefined | A timestamp of the date and time that the bot was created. |
dataPrivacy | DataPrivacy | undefined | The data privacy settings for the bot after the update. |
description | string | undefined | The description of the bot after the update. |
errorLogSettings | ErrorLogSettings | undefined | Settings for managing error logs within the response of an update bot operation. |
idleSessionTTLInSeconds | number | undefined | The session timeout, in seconds, for the bot after the update. |
lastUpdatedDateTime | Date | undefined | A timestamp of the date and time that the bot was last updated. |
roleArn | string | undefined | The Amazon Resource Name (ARN) of the IAM role used by the bot after the update. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ConflictException | client | 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 | server | The service encountered an unexpected condition. Try your request again. |
PreconditionFailedException | client | 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 | client | You have reached a quota for your bot. |
ThrottlingException | client | Your request rate is too high. Reduce the frequency of requests. |
ValidationException | client | One of the input parameters in your request isn't valid. Check the parameters and try your request again. |
LexModelsV2ServiceException | Base exception class for all service exceptions from LexModelsV2 service. |