diff --git a/clients/client-connect/README.md b/clients/client-connect/README.md index fb62e18070a9..eb014db3b3ac 100644 --- a/clients/client-connect/README.md +++ b/clients/client-connect/README.md @@ -351,6 +351,14 @@ CreateIntegrationAssociation [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/createintegrationassociationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/createintegrationassociationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/createintegrationassociationcommandoutput.html) + +
+ +CreateParticipant + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/createparticipantcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/createparticipantcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/createparticipantcommandoutput.html) +
diff --git a/clients/client-connect/src/Connect.ts b/clients/client-connect/src/Connect.ts index 9581d66088f0..d1f7a4a4d4f8 100644 --- a/clients/client-connect/src/Connect.ts +++ b/clients/client-connect/src/Connect.ts @@ -87,6 +87,11 @@ import { CreateIntegrationAssociationCommandInput, CreateIntegrationAssociationCommandOutput, } from "./commands/CreateIntegrationAssociationCommand"; +import { + CreateParticipantCommand, + CreateParticipantCommandInput, + CreateParticipantCommandOutput, +} from "./commands/CreateParticipantCommand"; import { CreateQueueCommand, CreateQueueCommandInput, CreateQueueCommandOutput } from "./commands/CreateQueueCommand"; import { CreateQuickConnectCommand, @@ -812,6 +817,7 @@ const commands = { CreateHoursOfOperationCommand, CreateInstanceCommand, CreateIntegrationAssociationCommand, + CreateParticipantCommand, CreateQueueCommand, CreateQuickConnectCommand, CreateRoutingProfileCommand, @@ -1245,6 +1251,23 @@ export interface Connect { cb: (err: any, data?: CreateIntegrationAssociationCommandOutput) => void ): void; + /** + * @see {@link CreateParticipantCommand} + */ + createParticipant( + args: CreateParticipantCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createParticipant( + args: CreateParticipantCommandInput, + cb: (err: any, data?: CreateParticipantCommandOutput) => void + ): void; + createParticipant( + args: CreateParticipantCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateParticipantCommandOutput) => void + ): void; + /** * @see {@link CreateQueueCommand} */ diff --git a/clients/client-connect/src/ConnectClient.ts b/clients/client-connect/src/ConnectClient.ts index 68d60f948e45..cbcafec1ea80 100644 --- a/clients/client-connect/src/ConnectClient.ts +++ b/clients/client-connect/src/ConnectClient.ts @@ -99,6 +99,7 @@ import { CreateIntegrationAssociationCommandInput, CreateIntegrationAssociationCommandOutput, } from "./commands/CreateIntegrationAssociationCommand"; +import { CreateParticipantCommandInput, CreateParticipantCommandOutput } from "./commands/CreateParticipantCommand"; import { CreateQueueCommandInput, CreateQueueCommandOutput } from "./commands/CreateQueueCommand"; import { CreateQuickConnectCommandInput, CreateQuickConnectCommandOutput } from "./commands/CreateQuickConnectCommand"; import { @@ -548,6 +549,7 @@ export type ServiceInputTypes = | CreateHoursOfOperationCommandInput | CreateInstanceCommandInput | CreateIntegrationAssociationCommandInput + | CreateParticipantCommandInput | CreateQueueCommandInput | CreateQuickConnectCommandInput | CreateRoutingProfileCommandInput @@ -723,6 +725,7 @@ export type ServiceOutputTypes = | CreateHoursOfOperationCommandOutput | CreateInstanceCommandOutput | CreateIntegrationAssociationCommandOutput + | CreateParticipantCommandOutput | CreateQueueCommandOutput | CreateQuickConnectCommandOutput | CreateRoutingProfileCommandOutput diff --git a/clients/client-connect/src/commands/CreateParticipantCommand.ts b/clients/client-connect/src/commands/CreateParticipantCommand.ts new file mode 100644 index 000000000000..03f3c79a0087 --- /dev/null +++ b/clients/client-connect/src/commands/CreateParticipantCommand.ts @@ -0,0 +1,157 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; +import { CreateParticipantRequest, CreateParticipantResponse } from "../models/models_0"; +import { de_CreateParticipantCommand, se_CreateParticipantCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + * + * The input for {@link CreateParticipantCommand}. + */ +export interface CreateParticipantCommandInput extends CreateParticipantRequest {} +/** + * @public + * + * The output of {@link CreateParticipantCommand}. + */ +export interface CreateParticipantCommandOutput extends CreateParticipantResponse, __MetadataBearer {} + +/** + * @public + *

Adds a new participant into an on-going chat contact. For more information, see Customize chat + * flow experiences by integrating custom participants.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ConnectClient, CreateParticipantCommand } from "@aws-sdk/client-connect"; // ES Modules import + * // const { ConnectClient, CreateParticipantCommand } = require("@aws-sdk/client-connect"); // CommonJS import + * const client = new ConnectClient(config); + * const input = { // CreateParticipantRequest + * InstanceId: "STRING_VALUE", // required + * ContactId: "STRING_VALUE", // required + * ClientToken: "STRING_VALUE", + * ParticipantDetails: { // ParticipantDetailsToAdd + * ParticipantRole: "AGENT" || "CUSTOMER" || "SYSTEM" || "CUSTOM_BOT", + * DisplayName: "STRING_VALUE", + * }, + * }; + * const command = new CreateParticipantCommand(input); + * const response = await client.send(command); + * ``` + * + * @param CreateParticipantCommandInput - {@link CreateParticipantCommandInput} + * @returns {@link CreateParticipantCommandOutput} + * @see {@link CreateParticipantCommandInput} for command's `input` shape. + * @see {@link CreateParticipantCommandOutput} for command's `response` shape. + * @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. + * + * @throws {@link InternalServiceException} (server fault) + *

Request processing failed because of an error or failure with the service.

+ * + * @throws {@link InvalidParameterException} (client fault) + *

One or more of the specified parameters are not valid.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

The request is not valid.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource was not found.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The service quota has been exceeded.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The throttling limit has been exceeded.

+ * + * + */ +export class CreateParticipantCommand extends $Command< + CreateParticipantCommandInput, + CreateParticipantCommandOutput, + ConnectClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateParticipantCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ConnectClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, CreateParticipantCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "ConnectClient"; + const commandName = "CreateParticipantCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateParticipantCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateParticipantCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateParticipantCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-connect/src/commands/ListAgentStatusesCommand.ts b/clients/client-connect/src/commands/ListAgentStatusesCommand.ts index 862fa497a7c1..dbd2fa2fb99b 100644 --- a/clients/client-connect/src/commands/ListAgentStatusesCommand.ts +++ b/clients/client-connect/src/commands/ListAgentStatusesCommand.ts @@ -14,7 +14,8 @@ import { } from "@aws-sdk/types"; import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; -import { ListAgentStatusRequest, ListAgentStatusResponse } from "../models/models_0"; +import { ListAgentStatusRequest } from "../models/models_0"; +import { ListAgentStatusResponse } from "../models/models_1"; import { de_ListAgentStatusesCommand, se_ListAgentStatusesCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-connect/src/commands/ListApprovedOriginsCommand.ts b/clients/client-connect/src/commands/ListApprovedOriginsCommand.ts index a9128a200888..805c2cafbdfa 100644 --- a/clients/client-connect/src/commands/ListApprovedOriginsCommand.ts +++ b/clients/client-connect/src/commands/ListApprovedOriginsCommand.ts @@ -14,7 +14,7 @@ import { } from "@aws-sdk/types"; import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; -import { ListApprovedOriginsRequest, ListApprovedOriginsResponse } from "../models/models_0"; +import { ListApprovedOriginsRequest, ListApprovedOriginsResponse } from "../models/models_1"; import { de_ListApprovedOriginsCommand, se_ListApprovedOriginsCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-connect/src/commands/ListBotsCommand.ts b/clients/client-connect/src/commands/ListBotsCommand.ts index 898852795941..bd2d71c03a78 100644 --- a/clients/client-connect/src/commands/ListBotsCommand.ts +++ b/clients/client-connect/src/commands/ListBotsCommand.ts @@ -14,8 +14,7 @@ import { } from "@aws-sdk/types"; import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; -import { ListBotsRequest } from "../models/models_0"; -import { ListBotsResponse } from "../models/models_1"; +import { ListBotsRequest, ListBotsResponse } from "../models/models_1"; import { de_ListBotsCommand, se_ListBotsCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-connect/src/commands/index.ts b/clients/client-connect/src/commands/index.ts index a49c52cf2774..4636894b98ee 100644 --- a/clients/client-connect/src/commands/index.ts +++ b/clients/client-connect/src/commands/index.ts @@ -16,6 +16,7 @@ export * from "./CreateContactFlowModuleCommand"; export * from "./CreateHoursOfOperationCommand"; export * from "./CreateInstanceCommand"; export * from "./CreateIntegrationAssociationCommand"; +export * from "./CreateParticipantCommand"; export * from "./CreateQueueCommand"; export * from "./CreateQuickConnectCommand"; export * from "./CreateRoutingProfileCommand"; diff --git a/clients/client-connect/src/models/models_0.ts b/clients/client-connect/src/models/models_0.ts index 50b635dc001f..dba510b62673 100644 --- a/clients/client-connect/src/models/models_0.ts +++ b/clients/client-connect/src/models/models_0.ts @@ -1589,6 +1589,106 @@ export interface CreateIntegrationAssociationResponse { IntegrationAssociationArn?: string; } +/** + * @public + * @enum + */ +export const ParticipantRole = { + AGENT: "AGENT", + CUSTOMER: "CUSTOMER", + CUSTOM_BOT: "CUSTOM_BOT", + SYSTEM: "SYSTEM", +} as const; + +/** + * @public + */ +export type ParticipantRole = (typeof ParticipantRole)[keyof typeof ParticipantRole]; + +/** + * @public + *

The details to add for the participant.

+ */ +export interface ParticipantDetailsToAdd { + /** + *

The role of the participant being added.

+ */ + ParticipantRole?: ParticipantRole | string; + + /** + *

The display name of the participant.

+ */ + DisplayName?: string; +} + +/** + * @public + */ +export interface CreateParticipantRequest { + /** + *

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

+ */ + InstanceId: string | undefined; + + /** + *

The identifier of the contact in this instance of Amazon Connect. Only contacts in the CHAT channel are supported.

+ */ + ContactId: string | undefined; + + /** + *

A unique, case-sensitive identifier that you provide to ensure the idempotency of the + * request. If not provided, the Amazon Web Services + * SDK populates this field. For more information about idempotency, see + * Making retries safe with idempotent APIs.

+ */ + ClientToken?: string; + + /** + *

Information identifying the participant.

+ * + *

The only Valid value for ParticipantRole is CUSTOM_BOT.

+ *

+ * DisplayName is Required.

+ *
+ */ + ParticipantDetails: ParticipantDetailsToAdd | undefined; +} + +/** + * @public + *

The credentials used by the participant.

+ */ +export interface ParticipantTokenCredentials { + /** + *

The token used by the chat participant to call CreateParticipantConnection. The participant token is valid for the lifetime of a chat + * participant.

+ */ + ParticipantToken?: string; + + /** + *

The expiration of the token. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. + * For example, 2019-11-08T02:41:28.172Z.

+ */ + Expiry?: string; +} + +/** + * @public + */ +export interface CreateParticipantResponse { + /** + *

The token used by the chat participant to call CreateParticipantConnection. The participant + * token is valid for the lifetime of a chat participant.

+ */ + ParticipantCredentials?: ParticipantTokenCredentials; + + /** + *

The identifier for a chat participant. The participantId for a chat participant is the same + * throughout the chat lifecycle.

+ */ + ParticipantId?: string; +} + /** * @public *

The outbound caller ID name, number, and outbound whisper flow.

@@ -1818,12 +1918,13 @@ export type BehaviorType = (typeof BehaviorType)[keyof typeof BehaviorType]; /** * @public - *

Defines the cross-channel routing behavior that allows an agent working on a contact in - * one channel to be offered a contact from a different channel.

+ *

Defines the cross-channel routing behavior that allows an agent working on a contact in one + * channel to be offered a contact from a different channel.

*/ export interface CrossChannelBehavior { /** - *

Specifies the other channels that can be routed to an agent handling their current channel.

+ *

Specifies the other channels that can be routed to an agent handling their current + * channel.

*/ BehaviorType: BehaviorType | string | undefined; } @@ -6511,9 +6612,9 @@ export interface FilterV2 { export interface MetricFilterV2 { /** *

The key to use for filtering data.

- *

Valid metric filter keys: INITIATION_METHOD, - * DISCONNECT_REASON - *

+ *

Valid metric filter keys: INITIATION_METHOD, DISCONNECT_REASON. + * These are the same values as the InitiationMethod and DisconnectReason + * in the contact record. For more information, see ContactTraceRecord in the Amazon Connect Administrator's Guide.

*/ MetricFilterKey?: string; @@ -6590,8 +6691,8 @@ export interface GetMetricDataV2Request { /** *

The timestamp, in UNIX Epoch time format, at which to end the reporting interval for the - * retrieval of historical metrics data. The time must be later than the start time - * timestamp. It cannot be later than the current timestamp.

+ * retrieval of historical metrics data. The time must be later than the start time timestamp. It + * cannot be later than the current timestamp.

*

The time range between the start and end time must be less than 24 hours.

*/ EndTime: Date | undefined; @@ -7062,97 +7163,6 @@ export interface ListAgentStatusRequest { AgentStatusTypes?: (AgentStatusType | string)[]; } -/** - * @public - */ -export interface ListAgentStatusResponse { - /** - *

If there are additional results, this is the token for the next set of results.

- */ - NextToken?: string; - - /** - *

A summary of agent statuses.

- */ - AgentStatusSummaryList?: AgentStatusSummary[]; -} - -/** - * @public - */ -export interface ListApprovedOriginsRequest { - /** - *

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

- */ - InstanceId: string | undefined; - - /** - *

The token for the next set of results. Use the value returned in the previous - * response in the next request to retrieve the next set of results.

- */ - NextToken?: string; - - /** - *

The maximum number of results to return per page.

- */ - MaxResults?: number; -} - -/** - * @public - */ -export interface ListApprovedOriginsResponse { - /** - *

The approved origins.

- */ - Origins?: string[]; - - /** - *

If there are additional results, this is the token for the next set of results.

- */ - NextToken?: string; -} - -/** - * @public - * @enum - */ -export const LexVersion = { - V1: "V1", - V2: "V2", -} as const; - -/** - * @public - */ -export type LexVersion = (typeof LexVersion)[keyof typeof LexVersion]; - -/** - * @public - */ -export interface ListBotsRequest { - /** - *

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

- */ - InstanceId: string | undefined; - - /** - *

The token for the next set of results. Use the value returned in the previous - * response in the next request to retrieve the next set of results.

- */ - NextToken?: string; - - /** - *

The maximum number of results to return per page.

- */ - MaxResults?: number; - - /** - *

The version of Amazon Lex or Amazon Lex V2.

- */ - LexVersion: LexVersion | string | undefined; -} - /** * @internal */ diff --git a/clients/client-connect/src/models/models_1.ts b/clients/client-connect/src/models/models_1.ts index 9f07d6a2e709..349365e61e73 100644 --- a/clients/client-connect/src/models/models_1.ts +++ b/clients/client-connect/src/models/models_1.ts @@ -5,6 +5,7 @@ import { ConnectServiceException as __BaseException } from "./ConnectServiceExce import { ActionSummary, AgentStatusState, + AgentStatusSummary, Attribute, Channel, ContactFlowModuleState, @@ -50,6 +51,97 @@ import { VocabularyState, } from "./models_0"; +/** + * @public + */ +export interface ListAgentStatusResponse { + /** + *

If there are additional results, this is the token for the next set of results.

+ */ + NextToken?: string; + + /** + *

A summary of agent statuses.

+ */ + AgentStatusSummaryList?: AgentStatusSummary[]; +} + +/** + * @public + */ +export interface ListApprovedOriginsRequest { + /** + *

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

+ */ + InstanceId: string | undefined; + + /** + *

The token for the next set of results. Use the value returned in the previous + * response in the next request to retrieve the next set of results.

+ */ + NextToken?: string; + + /** + *

The maximum number of results to return per page.

+ */ + MaxResults?: number; +} + +/** + * @public + */ +export interface ListApprovedOriginsResponse { + /** + *

The approved origins.

+ */ + Origins?: string[]; + + /** + *

If there are additional results, this is the token for the next set of results.

+ */ + NextToken?: string; +} + +/** + * @public + * @enum + */ +export const LexVersion = { + V1: "V1", + V2: "V2", +} as const; + +/** + * @public + */ +export type LexVersion = (typeof LexVersion)[keyof typeof LexVersion]; + +/** + * @public + */ +export interface ListBotsRequest { + /** + *

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

+ */ + InstanceId: string | undefined; + + /** + *

The token for the next set of results. Use the value returned in the previous + * response in the next request to retrieve the next set of results.

+ */ + NextToken?: string; + + /** + *

The maximum number of results to return per page.

+ */ + MaxResults?: number; + + /** + *

The version of Amazon Lex or Amazon Lex V2.

+ */ + LexVersion: LexVersion | string | undefined; +} + /** * @public *

Configuration information of an Amazon Lex or Amazon Lex V2 bot.

@@ -2903,8 +2995,8 @@ export interface SearchVocabulariesResponse { export interface ChatMessage { /** *

The type of the content. Supported types are text/plain, - * text/markdown, application/json, and - * application/vnd.amazonaws.connect.message.interactive.response.

+ * text/markdown, application/json, and + * application/vnd.amazonaws.connect.message.interactive.response.

*/ ContentType: string | undefined; @@ -2920,8 +3012,8 @@ export interface ChatMessage { * 12000.

* *
  • - *

    For application/vnd.amazonaws.connect.message.interactive.response, the Length - * Constraints are Minimum of 1, Maximum of 12288.

    + *

    For application/vnd.amazonaws.connect.message.interactive.response, the + * Length Constraints are Minimum of 1, Maximum of 12288.

    *
  • * */ @@ -3043,15 +3135,14 @@ export interface StartChatContactRequest { ChatDurationInMinutes?: number; /** - *

    The supported chat message content types. - * Supported types are text/plain, - * text/markdown, application/json, application/vnd.amazonaws.connect.message.interactive, and - * application/vnd.amazonaws.connect.message.interactive.response.

    - *

    Content types must always contain - * text/plain. You can then put any other supported type in the list. For example, all - * the following lists are valid because they contain text/plain: [text/plain, - * text/markdown, application/json], [text/markdown, text/plain], - * [text/plain, application/json, + *

    The supported chat message content types. Supported types are text/plain, + * text/markdown, application/json, + * application/vnd.amazonaws.connect.message.interactive, and + * application/vnd.amazonaws.connect.message.interactive.response.

    + *

    Content types must always contain text/plain. You can then put any other + * supported type in the list. For example, all the following lists are valid because they contain + * text/plain: [text/plain, text/markdown, application/json], + * [text/markdown, text/plain], [text/plain, application/json, * application/vnd.amazonaws.connect.message.interactive.response].

    * *

    The type application/vnd.amazonaws.connect.message.interactive is required to diff --git a/clients/client-connect/src/protocols/Aws_restJson1.ts b/clients/client-connect/src/protocols/Aws_restJson1.ts index 660947af66f1..0087b75c1970 100644 --- a/clients/client-connect/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect/src/protocols/Aws_restJson1.ts @@ -75,6 +75,7 @@ import { CreateIntegrationAssociationCommandInput, CreateIntegrationAssociationCommandOutput, } from "../commands/CreateIntegrationAssociationCommand"; +import { CreateParticipantCommandInput, CreateParticipantCommandOutput } from "../commands/CreateParticipantCommand"; import { CreateQueueCommandInput, CreateQueueCommandOutput } from "../commands/CreateQueueCommand"; import { CreateQuickConnectCommandInput, CreateQuickConnectCommandOutput } from "../commands/CreateQuickConnectCommand"; import { @@ -548,6 +549,7 @@ import { MonitorCapability, NotificationRecipientType, OutboundCallerConfig, + ParticipantDetailsToAdd, PhoneNumberCountryCode, PhoneNumberQuickConnectConfig, PhoneNumberType, @@ -1208,6 +1210,39 @@ export const se_CreateIntegrationAssociationCommand = async ( }); }; +/** + * serializeAws_restJson1CreateParticipantCommand + */ +export const se_CreateParticipantCommand = async ( + input: CreateParticipantCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/contact/create-participant"; + let body: any; + body = JSON.stringify( + take(input, { + ClientToken: [true, (_) => _ ?? generateIdempotencyToken()], + ContactId: [], + InstanceId: [], + ParticipantDetails: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1CreateQueueCommand */ @@ -7361,6 +7396,69 @@ const de_CreateIntegrationAssociationCommandError = async ( } }; +/** + * deserializeAws_restJson1CreateParticipantCommand + */ +export const de_CreateParticipantCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CreateParticipantCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ParticipantCredentials: _json, + ParticipantId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateParticipantCommandError + */ +const de_CreateParticipantCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServiceException": + case "com.amazonaws.connect#InternalServiceException": + throw await de_InternalServiceExceptionRes(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.connect#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.connect#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.connect#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.connect#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.connect#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1CreateQueueCommand */ @@ -16893,6 +16991,8 @@ const se_MetricV2 = (input: MetricV2, context: __SerdeContext): any => { // se_ParticipantDetails omitted. +// se_ParticipantDetailsToAdd omitted. + // se_ParticipantTimerConfigList omitted. // se_ParticipantTimerConfiguration omitted. @@ -17569,6 +17669,8 @@ const de_MetricV2 = (output: any, context: __SerdeContext): MetricV2 => { // de_OutboundCallerConfig omitted. +// de_ParticipantTokenCredentials omitted. + // de_PermissionsList omitted. // de_PhoneNumberQuickConnectConfig omitted. diff --git a/codegen/sdk-codegen/aws-models/connect.json b/codegen/sdk-codegen/aws-models/connect.json index fcc3d19b4db5..b456205d5a79 100644 --- a/codegen/sdk-codegen/aws-models/connect.json +++ b/codegen/sdk-codegen/aws-models/connect.json @@ -522,6 +522,9 @@ { "target": "com.amazonaws.connect#CreateIntegrationAssociation" }, + { + "target": "com.amazonaws.connect#CreateParticipant" + }, { "target": "com.amazonaws.connect#CreateQueue" }, @@ -2805,14 +2808,14 @@ "ContentType": { "target": "com.amazonaws.connect#ChatContentType", "traits": { - "smithy.api#documentation": "

    The type of the content. Supported types are text/plain,\n text/markdown, application/json, and \n application/vnd.amazonaws.connect.message.interactive.response.

    ", + "smithy.api#documentation": "

    The type of the content. Supported types are text/plain,\n text/markdown, application/json, and\n application/vnd.amazonaws.connect.message.interactive.response.

    ", "smithy.api#required": {} } }, "Content": { "target": "com.amazonaws.connect#ChatContent", "traits": { - "smithy.api#documentation": "

    The content of the chat message.

    \n
      \n
    • \n

      For text/plain and text/markdown, the Length Constraints are\n Minimum of 1, Maximum of 1024.

      \n
    • \n
    • \n

      For application/json, the Length Constraints are Minimum of 1, Maximum of\n 12000.

      \n
    • \n
    • \n

      For application/vnd.amazonaws.connect.message.interactive.response, the Length\n Constraints are Minimum of 1, Maximum of 12288.

      \n
    • \n
    ", + "smithy.api#documentation": "

    The content of the chat message.

    \n
      \n
    • \n

      For text/plain and text/markdown, the Length Constraints are\n Minimum of 1, Maximum of 1024.

      \n
    • \n
    • \n

      For application/json, the Length Constraints are Minimum of 1, Maximum of\n 12000.

      \n
    • \n
    • \n

      For application/vnd.amazonaws.connect.message.interactive.response, the\n Length Constraints are Minimum of 1, Maximum of 12288.

      \n
    • \n
    ", "smithy.api#required": {} } } @@ -4420,6 +4423,99 @@ "smithy.api#output": {} } }, + "com.amazonaws.connect#CreateParticipant": { + "type": "operation", + "input": { + "target": "com.amazonaws.connect#CreateParticipantRequest" + }, + "output": { + "target": "com.amazonaws.connect#CreateParticipantResponse" + }, + "errors": [ + { + "target": "com.amazonaws.connect#InternalServiceException" + }, + { + "target": "com.amazonaws.connect#InvalidParameterException" + }, + { + "target": "com.amazonaws.connect#InvalidRequestException" + }, + { + "target": "com.amazonaws.connect#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.connect#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.connect#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

    Adds a new participant into an on-going chat contact. For more information, see Customize chat\n flow experiences by integrating custom participants.

    ", + "smithy.api#http": { + "method": "POST", + "uri": "/contact/create-participant", + "code": 200 + } + } + }, + "com.amazonaws.connect#CreateParticipantRequest": { + "type": "structure", + "members": { + "InstanceId": { + "target": "com.amazonaws.connect#InstanceId", + "traits": { + "smithy.api#documentation": "

    The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

    ", + "smithy.api#required": {} + } + }, + "ContactId": { + "target": "com.amazonaws.connect#ContactId", + "traits": { + "smithy.api#documentation": "

    The identifier of the contact in this instance of Amazon Connect. Only contacts in the CHAT channel are supported.

    ", + "smithy.api#required": {} + } + }, + "ClientToken": { + "target": "com.amazonaws.connect#ClientToken", + "traits": { + "smithy.api#documentation": "

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request. If not provided, the Amazon Web Services\n SDK populates this field. For more information about idempotency, see\n Making retries safe with idempotent APIs.

    ", + "smithy.api#idempotencyToken": {} + } + }, + "ParticipantDetails": { + "target": "com.amazonaws.connect#ParticipantDetailsToAdd", + "traits": { + "smithy.api#documentation": "

    Information identifying the participant.

    \n \n

    The only Valid value for ParticipantRole is CUSTOM_BOT.

    \n

    \n DisplayName is Required.

    \n
    ", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.connect#CreateParticipantResponse": { + "type": "structure", + "members": { + "ParticipantCredentials": { + "target": "com.amazonaws.connect#ParticipantTokenCredentials", + "traits": { + "smithy.api#documentation": "

    The token used by the chat participant to call CreateParticipantConnection. The participant\n token is valid for the lifetime of a chat participant.

    " + } + }, + "ParticipantId": { + "target": "com.amazonaws.connect#ParticipantId", + "traits": { + "smithy.api#documentation": "

    The identifier for a chat participant. The participantId for a chat participant is the same\n throughout the chat lifecycle.

    " + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.connect#CreateQueue": { "type": "operation", "input": { @@ -5709,13 +5805,13 @@ "BehaviorType": { "target": "com.amazonaws.connect#BehaviorType", "traits": { - "smithy.api#documentation": "

    Specifies the other channels that can be routed to an agent handling their current channel.

    ", + "smithy.api#documentation": "

    Specifies the other channels that can be routed to an agent handling their current\n channel.

    ", "smithy.api#required": {} } } }, "traits": { - "smithy.api#documentation": "

    Defines the cross-channel routing behavior that allows an agent working on a contact in \n one channel to be offered a contact from a different channel.

    " + "smithy.api#documentation": "

    Defines the cross-channel routing behavior that allows an agent working on a contact in one\n channel to be offered a contact from a different channel.

    " } }, "com.amazonaws.connect#CurrentMetric": { @@ -9761,7 +9857,7 @@ "EndTime": { "target": "com.amazonaws.connect#Timestamp", "traits": { - "smithy.api#documentation": "

    The timestamp, in UNIX Epoch time format, at which to end the reporting interval for the\n retrieval of historical metrics data. The time must be later than the start time\n timestamp. It cannot be later than the current timestamp.

    \n

    The time range between the start and end time must be less than 24 hours.

    ", + "smithy.api#documentation": "

    The timestamp, in UNIX Epoch time format, at which to end the reporting interval for the\n retrieval of historical metrics data. The time must be later than the start time timestamp. It\n cannot be later than the current timestamp.

    \n

    The time range between the start and end time must be less than 24 hours.

    ", "smithy.api#required": {} } }, @@ -10918,6 +11014,9 @@ "smithy.api#documentation": "

    The start time or end time for an hours of operation.

    " } }, + "com.amazonaws.connect#ISO8601Datetime": { + "type": "string" + }, "com.amazonaws.connect#IdempotencyException": { "type": "structure", "members": { @@ -14887,7 +14986,7 @@ "CrossChannelBehavior": { "target": "com.amazonaws.connect#CrossChannelBehavior", "traits": { - "smithy.api#documentation": "

    Defines the cross-channel routing behavior for each channel that is enabled for this Routing \n Profile. For example, this allows you to offer an agent a different contact from another channel \n when they are currently working with a contact from a Voice channel.

    " + "smithy.api#documentation": "

    Defines the cross-channel routing behavior for each channel that is enabled for this Routing\n Profile. For example, this allows you to offer an agent a different contact from another channel\n when they are currently working with a contact from a Voice channel.

    " } } }, @@ -14930,7 +15029,7 @@ "MetricFilterKey": { "target": "com.amazonaws.connect#String", "traits": { - "smithy.api#documentation": "

    The key to use for filtering data.

    \n

    Valid metric filter keys: INITIATION_METHOD,\n DISCONNECT_REASON\n

    " + "smithy.api#documentation": "

    The key to use for filtering data.

    \n

    Valid metric filter keys: INITIATION_METHOD, DISCONNECT_REASON.\n These are the same values as the InitiationMethod and DisconnectReason\n in the contact record. For more information, see ContactTraceRecord in the Amazon Connect Administrator's Guide.

    " } }, "MetricFilterValues": { @@ -15348,6 +15447,26 @@ "smithy.api#documentation": "

    The customer's details.

    " } }, + "com.amazonaws.connect#ParticipantDetailsToAdd": { + "type": "structure", + "members": { + "ParticipantRole": { + "target": "com.amazonaws.connect#ParticipantRole", + "traits": { + "smithy.api#documentation": "

    The role of the participant being added.

    " + } + }, + "DisplayName": { + "target": "com.amazonaws.connect#DisplayName", + "traits": { + "smithy.api#documentation": "

    The display name of the participant.

    " + } + } + }, + "traits": { + "smithy.api#documentation": "

    The details to add for the participant.

    " + } + }, "com.amazonaws.connect#ParticipantId": { "type": "string", "traits": { @@ -15357,6 +15476,35 @@ } } }, + "com.amazonaws.connect#ParticipantRole": { + "type": "enum", + "members": { + "AGENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AGENT" + } + }, + "CUSTOMER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOMER" + } + }, + "SYSTEM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SYSTEM" + } + }, + "CUSTOM_BOT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM_BOT" + } + } + } + }, "com.amazonaws.connect#ParticipantTimerAction": { "type": "enum", "members": { @@ -15464,6 +15612,26 @@ } } }, + "com.amazonaws.connect#ParticipantTokenCredentials": { + "type": "structure", + "members": { + "ParticipantToken": { + "target": "com.amazonaws.connect#ParticipantToken", + "traits": { + "smithy.api#documentation": "

    The token used by the chat participant to call CreateParticipantConnection. The participant token is valid for the lifetime of a chat\n participant.

    " + } + }, + "Expiry": { + "target": "com.amazonaws.connect#ISO8601Datetime", + "traits": { + "smithy.api#documentation": "

    The expiration of the token. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ.\n For example, 2019-11-08T02:41:28.172Z.

    " + } + } + }, + "traits": { + "smithy.api#documentation": "

    The credentials used by the participant.

    " + } + }, "com.amazonaws.connect#Password": { "type": "string", "traits": { @@ -20181,7 +20349,7 @@ "SupportedMessagingContentTypes": { "target": "com.amazonaws.connect#SupportedMessagingContentTypes", "traits": { - "smithy.api#documentation": "

    The supported chat message content types. \n Supported types are text/plain,\n text/markdown, application/json, application/vnd.amazonaws.connect.message.interactive, and \n application/vnd.amazonaws.connect.message.interactive.response.

    \n

    Content types must always contain\n text/plain. You can then put any other supported type in the list. For example, all\n the following lists are valid because they contain text/plain: [text/plain,\n text/markdown, application/json], [text/markdown, text/plain],\n [text/plain, application/json,\n application/vnd.amazonaws.connect.message.interactive.response].

    \n \n

    The type application/vnd.amazonaws.connect.message.interactive is required to\n use the Show\n view flow block.

    \n
    " + "smithy.api#documentation": "

    The supported chat message content types. Supported types are text/plain,\n text/markdown, application/json,\n application/vnd.amazonaws.connect.message.interactive, and\n application/vnd.amazonaws.connect.message.interactive.response.

    \n

    Content types must always contain text/plain. You can then put any other\n supported type in the list. For example, all the following lists are valid because they contain\n text/plain: [text/plain, text/markdown, application/json],\n [text/markdown, text/plain], [text/plain, application/json,\n application/vnd.amazonaws.connect.message.interactive.response].

    \n \n

    The type application/vnd.amazonaws.connect.message.interactive is required to\n use the Show\n view flow block.

    \n
    " } }, "PersistentChat": {