Skip to content

Commit

Permalink
feat(client-connect): This release adds a new API CreateParticipant. …
Browse files Browse the repository at this point in the history
…For Amazon Connect Chat, you can use this new API to customize chat flow experiences.
  • Loading branch information
awstools committed Apr 21, 2023
1 parent cc30733 commit 257af63
Show file tree
Hide file tree
Showing 12 changed files with 687 additions and 124 deletions.
8 changes: 8 additions & 0 deletions clients/client-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

</details>
<details>
<summary>
CreateParticipant
</summary>

[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)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-connect/src/Connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -812,6 +817,7 @@ const commands = {
CreateHoursOfOperationCommand,
CreateInstanceCommand,
CreateIntegrationAssociationCommand,
CreateParticipantCommand,
CreateQueueCommand,
CreateQuickConnectCommand,
CreateRoutingProfileCommand,
Expand Down Expand Up @@ -1245,6 +1251,23 @@ export interface Connect {
cb: (err: any, data?: CreateIntegrationAssociationCommandOutput) => void
): void;

/**
* @see {@link CreateParticipantCommand}
*/
createParticipant(
args: CreateParticipantCommandInput,
options?: __HttpHandlerOptions
): Promise<CreateParticipantCommandOutput>;
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}
*/
Expand Down
3 changes: 3 additions & 0 deletions clients/client-connect/src/ConnectClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -548,6 +549,7 @@ export type ServiceInputTypes =
| CreateHoursOfOperationCommandInput
| CreateInstanceCommandInput
| CreateIntegrationAssociationCommandInput
| CreateParticipantCommandInput
| CreateQueueCommandInput
| CreateQuickConnectCommandInput
| CreateRoutingProfileCommandInput
Expand Down Expand Up @@ -723,6 +725,7 @@ export type ServiceOutputTypes =
| CreateHoursOfOperationCommandOutput
| CreateInstanceCommandOutput
| CreateIntegrationAssociationCommandOutput
| CreateParticipantCommandOutput
| CreateQueueCommandOutput
| CreateQuickConnectCommandOutput
| CreateRoutingProfileCommandOutput
Expand Down
157 changes: 157 additions & 0 deletions clients/client-connect/src/commands/CreateParticipantCommand.ts
Original file line number Diff line number Diff line change
@@ -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
* <p>Adds a new participant into an on-going chat contact. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/chat-customize-flow.html">Customize chat
* flow experiences by integrating custom participants</a>.</p>
* @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)
* <p>Request processing failed because of an error or failure with the service.</p>
*
* @throws {@link InvalidParameterException} (client fault)
* <p>One or more of the specified parameters are not valid.</p>
*
* @throws {@link InvalidRequestException} (client fault)
* <p>The request is not valid.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource was not found.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>The service quota has been exceeded.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The throttling limit has been exceeded.</p>
*
*
*/
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<ServiceInputTypes, ServiceOutputTypes>,
configuration: ConnectClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CreateParticipantCommandInput, CreateParticipantCommandOutput> {
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<any>) =>
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<CreateParticipantCommandOutput> {
return de_CreateParticipantCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
3 changes: 1 addition & 2 deletions clients/client-connect/src/commands/ListBotsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
1 change: 1 addition & 0 deletions clients/client-connect/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading

0 comments on commit 257af63

Please sign in to comment.