Skip to content

Commit 8f9a63c

Browse files
author
awstools
committedDec 10, 2024
feat(client-connect): Add support for Push Notifications for Amazon Connect chat. With Push Notifications enabled an alert could be sent to customers about new messages even when they aren't actively using the mobile application.
1 parent ba20f1d commit 8f9a63c

23 files changed

+1447
-648
lines changed
 

‎clients/client-connect/README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ touch with the appropriate agents.</p>
2828
are also limits to the number of requests that you can make per second. For more information, see
2929
<a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html">Amazon Connect Service Quotas</a> in the <i>Amazon Connect Administrator
3030
Guide</i>.</p>
31-
<p>You can use an endpoint to connect programmatically to an Amazon Web Services service. For
32-
a list of Amazon Connect endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect Endpoints</a>.</p>
31+
<p>You can use an endpoint to connect programmatically to an Amazon Web Services service. For a
32+
list of Amazon Connect endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect Endpoints</a>.</p>
3333

3434
## Installing
3535

@@ -513,6 +513,14 @@ CreatePrompt
513513

514514
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/CreatePromptCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/CreatePromptCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/CreatePromptCommandOutput/)
515515

516+
</details>
517+
<details>
518+
<summary>
519+
CreatePushNotificationRegistration
520+
</summary>
521+
522+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/CreatePushNotificationRegistrationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/CreatePushNotificationRegistrationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/CreatePushNotificationRegistrationCommandOutput/)
523+
516524
</details>
517525
<details>
518526
<summary>
@@ -713,6 +721,14 @@ DeletePrompt
713721

714722
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/DeletePromptCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/DeletePromptCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/DeletePromptCommandOutput/)
715723

724+
</details>
725+
<details>
726+
<summary>
727+
DeletePushNotificationRegistration
728+
</summary>
729+
730+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/DeletePushNotificationRegistrationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/DeletePushNotificationRegistrationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/DeletePushNotificationRegistrationCommandOutput/)
731+
716732
</details>
717733
<details>
718734
<summary>

‎clients/client-connect/src/Connect.ts

