import type { MetadataBearer as __MetadataBearer, StreamingBlobPayloadOutputTypes } from "@smithy/types"; import type { PutSessionRequest, PutSessionResponse } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; /** * @public * * The input for {@link PutSessionCommand}. */ export interface PutSessionCommandInput extends PutSessionRequest { } /** * @public * * The output of {@link PutSessionCommand}. */ export interface PutSessionCommandOutput extends Omit, __MetadataBearer { audioStream?: StreamingBlobPayloadOutputTypes; } declare const PutSessionCommand_base: { new (input: PutSessionCommandInput): import("@smithy/core/client").CommandImpl; new (input: PutSessionCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions; }; /** *

Creates a new session or modifies an existing session with an Amazon Lex * bot. Use this operation to enable your application to set the state of the * bot.

*

For more information, see Managing * Sessions.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { LexRuntimeServiceClient, PutSessionCommand } from "@aws-sdk/client-lex-runtime-service"; // ES Modules import * // const { LexRuntimeServiceClient, PutSessionCommand } = require("@aws-sdk/client-lex-runtime-service"); // CommonJS import * // import type { LexRuntimeServiceClientConfig } from "@aws-sdk/client-lex-runtime-service"; * const config = {}; // type is LexRuntimeServiceClientConfig * const client = new LexRuntimeServiceClient(config); * const input = { // PutSessionRequest * botName: "STRING_VALUE", // required * botAlias: "STRING_VALUE", // required * userId: "STRING_VALUE", // required * sessionAttributes: { // StringMap * "": "STRING_VALUE", * }, * dialogAction: { // DialogAction * type: "ElicitIntent" || "ConfirmIntent" || "ElicitSlot" || "Close" || "Delegate", // required * intentName: "STRING_VALUE", * slots: { * "": "STRING_VALUE", * }, * slotToElicit: "STRING_VALUE", * fulfillmentState: "Fulfilled" || "Failed" || "ReadyForFulfillment", * message: "STRING_VALUE", * messageFormat: "PlainText" || "CustomPayload" || "SSML" || "Composite", * }, * recentIntentSummaryView: [ // IntentSummaryList * { // IntentSummary * intentName: "STRING_VALUE", * checkpointLabel: "STRING_VALUE", * slots: "", * confirmationStatus: "None" || "Confirmed" || "Denied", * dialogActionType: "ElicitIntent" || "ConfirmIntent" || "ElicitSlot" || "Close" || "Delegate", // required * fulfillmentState: "Fulfilled" || "Failed" || "ReadyForFulfillment", * slotToElicit: "STRING_VALUE", * }, * ], * accept: "STRING_VALUE", * activeContexts: [ // ActiveContextsList * { // ActiveContext * name: "STRING_VALUE", // required * timeToLive: { // ActiveContextTimeToLive * timeToLiveInSeconds: Number("int"), * turnsToLive: Number("int"), * }, * parameters: { // ActiveContextParametersMap // required * "": "STRING_VALUE", * }, * }, * ], * }; * const command = new PutSessionCommand(input); * const response = await client.send(command); * // consume or destroy the stream to free the socket. * const bytes = await response.audioStream.transformToByteArray(); * // const str = await response.audioStream.transformToString(); * // response.audioStream.destroy(); // only applicable to Node.js Readable streams. * * // { // PutSessionResponse * // contentType: "STRING_VALUE", * // intentName: "STRING_VALUE", * // slots: "STRING_VALUE", * // sessionAttributes: "STRING_VALUE", * // message: "STRING_VALUE", * // encodedMessage: "STRING_VALUE", * // messageFormat: "PlainText" || "CustomPayload" || "SSML" || "Composite", * // dialogState: "ElicitIntent" || "ConfirmIntent" || "ElicitSlot" || "Fulfilled" || "ReadyForFulfillment" || "Failed", * // slotToElicit: "STRING_VALUE", * // audioStream: "", // see \@smithy/types -> StreamingBlobPayloadOutputTypes * // sessionId: "STRING_VALUE", * // activeContexts: "STRING_VALUE", * // }; * * ``` * * @param PutSessionCommandInput - {@link PutSessionCommandInput} * @returns {@link PutSessionCommandOutput} * @see {@link PutSessionCommandInput} for command's `input` shape. * @see {@link PutSessionCommandOutput} for command's `response` shape. * @see {@link LexRuntimeServiceClientResolvedConfig | config} for LexRuntimeServiceClient's `config` shape. * * @throws {@link BadGatewayException} (server fault) *

Either the Amazon Lex bot is still building, or one of the dependent * services (Amazon Polly, AWS Lambda) failed with an internal service * error.

* * @throws {@link BadRequestException} (client fault) *

Request validation failed, there is no usable message in the context, * or the bot build failed, is still in progress, or contains unbuilt * changes.

* * @throws {@link ConflictException} (client fault) *

Two clients are using the same AWS account, Amazon Lex bot, and user * ID.

* * @throws {@link DependencyFailedException} (client fault) *

One of the dependencies, such as AWS Lambda or Amazon Polly, threw an * exception. For example,

*
    *
  • *

    If Amazon Lex does not have sufficient permissions to call a Lambda * function.

    *
  • *
  • *

    If a Lambda function takes longer than 30 seconds to * execute.

    *
  • *
  • *

    If a fulfillment Lambda function returns a Delegate * dialog action without removing any slot values.

    *
  • *
* * @throws {@link InternalFailureException} (server fault) *

Internal service error. Retry the call.

* * @throws {@link LimitExceededException} (client fault) *

Exceeded a limit.

* * @throws {@link NotAcceptableException} (client fault) *

The accept header in the request does not have a valid value.

* * @throws {@link NotFoundException} (client fault) *

The resource (such as the Amazon Lex bot or an alias) that is referred * to is not found.

* * @throws {@link LexRuntimeServiceServiceException} *

Base exception class for all service exceptions from LexRuntimeService service.

* * * @public */ export declare class PutSessionCommand extends PutSessionCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: PutSessionRequest; output: PutSessionResponse; }; sdk: { input: PutSessionCommandInput; output: PutSessionCommandOutput; }; }; }