Skip to content

Commit

Permalink
feat(client-connect): This release adds the following features: 1) Ne…
Browse files Browse the repository at this point in the history
…w APIs to manage (create, list, update) task template resources, 2) Updates to startTaskContact API to support task templates, and 3) new TransferContact API to programmatically transfer in-progress tasks via a contact flow.
  • Loading branch information
awstools committed Jun 2, 2022
1 parent fd798b0 commit e10c8ed
Show file tree
Hide file tree
Showing 34 changed files with 5,283 additions and 826 deletions.
299 changes: 277 additions & 22 deletions clients/client-connect/src/Connect.ts

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions clients/client-connect/src/ConnectClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ import {
CreateSecurityProfileCommandInput,
CreateSecurityProfileCommandOutput,
} from "./commands/CreateSecurityProfileCommand";
import { CreateTaskTemplateCommandInput, CreateTaskTemplateCommandOutput } from "./commands/CreateTaskTemplateCommand";
import { CreateUseCaseCommandInput, CreateUseCaseCommandOutput } from "./commands/CreateUseCaseCommand";
import { CreateUserCommandInput, CreateUserCommandOutput } from "./commands/CreateUserCommand";
import {
Expand All @@ -138,6 +139,7 @@ import {
DeleteSecurityProfileCommandInput,
DeleteSecurityProfileCommandOutput,
} from "./commands/DeleteSecurityProfileCommand";
import { DeleteTaskTemplateCommandInput, DeleteTaskTemplateCommandOutput } from "./commands/DeleteTaskTemplateCommand";
import { DeleteUseCaseCommandInput, DeleteUseCaseCommandOutput } from "./commands/DeleteUseCaseCommand";
import { DeleteUserCommandInput, DeleteUserCommandOutput } from "./commands/DeleteUserCommand";
import {
Expand Down Expand Up @@ -238,6 +240,7 @@ import {
} from "./commands/GetCurrentMetricDataCommand";
import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "./commands/GetFederationTokenCommand";
import { GetMetricDataCommandInput, GetMetricDataCommandOutput } from "./commands/GetMetricDataCommand";
import { GetTaskTemplateCommandInput, GetTaskTemplateCommandOutput } from "./commands/GetTaskTemplateCommand";
import { ListAgentStatusesCommandInput, ListAgentStatusesCommandOutput } from "./commands/ListAgentStatusesCommand";
import {
ListApprovedOriginsCommandInput,
Expand Down Expand Up @@ -309,6 +312,7 @@ import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { ListTaskTemplatesCommandInput, ListTaskTemplatesCommandOutput } from "./commands/ListTaskTemplatesCommand";
import { ListUseCasesCommandInput, ListUseCasesCommandOutput } from "./commands/ListUseCasesCommand";
import {
ListUserHierarchyGroupsCommandInput,
Expand Down Expand Up @@ -355,6 +359,7 @@ import {
SuspendContactRecordingCommandOutput,
} from "./commands/SuspendContactRecordingCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { TransferContactCommandInput, TransferContactCommandOutput } from "./commands/TransferContactCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import { UpdateAgentStatusCommandInput, UpdateAgentStatusCommandOutput } from "./commands/UpdateAgentStatusCommand";
import {
Expand Down Expand Up @@ -441,6 +446,7 @@ import {
UpdateSecurityProfileCommandInput,
UpdateSecurityProfileCommandOutput,
} from "./commands/UpdateSecurityProfileCommand";
import { UpdateTaskTemplateCommandInput, UpdateTaskTemplateCommandOutput } from "./commands/UpdateTaskTemplateCommand";
import {
UpdateUserHierarchyCommandInput,
UpdateUserHierarchyCommandOutput,
Expand Down Expand Up @@ -493,6 +499,7 @@ export type ServiceInputTypes =
| CreateQuickConnectCommandInput
| CreateRoutingProfileCommandInput
| CreateSecurityProfileCommandInput
| CreateTaskTemplateCommandInput
| CreateUseCaseCommandInput
| CreateUserCommandInput
| CreateUserHierarchyGroupCommandInput
Expand All @@ -504,6 +511,7 @@ export type ServiceInputTypes =
| DeleteIntegrationAssociationCommandInput
| DeleteQuickConnectCommandInput
| DeleteSecurityProfileCommandInput
| DeleteTaskTemplateCommandInput
| DeleteUseCaseCommandInput
| DeleteUserCommandInput
| DeleteUserHierarchyGroupCommandInput
Expand Down Expand Up @@ -538,6 +546,7 @@ export type ServiceInputTypes =
| GetCurrentMetricDataCommandInput
| GetFederationTokenCommandInput
| GetMetricDataCommandInput
| GetTaskTemplateCommandInput
| ListAgentStatusesCommandInput
| ListApprovedOriginsCommandInput
| ListBotsCommandInput
Expand All @@ -564,6 +573,7 @@ export type ServiceInputTypes =
| ListSecurityProfilePermissionsCommandInput
| ListSecurityProfilesCommandInput
| ListTagsForResourceCommandInput
| ListTaskTemplatesCommandInput
| ListUseCasesCommandInput
| ListUserHierarchyGroupsCommandInput
| ListUsersCommandInput
Expand All @@ -583,6 +593,7 @@ export type ServiceInputTypes =
| StopContactStreamingCommandInput
| SuspendContactRecordingCommandInput
| TagResourceCommandInput
| TransferContactCommandInput
| UntagResourceCommandInput
| UpdateAgentStatusCommandInput
| UpdateContactAttributesCommandInput
Expand All @@ -609,6 +620,7 @@ export type ServiceInputTypes =
| UpdateRoutingProfileNameCommandInput
| UpdateRoutingProfileQueuesCommandInput
| UpdateSecurityProfileCommandInput
| UpdateTaskTemplateCommandInput
| UpdateUserHierarchyCommandInput
| UpdateUserHierarchyGroupNameCommandInput
| UpdateUserHierarchyStructureCommandInput
Expand Down Expand Up @@ -639,6 +651,7 @@ export type ServiceOutputTypes =
| CreateQuickConnectCommandOutput
| CreateRoutingProfileCommandOutput
| CreateSecurityProfileCommandOutput
| CreateTaskTemplateCommandOutput
| CreateUseCaseCommandOutput
| CreateUserCommandOutput
| CreateUserHierarchyGroupCommandOutput
Expand All @@ -650,6 +663,7 @@ export type ServiceOutputTypes =
| DeleteIntegrationAssociationCommandOutput
| DeleteQuickConnectCommandOutput
| DeleteSecurityProfileCommandOutput
| DeleteTaskTemplateCommandOutput
| DeleteUseCaseCommandOutput
| DeleteUserCommandOutput
| DeleteUserHierarchyGroupCommandOutput
Expand Down Expand Up @@ -684,6 +698,7 @@ export type ServiceOutputTypes =
| GetCurrentMetricDataCommandOutput
| GetFederationTokenCommandOutput
| GetMetricDataCommandOutput
| GetTaskTemplateCommandOutput
| ListAgentStatusesCommandOutput
| ListApprovedOriginsCommandOutput
| ListBotsCommandOutput
Expand All @@ -710,6 +725,7 @@ export type ServiceOutputTypes =
| ListSecurityProfilePermissionsCommandOutput
| ListSecurityProfilesCommandOutput
| ListTagsForResourceCommandOutput
| ListTaskTemplatesCommandOutput
| ListUseCasesCommandOutput
| ListUserHierarchyGroupsCommandOutput
| ListUsersCommandOutput
Expand All @@ -729,6 +745,7 @@ export type ServiceOutputTypes =
| StopContactStreamingCommandOutput
| SuspendContactRecordingCommandOutput
| TagResourceCommandOutput
| TransferContactCommandOutput
| UntagResourceCommandOutput
| UpdateAgentStatusCommandOutput
| UpdateContactAttributesCommandOutput
Expand All @@ -755,6 +772,7 @@ export type ServiceOutputTypes =
| UpdateRoutingProfileNameCommandOutput
| UpdateRoutingProfileQueuesCommandOutput
| UpdateSecurityProfileCommandOutput
| UpdateTaskTemplateCommandOutput
| UpdateUserHierarchyCommandOutput
| UpdateUserHierarchyGroupNameCommandOutput
| UpdateUserHierarchyStructureCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export interface AssociateDefaultVocabularyCommandInput extends AssociateDefault
export interface AssociateDefaultVocabularyCommandOutput extends AssociateDefaultVocabularyResponse, __MetadataBearer {}

/**
* <p>Associates an existing vocabulary as the default. Contact Lens for Amazon Connect uses the vocabulary in post-call and real-time analysis sessions for the given language.</p>
* <p>Associates an existing vocabulary as the default. Contact Lens for Amazon Connect uses the vocabulary in post-call
* and real-time analysis sessions for the given language.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
96 changes: 96 additions & 0 deletions clients/client-connect/src/commands/CreateTaskTemplateCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// smithy-typescript generated code
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 { CreateTaskTemplateRequest, CreateTaskTemplateResponse } from "../models/models_0";
import {
deserializeAws_restJson1CreateTaskTemplateCommand,
serializeAws_restJson1CreateTaskTemplateCommand,
} from "../protocols/Aws_restJson1";

export interface CreateTaskTemplateCommandInput extends CreateTaskTemplateRequest {}
export interface CreateTaskTemplateCommandOutput extends CreateTaskTemplateResponse, __MetadataBearer {}

/**
* <p>Creates a new task template in the specified Amazon Connect instance.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ConnectClient, CreateTaskTemplateCommand } from "@aws-sdk/client-connect"; // ES Modules import
* // const { ConnectClient, CreateTaskTemplateCommand } = require("@aws-sdk/client-connect"); // CommonJS import
* const client = new ConnectClient(config);
* const command = new CreateTaskTemplateCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link CreateTaskTemplateCommandInput} for command's `input` shape.
* @see {@link CreateTaskTemplateCommandOutput} for command's `response` shape.
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
*
*/
export class CreateTaskTemplateCommand extends $Command<
CreateTaskTemplateCommandInput,
CreateTaskTemplateCommandOutput,
ConnectClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: CreateTaskTemplateCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ConnectClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CreateTaskTemplateCommandInput, CreateTaskTemplateCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "ConnectClient";
const commandName = "CreateTaskTemplateCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: CreateTaskTemplateRequest.filterSensitiveLog,
outputFilterSensitiveLog: CreateTaskTemplateResponse.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: CreateTaskTemplateCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1CreateTaskTemplateCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateTaskTemplateCommandOutput> {
return deserializeAws_restJson1CreateTaskTemplateCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
96 changes: 96 additions & 0 deletions clients/client-connect/src/commands/DeleteTaskTemplateCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// smithy-typescript generated code
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 { DeleteTaskTemplateRequest, DeleteTaskTemplateResponse } from "../models/models_0";
import {
deserializeAws_restJson1DeleteTaskTemplateCommand,
serializeAws_restJson1DeleteTaskTemplateCommand,
} from "../protocols/Aws_restJson1";

export interface DeleteTaskTemplateCommandInput extends DeleteTaskTemplateRequest {}
export interface DeleteTaskTemplateCommandOutput extends DeleteTaskTemplateResponse, __MetadataBearer {}

/**
* <p>Deletes the task template.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ConnectClient, DeleteTaskTemplateCommand } from "@aws-sdk/client-connect"; // ES Modules import
* // const { ConnectClient, DeleteTaskTemplateCommand } = require("@aws-sdk/client-connect"); // CommonJS import
* const client = new ConnectClient(config);
* const command = new DeleteTaskTemplateCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link DeleteTaskTemplateCommandInput} for command's `input` shape.
* @see {@link DeleteTaskTemplateCommandOutput} for command's `response` shape.
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
*
*/
export class DeleteTaskTemplateCommand extends $Command<
DeleteTaskTemplateCommandInput,
DeleteTaskTemplateCommandOutput,
ConnectClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: DeleteTaskTemplateCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ConnectClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DeleteTaskTemplateCommandInput, DeleteTaskTemplateCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "ConnectClient";
const commandName = "DeleteTaskTemplateCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: DeleteTaskTemplateRequest.filterSensitiveLog,
outputFilterSensitiveLog: DeleteTaskTemplateResponse.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: DeleteTaskTemplateCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1DeleteTaskTemplateCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteTaskTemplateCommandOutput> {
return deserializeAws_restJson1DeleteTaskTemplateCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export interface DisassociatePhoneNumberContactFlowCommandInput extends Disassoc
export interface DisassociatePhoneNumberContactFlowCommandOutput extends __MetadataBearer {}

/**
* <p>Removes the contact flow association from a phone number claimed to your Amazon Connect instance, if a contact flow association exists.</p>
* <p>Removes the contact flow association from a phone number claimed to your Amazon Connect instance, if
* a contact flow association exists.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Loading

0 comments on commit e10c8ed

Please sign in to comment.