+48-2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ import {
182182
CreatePromptCommandInput,
183183
CreatePromptCommandOutput,
184184
} from "./commands/CreatePromptCommand";
185+
import {
186+
CreatePushNotificationRegistrationCommand,
187+
CreatePushNotificationRegistrationCommandInput,
188+
CreatePushNotificationRegistrationCommandOutput,
189+
} from "./commands/CreatePushNotificationRegistrationCommand";
185190
import { CreateQueueCommand, CreateQueueCommandInput, CreateQueueCommandOutput } from "./commands/CreateQueueCommand";
186191
import {
187192
CreateQuickConnectCommand,
@@ -291,6 +296,11 @@ import {
291296
DeletePromptCommandInput,
292297
DeletePromptCommandOutput,
293298
} from "./commands/DeletePromptCommand";
299+
import {
300+
DeletePushNotificationRegistrationCommand,
301+
DeletePushNotificationRegistrationCommandInput,
302+
DeletePushNotificationRegistrationCommandOutput,
303+
} from "./commands/DeletePushNotificationRegistrationCommand";
294304
import { DeleteQueueCommand, DeleteQueueCommandInput, DeleteQueueCommandOutput } from "./commands/DeleteQueueCommand";
295305
import {
296306
DeleteQuickConnectCommand,
@@ -1311,6 +1321,7 @@ const commands = {
13111321
CreatePersistentContactAssociationCommand,
13121322
CreatePredefinedAttributeCommand,
13131323
CreatePromptCommand,
1324+
CreatePushNotificationRegistrationCommand,
13141325
CreateQueueCommand,
13151326
CreateQuickConnectCommand,
13161327
CreateRoutingProfileCommand,
@@ -1336,6 +1347,7 @@ const commands = {
13361347
DeleteIntegrationAssociationCommand,
13371348
DeletePredefinedAttributeCommand,
13381349
DeletePromptCommand,
1350+
DeletePushNotificationRegistrationCommand,
13391351
DeleteQueueCommand,
13401352
DeleteQuickConnectCommand,
13411353
DeleteRoutingProfileCommand,
@@ -2127,6 +2139,23 @@ export interface Connect {
21272139
cb: (err: any, data?: CreatePromptCommandOutput) => void
21282140
): void;
21292141

2142+
/**
2143+
* @see {@link CreatePushNotificationRegistrationCommand}
2144+
*/
2145+
createPushNotificationRegistration(
2146+
args: CreatePushNotificationRegistrationCommandInput,
2147+
options?: __HttpHandlerOptions
2148+
): Promise<CreatePushNotificationRegistrationCommandOutput>;
2149+
createPushNotificationRegistration(
2150+
args: CreatePushNotificationRegistrationCommandInput,
2151+
cb: (err: any, data?: CreatePushNotificationRegistrationCommandOutput) => void
2152+
): void;
2153+
createPushNotificationRegistration(
2154+
args: CreatePushNotificationRegistrationCommandInput,
2155+
options: __HttpHandlerOptions,
2156+
cb: (err: any, data?: CreatePushNotificationRegistrationCommandOutput) => void
2157+
): void;
2158+
21302159
/**
21312160
* @see {@link CreateQueueCommand}
21322161
*/
@@ -2513,6 +2542,23 @@ export interface Connect {
25132542
cb: (err: any, data?: DeletePromptCommandOutput) => void
25142543
): void;
25152544

2545+
/**
2546+
* @see {@link DeletePushNotificationRegistrationCommand}
2547+
*/
2548+
deletePushNotificationRegistration(
2549+
args: DeletePushNotificationRegistrationCommandInput,
2550+
options?: __HttpHandlerOptions
2551+
): Promise<DeletePushNotificationRegistrationCommandOutput>;
2552+
deletePushNotificationRegistration(
2553+
args: DeletePushNotificationRegistrationCommandInput,
2554+
cb: (err: any, data?: DeletePushNotificationRegistrationCommandOutput) => void
2555+
): void;
2556+
deletePushNotificationRegistration(
2557+
args: DeletePushNotificationRegistrationCommandInput,
2558+
options: __HttpHandlerOptions,
2559+
cb: (err: any, data?: DeletePushNotificationRegistrationCommandOutput) => void
2560+
): void;
2561+
25162562
/**
25172563
* @see {@link DeleteQueueCommand}
25182564
*/
@@ -5859,8 +5905,8 @@ export interface Connect {
58595905
* are also limits to the number of requests that you can make per second. For more information, see
58605906
* <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html">Amazon Connect Service Quotas</a> in the <i>Amazon Connect Administrator
58615907
* Guide</i>.</p>
5862-
* <p>You can use an endpoint to connect programmatically to an Amazon Web Services service. For
5863-
* a list of Amazon Connect endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect Endpoints</a>.</p>
5908+
* <p>You can use an endpoint to connect programmatically to an Amazon Web Services service. For a
5909+
* list of Amazon Connect endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect Endpoints</a>.</p>
58645910
* @public
58655911
*/
58665912
export class Connect extends ConnectClient implements Connect {}

‎clients/client-connect/src/ConnectClient.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ import {
161161
CreatePredefinedAttributeCommandOutput,
162162
} from "./commands/CreatePredefinedAttributeCommand";
163163
import { CreatePromptCommandInput, CreatePromptCommandOutput } from "./commands/CreatePromptCommand";
164+
import {
165+
CreatePushNotificationRegistrationCommandInput,
166+
CreatePushNotificationRegistrationCommandOutput,
167+
} from "./commands/CreatePushNotificationRegistrationCommand";
164168
import { CreateQueueCommandInput, CreateQueueCommandOutput } from "./commands/CreateQueueCommand";
165169
import { CreateQuickConnectCommandInput, CreateQuickConnectCommandOutput } from "./commands/CreateQuickConnectCommand";
166170
import {
@@ -219,6 +223,10 @@ import {
219223
DeletePredefinedAttributeCommandOutput,
220224
} from "./commands/DeletePredefinedAttributeCommand";
221225
import { DeletePromptCommandInput, DeletePromptCommandOutput } from "./commands/DeletePromptCommand";
226+
import {
227+
DeletePushNotificationRegistrationCommandInput,
228+
DeletePushNotificationRegistrationCommandOutput,
229+
} from "./commands/DeletePushNotificationRegistrationCommand";
222230
import { DeleteQueueCommandInput, DeleteQueueCommandOutput } from "./commands/DeleteQueueCommand";
223231
import { DeleteQuickConnectCommandInput, DeleteQuickConnectCommandOutput } from "./commands/DeleteQuickConnectCommand";
224232
import {
@@ -860,6 +868,7 @@ export type ServiceInputTypes =
860868
| CreatePersistentContactAssociationCommandInput
861869
| CreatePredefinedAttributeCommandInput
862870
| CreatePromptCommandInput
871+
| CreatePushNotificationRegistrationCommandInput
863872
| CreateQueueCommandInput
864873
| CreateQuickConnectCommandInput
865874
| CreateRoutingProfileCommandInput
@@ -885,6 +894,7 @@ export type ServiceInputTypes =
885894
| DeleteIntegrationAssociationCommandInput
886895
| DeletePredefinedAttributeCommandInput
887896
| DeletePromptCommandInput
897+
| DeletePushNotificationRegistrationCommandInput
888898
| DeleteQueueCommandInput
889899
| DeleteQuickConnectCommandInput
890900
| DeleteRoutingProfileCommandInput
@@ -1135,6 +1145,7 @@ export type ServiceOutputTypes =
11351145
| CreatePersistentContactAssociationCommandOutput
11361146
| CreatePredefinedAttributeCommandOutput
11371147
| CreatePromptCommandOutput
1148+
| CreatePushNotificationRegistrationCommandOutput
11381149
| CreateQueueCommandOutput
11391150
| CreateQuickConnectCommandOutput
11401151
| CreateRoutingProfileCommandOutput
@@ -1160,6 +1171,7 @@ export type ServiceOutputTypes =
11601171
| DeleteIntegrationAssociationCommandOutput
11611172
| DeletePredefinedAttributeCommandOutput
11621173
| DeletePromptCommandOutput
1174+
| DeletePushNotificationRegistrationCommandOutput
11631175
| DeleteQueueCommandOutput
11641176
| DeleteQuickConnectCommandOutput
11651177
| DeleteRoutingProfileCommandOutput
@@ -1564,8 +1576,8 @@ export interface ConnectClientResolvedConfig extends ConnectClientResolvedConfig
15641576
* are also limits to the number of requests that you can make per second. For more information, see
15651577
* <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html">Amazon Connect Service Quotas</a> in the <i>Amazon Connect Administrator
15661578
* Guide</i>.</p>
1567-
* <p>You can use an endpoint to connect programmatically to an Amazon Web Services service. For
1568-
* a list of Amazon Connect endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect Endpoints</a>.</p>
1579+
* <p>You can use an endpoint to connect programmatically to an Amazon Web Services service. For a
1580+
* list of Amazon Connect endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect Endpoints</a>.</p>
15691581
* @public
15701582
*/
15711583
export class ConnectClient extends __Client<

‎clients/client-connect/src/commands/CreateContactCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
77
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
99
import { CreateContactResponse } from "../models/models_0";
10-
import { CreateContactRequest, CreateContactRequestFilterSensitiveLog } from "../models/models_2";
10+
import { CreateContactRequest, CreateContactRequestFilterSensitiveLog } from "../models/models_3";
1111
import { de_CreateContactCommand, se_CreateContactCommand } from "../protocols/Aws_restJson1";
1212

1313
/**

‎clients/client-connect/src/commands/CreateEvaluationFormCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
77
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
99
import { CreateEvaluationFormResponse } from "../models/models_0";
10-
import { CreateEvaluationFormRequest } from "../models/models_2";
10+
import { CreateEvaluationFormRequest } from "../models/models_3";
1111
import { de_CreateEvaluationFormCommand, se_CreateEvaluationFormCommand } from "../protocols/Aws_restJson1";
1212

1313
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
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 {
10+
CreatePushNotificationRegistrationRequest,
11+
CreatePushNotificationRegistrationResponse,
12+
} from "../models/models_0";
13+
import {
14+
de_CreatePushNotificationRegistrationCommand,
15+
se_CreatePushNotificationRegistrationCommand,
16+
} from "../protocols/Aws_restJson1";
17+
18+
/**
19+
* @public
20+
*/
21+
export type { __MetadataBearer };
22+
export { $Command };
23+
/**
24+
* @public
25+
*
26+
* The input for {@link CreatePushNotificationRegistrationCommand}.
27+
*/
28+
export interface CreatePushNotificationRegistrationCommandInput extends CreatePushNotificationRegistrationRequest {}
29+
/**
30+
* @public
31+
*
32+
* The output of {@link CreatePushNotificationRegistrationCommand}.
33+
*/
34+
export interface CreatePushNotificationRegistrationCommandOutput
35+
extends CreatePushNotificationRegistrationResponse,
36+
__MetadataBearer {}
37+
38+
/**
39+
* <p>Creates registration for a device token and a chat contact to receive real-time push
40+
* notifications. For more information about push notifications, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/set-up-push-notifications-for-mobile-chat.html">Set up push
41+
* notifications in Amazon Connect for mobile chat</a> in the <i>Amazon Connect
42+
* Administrator Guide</i>.</p>
43+
* @example
44+
* Use a bare-bones client and the command you need to make an API call.
45+
* ```javascript
46+
* import { ConnectClient, CreatePushNotificationRegistrationCommand } from "@aws-sdk/client-connect"; // ES Modules import
47+
* // const { ConnectClient, CreatePushNotificationRegistrationCommand } = require("@aws-sdk/client-connect"); // CommonJS import
48+
* const client = new ConnectClient(config);
49+
* const input = { // CreatePushNotificationRegistrationRequest
50+
* InstanceId: "STRING_VALUE", // required
51+
* ClientToken: "STRING_VALUE",
52+
* PinpointAppArn: "STRING_VALUE", // required
53+
* DeviceToken: "STRING_VALUE", // required
54+
* DeviceType: "GCM" || "APNS" || "APNS_SANDBOX", // required
55+
* ContactConfiguration: { // ContactConfiguration
56+
* ContactId: "STRING_VALUE", // required
57+
* ParticipantRole: "AGENT" || "CUSTOMER" || "SYSTEM" || "CUSTOM_BOT" || "SUPERVISOR",
58+
* IncludeRawMessage: true || false,
59+
* },
60+
* };
61+
* const command = new CreatePushNotificationRegistrationCommand(input);
62+
* const response = await client.send(command);
63+
* // { // CreatePushNotificationRegistrationResponse
64+
* // RegistrationId: "STRING_VALUE", // required
65+
* // };
66+
*
67+
* ```
68+
*
69+
* @param CreatePushNotificationRegistrationCommandInput - {@link CreatePushNotificationRegistrationCommandInput}
70+
* @returns {@link CreatePushNotificationRegistrationCommandOutput}
71+
* @see {@link CreatePushNotificationRegistrationCommandInput} for command's `input` shape.
72+
* @see {@link CreatePushNotificationRegistrationCommandOutput} for command's `response` shape.
73+
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
74+
*
75+
* @throws {@link AccessDeniedException} (client fault)
76+
* <p>You do not have sufficient permissions to perform this action.</p>
77+
*
78+
* @throws {@link InternalServiceException} (server fault)
79+
* <p>Request processing failed because of an error or failure with the service.</p>
80+
*
81+
* @throws {@link InvalidParameterException} (client fault)
82+
* <p>One or more of the specified parameters are not valid.</p>
83+
*
84+
* @throws {@link ResourceNotFoundException} (client fault)
85+
* <p>The specified resource was not found.</p>
86+
*
87+
* @throws {@link ServiceQuotaExceededException} (client fault)
88+
* <p>The service quota has been exceeded.</p>
89+
*
90+
* @throws {@link ThrottlingException} (client fault)
91+
* <p>The throttling limit has been exceeded.</p>
92+
*
93+
* @throws {@link ConnectServiceException}
94+
* <p>Base exception class for all service exceptions from Connect service.</p>
95+
*
96+
* @public
97+
*/
98+
export class CreatePushNotificationRegistrationCommand extends $Command
99+
.classBuilder<
100+
CreatePushNotificationRegistrationCommandInput,
101+
CreatePushNotificationRegistrationCommandOutput,
102+
ConnectClientResolvedConfig,
103+
ServiceInputTypes,
104+
ServiceOutputTypes
105+
>()
106+
.ep(commonParams)
107+
.m(function (this: any, Command: any, cs: any, config: ConnectClientResolvedConfig, o: any) {
108+
return [
109+
getSerdePlugin(config, this.serialize, this.deserialize),
110+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
111+
];
112+
})
113+
.s("AmazonConnectService", "CreatePushNotificationRegistration", {})
114+
.n("ConnectClient", "CreatePushNotificationRegistrationCommand")
115+
.f(void 0, void 0)
116+
.ser(se_CreatePushNotificationRegistrationCommand)
117+
.de(de_CreatePushNotificationRegistrationCommand)
118+
.build() {
119+
/** @internal type navigation helper, not in runtime. */
120+
protected declare static __types: {
121+
api: {
122+
input: CreatePushNotificationRegistrationRequest;
123+
output: CreatePushNotificationRegistrationResponse;
124+
};
125+
sdk: {
126+
input: CreatePushNotificationRegistrationCommandInput;
127+
output: CreatePushNotificationRegistrationCommandOutput;
128+
};
129+
};
130+
}

0 commit comments

Comments
 (0)
Please sign in to comment.