Skip to content

Commit d7c1515

Browse files
author
awstools
committed
feat(client-connect): Adds CreateContactFlowVersion and ListContactFlowVersions APIs to create and view the versions of a contact flow.
1 parent fa926ac commit d7c1515

24 files changed

+1249
-233
lines changed

clients/client-connect/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,14 @@ CreateContactFlowModule
425425

426426
[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/)
427427

428+
</details>
429+
<details>
430+
<summary>
431+
CreateContactFlowVersion
432+
</summary>
433+
434+
[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/)
435+
428436
</details>
429437
<details>
430438
<summary>
@@ -1257,6 +1265,14 @@ ListContactFlows
12571265

12581266
[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/)
12591267

1268+
</details>
1269+
<details>
1270+
<summary>
1271+
ListContactFlowVersions
1272+
</summary>
1273+
1274+
[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/)
1275+
12601276
</details>
12611277
<details>
12621278
<summary>

clients/client-connect/src/Connect.ts

+46
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ import {
127127
CreateContactFlowModuleCommandInput,
128128
CreateContactFlowModuleCommandOutput,
129129
} from "./commands/CreateContactFlowModuleCommand";
130+
import {
131+
CreateContactFlowVersionCommand,
132+
CreateContactFlowVersionCommandInput,
133+
CreateContactFlowVersionCommandOutput,
134+
} from "./commands/CreateContactFlowVersionCommand";
130135
import {
131136
CreateEvaluationFormCommand,
132137
CreateEvaluationFormCommandInput,
@@ -611,6 +616,11 @@ import {
611616
ListContactFlowsCommandInput,
612617
ListContactFlowsCommandOutput,
613618
} from "./commands/ListContactFlowsCommand";
619+
import {
620+
ListContactFlowVersionsCommand,
621+
ListContactFlowVersionsCommandInput,
622+
ListContactFlowVersionsCommandOutput,
623+
} from "./commands/ListContactFlowVersionsCommand";
614624
import {
615625
ListContactReferencesCommand,
616626
ListContactReferencesCommandInput,
@@ -1235,6 +1245,7 @@ const commands = {
12351245
CreateAgentStatusCommand,
12361246
CreateContactFlowCommand,
12371247
CreateContactFlowModuleCommand,
1248+
CreateContactFlowVersionCommand,
12381249
CreateEvaluationFormCommand,
12391250
CreateHoursOfOperationCommand,
12401251
CreateInstanceCommand,
@@ -1339,6 +1350,7 @@ const commands = {
13391350
ListContactEvaluationsCommand,
13401351
ListContactFlowModulesCommand,
13411352
ListContactFlowsCommand,
1353+
ListContactFlowVersionsCommand,
13421354
ListContactReferencesCommand,
13431355
ListDefaultVocabulariesCommand,
13441356
ListEvaluationFormsCommand,
@@ -1877,6 +1889,23 @@ export interface Connect {
18771889
cb: (err: any, data?: CreateContactFlowModuleCommandOutput) => void
18781890
): void;
18791891

1892+
/**
1893+
* @see {@link CreateContactFlowVersionCommand}
1894+
*/
1895+
createContactFlowVersion(
1896+
args: CreateContactFlowVersionCommandInput,
1897+
options?: __HttpHandlerOptions
1898+
): Promise<CreateContactFlowVersionCommandOutput>;
1899+
createContactFlowVersion(
1900+
args: CreateContactFlowVersionCommandInput,
1901+
cb: (err: any, data?: CreateContactFlowVersionCommandOutput) => void
1902+
): void;
1903+
createContactFlowVersion(
1904+
args: CreateContactFlowVersionCommandInput,
1905+
options: __HttpHandlerOptions,
1906+
cb: (err: any, data?: CreateContactFlowVersionCommandOutput) => void
1907+
): void;
1908+
18801909
/**
18811910
* @see {@link CreateEvaluationFormCommand}
18821911
*/
@@ -3507,6 +3536,23 @@ export interface Connect {
35073536
cb: (err: any, data?: ListContactFlowsCommandOutput) => void
35083537
): void;
35093538

3539+
/**
3540+
* @see {@link ListContactFlowVersionsCommand}
3541+
*/
3542+
listContactFlowVersions(
3543+
args: ListContactFlowVersionsCommandInput,
3544+
options?: __HttpHandlerOptions
3545+
): Promise<ListContactFlowVersionsCommandOutput>;
3546+
listContactFlowVersions(
3547+
args: ListContactFlowVersionsCommandInput,
3548+
cb: (err: any, data?: ListContactFlowVersionsCommandOutput) => void
3549+
): void;
3550+
listContactFlowVersions(
3551+
args: ListContactFlowVersionsCommandInput,
3552+
options: __HttpHandlerOptions,
3553+
cb: (err: any, data?: ListContactFlowVersionsCommandOutput) => void
3554+
): void;
3555+
35103556
/**
35113557
* @see {@link ListContactReferencesCommand}
35123558
*/

clients/client-connect/src/ConnectClient.ts

+12
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ import {
132132
CreateContactFlowModuleCommandInput,
133133
CreateContactFlowModuleCommandOutput,
134134
} from "./commands/CreateContactFlowModuleCommand";
135+
import {
136+
CreateContactFlowVersionCommandInput,
137+
CreateContactFlowVersionCommandOutput,
138+
} from "./commands/CreateContactFlowVersionCommand";
135139
import {
136140
CreateEvaluationFormCommandInput,
137141
CreateEvaluationFormCommandOutput,
@@ -401,6 +405,10 @@ import {
401405
ListContactFlowModulesCommandOutput,
402406
} from "./commands/ListContactFlowModulesCommand";
403407
import { ListContactFlowsCommandInput, ListContactFlowsCommandOutput } from "./commands/ListContactFlowsCommand";
408+
import {
409+
ListContactFlowVersionsCommandInput,
410+
ListContactFlowVersionsCommandOutput,
411+
} from "./commands/ListContactFlowVersionsCommand";
404412
import {
405413
ListContactReferencesCommandInput,
406414
ListContactReferencesCommandOutput,
@@ -812,6 +820,7 @@ export type ServiceInputTypes =
812820
| CreateAgentStatusCommandInput
813821
| CreateContactFlowCommandInput
814822
| CreateContactFlowModuleCommandInput
823+
| CreateContactFlowVersionCommandInput
815824
| CreateEvaluationFormCommandInput
816825
| CreateHoursOfOperationCommandInput
817826
| CreateInstanceCommandInput
@@ -915,6 +924,7 @@ export type ServiceInputTypes =
915924
| ListBotsCommandInput
916925
| ListContactEvaluationsCommandInput
917926
| ListContactFlowModulesCommandInput
927+
| ListContactFlowVersionsCommandInput
918928
| ListContactFlowsCommandInput
919929
| ListContactReferencesCommandInput
920930
| ListDefaultVocabulariesCommandInput
@@ -1074,6 +1084,7 @@ export type ServiceOutputTypes =
10741084
| CreateAgentStatusCommandOutput
10751085
| CreateContactFlowCommandOutput
10761086
| CreateContactFlowModuleCommandOutput
1087+
| CreateContactFlowVersionCommandOutput
10771088
| CreateEvaluationFormCommandOutput
10781089
| CreateHoursOfOperationCommandOutput
10791090
| CreateInstanceCommandOutput
@@ -1177,6 +1188,7 @@ export type ServiceOutputTypes =
11771188
| ListBotsCommandOutput
11781189
| ListContactEvaluationsCommandOutput
11791190
| ListContactFlowModulesCommandOutput
1191+
| ListContactFlowVersionsCommandOutput
11801192
| ListContactFlowsCommandOutput
11811193
| ListContactReferencesCommandOutput
11821194
| ListDefaultVocabulariesCommandOutput

clients/client-connect/src/commands/AssociateTrafficDistributionGroupUserCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export interface AssociateTrafficDistributionGroupUserCommandOutput
3737
__MetadataBearer {}
3838

3939
/**
40-
* <p>Associates an agent with a traffic distribution group. This API can be called only in the Region where the traffic distribution group is
41-
* created.</p>
40+
* <p>Associates an agent with a traffic distribution group. This API can be called only in the
41+
* Region where the traffic distribution group is created.</p>
4242
* @example
4343
* Use a bare-bones client and the command you need to make an API call.
4444
* ```javascript

clients/client-connect/src/commands/CreateContactFlowCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export interface CreateContactFlowCommandOutput extends CreateContactFlowRespons
5353
* // { // CreateContactFlowResponse
5454
* // ContactFlowId: "STRING_VALUE",
5555
* // ContactFlowArn: "STRING_VALUE",
56+
* // FlowContentSha256: "STRING_VALUE",
5657
* // };
5758
*
5859
* ```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { CreateContactFlowVersionRequest, CreateContactFlowVersionResponse } from "../models/models_0";
10+
import { de_CreateContactFlowVersionCommand, se_CreateContactFlowVersionCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link CreateContactFlowVersionCommand}.
21+
*/
22+
export interface CreateContactFlowVersionCommandInput extends CreateContactFlowVersionRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link CreateContactFlowVersionCommand}.
27+
*/
28+
export interface CreateContactFlowVersionCommandOutput extends CreateContactFlowVersionResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Publishes a new version of the flow provided. Versions are immutable and monotonically
32+
* increasing. If a version of the same flow content already exists, no new version is created and
33+
* instead the existing version number is returned. If the <code>FlowContentSha256</code> provided
34+
* is different from the <code>FlowContentSha256</code> of the <code>$LATEST</code> published flow
35+
* content, then an error is returned. This API only supports creating versions for flows of type
36+
* <code>Campaign</code>.</p>
37+
* @example
38+
* Use a bare-bones client and the command you need to make an API call.
39+
* ```javascript
40+
* import { ConnectClient, CreateContactFlowVersionCommand } from "@aws-sdk/client-connect"; // ES Modules import
41+
* // const { ConnectClient, CreateContactFlowVersionCommand } = require("@aws-sdk/client-connect"); // CommonJS import
42+
* const client = new ConnectClient(config);
43+
* const input = { // CreateContactFlowVersionRequest
44+
* InstanceId: "STRING_VALUE", // required
45+
* Description: "STRING_VALUE",
46+
* ContactFlowId: "STRING_VALUE", // required
47+
* FlowContentSha256: "STRING_VALUE",
48+
* LastModifiedTime: new Date("TIMESTAMP"),
49+
* LastModifiedRegion: "STRING_VALUE",
50+
* };
51+
* const command = new CreateContactFlowVersionCommand(input);
52+
* const response = await client.send(command);
53+
* // { // CreateContactFlowVersionResponse
54+
* // ContactFlowArn: "STRING_VALUE",
55+
* // Version: Number("long"),
56+
* // };
57+
*
58+
* ```
59+
*
60+
* @param CreateContactFlowVersionCommandInput - {@link CreateContactFlowVersionCommandInput}
61+
* @returns {@link CreateContactFlowVersionCommandOutput}
62+
* @see {@link CreateContactFlowVersionCommandInput} for command's `input` shape.
63+
* @see {@link CreateContactFlowVersionCommandOutput} for command's `response` shape.
64+
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
65+
*
66+
* @throws {@link AccessDeniedException} (client fault)
67+
* <p>You do not have sufficient permissions to perform this action.</p>
68+
*
69+
* @throws {@link InternalServiceException} (server fault)
70+
* <p>Request processing failed because of an error or failure with the service.</p>
71+
*
72+
* @throws {@link InvalidParameterException} (client fault)
73+
* <p>One or more of the specified parameters are not valid.</p>
74+
*
75+
* @throws {@link InvalidRequestException} (client fault)
76+
* <p>The request is not valid.</p>
77+
*
78+
* @throws {@link LimitExceededException} (client fault)
79+
* <p>The allowed limit for the resource has been exceeded.</p>
80+
*
81+
* @throws {@link ResourceNotFoundException} (client fault)
82+
* <p>The specified resource was not found.</p>
83+
*
84+
* @throws {@link ThrottlingException} (client fault)
85+
* <p>The throttling limit has been exceeded.</p>
86+
*
87+
* @throws {@link ConnectServiceException}
88+
* <p>Base exception class for all service exceptions from Connect service.</p>
89+
*
90+
* @public
91+
*/
92+
export class CreateContactFlowVersionCommand extends $Command
93+
.classBuilder<
94+
CreateContactFlowVersionCommandInput,
95+
CreateContactFlowVersionCommandOutput,
96+
ConnectClientResolvedConfig,
97+
ServiceInputTypes,
98+
ServiceOutputTypes
99+
>()
100+
.ep(commonParams)
101+
.m(function (this: any, Command: any, cs: any, config: ConnectClientResolvedConfig, o: any) {
102+
return [
103+
getSerdePlugin(config, this.serialize, this.deserialize),
104+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
105+
];
106+
})
107+
.s("AmazonConnectService", "CreateContactFlowVersion", {})
108+
.n("ConnectClient", "CreateContactFlowVersionCommand")
109+
.f(void 0, void 0)
110+
.ser(se_CreateContactFlowVersionCommand)
111+
.de(de_CreateContactFlowVersionCommand)
112+
.build() {
113+
/** @internal type navigation helper, not in runtime. */
114+
protected declare static __types: {
115+
api: {
116+
input: CreateContactFlowVersionRequest;
117+
output: CreateContactFlowVersionResponse;
118+
};
119+
sdk: {
120+
input: CreateContactFlowVersionCommandInput;
121+
output: CreateContactFlowVersionCommandOutput;
122+
};
123+
};
124+
}

clients/client-connect/src/commands/CreateIntegrationAssociationCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface CreateIntegrationAssociationCommandOutput
4343
* const client = new ConnectClient(config);
4444
* const input = { // CreateIntegrationAssociationRequest
4545
* InstanceId: "STRING_VALUE", // required
46-
* IntegrationType: "EVENT" || "VOICE_ID" || "PINPOINT_APP" || "WISDOM_ASSISTANT" || "WISDOM_KNOWLEDGE_BASE" || "WISDOM_QUICK_RESPONSES" || "CASES_DOMAIN" || "APPLICATION" || "FILE_SCANNER", // required
46+
* IntegrationType: "EVENT" || "VOICE_ID" || "PINPOINT_APP" || "WISDOM_ASSISTANT" || "WISDOM_KNOWLEDGE_BASE" || "WISDOM_QUICK_RESPONSES" || "Q_MESSAGE_TEMPLATES" || "CASES_DOMAIN" || "APPLICATION" || "FILE_SCANNER", // required
4747
* IntegrationArn: "STRING_VALUE", // required
4848
* SourceApplicationUrl: "STRING_VALUE",
4949
* SourceApplicationName: "STRING_VALUE",

clients/client-connect/src/commands/DescribeContactFlowCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ export interface DescribeContactFlowCommandOutput extends DescribeContactFlowRes
6565
* // Tags: { // TagMap
6666
* // "<keys>": "STRING_VALUE",
6767
* // },
68+
* // IsDefault: true || false,
69+
* // FlowContentSha256: "STRING_VALUE",
70+
* // Version: Number("long"),
71+
* // VersionDescription: "STRING_VALUE",
72+
* // LastModifiedTime: new Date("TIMESTAMP"),
73+
* // LastModifiedRegion: "STRING_VALUE",
6874
* // },
6975
* // };
7076
*

clients/client-connect/src/commands/DisassociateTrafficDistributionGroupUserCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export interface DisassociateTrafficDistributionGroupUserCommandOutput
3737
__MetadataBearer {}
3838

3939
/**
40-
* <p>Disassociates an agent from a traffic distribution group. This API can be called only in the Region where the traffic distribution group is
41-
* created.</p>
40+
* <p>Disassociates an agent from a traffic distribution group. This API can be called only in the
41+
* Region where the traffic distribution group is created.</p>
4242
* @example
4343
* Use a bare-bones client and the command you need to make an API call.
4444
* ```javascript

0 commit comments

Comments
 (0)