Skip to content

Commit

Permalink
feat(client-connect): Add support for deleting Queues and Routing Pro…
Browse files Browse the repository at this point in the history
…files.
  • Loading branch information
awstools committed Jul 13, 2023
1 parent 53ac18c commit 243007b
Show file tree
Hide file tree
Showing 17 changed files with 1,035 additions and 324 deletions.
16 changes: 16 additions & 0 deletions clients/client-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ DeletePrompt

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/deletepromptcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/deletepromptcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/deletepromptcommandoutput.html)

</details>
<details>
<summary>
DeleteQueue
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/deletequeuecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/deletequeuecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/deletequeuecommandoutput.html)

</details>
<details>
<summary>
Expand All @@ -548,6 +556,14 @@ DeleteQuickConnect

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/deletequickconnectcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/deletequickconnectcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/deletequickconnectcommandoutput.html)

</details>
<details>
<summary>
DeleteRoutingProfile
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/deleteroutingprofilecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/deleteroutingprofilecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/deleteroutingprofilecommandoutput.html)

</details>
<details>
<summary>
Expand Down
36 changes: 36 additions & 0 deletions clients/client-connect/src/Connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,17 @@ import {
DeletePromptCommandInput,
DeletePromptCommandOutput,
} from "./commands/DeletePromptCommand";
import { DeleteQueueCommand, DeleteQueueCommandInput, DeleteQueueCommandOutput } from "./commands/DeleteQueueCommand";
import {
DeleteQuickConnectCommand,
DeleteQuickConnectCommandInput,
DeleteQuickConnectCommandOutput,
} from "./commands/DeleteQuickConnectCommand";
import {
DeleteRoutingProfileCommand,
DeleteRoutingProfileCommandInput,
DeleteRoutingProfileCommandOutput,
} from "./commands/DeleteRoutingProfileCommand";
import { DeleteRuleCommand, DeleteRuleCommandInput, DeleteRuleCommandOutput } from "./commands/DeleteRuleCommand";
import {
DeleteSecurityProfileCommand,
Expand Down Expand Up @@ -956,7 +962,9 @@ const commands = {
DeleteInstanceCommand,
DeleteIntegrationAssociationCommand,
DeletePromptCommand,
DeleteQueueCommand,
DeleteQuickConnectCommand,
DeleteRoutingProfileCommand,
DeleteRuleCommand,
DeleteSecurityProfileCommand,
DeleteTaskTemplateCommand,
Expand Down Expand Up @@ -1758,6 +1766,17 @@ export interface Connect {
cb: (err: any, data?: DeletePromptCommandOutput) => void
): void;

/**
* @see {@link DeleteQueueCommand}
*/
deleteQueue(args: DeleteQueueCommandInput, options?: __HttpHandlerOptions): Promise<DeleteQueueCommandOutput>;
deleteQueue(args: DeleteQueueCommandInput, cb: (err: any, data?: DeleteQueueCommandOutput) => void): void;
deleteQueue(
args: DeleteQueueCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteQueueCommandOutput) => void
): void;

/**
* @see {@link DeleteQuickConnectCommand}
*/
Expand All @@ -1775,6 +1794,23 @@ export interface Connect {
cb: (err: any, data?: DeleteQuickConnectCommandOutput) => void
): void;

/**
* @see {@link DeleteRoutingProfileCommand}
*/
deleteRoutingProfile(
args: DeleteRoutingProfileCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteRoutingProfileCommandOutput>;
deleteRoutingProfile(
args: DeleteRoutingProfileCommandInput,
cb: (err: any, data?: DeleteRoutingProfileCommandOutput) => void
): void;
deleteRoutingProfile(
args: DeleteRoutingProfileCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteRoutingProfileCommandOutput) => void
): void;

/**
* @see {@link DeleteRuleCommand}
*/
Expand Down
9 changes: 9 additions & 0 deletions clients/client-connect/src/ConnectClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ import {
DeleteIntegrationAssociationCommandOutput,
} from "./commands/DeleteIntegrationAssociationCommand";
import { DeletePromptCommandInput, DeletePromptCommandOutput } from "./commands/DeletePromptCommand";
import { DeleteQueueCommandInput, DeleteQueueCommandOutput } from "./commands/DeleteQueueCommand";
import { DeleteQuickConnectCommandInput, DeleteQuickConnectCommandOutput } from "./commands/DeleteQuickConnectCommand";
import {
DeleteRoutingProfileCommandInput,
DeleteRoutingProfileCommandOutput,
} from "./commands/DeleteRoutingProfileCommand";
import { DeleteRuleCommandInput, DeleteRuleCommandOutput } from "./commands/DeleteRuleCommand";
import {
DeleteSecurityProfileCommandInput,
Expand Down Expand Up @@ -646,7 +651,9 @@ export type ServiceInputTypes =
| DeleteInstanceCommandInput
| DeleteIntegrationAssociationCommandInput
| DeletePromptCommandInput
| DeleteQueueCommandInput
| DeleteQuickConnectCommandInput
| DeleteRoutingProfileCommandInput
| DeleteRuleCommandInput
| DeleteSecurityProfileCommandInput
| DeleteTaskTemplateCommandInput
Expand Down Expand Up @@ -845,7 +852,9 @@ export type ServiceOutputTypes =
| DeleteInstanceCommandOutput
| DeleteIntegrationAssociationCommandOutput
| DeletePromptCommandOutput
| DeleteQueueCommandOutput
| DeleteQuickConnectCommandOutput
| DeleteRoutingProfileCommandOutput
| DeleteRuleCommandOutput
| DeleteSecurityProfileCommandOutput
| DeleteTaskTemplateCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ export interface CreateEvaluationFormCommandOutput extends CreateEvaluationFormR

/**
* @public
* <p>Creates an evaluation form in the specified Amazon Connect instance. The form can be
* used to define questions related to agent performance, and create sections to organize such
* questions. Question and section identifiers cannot be duplicated within the same evaluation
* form.</p>
* <p>Creates an evaluation form in the specified Amazon Connect instance. The form can be used to define
* questions related to agent performance, and create sections to organize such questions. Question and section identifiers
* cannot be duplicated within the same evaluation form.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface CreateParticipantCommandOutput extends CreateParticipantRespons
/**
* @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>
* 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
Expand Down
4 changes: 1 addition & 3 deletions clients/client-connect/src/commands/CreatePromptCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ export interface CreatePromptCommandOutput extends CreatePromptResponse, __Metad

/**
* @public
* <p>Creates a prompt. For more information about prompts, such as supported file types and
* maximum length, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/prompts.html">Create prompts</a> in the <i>Amazon Connect Administrator's
* Guide</i>.</p>
* <p>Creates a prompt. For more information about prompts, such as supported file types and maximum length, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/prompts.html">Create prompts</a> in the <i>Amazon Connect Administrator's Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
157 changes: 157 additions & 0 deletions clients/client-connect/src/commands/DeleteQueueCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { DeleteQueueRequest } from "../models/models_0";
import { de_DeleteQueueCommand, se_DeleteQueueCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link DeleteQueueCommand}.
*/
export interface DeleteQueueCommandInput extends DeleteQueueRequest {}
/**
* @public
*
* The output of {@link DeleteQueueCommand}.
*/
export interface DeleteQueueCommandOutput extends __MetadataBearer {}

/**
* @public
* <p>Deletes a queue.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ConnectClient, DeleteQueueCommand } from "@aws-sdk/client-connect"; // ES Modules import
* // const { ConnectClient, DeleteQueueCommand } = require("@aws-sdk/client-connect"); // CommonJS import
* const client = new ConnectClient(config);
* const input = { // DeleteQueueRequest
* InstanceId: "STRING_VALUE", // required
* QueueId: "STRING_VALUE", // required
* };
* const command = new DeleteQueueCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param DeleteQueueCommandInput - {@link DeleteQueueCommandInput}
* @returns {@link DeleteQueueCommandOutput}
* @see {@link DeleteQueueCommandInput} for command's `input` shape.
* @see {@link DeleteQueueCommandOutput} 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 ResourceInUseException} (client fault)
* <p>That resource is already in use. Please try another.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource was not found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The throttling limit has been exceeded.</p>
*
* @throws {@link ConnectServiceException}
* <p>Base exception class for all service exceptions from Connect service.</p>
*
*/
export class DeleteQueueCommand extends $Command<
DeleteQueueCommandInput,
DeleteQueueCommandOutput,
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: DeleteQueueCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

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

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

const { logger } = configuration;
const clientName = "ConnectClient";
const commandName = "DeleteQueueCommand";
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: DeleteQueueCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_DeleteQueueCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteQueueCommandOutput> {
return de_DeleteQueueCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Loading

0 comments on commit 243007b

Please sign in to comment.