Skip to content

Commit

Permalink
feat(client-connect): Adds CreateContactFlowVersion and ListContactFl…
Browse files Browse the repository at this point in the history
…owVersions APIs to create and view the versions of a contact flow.
  • Loading branch information
awstools committed Nov 18, 2024
1 parent fa926ac commit d7c1515
Show file tree
Hide file tree
Showing 24 changed files with 1,249 additions and 233 deletions.
16 changes: 16 additions & 0 deletions clients/client-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,14 @@ CreateContactFlowModule

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/CreateContactFlowModuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/CreateContactFlowModuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/CreateContactFlowModuleCommandOutput/)

</details>
<details>
<summary>
CreateContactFlowVersion
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/CreateContactFlowVersionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/CreateContactFlowVersionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/CreateContactFlowVersionCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -1257,6 +1265,14 @@ ListContactFlows

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/ListContactFlowsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/ListContactFlowsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/ListContactFlowsCommandOutput/)

</details>
<details>
<summary>
ListContactFlowVersions
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/ListContactFlowVersionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/ListContactFlowVersionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/ListContactFlowVersionsCommandOutput/)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-connect/src/Connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ import {
CreateContactFlowModuleCommandInput,
CreateContactFlowModuleCommandOutput,
} from "./commands/CreateContactFlowModuleCommand";
import {
CreateContactFlowVersionCommand,
CreateContactFlowVersionCommandInput,
CreateContactFlowVersionCommandOutput,
} from "./commands/CreateContactFlowVersionCommand";
import {
CreateEvaluationFormCommand,
CreateEvaluationFormCommandInput,
Expand Down Expand Up @@ -611,6 +616,11 @@ import {
ListContactFlowsCommandInput,
ListContactFlowsCommandOutput,
} from "./commands/ListContactFlowsCommand";
import {
ListContactFlowVersionsCommand,
ListContactFlowVersionsCommandInput,
ListContactFlowVersionsCommandOutput,
} from "./commands/ListContactFlowVersionsCommand";
import {
ListContactReferencesCommand,
ListContactReferencesCommandInput,
Expand Down Expand Up @@ -1235,6 +1245,7 @@ const commands = {
CreateAgentStatusCommand,
CreateContactFlowCommand,
CreateContactFlowModuleCommand,
CreateContactFlowVersionCommand,
CreateEvaluationFormCommand,
CreateHoursOfOperationCommand,
CreateInstanceCommand,
Expand Down Expand Up @@ -1339,6 +1350,7 @@ const commands = {
ListContactEvaluationsCommand,
ListContactFlowModulesCommand,
ListContactFlowsCommand,
ListContactFlowVersionsCommand,
ListContactReferencesCommand,
ListDefaultVocabulariesCommand,
ListEvaluationFormsCommand,
Expand Down Expand Up @@ -1877,6 +1889,23 @@ export interface Connect {
cb: (err: any, data?: CreateContactFlowModuleCommandOutput) => void
): void;

/**
* @see {@link CreateContactFlowVersionCommand}
*/
createContactFlowVersion(
args: CreateContactFlowVersionCommandInput,
options?: __HttpHandlerOptions
): Promise<CreateContactFlowVersionCommandOutput>;
createContactFlowVersion(
args: CreateContactFlowVersionCommandInput,
cb: (err: any, data?: CreateContactFlowVersionCommandOutput) => void
): void;
createContactFlowVersion(
args: CreateContactFlowVersionCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateContactFlowVersionCommandOutput) => void
): void;

/**
* @see {@link CreateEvaluationFormCommand}
*/
Expand Down Expand Up @@ -3507,6 +3536,23 @@ export interface Connect {
cb: (err: any, data?: ListContactFlowsCommandOutput) => void
): void;

/**
* @see {@link ListContactFlowVersionsCommand}
*/
listContactFlowVersions(
args: ListContactFlowVersionsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListContactFlowVersionsCommandOutput>;
listContactFlowVersions(
args: ListContactFlowVersionsCommandInput,
cb: (err: any, data?: ListContactFlowVersionsCommandOutput) => void
): void;
listContactFlowVersions(
args: ListContactFlowVersionsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListContactFlowVersionsCommandOutput) => void
): void;

/**
* @see {@link ListContactReferencesCommand}
*/
Expand Down
12 changes: 12 additions & 0 deletions clients/client-connect/src/ConnectClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ import {
CreateContactFlowModuleCommandInput,
CreateContactFlowModuleCommandOutput,
} from "./commands/CreateContactFlowModuleCommand";
import {
CreateContactFlowVersionCommandInput,
CreateContactFlowVersionCommandOutput,
} from "./commands/CreateContactFlowVersionCommand";
import {
CreateEvaluationFormCommandInput,
CreateEvaluationFormCommandOutput,
Expand Down Expand Up @@ -401,6 +405,10 @@ import {
ListContactFlowModulesCommandOutput,
} from "./commands/ListContactFlowModulesCommand";
import { ListContactFlowsCommandInput, ListContactFlowsCommandOutput } from "./commands/ListContactFlowsCommand";
import {
ListContactFlowVersionsCommandInput,
ListContactFlowVersionsCommandOutput,
} from "./commands/ListContactFlowVersionsCommand";
import {
ListContactReferencesCommandInput,
ListContactReferencesCommandOutput,
Expand Down Expand Up @@ -812,6 +820,7 @@ export type ServiceInputTypes =
| CreateAgentStatusCommandInput
| CreateContactFlowCommandInput
| CreateContactFlowModuleCommandInput
| CreateContactFlowVersionCommandInput
| CreateEvaluationFormCommandInput
| CreateHoursOfOperationCommandInput
| CreateInstanceCommandInput
Expand Down Expand Up @@ -915,6 +924,7 @@ export type ServiceInputTypes =
| ListBotsCommandInput
| ListContactEvaluationsCommandInput
| ListContactFlowModulesCommandInput
| ListContactFlowVersionsCommandInput
| ListContactFlowsCommandInput
| ListContactReferencesCommandInput
| ListDefaultVocabulariesCommandInput
Expand Down Expand Up @@ -1074,6 +1084,7 @@ export type ServiceOutputTypes =
| CreateAgentStatusCommandOutput
| CreateContactFlowCommandOutput
| CreateContactFlowModuleCommandOutput
| CreateContactFlowVersionCommandOutput
| CreateEvaluationFormCommandOutput
| CreateHoursOfOperationCommandOutput
| CreateInstanceCommandOutput
Expand Down Expand Up @@ -1177,6 +1188,7 @@ export type ServiceOutputTypes =
| ListBotsCommandOutput
| ListContactEvaluationsCommandOutput
| ListContactFlowModulesCommandOutput
| ListContactFlowVersionsCommandOutput
| ListContactFlowsCommandOutput
| ListContactReferencesCommandOutput
| ListDefaultVocabulariesCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export interface AssociateTrafficDistributionGroupUserCommandOutput
__MetadataBearer {}

/**
* <p>Associates an agent with a traffic distribution group. This API can be called only in the Region where the traffic distribution group is
* created.</p>
* <p>Associates an agent with a traffic distribution group. This API can be called only in the
* Region where the traffic distribution group is created.</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 @@ -53,6 +53,7 @@ export interface CreateContactFlowCommandOutput extends CreateContactFlowRespons
* // { // CreateContactFlowResponse
* // ContactFlowId: "STRING_VALUE",
* // ContactFlowArn: "STRING_VALUE",
* // FlowContentSha256: "STRING_VALUE",
* // };
*
* ```
Expand Down
124 changes: 124 additions & 0 deletions clients/client-connect/src/commands/CreateContactFlowVersionCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { CreateContactFlowVersionRequest, CreateContactFlowVersionResponse } from "../models/models_0";
import { de_CreateContactFlowVersionCommand, se_CreateContactFlowVersionCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link CreateContactFlowVersionCommand}.
*/
export interface CreateContactFlowVersionCommandInput extends CreateContactFlowVersionRequest {}
/**
* @public
*
* The output of {@link CreateContactFlowVersionCommand}.
*/
export interface CreateContactFlowVersionCommandOutput extends CreateContactFlowVersionResponse, __MetadataBearer {}

/**
* <p>Publishes a new version of the flow provided. Versions are immutable and monotonically
* increasing. If a version of the same flow content already exists, no new version is created and
* instead the existing version number is returned. If the <code>FlowContentSha256</code> provided
* is different from the <code>FlowContentSha256</code> of the <code>$LATEST</code> published flow
* content, then an error is returned. This API only supports creating versions for flows of type
* <code>Campaign</code>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ConnectClient, CreateContactFlowVersionCommand } from "@aws-sdk/client-connect"; // ES Modules import
* // const { ConnectClient, CreateContactFlowVersionCommand } = require("@aws-sdk/client-connect"); // CommonJS import
* const client = new ConnectClient(config);
* const input = { // CreateContactFlowVersionRequest
* InstanceId: "STRING_VALUE", // required
* Description: "STRING_VALUE",
* ContactFlowId: "STRING_VALUE", // required
* FlowContentSha256: "STRING_VALUE",
* LastModifiedTime: new Date("TIMESTAMP"),
* LastModifiedRegion: "STRING_VALUE",
* };
* const command = new CreateContactFlowVersionCommand(input);
* const response = await client.send(command);
* // { // CreateContactFlowVersionResponse
* // ContactFlowArn: "STRING_VALUE",
* // Version: Number("long"),
* // };
*
* ```
*
* @param CreateContactFlowVersionCommandInput - {@link CreateContactFlowVersionCommandInput}
* @returns {@link CreateContactFlowVersionCommandOutput}
* @see {@link CreateContactFlowVersionCommandInput} for command's `input` shape.
* @see {@link CreateContactFlowVersionCommandOutput} for command's `response` shape.
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You do not have sufficient permissions to perform this action.</p>
*
* @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 LimitExceededException} (client fault)
* <p>The allowed limit for the resource has been exceeded.</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>
*
* @public
*/
export class CreateContactFlowVersionCommand extends $Command
.classBuilder<
CreateContactFlowVersionCommandInput,
CreateContactFlowVersionCommandOutput,
ConnectClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: ConnectClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonConnectService", "CreateContactFlowVersion", {})
.n("ConnectClient", "CreateContactFlowVersionCommand")
.f(void 0, void 0)
.ser(se_CreateContactFlowVersionCommand)
.de(de_CreateContactFlowVersionCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: CreateContactFlowVersionRequest;
output: CreateContactFlowVersionResponse;
};
sdk: {
input: CreateContactFlowVersionCommandInput;
output: CreateContactFlowVersionCommandOutput;
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface CreateIntegrationAssociationCommandOutput
* const client = new ConnectClient(config);
* const input = { // CreateIntegrationAssociationRequest
* InstanceId: "STRING_VALUE", // required
* IntegrationType: "EVENT" || "VOICE_ID" || "PINPOINT_APP" || "WISDOM_ASSISTANT" || "WISDOM_KNOWLEDGE_BASE" || "WISDOM_QUICK_RESPONSES" || "CASES_DOMAIN" || "APPLICATION" || "FILE_SCANNER", // required
* IntegrationType: "EVENT" || "VOICE_ID" || "PINPOINT_APP" || "WISDOM_ASSISTANT" || "WISDOM_KNOWLEDGE_BASE" || "WISDOM_QUICK_RESPONSES" || "Q_MESSAGE_TEMPLATES" || "CASES_DOMAIN" || "APPLICATION" || "FILE_SCANNER", // required
* IntegrationArn: "STRING_VALUE", // required
* SourceApplicationUrl: "STRING_VALUE",
* SourceApplicationName: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export interface DescribeContactFlowCommandOutput extends DescribeContactFlowRes
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
* // IsDefault: true || false,
* // FlowContentSha256: "STRING_VALUE",
* // Version: Number("long"),
* // VersionDescription: "STRING_VALUE",
* // LastModifiedTime: new Date("TIMESTAMP"),
* // LastModifiedRegion: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export interface DisassociateTrafficDistributionGroupUserCommandOutput
__MetadataBearer {}

/**
* <p>Disassociates an agent from a traffic distribution group. This API can be called only in the Region where the traffic distribution group is
* created.</p>
* <p>Disassociates an agent from a traffic distribution group. This API can be called only in the
* Region where the traffic distribution group is created.</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 d7c1515

Please sign in to comment.