@aws-sdk/client-connectcampaigns 3.186.0 → 3.188.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/ConnectCampaigns.js +90 -97
  3. package/dist-es/ConnectCampaignsClient.js +22 -28
  4. package/dist-es/commands/CreateCampaignCommand.js +21 -28
  5. package/dist-es/commands/DeleteCampaignCommand.js +22 -29
  6. package/dist-es/commands/DeleteConnectInstanceConfigCommand.js +22 -29
  7. package/dist-es/commands/DeleteInstanceOnboardingJobCommand.js +22 -29
  8. package/dist-es/commands/DescribeCampaignCommand.js +21 -28
  9. package/dist-es/commands/GetCampaignStateBatchCommand.js +21 -28
  10. package/dist-es/commands/GetCampaignStateCommand.js +21 -28
  11. package/dist-es/commands/GetConnectInstanceConfigCommand.js +21 -28
  12. package/dist-es/commands/GetInstanceOnboardingJobStatusCommand.js +21 -28
  13. package/dist-es/commands/ListCampaignsCommand.js +21 -28
  14. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  15. package/dist-es/commands/PauseCampaignCommand.js +22 -29
  16. package/dist-es/commands/PutDialRequestBatchCommand.js +21 -28
  17. package/dist-es/commands/ResumeCampaignCommand.js +22 -29
  18. package/dist-es/commands/StartCampaignCommand.js +22 -29
  19. package/dist-es/commands/StartInstanceOnboardingJobCommand.js +21 -28
  20. package/dist-es/commands/StopCampaignCommand.js +22 -29
  21. package/dist-es/commands/TagResourceCommand.js +22 -29
  22. package/dist-es/commands/UntagResourceCommand.js +22 -29
  23. package/dist-es/commands/UpdateCampaignDialerConfigCommand.js +22 -29
  24. package/dist-es/commands/UpdateCampaignNameCommand.js +22 -29
  25. package/dist-es/commands/UpdateCampaignOutboundCallConfigCommand.js +22 -29
  26. package/dist-es/endpoints.js +8 -8
  27. package/dist-es/models/ConnectCampaignsServiceException.js +5 -10
  28. package/dist-es/models/models_0.js +265 -164
  29. package/dist-es/pagination/ListCampaignsPaginator.js +25 -68
  30. package/dist-es/protocols/Aws_restJson1.js +1625 -2300
  31. package/dist-es/runtimeConfig.browser.js +26 -12
  32. package/dist-es/runtimeConfig.js +30 -12
  33. package/dist-es/runtimeConfig.native.js +8 -5
  34. package/dist-es/runtimeConfig.shared.js +8 -11
  35. package/package.json +33 -33
@@ -1,2319 +1,1661 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, map as __map, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { ConnectCampaignsServiceException as __BaseException } from "../models/ConnectCampaignsServiceException";
5
4
  import { AccessDeniedException, ConflictException, DialerConfig, InternalServerException, InvalidCampaignStateException, InvalidStateException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
- export var serializeAws_restJson1CreateCampaignCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
- return __generator(this, function (_c) {
9
- switch (_c.label) {
10
- case 0: return [4, context.endpoint()];
11
- case 1:
12
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = {
14
- "content-type": "application/json",
15
- };
16
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns";
17
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.connectInstanceId != null && { connectInstanceId: input.connectInstanceId })), (input.dialerConfig != null && {
18
- dialerConfig: serializeAws_restJson1DialerConfig(input.dialerConfig, context),
19
- })), (input.name != null && { name: input.name })), (input.outboundCallConfig != null && {
20
- outboundCallConfig: serializeAws_restJson1OutboundCallConfig(input.outboundCallConfig, context),
21
- })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
22
- return [2, new __HttpRequest({
23
- protocol: protocol,
24
- hostname: hostname,
25
- port: port,
26
- method: "PUT",
27
- headers: headers,
28
- path: resolvedPath,
29
- body: body,
30
- })];
31
- }
32
- });
33
- }); };
34
- export var serializeAws_restJson1DeleteCampaignCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
35
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
36
- return __generator(this, function (_c) {
37
- switch (_c.label) {
38
- case 0: return [4, context.endpoint()];
39
- case 1:
40
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
41
- headers = {};
42
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}";
43
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
44
- return [2, new __HttpRequest({
45
- protocol: protocol,
46
- hostname: hostname,
47
- port: port,
48
- method: "DELETE",
49
- headers: headers,
50
- path: resolvedPath,
51
- body: body,
52
- })];
53
- }
54
- });
55
- }); };
56
- export var serializeAws_restJson1DeleteConnectInstanceConfigCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
57
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
58
- return __generator(this, function (_c) {
59
- switch (_c.label) {
60
- case 0: return [4, context.endpoint()];
61
- case 1:
62
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
63
- headers = {};
64
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
65
- "/connect-instance/{connectInstanceId}/config";
66
- resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", function () { return input.connectInstanceId; }, "{connectInstanceId}", false);
67
- return [2, new __HttpRequest({
68
- protocol: protocol,
69
- hostname: hostname,
70
- port: port,
71
- method: "DELETE",
72
- headers: headers,
73
- path: resolvedPath,
74
- body: body,
75
- })];
76
- }
77
- });
78
- }); };
79
- export var serializeAws_restJson1DeleteInstanceOnboardingJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
80
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
81
- return __generator(this, function (_c) {
82
- switch (_c.label) {
83
- case 0: return [4, context.endpoint()];
84
- case 1:
85
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
86
- headers = {};
87
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
88
- "/connect-instance/{connectInstanceId}/onboarding";
89
- resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", function () { return input.connectInstanceId; }, "{connectInstanceId}", false);
90
- return [2, new __HttpRequest({
91
- protocol: protocol,
92
- hostname: hostname,
93
- port: port,
94
- method: "DELETE",
95
- headers: headers,
96
- path: resolvedPath,
97
- body: body,
98
- })];
99
- }
100
- });
101
- }); };
102
- export var serializeAws_restJson1DescribeCampaignCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
103
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
104
- return __generator(this, function (_c) {
105
- switch (_c.label) {
106
- case 0: return [4, context.endpoint()];
107
- case 1:
108
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
109
- headers = {};
110
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}";
111
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
112
- return [2, new __HttpRequest({
113
- protocol: protocol,
114
- hostname: hostname,
115
- port: port,
116
- method: "GET",
117
- headers: headers,
118
- path: resolvedPath,
119
- body: body,
120
- })];
121
- }
122
- });
123
- }); };
124
- export var serializeAws_restJson1GetCampaignStateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
125
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
126
- return __generator(this, function (_c) {
127
- switch (_c.label) {
128
- case 0: return [4, context.endpoint()];
129
- case 1:
130
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
131
- headers = {};
132
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/state";
133
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
134
- return [2, new __HttpRequest({
135
- protocol: protocol,
136
- hostname: hostname,
137
- port: port,
138
- method: "GET",
139
- headers: headers,
140
- path: resolvedPath,
141
- body: body,
142
- })];
143
- }
5
+ export const serializeAws_restJson1CreateCampaignCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.connectInstanceId != null && { connectInstanceId: input.connectInstanceId }),
14
+ ...(input.dialerConfig != null && {
15
+ dialerConfig: serializeAws_restJson1DialerConfig(input.dialerConfig, context),
16
+ }),
17
+ ...(input.name != null && { name: input.name }),
18
+ ...(input.outboundCallConfig != null && {
19
+ outboundCallConfig: serializeAws_restJson1OutboundCallConfig(input.outboundCallConfig, context),
20
+ }),
21
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
22
+ });
23
+ return new __HttpRequest({
24
+ protocol,
25
+ hostname,
26
+ port,
27
+ method: "PUT",
28
+ headers,
29
+ path: resolvedPath,
30
+ body,
144
31
  });
145
- }); };
146
- export var serializeAws_restJson1GetCampaignStateBatchCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
147
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
148
- return __generator(this, function (_c) {
149
- switch (_c.label) {
150
- case 0: return [4, context.endpoint()];
151
- case 1:
152
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
153
- headers = {
154
- "content-type": "application/json",
155
- };
156
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns-state";
157
- body = JSON.stringify(__assign({}, (input.campaignIds != null && { campaignIds: serializeAws_restJson1CampaignIdList(input.campaignIds, context) })));
158
- return [2, new __HttpRequest({
159
- protocol: protocol,
160
- hostname: hostname,
161
- port: port,
162
- method: "POST",
163
- headers: headers,
164
- path: resolvedPath,
165
- body: body,
166
- })];
167
- }
32
+ };
33
+ export const serializeAws_restJson1DeleteCampaignCommand = async (input, context) => {
34
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
35
+ const headers = {};
36
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}";
37
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
38
+ let body;
39
+ return new __HttpRequest({
40
+ protocol,
41
+ hostname,
42
+ port,
43
+ method: "DELETE",
44
+ headers,
45
+ path: resolvedPath,
46
+ body,
168
47
  });
169
- }); };
170
- export var serializeAws_restJson1GetConnectInstanceConfigCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
171
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
172
- return __generator(this, function (_c) {
173
- switch (_c.label) {
174
- case 0: return [4, context.endpoint()];
175
- case 1:
176
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
177
- headers = {};
178
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
179
- "/connect-instance/{connectInstanceId}/config";
180
- resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", function () { return input.connectInstanceId; }, "{connectInstanceId}", false);
181
- return [2, new __HttpRequest({
182
- protocol: protocol,
183
- hostname: hostname,
184
- port: port,
185
- method: "GET",
186
- headers: headers,
187
- path: resolvedPath,
188
- body: body,
189
- })];
190
- }
48
+ };
49
+ export const serializeAws_restJson1DeleteConnectInstanceConfigCommand = async (input, context) => {
50
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
51
+ const headers = {};
52
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
53
+ "/connect-instance/{connectInstanceId}/config";
54
+ resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", () => input.connectInstanceId, "{connectInstanceId}", false);
55
+ let body;
56
+ return new __HttpRequest({
57
+ protocol,
58
+ hostname,
59
+ port,
60
+ method: "DELETE",
61
+ headers,
62
+ path: resolvedPath,
63
+ body,
191
64
  });
192
- }); };
193
- export var serializeAws_restJson1GetInstanceOnboardingJobStatusCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
194
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
195
- return __generator(this, function (_c) {
196
- switch (_c.label) {
197
- case 0: return [4, context.endpoint()];
198
- case 1:
199
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
200
- headers = {};
201
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
202
- "/connect-instance/{connectInstanceId}/onboarding";
203
- resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", function () { return input.connectInstanceId; }, "{connectInstanceId}", false);
204
- return [2, new __HttpRequest({
205
- protocol: protocol,
206
- hostname: hostname,
207
- port: port,
208
- method: "GET",
209
- headers: headers,
210
- path: resolvedPath,
211
- body: body,
212
- })];
213
- }
65
+ };
66
+ export const serializeAws_restJson1DeleteInstanceOnboardingJobCommand = async (input, context) => {
67
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
68
+ const headers = {};
69
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
70
+ "/connect-instance/{connectInstanceId}/onboarding";
71
+ resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", () => input.connectInstanceId, "{connectInstanceId}", false);
72
+ let body;
73
+ return new __HttpRequest({
74
+ protocol,
75
+ hostname,
76
+ port,
77
+ method: "DELETE",
78
+ headers,
79
+ path: resolvedPath,
80
+ body,
214
81
  });
215
- }); };
216
- export var serializeAws_restJson1ListCampaignsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
217
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
218
- return __generator(this, function (_c) {
219
- switch (_c.label) {
220
- case 0: return [4, context.endpoint()];
221
- case 1:
222
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
223
- headers = {
224
- "content-type": "application/json",
225
- };
226
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns-summary";
227
- body = JSON.stringify(__assign(__assign(__assign({}, (input.filters != null && { filters: serializeAws_restJson1CampaignFilters(input.filters, context) })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })));
228
- return [2, new __HttpRequest({
229
- protocol: protocol,
230
- hostname: hostname,
231
- port: port,
232
- method: "POST",
233
- headers: headers,
234
- path: resolvedPath,
235
- body: body,
236
- })];
237
- }
82
+ };
83
+ export const serializeAws_restJson1DescribeCampaignCommand = async (input, context) => {
84
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
85
+ const headers = {};
86
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}";
87
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
88
+ let body;
89
+ return new __HttpRequest({
90
+ protocol,
91
+ hostname,
92
+ port,
93
+ method: "GET",
94
+ headers,
95
+ path: resolvedPath,
96
+ body,
238
97
  });
239
- }); };
240
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
241
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
242
- return __generator(this, function (_c) {
243
- switch (_c.label) {
244
- case 0: return [4, context.endpoint()];
245
- case 1:
246
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
247
- headers = {};
248
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{arn}";
249
- resolvedPath = __resolvedPath(resolvedPath, input, "arn", function () { return input.arn; }, "{arn}", false);
250
- return [2, new __HttpRequest({
251
- protocol: protocol,
252
- hostname: hostname,
253
- port: port,
254
- method: "GET",
255
- headers: headers,
256
- path: resolvedPath,
257
- body: body,
258
- })];
259
- }
98
+ };
99
+ export const serializeAws_restJson1GetCampaignStateCommand = async (input, context) => {
100
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
101
+ const headers = {};
102
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/state";
103
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
104
+ let body;
105
+ return new __HttpRequest({
106
+ protocol,
107
+ hostname,
108
+ port,
109
+ method: "GET",
110
+ headers,
111
+ path: resolvedPath,
112
+ body,
260
113
  });
261
- }); };
262
- export var serializeAws_restJson1PauseCampaignCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
263
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
264
- return __generator(this, function (_c) {
265
- switch (_c.label) {
266
- case 0: return [4, context.endpoint()];
267
- case 1:
268
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
269
- headers = {};
270
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/pause";
271
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
272
- return [2, new __HttpRequest({
273
- protocol: protocol,
274
- hostname: hostname,
275
- port: port,
276
- method: "POST",
277
- headers: headers,
278
- path: resolvedPath,
279
- body: body,
280
- })];
281
- }
114
+ };
115
+ export const serializeAws_restJson1GetCampaignStateBatchCommand = async (input, context) => {
116
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
117
+ const headers = {
118
+ "content-type": "application/json",
119
+ };
120
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns-state";
121
+ let body;
122
+ body = JSON.stringify({
123
+ ...(input.campaignIds != null && { campaignIds: serializeAws_restJson1CampaignIdList(input.campaignIds, context) }),
124
+ });
125
+ return new __HttpRequest({
126
+ protocol,
127
+ hostname,
128
+ port,
129
+ method: "POST",
130
+ headers,
131
+ path: resolvedPath,
132
+ body,
282
133
  });
283
- }); };
284
- export var serializeAws_restJson1PutDialRequestBatchCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
285
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
286
- return __generator(this, function (_c) {
287
- switch (_c.label) {
288
- case 0: return [4, context.endpoint()];
289
- case 1:
290
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
291
- headers = {
292
- "content-type": "application/json",
293
- };
294
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/dial-requests";
295
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
296
- body = JSON.stringify(__assign({}, (input.dialRequests != null && {
297
- dialRequests: serializeAws_restJson1DialRequestList(input.dialRequests, context),
298
- })));
299
- return [2, new __HttpRequest({
300
- protocol: protocol,
301
- hostname: hostname,
302
- port: port,
303
- method: "PUT",
304
- headers: headers,
305
- path: resolvedPath,
306
- body: body,
307
- })];
308
- }
134
+ };
135
+ export const serializeAws_restJson1GetConnectInstanceConfigCommand = async (input, context) => {
136
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
137
+ const headers = {};
138
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
139
+ "/connect-instance/{connectInstanceId}/config";
140
+ resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", () => input.connectInstanceId, "{connectInstanceId}", false);
141
+ let body;
142
+ return new __HttpRequest({
143
+ protocol,
144
+ hostname,
145
+ port,
146
+ method: "GET",
147
+ headers,
148
+ path: resolvedPath,
149
+ body,
309
150
  });
310
- }); };
311
- export var serializeAws_restJson1ResumeCampaignCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
312
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
313
- return __generator(this, function (_c) {
314
- switch (_c.label) {
315
- case 0: return [4, context.endpoint()];
316
- case 1:
317
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
318
- headers = {};
319
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/resume";
320
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
321
- return [2, new __HttpRequest({
322
- protocol: protocol,
323
- hostname: hostname,
324
- port: port,
325
- method: "POST",
326
- headers: headers,
327
- path: resolvedPath,
328
- body: body,
329
- })];
330
- }
151
+ };
152
+ export const serializeAws_restJson1GetInstanceOnboardingJobStatusCommand = async (input, context) => {
153
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
154
+ const headers = {};
155
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
156
+ "/connect-instance/{connectInstanceId}/onboarding";
157
+ resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", () => input.connectInstanceId, "{connectInstanceId}", false);
158
+ let body;
159
+ return new __HttpRequest({
160
+ protocol,
161
+ hostname,
162
+ port,
163
+ method: "GET",
164
+ headers,
165
+ path: resolvedPath,
166
+ body,
331
167
  });
332
- }); };
333
- export var serializeAws_restJson1StartCampaignCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
334
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
335
- return __generator(this, function (_c) {
336
- switch (_c.label) {
337
- case 0: return [4, context.endpoint()];
338
- case 1:
339
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
340
- headers = {};
341
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/start";
342
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
343
- return [2, new __HttpRequest({
344
- protocol: protocol,
345
- hostname: hostname,
346
- port: port,
347
- method: "POST",
348
- headers: headers,
349
- path: resolvedPath,
350
- body: body,
351
- })];
352
- }
168
+ };
169
+ export const serializeAws_restJson1ListCampaignsCommand = async (input, context) => {
170
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
171
+ const headers = {
172
+ "content-type": "application/json",
173
+ };
174
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns-summary";
175
+ let body;
176
+ body = JSON.stringify({
177
+ ...(input.filters != null && { filters: serializeAws_restJson1CampaignFilters(input.filters, context) }),
178
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
179
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
180
+ });
181
+ return new __HttpRequest({
182
+ protocol,
183
+ hostname,
184
+ port,
185
+ method: "POST",
186
+ headers,
187
+ path: resolvedPath,
188
+ body,
353
189
  });
354
- }); };
355
- export var serializeAws_restJson1StartInstanceOnboardingJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
356
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
357
- return __generator(this, function (_c) {
358
- switch (_c.label) {
359
- case 0: return [4, context.endpoint()];
360
- case 1:
361
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
362
- headers = {
363
- "content-type": "application/json",
364
- };
365
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
366
- "/connect-instance/{connectInstanceId}/onboarding";
367
- resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", function () { return input.connectInstanceId; }, "{connectInstanceId}", false);
368
- body = JSON.stringify(__assign({}, (input.encryptionConfig != null && {
369
- encryptionConfig: serializeAws_restJson1EncryptionConfig(input.encryptionConfig, context),
370
- })));
371
- return [2, new __HttpRequest({
372
- protocol: protocol,
373
- hostname: hostname,
374
- port: port,
375
- method: "PUT",
376
- headers: headers,
377
- path: resolvedPath,
378
- body: body,
379
- })];
380
- }
190
+ };
191
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
192
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
193
+ const headers = {};
194
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
195
+ resolvedPath = __resolvedPath(resolvedPath, input, "arn", () => input.arn, "{arn}", false);
196
+ let body;
197
+ return new __HttpRequest({
198
+ protocol,
199
+ hostname,
200
+ port,
201
+ method: "GET",
202
+ headers,
203
+ path: resolvedPath,
204
+ body,
381
205
  });
382
- }); };
383
- export var serializeAws_restJson1StopCampaignCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
384
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
385
- return __generator(this, function (_c) {
386
- switch (_c.label) {
387
- case 0: return [4, context.endpoint()];
388
- case 1:
389
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
390
- headers = {};
391
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/stop";
392
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
393
- return [2, new __HttpRequest({
394
- protocol: protocol,
395
- hostname: hostname,
396
- port: port,
397
- method: "POST",
398
- headers: headers,
399
- path: resolvedPath,
400
- body: body,
401
- })];
402
- }
206
+ };
207
+ export const serializeAws_restJson1PauseCampaignCommand = async (input, context) => {
208
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
209
+ const headers = {};
210
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/pause";
211
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
212
+ let body;
213
+ return new __HttpRequest({
214
+ protocol,
215
+ hostname,
216
+ port,
217
+ method: "POST",
218
+ headers,
219
+ path: resolvedPath,
220
+ body,
403
221
  });
404
- }); };
405
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
406
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
407
- return __generator(this, function (_c) {
408
- switch (_c.label) {
409
- case 0: return [4, context.endpoint()];
410
- case 1:
411
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
412
- headers = {
413
- "content-type": "application/json",
414
- };
415
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{arn}";
416
- resolvedPath = __resolvedPath(resolvedPath, input, "arn", function () { return input.arn; }, "{arn}", false);
417
- body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
418
- return [2, new __HttpRequest({
419
- protocol: protocol,
420
- hostname: hostname,
421
- port: port,
422
- method: "POST",
423
- headers: headers,
424
- path: resolvedPath,
425
- body: body,
426
- })];
427
- }
222
+ };
223
+ export const serializeAws_restJson1PutDialRequestBatchCommand = async (input, context) => {
224
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
225
+ const headers = {
226
+ "content-type": "application/json",
227
+ };
228
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/dial-requests";
229
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
230
+ let body;
231
+ body = JSON.stringify({
232
+ ...(input.dialRequests != null && {
233
+ dialRequests: serializeAws_restJson1DialRequestList(input.dialRequests, context),
234
+ }),
235
+ });
236
+ return new __HttpRequest({
237
+ protocol,
238
+ hostname,
239
+ port,
240
+ method: "PUT",
241
+ headers,
242
+ path: resolvedPath,
243
+ body,
428
244
  });
429
- }); };
430
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
431
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
432
- return __generator(this, function (_c) {
433
- switch (_c.label) {
434
- case 0: return [4, context.endpoint()];
435
- case 1:
436
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
437
- headers = {};
438
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{arn}";
439
- resolvedPath = __resolvedPath(resolvedPath, input, "arn", function () { return input.arn; }, "{arn}", false);
440
- query = map({
441
- tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
442
- });
443
- return [2, new __HttpRequest({
444
- protocol: protocol,
445
- hostname: hostname,
446
- port: port,
447
- method: "DELETE",
448
- headers: headers,
449
- path: resolvedPath,
450
- query: query,
451
- body: body,
452
- })];
453
- }
245
+ };
246
+ export const serializeAws_restJson1ResumeCampaignCommand = async (input, context) => {
247
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
248
+ const headers = {};
249
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/resume";
250
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
251
+ let body;
252
+ return new __HttpRequest({
253
+ protocol,
254
+ hostname,
255
+ port,
256
+ method: "POST",
257
+ headers,
258
+ path: resolvedPath,
259
+ body,
454
260
  });
455
- }); };
456
- export var serializeAws_restJson1UpdateCampaignDialerConfigCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
457
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
458
- return __generator(this, function (_c) {
459
- switch (_c.label) {
460
- case 0: return [4, context.endpoint()];
461
- case 1:
462
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
463
- headers = {
464
- "content-type": "application/json",
465
- };
466
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/dialer-config";
467
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
468
- body = JSON.stringify(__assign({}, (input.dialerConfig != null && {
469
- dialerConfig: serializeAws_restJson1DialerConfig(input.dialerConfig, context),
470
- })));
471
- return [2, new __HttpRequest({
472
- protocol: protocol,
473
- hostname: hostname,
474
- port: port,
475
- method: "POST",
476
- headers: headers,
477
- path: resolvedPath,
478
- body: body,
479
- })];
480
- }
261
+ };
262
+ export const serializeAws_restJson1StartCampaignCommand = async (input, context) => {
263
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
264
+ const headers = {};
265
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/start";
266
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
267
+ let body;
268
+ return new __HttpRequest({
269
+ protocol,
270
+ hostname,
271
+ port,
272
+ method: "POST",
273
+ headers,
274
+ path: resolvedPath,
275
+ body,
481
276
  });
482
- }); };
483
- export var serializeAws_restJson1UpdateCampaignNameCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
484
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
485
- return __generator(this, function (_c) {
486
- switch (_c.label) {
487
- case 0: return [4, context.endpoint()];
488
- case 1:
489
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
490
- headers = {
491
- "content-type": "application/json",
492
- };
493
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/name";
494
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
495
- body = JSON.stringify(__assign({}, (input.name != null && { name: input.name })));
496
- return [2, new __HttpRequest({
497
- protocol: protocol,
498
- hostname: hostname,
499
- port: port,
500
- method: "POST",
501
- headers: headers,
502
- path: resolvedPath,
503
- body: body,
504
- })];
505
- }
277
+ };
278
+ export const serializeAws_restJson1StartInstanceOnboardingJobCommand = async (input, context) => {
279
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
280
+ const headers = {
281
+ "content-type": "application/json",
282
+ };
283
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
284
+ "/connect-instance/{connectInstanceId}/onboarding";
285
+ resolvedPath = __resolvedPath(resolvedPath, input, "connectInstanceId", () => input.connectInstanceId, "{connectInstanceId}", false);
286
+ let body;
287
+ body = JSON.stringify({
288
+ ...(input.encryptionConfig != null && {
289
+ encryptionConfig: serializeAws_restJson1EncryptionConfig(input.encryptionConfig, context),
290
+ }),
291
+ });
292
+ return new __HttpRequest({
293
+ protocol,
294
+ hostname,
295
+ port,
296
+ method: "PUT",
297
+ headers,
298
+ path: resolvedPath,
299
+ body,
506
300
  });
507
- }); };
508
- export var serializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
509
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
510
- return __generator(this, function (_c) {
511
- switch (_c.label) {
512
- case 0: return [4, context.endpoint()];
513
- case 1:
514
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
515
- headers = {
516
- "content-type": "application/json",
517
- };
518
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/campaigns/{id}/outbound-call-config";
519
- resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
520
- body = JSON.stringify(__assign(__assign(__assign({}, (input.answerMachineDetectionConfig != null && {
521
- answerMachineDetectionConfig: serializeAws_restJson1AnswerMachineDetectionConfig(input.answerMachineDetectionConfig, context),
522
- })), (input.connectContactFlowId != null && { connectContactFlowId: input.connectContactFlowId })), (input.connectSourcePhoneNumber != null && { connectSourcePhoneNumber: input.connectSourcePhoneNumber })));
523
- return [2, new __HttpRequest({
524
- protocol: protocol,
525
- hostname: hostname,
526
- port: port,
527
- method: "POST",
528
- headers: headers,
529
- path: resolvedPath,
530
- body: body,
531
- })];
532
- }
301
+ };
302
+ export const serializeAws_restJson1StopCampaignCommand = async (input, context) => {
303
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
304
+ const headers = {};
305
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/stop";
306
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
307
+ let body;
308
+ return new __HttpRequest({
309
+ protocol,
310
+ hostname,
311
+ port,
312
+ method: "POST",
313
+ headers,
314
+ path: resolvedPath,
315
+ body,
533
316
  });
534
- }); };
535
- export var deserializeAws_restJson1CreateCampaignCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
536
- var contents, data, _a, _b;
537
- return __generator(this, function (_c) {
538
- switch (_c.label) {
539
- case 0:
540
- if (output.statusCode !== 200 && output.statusCode >= 300) {
541
- return [2, deserializeAws_restJson1CreateCampaignCommandError(output, context)];
542
- }
543
- contents = map({
544
- $metadata: deserializeMetadata(output),
545
- });
546
- _a = __expectNonNull;
547
- _b = __expectObject;
548
- return [4, parseBody(output.body, context)];
549
- case 1:
550
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
551
- if (data.arn != null) {
552
- contents.arn = __expectString(data.arn);
553
- }
554
- if (data.id != null) {
555
- contents.id = __expectString(data.id);
556
- }
557
- if (data.tags != null) {
558
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
559
- }
560
- return [2, contents];
561
- }
317
+ };
318
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
319
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
320
+ const headers = {
321
+ "content-type": "application/json",
322
+ };
323
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
324
+ resolvedPath = __resolvedPath(resolvedPath, input, "arn", () => input.arn, "{arn}", false);
325
+ let body;
326
+ body = JSON.stringify({
327
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
328
+ });
329
+ return new __HttpRequest({
330
+ protocol,
331
+ hostname,
332
+ port,
333
+ method: "POST",
334
+ headers,
335
+ path: resolvedPath,
336
+ body,
562
337
  });
563
- }); };
564
- var deserializeAws_restJson1CreateCampaignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
565
- var parsedOutput, _a, errorCode, _b, parsedBody;
566
- var _c;
567
- return __generator(this, function (_d) {
568
- switch (_d.label) {
569
- case 0:
570
- _a = [__assign({}, output)];
571
- _c = {};
572
- return [4, parseErrorBody(output.body, context)];
573
- case 1:
574
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
575
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
576
- _b = errorCode;
577
- switch (_b) {
578
- case "AccessDeniedException": return [3, 2];
579
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
580
- case "ConflictException": return [3, 4];
581
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
582
- case "InternalServerException": return [3, 6];
583
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
584
- case "ResourceNotFoundException": return [3, 8];
585
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 8];
586
- case "ServiceQuotaExceededException": return [3, 10];
587
- case "com.amazonaws.connectcampaigns#ServiceQuotaExceededException": return [3, 10];
588
- case "ThrottlingException": return [3, 12];
589
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 12];
590
- case "ValidationException": return [3, 14];
591
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 14];
592
- }
593
- return [3, 16];
594
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
595
- case 3: throw _d.sent();
596
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
597
- case 5: throw _d.sent();
598
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
599
- case 7: throw _d.sent();
600
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
601
- case 9: throw _d.sent();
602
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
603
- case 11: throw _d.sent();
604
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
605
- case 13: throw _d.sent();
606
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
607
- case 15: throw _d.sent();
608
- case 16:
609
- parsedBody = parsedOutput.body;
610
- throwDefaultError({
611
- output: output,
612
- parsedBody: parsedBody,
613
- exceptionCtor: __BaseException,
614
- errorCode: errorCode,
615
- });
616
- _d.label = 17;
617
- case 17: return [2];
618
- }
338
+ };
339
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
340
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
341
+ const headers = {};
342
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{arn}";
343
+ resolvedPath = __resolvedPath(resolvedPath, input, "arn", () => input.arn, "{arn}", false);
344
+ const query = map({
345
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
346
+ });
347
+ let body;
348
+ return new __HttpRequest({
349
+ protocol,
350
+ hostname,
351
+ port,
352
+ method: "DELETE",
353
+ headers,
354
+ path: resolvedPath,
355
+ query,
356
+ body,
619
357
  });
620
- }); };
621
- export var deserializeAws_restJson1DeleteCampaignCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
622
- var contents;
623
- return __generator(this, function (_a) {
624
- switch (_a.label) {
625
- case 0:
626
- if (output.statusCode !== 200 && output.statusCode >= 300) {
627
- return [2, deserializeAws_restJson1DeleteCampaignCommandError(output, context)];
628
- }
629
- contents = map({
630
- $metadata: deserializeMetadata(output),
631
- });
632
- return [4, collectBody(output.body, context)];
633
- case 1:
634
- _a.sent();
635
- return [2, contents];
636
- }
358
+ };
359
+ export const serializeAws_restJson1UpdateCampaignDialerConfigCommand = async (input, context) => {
360
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
361
+ const headers = {
362
+ "content-type": "application/json",
363
+ };
364
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/dialer-config";
365
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
366
+ let body;
367
+ body = JSON.stringify({
368
+ ...(input.dialerConfig != null && {
369
+ dialerConfig: serializeAws_restJson1DialerConfig(input.dialerConfig, context),
370
+ }),
371
+ });
372
+ return new __HttpRequest({
373
+ protocol,
374
+ hostname,
375
+ port,
376
+ method: "POST",
377
+ headers,
378
+ path: resolvedPath,
379
+ body,
637
380
  });
638
- }); };
639
- var deserializeAws_restJson1DeleteCampaignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
640
- var parsedOutput, _a, errorCode, _b, parsedBody;
641
- var _c;
642
- return __generator(this, function (_d) {
643
- switch (_d.label) {
644
- case 0:
645
- _a = [__assign({}, output)];
646
- _c = {};
647
- return [4, parseErrorBody(output.body, context)];
648
- case 1:
649
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
650
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
651
- _b = errorCode;
652
- switch (_b) {
653
- case "AccessDeniedException": return [3, 2];
654
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
655
- case "InternalServerException": return [3, 4];
656
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
657
- case "ResourceNotFoundException": return [3, 6];
658
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 6];
659
- case "ValidationException": return [3, 8];
660
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 8];
661
- }
662
- return [3, 10];
663
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
664
- case 3: throw _d.sent();
665
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
666
- case 5: throw _d.sent();
667
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
668
- case 7: throw _d.sent();
669
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
670
- case 9: throw _d.sent();
671
- case 10:
672
- parsedBody = parsedOutput.body;
673
- throwDefaultError({
674
- output: output,
675
- parsedBody: parsedBody,
676
- exceptionCtor: __BaseException,
677
- errorCode: errorCode,
678
- });
679
- _d.label = 11;
680
- case 11: return [2];
681
- }
381
+ };
382
+ export const serializeAws_restJson1UpdateCampaignNameCommand = async (input, context) => {
383
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
384
+ const headers = {
385
+ "content-type": "application/json",
386
+ };
387
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/name";
388
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
389
+ let body;
390
+ body = JSON.stringify({
391
+ ...(input.name != null && { name: input.name }),
392
+ });
393
+ return new __HttpRequest({
394
+ protocol,
395
+ hostname,
396
+ port,
397
+ method: "POST",
398
+ headers,
399
+ path: resolvedPath,
400
+ body,
682
401
  });
683
- }); };
684
- export var deserializeAws_restJson1DeleteConnectInstanceConfigCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
685
- var contents;
686
- return __generator(this, function (_a) {
687
- switch (_a.label) {
688
- case 0:
689
- if (output.statusCode !== 200 && output.statusCode >= 300) {
690
- return [2, deserializeAws_restJson1DeleteConnectInstanceConfigCommandError(output, context)];
691
- }
692
- contents = map({
693
- $metadata: deserializeMetadata(output),
694
- });
695
- return [4, collectBody(output.body, context)];
696
- case 1:
697
- _a.sent();
698
- return [2, contents];
699
- }
402
+ };
403
+ export const serializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = async (input, context) => {
404
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
405
+ const headers = {
406
+ "content-type": "application/json",
407
+ };
408
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/campaigns/{id}/outbound-call-config";
409
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
410
+ let body;
411
+ body = JSON.stringify({
412
+ ...(input.answerMachineDetectionConfig != null && {
413
+ answerMachineDetectionConfig: serializeAws_restJson1AnswerMachineDetectionConfig(input.answerMachineDetectionConfig, context),
414
+ }),
415
+ ...(input.connectContactFlowId != null && { connectContactFlowId: input.connectContactFlowId }),
416
+ ...(input.connectSourcePhoneNumber != null && { connectSourcePhoneNumber: input.connectSourcePhoneNumber }),
417
+ });
418
+ return new __HttpRequest({
419
+ protocol,
420
+ hostname,
421
+ port,
422
+ method: "POST",
423
+ headers,
424
+ path: resolvedPath,
425
+ body,
700
426
  });
701
- }); };
702
- var deserializeAws_restJson1DeleteConnectInstanceConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
703
- var parsedOutput, _a, errorCode, _b, parsedBody;
704
- var _c;
705
- return __generator(this, function (_d) {
706
- switch (_d.label) {
707
- case 0:
708
- _a = [__assign({}, output)];
709
- _c = {};
710
- return [4, parseErrorBody(output.body, context)];
711
- case 1:
712
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
713
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
714
- _b = errorCode;
715
- switch (_b) {
716
- case "AccessDeniedException": return [3, 2];
717
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
718
- case "InternalServerException": return [3, 4];
719
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
720
- case "InvalidStateException": return [3, 6];
721
- case "com.amazonaws.connectcampaigns#InvalidStateException": return [3, 6];
722
- case "ResourceNotFoundException": return [3, 8];
723
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 8];
724
- case "ThrottlingException": return [3, 10];
725
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 10];
726
- case "ValidationException": return [3, 12];
727
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 12];
728
- }
729
- return [3, 14];
730
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
731
- case 3: throw _d.sent();
732
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
733
- case 5: throw _d.sent();
734
- case 6: return [4, deserializeAws_restJson1InvalidStateExceptionResponse(parsedOutput, context)];
735
- case 7: throw _d.sent();
736
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
737
- case 9: throw _d.sent();
738
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
739
- case 11: throw _d.sent();
740
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
741
- case 13: throw _d.sent();
742
- case 14:
743
- parsedBody = parsedOutput.body;
744
- throwDefaultError({
745
- output: output,
746
- parsedBody: parsedBody,
747
- exceptionCtor: __BaseException,
748
- errorCode: errorCode,
749
- });
750
- _d.label = 15;
751
- case 15: return [2];
752
- }
427
+ };
428
+ export const deserializeAws_restJson1CreateCampaignCommand = async (output, context) => {
429
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
430
+ return deserializeAws_restJson1CreateCampaignCommandError(output, context);
431
+ }
432
+ const contents = map({
433
+ $metadata: deserializeMetadata(output),
753
434
  });
754
- }); };
755
- export var deserializeAws_restJson1DeleteInstanceOnboardingJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
756
- var contents;
757
- return __generator(this, function (_a) {
758
- switch (_a.label) {
759
- case 0:
760
- if (output.statusCode !== 200 && output.statusCode >= 300) {
761
- return [2, deserializeAws_restJson1DeleteInstanceOnboardingJobCommandError(output, context)];
762
- }
763
- contents = map({
764
- $metadata: deserializeMetadata(output),
765
- });
766
- return [4, collectBody(output.body, context)];
767
- case 1:
768
- _a.sent();
769
- return [2, contents];
770
- }
435
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
436
+ if (data.arn != null) {
437
+ contents.arn = __expectString(data.arn);
438
+ }
439
+ if (data.id != null) {
440
+ contents.id = __expectString(data.id);
441
+ }
442
+ if (data.tags != null) {
443
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
444
+ }
445
+ return contents;
446
+ };
447
+ const deserializeAws_restJson1CreateCampaignCommandError = async (output, context) => {
448
+ const parsedOutput = {
449
+ ...output,
450
+ body: await parseErrorBody(output.body, context),
451
+ };
452
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
453
+ switch (errorCode) {
454
+ case "AccessDeniedException":
455
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
456
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
457
+ case "ConflictException":
458
+ case "com.amazonaws.connectcampaigns#ConflictException":
459
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
460
+ case "InternalServerException":
461
+ case "com.amazonaws.connectcampaigns#InternalServerException":
462
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
463
+ case "ResourceNotFoundException":
464
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
465
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
466
+ case "ServiceQuotaExceededException":
467
+ case "com.amazonaws.connectcampaigns#ServiceQuotaExceededException":
468
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
469
+ case "ThrottlingException":
470
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
471
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
472
+ case "ValidationException":
473
+ case "com.amazonaws.connectcampaigns#ValidationException":
474
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
475
+ default:
476
+ const parsedBody = parsedOutput.body;
477
+ throwDefaultError({
478
+ output,
479
+ parsedBody,
480
+ exceptionCtor: __BaseException,
481
+ errorCode,
482
+ });
483
+ }
484
+ };
485
+ export const deserializeAws_restJson1DeleteCampaignCommand = async (output, context) => {
486
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
487
+ return deserializeAws_restJson1DeleteCampaignCommandError(output, context);
488
+ }
489
+ const contents = map({
490
+ $metadata: deserializeMetadata(output),
771
491
  });
772
- }); };
773
- var deserializeAws_restJson1DeleteInstanceOnboardingJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
774
- var parsedOutput, _a, errorCode, _b, parsedBody;
775
- var _c;
776
- return __generator(this, function (_d) {
777
- switch (_d.label) {
778
- case 0:
779
- _a = [__assign({}, output)];
780
- _c = {};
781
- return [4, parseErrorBody(output.body, context)];
782
- case 1:
783
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
784
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
785
- _b = errorCode;
786
- switch (_b) {
787
- case "AccessDeniedException": return [3, 2];
788
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
789
- case "InternalServerException": return [3, 4];
790
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
791
- case "InvalidStateException": return [3, 6];
792
- case "com.amazonaws.connectcampaigns#InvalidStateException": return [3, 6];
793
- case "ResourceNotFoundException": return [3, 8];
794
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 8];
795
- case "ValidationException": return [3, 10];
796
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 10];
797
- }
798
- return [3, 12];
799
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
800
- case 3: throw _d.sent();
801
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
802
- case 5: throw _d.sent();
803
- case 6: return [4, deserializeAws_restJson1InvalidStateExceptionResponse(parsedOutput, context)];
804
- case 7: throw _d.sent();
805
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
806
- case 9: throw _d.sent();
807
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
808
- case 11: throw _d.sent();
809
- case 12:
810
- parsedBody = parsedOutput.body;
811
- throwDefaultError({
812
- output: output,
813
- parsedBody: parsedBody,
814
- exceptionCtor: __BaseException,
815
- errorCode: errorCode,
816
- });
817
- _d.label = 13;
818
- case 13: return [2];
819
- }
492
+ await collectBody(output.body, context);
493
+ return contents;
494
+ };
495
+ const deserializeAws_restJson1DeleteCampaignCommandError = async (output, context) => {
496
+ const parsedOutput = {
497
+ ...output,
498
+ body: await parseErrorBody(output.body, context),
499
+ };
500
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
501
+ switch (errorCode) {
502
+ case "AccessDeniedException":
503
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
504
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
505
+ case "InternalServerException":
506
+ case "com.amazonaws.connectcampaigns#InternalServerException":
507
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
508
+ case "ResourceNotFoundException":
509
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
510
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
511
+ case "ValidationException":
512
+ case "com.amazonaws.connectcampaigns#ValidationException":
513
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
514
+ default:
515
+ const parsedBody = parsedOutput.body;
516
+ throwDefaultError({
517
+ output,
518
+ parsedBody,
519
+ exceptionCtor: __BaseException,
520
+ errorCode,
521
+ });
522
+ }
523
+ };
524
+ export const deserializeAws_restJson1DeleteConnectInstanceConfigCommand = async (output, context) => {
525
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
526
+ return deserializeAws_restJson1DeleteConnectInstanceConfigCommandError(output, context);
527
+ }
528
+ const contents = map({
529
+ $metadata: deserializeMetadata(output),
820
530
  });
821
- }); };
822
- export var deserializeAws_restJson1DescribeCampaignCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
823
- var contents, data, _a, _b;
824
- return __generator(this, function (_c) {
825
- switch (_c.label) {
826
- case 0:
827
- if (output.statusCode !== 200 && output.statusCode >= 300) {
828
- return [2, deserializeAws_restJson1DescribeCampaignCommandError(output, context)];
829
- }
830
- contents = map({
831
- $metadata: deserializeMetadata(output),
832
- });
833
- _a = __expectNonNull;
834
- _b = __expectObject;
835
- return [4, parseBody(output.body, context)];
836
- case 1:
837
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
838
- if (data.campaign != null) {
839
- contents.campaign = deserializeAws_restJson1Campaign(data.campaign, context);
840
- }
841
- return [2, contents];
842
- }
531
+ await collectBody(output.body, context);
532
+ return contents;
533
+ };
534
+ const deserializeAws_restJson1DeleteConnectInstanceConfigCommandError = async (output, context) => {
535
+ const parsedOutput = {
536
+ ...output,
537
+ body: await parseErrorBody(output.body, context),
538
+ };
539
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
540
+ switch (errorCode) {
541
+ case "AccessDeniedException":
542
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
543
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
544
+ case "InternalServerException":
545
+ case "com.amazonaws.connectcampaigns#InternalServerException":
546
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
547
+ case "InvalidStateException":
548
+ case "com.amazonaws.connectcampaigns#InvalidStateException":
549
+ throw await deserializeAws_restJson1InvalidStateExceptionResponse(parsedOutput, context);
550
+ case "ResourceNotFoundException":
551
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
552
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
553
+ case "ThrottlingException":
554
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
555
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
556
+ case "ValidationException":
557
+ case "com.amazonaws.connectcampaigns#ValidationException":
558
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
559
+ default:
560
+ const parsedBody = parsedOutput.body;
561
+ throwDefaultError({
562
+ output,
563
+ parsedBody,
564
+ exceptionCtor: __BaseException,
565
+ errorCode,
566
+ });
567
+ }
568
+ };
569
+ export const deserializeAws_restJson1DeleteInstanceOnboardingJobCommand = async (output, context) => {
570
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
571
+ return deserializeAws_restJson1DeleteInstanceOnboardingJobCommandError(output, context);
572
+ }
573
+ const contents = map({
574
+ $metadata: deserializeMetadata(output),
843
575
  });
844
- }); };
845
- var deserializeAws_restJson1DescribeCampaignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
846
- var parsedOutput, _a, errorCode, _b, parsedBody;
847
- var _c;
848
- return __generator(this, function (_d) {
849
- switch (_d.label) {
850
- case 0:
851
- _a = [__assign({}, output)];
852
- _c = {};
853
- return [4, parseErrorBody(output.body, context)];
854
- case 1:
855
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
856
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
857
- _b = errorCode;
858
- switch (_b) {
859
- case "AccessDeniedException": return [3, 2];
860
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
861
- case "InternalServerException": return [3, 4];
862
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
863
- case "ResourceNotFoundException": return [3, 6];
864
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 6];
865
- case "ValidationException": return [3, 8];
866
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 8];
867
- }
868
- return [3, 10];
869
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
870
- case 3: throw _d.sent();
871
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
872
- case 5: throw _d.sent();
873
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
874
- case 7: throw _d.sent();
875
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
876
- case 9: throw _d.sent();
877
- case 10:
878
- parsedBody = parsedOutput.body;
879
- throwDefaultError({
880
- output: output,
881
- parsedBody: parsedBody,
882
- exceptionCtor: __BaseException,
883
- errorCode: errorCode,
884
- });
885
- _d.label = 11;
886
- case 11: return [2];
887
- }
576
+ await collectBody(output.body, context);
577
+ return contents;
578
+ };
579
+ const deserializeAws_restJson1DeleteInstanceOnboardingJobCommandError = async (output, context) => {
580
+ const parsedOutput = {
581
+ ...output,
582
+ body: await parseErrorBody(output.body, context),
583
+ };
584
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
585
+ switch (errorCode) {
586
+ case "AccessDeniedException":
587
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
588
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
589
+ case "InternalServerException":
590
+ case "com.amazonaws.connectcampaigns#InternalServerException":
591
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
592
+ case "InvalidStateException":
593
+ case "com.amazonaws.connectcampaigns#InvalidStateException":
594
+ throw await deserializeAws_restJson1InvalidStateExceptionResponse(parsedOutput, context);
595
+ case "ResourceNotFoundException":
596
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
597
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
598
+ case "ValidationException":
599
+ case "com.amazonaws.connectcampaigns#ValidationException":
600
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
601
+ default:
602
+ const parsedBody = parsedOutput.body;
603
+ throwDefaultError({
604
+ output,
605
+ parsedBody,
606
+ exceptionCtor: __BaseException,
607
+ errorCode,
608
+ });
609
+ }
610
+ };
611
+ export const deserializeAws_restJson1DescribeCampaignCommand = async (output, context) => {
612
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
613
+ return deserializeAws_restJson1DescribeCampaignCommandError(output, context);
614
+ }
615
+ const contents = map({
616
+ $metadata: deserializeMetadata(output),
888
617
  });
889
- }); };
890
- export var deserializeAws_restJson1GetCampaignStateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
891
- var contents, data, _a, _b;
892
- return __generator(this, function (_c) {
893
- switch (_c.label) {
894
- case 0:
895
- if (output.statusCode !== 200 && output.statusCode >= 300) {
896
- return [2, deserializeAws_restJson1GetCampaignStateCommandError(output, context)];
897
- }
898
- contents = map({
899
- $metadata: deserializeMetadata(output),
900
- });
901
- _a = __expectNonNull;
902
- _b = __expectObject;
903
- return [4, parseBody(output.body, context)];
904
- case 1:
905
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
906
- if (data.state != null) {
907
- contents.state = __expectString(data.state);
908
- }
909
- return [2, contents];
910
- }
618
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
619
+ if (data.campaign != null) {
620
+ contents.campaign = deserializeAws_restJson1Campaign(data.campaign, context);
621
+ }
622
+ return contents;
623
+ };
624
+ const deserializeAws_restJson1DescribeCampaignCommandError = async (output, context) => {
625
+ const parsedOutput = {
626
+ ...output,
627
+ body: await parseErrorBody(output.body, context),
628
+ };
629
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
630
+ switch (errorCode) {
631
+ case "AccessDeniedException":
632
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
633
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
634
+ case "InternalServerException":
635
+ case "com.amazonaws.connectcampaigns#InternalServerException":
636
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
637
+ case "ResourceNotFoundException":
638
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
639
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
640
+ case "ValidationException":
641
+ case "com.amazonaws.connectcampaigns#ValidationException":
642
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
643
+ default:
644
+ const parsedBody = parsedOutput.body;
645
+ throwDefaultError({
646
+ output,
647
+ parsedBody,
648
+ exceptionCtor: __BaseException,
649
+ errorCode,
650
+ });
651
+ }
652
+ };
653
+ export const deserializeAws_restJson1GetCampaignStateCommand = async (output, context) => {
654
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
655
+ return deserializeAws_restJson1GetCampaignStateCommandError(output, context);
656
+ }
657
+ const contents = map({
658
+ $metadata: deserializeMetadata(output),
911
659
  });
912
- }); };
913
- var deserializeAws_restJson1GetCampaignStateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
914
- var parsedOutput, _a, errorCode, _b, parsedBody;
915
- var _c;
916
- return __generator(this, function (_d) {
917
- switch (_d.label) {
918
- case 0:
919
- _a = [__assign({}, output)];
920
- _c = {};
921
- return [4, parseErrorBody(output.body, context)];
922
- case 1:
923
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
924
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
925
- _b = errorCode;
926
- switch (_b) {
927
- case "AccessDeniedException": return [3, 2];
928
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
929
- case "InternalServerException": return [3, 4];
930
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
931
- case "ResourceNotFoundException": return [3, 6];
932
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 6];
933
- case "ThrottlingException": return [3, 8];
934
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 8];
935
- case "ValidationException": return [3, 10];
936
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 10];
937
- }
938
- return [3, 12];
939
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
940
- case 3: throw _d.sent();
941
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
942
- case 5: throw _d.sent();
943
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
944
- case 7: throw _d.sent();
945
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
946
- case 9: throw _d.sent();
947
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
948
- case 11: throw _d.sent();
949
- case 12:
950
- parsedBody = parsedOutput.body;
951
- throwDefaultError({
952
- output: output,
953
- parsedBody: parsedBody,
954
- exceptionCtor: __BaseException,
955
- errorCode: errorCode,
956
- });
957
- _d.label = 13;
958
- case 13: return [2];
959
- }
660
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
661
+ if (data.state != null) {
662
+ contents.state = __expectString(data.state);
663
+ }
664
+ return contents;
665
+ };
666
+ const deserializeAws_restJson1GetCampaignStateCommandError = async (output, context) => {
667
+ const parsedOutput = {
668
+ ...output,
669
+ body: await parseErrorBody(output.body, context),
670
+ };
671
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
672
+ switch (errorCode) {
673
+ case "AccessDeniedException":
674
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
675
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
676
+ case "InternalServerException":
677
+ case "com.amazonaws.connectcampaigns#InternalServerException":
678
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
679
+ case "ResourceNotFoundException":
680
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
681
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
682
+ case "ThrottlingException":
683
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
684
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
685
+ case "ValidationException":
686
+ case "com.amazonaws.connectcampaigns#ValidationException":
687
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
688
+ default:
689
+ const parsedBody = parsedOutput.body;
690
+ throwDefaultError({
691
+ output,
692
+ parsedBody,
693
+ exceptionCtor: __BaseException,
694
+ errorCode,
695
+ });
696
+ }
697
+ };
698
+ export const deserializeAws_restJson1GetCampaignStateBatchCommand = async (output, context) => {
699
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
700
+ return deserializeAws_restJson1GetCampaignStateBatchCommandError(output, context);
701
+ }
702
+ const contents = map({
703
+ $metadata: deserializeMetadata(output),
960
704
  });
961
- }); };
962
- export var deserializeAws_restJson1GetCampaignStateBatchCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
963
- var contents, data, _a, _b;
964
- return __generator(this, function (_c) {
965
- switch (_c.label) {
966
- case 0:
967
- if (output.statusCode !== 200 && output.statusCode >= 300) {
968
- return [2, deserializeAws_restJson1GetCampaignStateBatchCommandError(output, context)];
969
- }
970
- contents = map({
971
- $metadata: deserializeMetadata(output),
972
- });
973
- _a = __expectNonNull;
974
- _b = __expectObject;
975
- return [4, parseBody(output.body, context)];
976
- case 1:
977
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
978
- if (data.failedRequests != null) {
979
- contents.failedRequests = deserializeAws_restJson1FailedCampaignStateResponseList(data.failedRequests, context);
980
- }
981
- if (data.successfulRequests != null) {
982
- contents.successfulRequests = deserializeAws_restJson1SuccessfulCampaignStateResponseList(data.successfulRequests, context);
983
- }
984
- return [2, contents];
985
- }
705
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
706
+ if (data.failedRequests != null) {
707
+ contents.failedRequests = deserializeAws_restJson1FailedCampaignStateResponseList(data.failedRequests, context);
708
+ }
709
+ if (data.successfulRequests != null) {
710
+ contents.successfulRequests = deserializeAws_restJson1SuccessfulCampaignStateResponseList(data.successfulRequests, context);
711
+ }
712
+ return contents;
713
+ };
714
+ const deserializeAws_restJson1GetCampaignStateBatchCommandError = async (output, context) => {
715
+ const parsedOutput = {
716
+ ...output,
717
+ body: await parseErrorBody(output.body, context),
718
+ };
719
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
720
+ switch (errorCode) {
721
+ case "AccessDeniedException":
722
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
723
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
724
+ case "InternalServerException":
725
+ case "com.amazonaws.connectcampaigns#InternalServerException":
726
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
727
+ case "ThrottlingException":
728
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
729
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
730
+ case "ValidationException":
731
+ case "com.amazonaws.connectcampaigns#ValidationException":
732
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
733
+ default:
734
+ const parsedBody = parsedOutput.body;
735
+ throwDefaultError({
736
+ output,
737
+ parsedBody,
738
+ exceptionCtor: __BaseException,
739
+ errorCode,
740
+ });
741
+ }
742
+ };
743
+ export const deserializeAws_restJson1GetConnectInstanceConfigCommand = async (output, context) => {
744
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
745
+ return deserializeAws_restJson1GetConnectInstanceConfigCommandError(output, context);
746
+ }
747
+ const contents = map({
748
+ $metadata: deserializeMetadata(output),
986
749
  });
987
- }); };
988
- var deserializeAws_restJson1GetCampaignStateBatchCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
989
- var parsedOutput, _a, errorCode, _b, parsedBody;
990
- var _c;
991
- return __generator(this, function (_d) {
992
- switch (_d.label) {
993
- case 0:
994
- _a = [__assign({}, output)];
995
- _c = {};
996
- return [4, parseErrorBody(output.body, context)];
997
- case 1:
998
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
999
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1000
- _b = errorCode;
1001
- switch (_b) {
1002
- case "AccessDeniedException": return [3, 2];
1003
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1004
- case "InternalServerException": return [3, 4];
1005
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
1006
- case "ThrottlingException": return [3, 6];
1007
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 6];
1008
- case "ValidationException": return [3, 8];
1009
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 8];
1010
- }
1011
- return [3, 10];
1012
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1013
- case 3: throw _d.sent();
1014
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1015
- case 5: throw _d.sent();
1016
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1017
- case 7: throw _d.sent();
1018
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1019
- case 9: throw _d.sent();
1020
- case 10:
1021
- parsedBody = parsedOutput.body;
1022
- throwDefaultError({
1023
- output: output,
1024
- parsedBody: parsedBody,
1025
- exceptionCtor: __BaseException,
1026
- errorCode: errorCode,
1027
- });
1028
- _d.label = 11;
1029
- case 11: return [2];
1030
- }
750
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
751
+ if (data.connectInstanceConfig != null) {
752
+ contents.connectInstanceConfig = deserializeAws_restJson1InstanceConfig(data.connectInstanceConfig, context);
753
+ }
754
+ return contents;
755
+ };
756
+ const deserializeAws_restJson1GetConnectInstanceConfigCommandError = async (output, context) => {
757
+ const parsedOutput = {
758
+ ...output,
759
+ body: await parseErrorBody(output.body, context),
760
+ };
761
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
762
+ switch (errorCode) {
763
+ case "AccessDeniedException":
764
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
765
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
766
+ case "InternalServerException":
767
+ case "com.amazonaws.connectcampaigns#InternalServerException":
768
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
769
+ case "ResourceNotFoundException":
770
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
771
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
772
+ case "ValidationException":
773
+ case "com.amazonaws.connectcampaigns#ValidationException":
774
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
775
+ default:
776
+ const parsedBody = parsedOutput.body;
777
+ throwDefaultError({
778
+ output,
779
+ parsedBody,
780
+ exceptionCtor: __BaseException,
781
+ errorCode,
782
+ });
783
+ }
784
+ };
785
+ export const deserializeAws_restJson1GetInstanceOnboardingJobStatusCommand = async (output, context) => {
786
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
787
+ return deserializeAws_restJson1GetInstanceOnboardingJobStatusCommandError(output, context);
788
+ }
789
+ const contents = map({
790
+ $metadata: deserializeMetadata(output),
1031
791
  });
1032
- }); };
1033
- export var deserializeAws_restJson1GetConnectInstanceConfigCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1034
- var contents, data, _a, _b;
1035
- return __generator(this, function (_c) {
1036
- switch (_c.label) {
1037
- case 0:
1038
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1039
- return [2, deserializeAws_restJson1GetConnectInstanceConfigCommandError(output, context)];
1040
- }
1041
- contents = map({
1042
- $metadata: deserializeMetadata(output),
1043
- });
1044
- _a = __expectNonNull;
1045
- _b = __expectObject;
1046
- return [4, parseBody(output.body, context)];
1047
- case 1:
1048
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1049
- if (data.connectInstanceConfig != null) {
1050
- contents.connectInstanceConfig = deserializeAws_restJson1InstanceConfig(data.connectInstanceConfig, context);
1051
- }
1052
- return [2, contents];
1053
- }
792
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
793
+ if (data.connectInstanceOnboardingJobStatus != null) {
794
+ contents.connectInstanceOnboardingJobStatus = deserializeAws_restJson1InstanceOnboardingJobStatus(data.connectInstanceOnboardingJobStatus, context);
795
+ }
796
+ return contents;
797
+ };
798
+ const deserializeAws_restJson1GetInstanceOnboardingJobStatusCommandError = async (output, context) => {
799
+ const parsedOutput = {
800
+ ...output,
801
+ body: await parseErrorBody(output.body, context),
802
+ };
803
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
804
+ switch (errorCode) {
805
+ case "AccessDeniedException":
806
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
807
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
808
+ case "InternalServerException":
809
+ case "com.amazonaws.connectcampaigns#InternalServerException":
810
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
811
+ case "ResourceNotFoundException":
812
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
813
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
814
+ case "ValidationException":
815
+ case "com.amazonaws.connectcampaigns#ValidationException":
816
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
817
+ default:
818
+ const parsedBody = parsedOutput.body;
819
+ throwDefaultError({
820
+ output,
821
+ parsedBody,
822
+ exceptionCtor: __BaseException,
823
+ errorCode,
824
+ });
825
+ }
826
+ };
827
+ export const deserializeAws_restJson1ListCampaignsCommand = async (output, context) => {
828
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
829
+ return deserializeAws_restJson1ListCampaignsCommandError(output, context);
830
+ }
831
+ const contents = map({
832
+ $metadata: deserializeMetadata(output),
1054
833
  });
1055
- }); };
1056
- var deserializeAws_restJson1GetConnectInstanceConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1057
- var parsedOutput, _a, errorCode, _b, parsedBody;
1058
- var _c;
1059
- return __generator(this, function (_d) {
1060
- switch (_d.label) {
1061
- case 0:
1062
- _a = [__assign({}, output)];
1063
- _c = {};
1064
- return [4, parseErrorBody(output.body, context)];
1065
- case 1:
1066
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1067
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1068
- _b = errorCode;
1069
- switch (_b) {
1070
- case "AccessDeniedException": return [3, 2];
1071
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1072
- case "InternalServerException": return [3, 4];
1073
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
1074
- case "ResourceNotFoundException": return [3, 6];
1075
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 6];
1076
- case "ValidationException": return [3, 8];
1077
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 8];
1078
- }
1079
- return [3, 10];
1080
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1081
- case 3: throw _d.sent();
1082
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1083
- case 5: throw _d.sent();
1084
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1085
- case 7: throw _d.sent();
1086
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1087
- case 9: throw _d.sent();
1088
- case 10:
1089
- parsedBody = parsedOutput.body;
1090
- throwDefaultError({
1091
- output: output,
1092
- parsedBody: parsedBody,
1093
- exceptionCtor: __BaseException,
1094
- errorCode: errorCode,
1095
- });
1096
- _d.label = 11;
1097
- case 11: return [2];
1098
- }
834
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
835
+ if (data.campaignSummaryList != null) {
836
+ contents.campaignSummaryList = deserializeAws_restJson1CampaignSummaryList(data.campaignSummaryList, context);
837
+ }
838
+ if (data.nextToken != null) {
839
+ contents.nextToken = __expectString(data.nextToken);
840
+ }
841
+ return contents;
842
+ };
843
+ const deserializeAws_restJson1ListCampaignsCommandError = async (output, context) => {
844
+ const parsedOutput = {
845
+ ...output,
846
+ body: await parseErrorBody(output.body, context),
847
+ };
848
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
849
+ switch (errorCode) {
850
+ case "AccessDeniedException":
851
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
852
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
853
+ case "InternalServerException":
854
+ case "com.amazonaws.connectcampaigns#InternalServerException":
855
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
856
+ case "ValidationException":
857
+ case "com.amazonaws.connectcampaigns#ValidationException":
858
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
859
+ default:
860
+ const parsedBody = parsedOutput.body;
861
+ throwDefaultError({
862
+ output,
863
+ parsedBody,
864
+ exceptionCtor: __BaseException,
865
+ errorCode,
866
+ });
867
+ }
868
+ };
869
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
870
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
871
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
872
+ }
873
+ const contents = map({
874
+ $metadata: deserializeMetadata(output),
1099
875
  });
1100
- }); };
1101
- export var deserializeAws_restJson1GetInstanceOnboardingJobStatusCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1102
- var contents, data, _a, _b;
1103
- return __generator(this, function (_c) {
1104
- switch (_c.label) {
1105
- case 0:
1106
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1107
- return [2, deserializeAws_restJson1GetInstanceOnboardingJobStatusCommandError(output, context)];
1108
- }
1109
- contents = map({
1110
- $metadata: deserializeMetadata(output),
1111
- });
1112
- _a = __expectNonNull;
1113
- _b = __expectObject;
1114
- return [4, parseBody(output.body, context)];
1115
- case 1:
1116
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1117
- if (data.connectInstanceOnboardingJobStatus != null) {
1118
- contents.connectInstanceOnboardingJobStatus = deserializeAws_restJson1InstanceOnboardingJobStatus(data.connectInstanceOnboardingJobStatus, context);
1119
- }
1120
- return [2, contents];
1121
- }
876
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
877
+ if (data.tags != null) {
878
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
879
+ }
880
+ return contents;
881
+ };
882
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
883
+ const parsedOutput = {
884
+ ...output,
885
+ body: await parseErrorBody(output.body, context),
886
+ };
887
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
888
+ switch (errorCode) {
889
+ case "AccessDeniedException":
890
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
891
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
892
+ case "InternalServerException":
893
+ case "com.amazonaws.connectcampaigns#InternalServerException":
894
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
895
+ case "ResourceNotFoundException":
896
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
897
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
898
+ case "ThrottlingException":
899
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
900
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
901
+ case "ValidationException":
902
+ case "com.amazonaws.connectcampaigns#ValidationException":
903
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
904
+ default:
905
+ const parsedBody = parsedOutput.body;
906
+ throwDefaultError({
907
+ output,
908
+ parsedBody,
909
+ exceptionCtor: __BaseException,
910
+ errorCode,
911
+ });
912
+ }
913
+ };
914
+ export const deserializeAws_restJson1PauseCampaignCommand = async (output, context) => {
915
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
916
+ return deserializeAws_restJson1PauseCampaignCommandError(output, context);
917
+ }
918
+ const contents = map({
919
+ $metadata: deserializeMetadata(output),
1122
920
  });
1123
- }); };
1124
- var deserializeAws_restJson1GetInstanceOnboardingJobStatusCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1125
- var parsedOutput, _a, errorCode, _b, parsedBody;
1126
- var _c;
1127
- return __generator(this, function (_d) {
1128
- switch (_d.label) {
1129
- case 0:
1130
- _a = [__assign({}, output)];
1131
- _c = {};
1132
- return [4, parseErrorBody(output.body, context)];
1133
- case 1:
1134
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1135
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1136
- _b = errorCode;
1137
- switch (_b) {
1138
- case "AccessDeniedException": return [3, 2];
1139
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1140
- case "InternalServerException": return [3, 4];
1141
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
1142
- case "ResourceNotFoundException": return [3, 6];
1143
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 6];
1144
- case "ValidationException": return [3, 8];
1145
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 8];
1146
- }
1147
- return [3, 10];
1148
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1149
- case 3: throw _d.sent();
1150
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1151
- case 5: throw _d.sent();
1152
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1153
- case 7: throw _d.sent();
1154
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1155
- case 9: throw _d.sent();
1156
- case 10:
1157
- parsedBody = parsedOutput.body;
1158
- throwDefaultError({
1159
- output: output,
1160
- parsedBody: parsedBody,
1161
- exceptionCtor: __BaseException,
1162
- errorCode: errorCode,
1163
- });
1164
- _d.label = 11;
1165
- case 11: return [2];
1166
- }
921
+ await collectBody(output.body, context);
922
+ return contents;
923
+ };
924
+ const deserializeAws_restJson1PauseCampaignCommandError = async (output, context) => {
925
+ const parsedOutput = {
926
+ ...output,
927
+ body: await parseErrorBody(output.body, context),
928
+ };
929
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
930
+ switch (errorCode) {
931
+ case "AccessDeniedException":
932
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
933
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
934
+ case "ConflictException":
935
+ case "com.amazonaws.connectcampaigns#ConflictException":
936
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
937
+ case "InternalServerException":
938
+ case "com.amazonaws.connectcampaigns#InternalServerException":
939
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
940
+ case "InvalidCampaignStateException":
941
+ case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
942
+ throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
943
+ case "ResourceNotFoundException":
944
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
945
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
946
+ case "ThrottlingException":
947
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
948
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
949
+ case "ValidationException":
950
+ case "com.amazonaws.connectcampaigns#ValidationException":
951
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
952
+ default:
953
+ const parsedBody = parsedOutput.body;
954
+ throwDefaultError({
955
+ output,
956
+ parsedBody,
957
+ exceptionCtor: __BaseException,
958
+ errorCode,
959
+ });
960
+ }
961
+ };
962
+ export const deserializeAws_restJson1PutDialRequestBatchCommand = async (output, context) => {
963
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
964
+ return deserializeAws_restJson1PutDialRequestBatchCommandError(output, context);
965
+ }
966
+ const contents = map({
967
+ $metadata: deserializeMetadata(output),
1167
968
  });
1168
- }); };
1169
- export var deserializeAws_restJson1ListCampaignsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1170
- var contents, data, _a, _b;
1171
- return __generator(this, function (_c) {
1172
- switch (_c.label) {
1173
- case 0:
1174
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1175
- return [2, deserializeAws_restJson1ListCampaignsCommandError(output, context)];
1176
- }
1177
- contents = map({
1178
- $metadata: deserializeMetadata(output),
1179
- });
1180
- _a = __expectNonNull;
1181
- _b = __expectObject;
1182
- return [4, parseBody(output.body, context)];
1183
- case 1:
1184
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1185
- if (data.campaignSummaryList != null) {
1186
- contents.campaignSummaryList = deserializeAws_restJson1CampaignSummaryList(data.campaignSummaryList, context);
1187
- }
1188
- if (data.nextToken != null) {
1189
- contents.nextToken = __expectString(data.nextToken);
1190
- }
1191
- return [2, contents];
1192
- }
969
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
970
+ if (data.failedRequests != null) {
971
+ contents.failedRequests = deserializeAws_restJson1FailedRequestList(data.failedRequests, context);
972
+ }
973
+ if (data.successfulRequests != null) {
974
+ contents.successfulRequests = deserializeAws_restJson1SuccessfulRequestList(data.successfulRequests, context);
975
+ }
976
+ return contents;
977
+ };
978
+ const deserializeAws_restJson1PutDialRequestBatchCommandError = async (output, context) => {
979
+ const parsedOutput = {
980
+ ...output,
981
+ body: await parseErrorBody(output.body, context),
982
+ };
983
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
984
+ switch (errorCode) {
985
+ case "AccessDeniedException":
986
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
987
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
988
+ case "ConflictException":
989
+ case "com.amazonaws.connectcampaigns#ConflictException":
990
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
991
+ case "InternalServerException":
992
+ case "com.amazonaws.connectcampaigns#InternalServerException":
993
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
994
+ case "InvalidCampaignStateException":
995
+ case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
996
+ throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
997
+ case "ResourceNotFoundException":
998
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
999
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1000
+ case "ThrottlingException":
1001
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
1002
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1003
+ case "ValidationException":
1004
+ case "com.amazonaws.connectcampaigns#ValidationException":
1005
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1006
+ default:
1007
+ const parsedBody = parsedOutput.body;
1008
+ throwDefaultError({
1009
+ output,
1010
+ parsedBody,
1011
+ exceptionCtor: __BaseException,
1012
+ errorCode,
1013
+ });
1014
+ }
1015
+ };
1016
+ export const deserializeAws_restJson1ResumeCampaignCommand = async (output, context) => {
1017
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1018
+ return deserializeAws_restJson1ResumeCampaignCommandError(output, context);
1019
+ }
1020
+ const contents = map({
1021
+ $metadata: deserializeMetadata(output),
1193
1022
  });
1194
- }); };
1195
- var deserializeAws_restJson1ListCampaignsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1196
- var parsedOutput, _a, errorCode, _b, parsedBody;
1197
- var _c;
1198
- return __generator(this, function (_d) {
1199
- switch (_d.label) {
1200
- case 0:
1201
- _a = [__assign({}, output)];
1202
- _c = {};
1203
- return [4, parseErrorBody(output.body, context)];
1204
- case 1:
1205
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1206
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1207
- _b = errorCode;
1208
- switch (_b) {
1209
- case "AccessDeniedException": return [3, 2];
1210
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1211
- case "InternalServerException": return [3, 4];
1212
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
1213
- case "ValidationException": return [3, 6];
1214
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 6];
1215
- }
1216
- return [3, 8];
1217
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1218
- case 3: throw _d.sent();
1219
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1220
- case 5: throw _d.sent();
1221
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1222
- case 7: throw _d.sent();
1223
- case 8:
1224
- parsedBody = parsedOutput.body;
1225
- throwDefaultError({
1226
- output: output,
1227
- parsedBody: parsedBody,
1228
- exceptionCtor: __BaseException,
1229
- errorCode: errorCode,
1230
- });
1231
- _d.label = 9;
1232
- case 9: return [2];
1233
- }
1023
+ await collectBody(output.body, context);
1024
+ return contents;
1025
+ };
1026
+ const deserializeAws_restJson1ResumeCampaignCommandError = async (output, context) => {
1027
+ const parsedOutput = {
1028
+ ...output,
1029
+ body: await parseErrorBody(output.body, context),
1030
+ };
1031
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1032
+ switch (errorCode) {
1033
+ case "AccessDeniedException":
1034
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1035
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1036
+ case "ConflictException":
1037
+ case "com.amazonaws.connectcampaigns#ConflictException":
1038
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1039
+ case "InternalServerException":
1040
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1041
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1042
+ case "InvalidCampaignStateException":
1043
+ case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
1044
+ throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
1045
+ case "ResourceNotFoundException":
1046
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1047
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1048
+ case "ThrottlingException":
1049
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
1050
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1051
+ case "ValidationException":
1052
+ case "com.amazonaws.connectcampaigns#ValidationException":
1053
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1054
+ default:
1055
+ const parsedBody = parsedOutput.body;
1056
+ throwDefaultError({
1057
+ output,
1058
+ parsedBody,
1059
+ exceptionCtor: __BaseException,
1060
+ errorCode,
1061
+ });
1062
+ }
1063
+ };
1064
+ export const deserializeAws_restJson1StartCampaignCommand = async (output, context) => {
1065
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1066
+ return deserializeAws_restJson1StartCampaignCommandError(output, context);
1067
+ }
1068
+ const contents = map({
1069
+ $metadata: deserializeMetadata(output),
1234
1070
  });
1235
- }); };
1236
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1237
- var contents, data, _a, _b;
1238
- return __generator(this, function (_c) {
1239
- switch (_c.label) {
1240
- case 0:
1241
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1242
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1243
- }
1244
- contents = map({
1245
- $metadata: deserializeMetadata(output),
1246
- });
1247
- _a = __expectNonNull;
1248
- _b = __expectObject;
1249
- return [4, parseBody(output.body, context)];
1250
- case 1:
1251
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1252
- if (data.tags != null) {
1253
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1254
- }
1255
- return [2, contents];
1256
- }
1071
+ await collectBody(output.body, context);
1072
+ return contents;
1073
+ };
1074
+ const deserializeAws_restJson1StartCampaignCommandError = async (output, context) => {
1075
+ const parsedOutput = {
1076
+ ...output,
1077
+ body: await parseErrorBody(output.body, context),
1078
+ };
1079
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1080
+ switch (errorCode) {
1081
+ case "AccessDeniedException":
1082
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1083
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1084
+ case "ConflictException":
1085
+ case "com.amazonaws.connectcampaigns#ConflictException":
1086
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1087
+ case "InternalServerException":
1088
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1089
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1090
+ case "InvalidCampaignStateException":
1091
+ case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
1092
+ throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
1093
+ case "ResourceNotFoundException":
1094
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1095
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1096
+ case "ThrottlingException":
1097
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
1098
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1099
+ case "ValidationException":
1100
+ case "com.amazonaws.connectcampaigns#ValidationException":
1101
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1102
+ default:
1103
+ const parsedBody = parsedOutput.body;
1104
+ throwDefaultError({
1105
+ output,
1106
+ parsedBody,
1107
+ exceptionCtor: __BaseException,
1108
+ errorCode,
1109
+ });
1110
+ }
1111
+ };
1112
+ export const deserializeAws_restJson1StartInstanceOnboardingJobCommand = async (output, context) => {
1113
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1114
+ return deserializeAws_restJson1StartInstanceOnboardingJobCommandError(output, context);
1115
+ }
1116
+ const contents = map({
1117
+ $metadata: deserializeMetadata(output),
1257
1118
  });
1258
- }); };
1259
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1260
- var parsedOutput, _a, errorCode, _b, parsedBody;
1261
- var _c;
1262
- return __generator(this, function (_d) {
1263
- switch (_d.label) {
1264
- case 0:
1265
- _a = [__assign({}, output)];
1266
- _c = {};
1267
- return [4, parseErrorBody(output.body, context)];
1268
- case 1:
1269
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1270
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1271
- _b = errorCode;
1272
- switch (_b) {
1273
- case "AccessDeniedException": return [3, 2];
1274
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1275
- case "InternalServerException": return [3, 4];
1276
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
1277
- case "ResourceNotFoundException": return [3, 6];
1278
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 6];
1279
- case "ThrottlingException": return [3, 8];
1280
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 8];
1281
- case "ValidationException": return [3, 10];
1282
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 10];
1283
- }
1284
- return [3, 12];
1285
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1286
- case 3: throw _d.sent();
1287
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1288
- case 5: throw _d.sent();
1289
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1290
- case 7: throw _d.sent();
1291
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1292
- case 9: throw _d.sent();
1293
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1294
- case 11: throw _d.sent();
1295
- case 12:
1296
- parsedBody = parsedOutput.body;
1297
- throwDefaultError({
1298
- output: output,
1299
- parsedBody: parsedBody,
1300
- exceptionCtor: __BaseException,
1301
- errorCode: errorCode,
1302
- });
1303
- _d.label = 13;
1304
- case 13: return [2];
1305
- }
1119
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1120
+ if (data.connectInstanceOnboardingJobStatus != null) {
1121
+ contents.connectInstanceOnboardingJobStatus = deserializeAws_restJson1InstanceOnboardingJobStatus(data.connectInstanceOnboardingJobStatus, context);
1122
+ }
1123
+ return contents;
1124
+ };
1125
+ const deserializeAws_restJson1StartInstanceOnboardingJobCommandError = async (output, context) => {
1126
+ const parsedOutput = {
1127
+ ...output,
1128
+ body: await parseErrorBody(output.body, context),
1129
+ };
1130
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1131
+ switch (errorCode) {
1132
+ case "AccessDeniedException":
1133
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1134
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1135
+ case "ConflictException":
1136
+ case "com.amazonaws.connectcampaigns#ConflictException":
1137
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1138
+ case "InternalServerException":
1139
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1140
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1141
+ case "ResourceNotFoundException":
1142
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1143
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1144
+ case "ThrottlingException":
1145
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
1146
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1147
+ case "ValidationException":
1148
+ case "com.amazonaws.connectcampaigns#ValidationException":
1149
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1150
+ default:
1151
+ const parsedBody = parsedOutput.body;
1152
+ throwDefaultError({
1153
+ output,
1154
+ parsedBody,
1155
+ exceptionCtor: __BaseException,
1156
+ errorCode,
1157
+ });
1158
+ }
1159
+ };
1160
+ export const deserializeAws_restJson1StopCampaignCommand = async (output, context) => {
1161
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1162
+ return deserializeAws_restJson1StopCampaignCommandError(output, context);
1163
+ }
1164
+ const contents = map({
1165
+ $metadata: deserializeMetadata(output),
1306
1166
  });
1307
- }); };
1308
- export var deserializeAws_restJson1PauseCampaignCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1309
- var contents;
1310
- return __generator(this, function (_a) {
1311
- switch (_a.label) {
1312
- case 0:
1313
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1314
- return [2, deserializeAws_restJson1PauseCampaignCommandError(output, context)];
1315
- }
1316
- contents = map({
1317
- $metadata: deserializeMetadata(output),
1318
- });
1319
- return [4, collectBody(output.body, context)];
1320
- case 1:
1321
- _a.sent();
1322
- return [2, contents];
1323
- }
1167
+ await collectBody(output.body, context);
1168
+ return contents;
1169
+ };
1170
+ const deserializeAws_restJson1StopCampaignCommandError = async (output, context) => {
1171
+ const parsedOutput = {
1172
+ ...output,
1173
+ body: await parseErrorBody(output.body, context),
1174
+ };
1175
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1176
+ switch (errorCode) {
1177
+ case "AccessDeniedException":
1178
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1179
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1180
+ case "ConflictException":
1181
+ case "com.amazonaws.connectcampaigns#ConflictException":
1182
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1183
+ case "InternalServerException":
1184
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1185
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1186
+ case "InvalidCampaignStateException":
1187
+ case "com.amazonaws.connectcampaigns#InvalidCampaignStateException":
1188
+ throw await deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context);
1189
+ case "ResourceNotFoundException":
1190
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1191
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1192
+ case "ThrottlingException":
1193
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
1194
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1195
+ case "ValidationException":
1196
+ case "com.amazonaws.connectcampaigns#ValidationException":
1197
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1198
+ default:
1199
+ const parsedBody = parsedOutput.body;
1200
+ throwDefaultError({
1201
+ output,
1202
+ parsedBody,
1203
+ exceptionCtor: __BaseException,
1204
+ errorCode,
1205
+ });
1206
+ }
1207
+ };
1208
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1209
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1210
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1211
+ }
1212
+ const contents = map({
1213
+ $metadata: deserializeMetadata(output),
1324
1214
  });
1325
- }); };
1326
- var deserializeAws_restJson1PauseCampaignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1327
- var parsedOutput, _a, errorCode, _b, parsedBody;
1328
- var _c;
1329
- return __generator(this, function (_d) {
1330
- switch (_d.label) {
1331
- case 0:
1332
- _a = [__assign({}, output)];
1333
- _c = {};
1334
- return [4, parseErrorBody(output.body, context)];
1335
- case 1:
1336
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1337
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1338
- _b = errorCode;
1339
- switch (_b) {
1340
- case "AccessDeniedException": return [3, 2];
1341
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1342
- case "ConflictException": return [3, 4];
1343
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
1344
- case "InternalServerException": return [3, 6];
1345
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
1346
- case "InvalidCampaignStateException": return [3, 8];
1347
- case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": return [3, 8];
1348
- case "ResourceNotFoundException": return [3, 10];
1349
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 10];
1350
- case "ThrottlingException": return [3, 12];
1351
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 12];
1352
- case "ValidationException": return [3, 14];
1353
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 14];
1354
- }
1355
- return [3, 16];
1356
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1357
- case 3: throw _d.sent();
1358
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1359
- case 5: throw _d.sent();
1360
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1361
- case 7: throw _d.sent();
1362
- case 8: return [4, deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context)];
1363
- case 9: throw _d.sent();
1364
- case 10: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1365
- case 11: throw _d.sent();
1366
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1367
- case 13: throw _d.sent();
1368
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1369
- case 15: throw _d.sent();
1370
- case 16:
1371
- parsedBody = parsedOutput.body;
1372
- throwDefaultError({
1373
- output: output,
1374
- parsedBody: parsedBody,
1375
- exceptionCtor: __BaseException,
1376
- errorCode: errorCode,
1377
- });
1378
- _d.label = 17;
1379
- case 17: return [2];
1380
- }
1215
+ await collectBody(output.body, context);
1216
+ return contents;
1217
+ };
1218
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1219
+ const parsedOutput = {
1220
+ ...output,
1221
+ body: await parseErrorBody(output.body, context),
1222
+ };
1223
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1224
+ switch (errorCode) {
1225
+ case "AccessDeniedException":
1226
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1227
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1228
+ case "InternalServerException":
1229
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1230
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1231
+ case "ResourceNotFoundException":
1232
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1233
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1234
+ case "ThrottlingException":
1235
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
1236
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1237
+ case "ValidationException":
1238
+ case "com.amazonaws.connectcampaigns#ValidationException":
1239
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1240
+ default:
1241
+ const parsedBody = parsedOutput.body;
1242
+ throwDefaultError({
1243
+ output,
1244
+ parsedBody,
1245
+ exceptionCtor: __BaseException,
1246
+ errorCode,
1247
+ });
1248
+ }
1249
+ };
1250
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1251
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1252
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1253
+ }
1254
+ const contents = map({
1255
+ $metadata: deserializeMetadata(output),
1381
1256
  });
1382
- }); };
1383
- export var deserializeAws_restJson1PutDialRequestBatchCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1384
- var contents, data, _a, _b;
1385
- return __generator(this, function (_c) {
1386
- switch (_c.label) {
1387
- case 0:
1388
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1389
- return [2, deserializeAws_restJson1PutDialRequestBatchCommandError(output, context)];
1390
- }
1391
- contents = map({
1392
- $metadata: deserializeMetadata(output),
1393
- });
1394
- _a = __expectNonNull;
1395
- _b = __expectObject;
1396
- return [4, parseBody(output.body, context)];
1397
- case 1:
1398
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1399
- if (data.failedRequests != null) {
1400
- contents.failedRequests = deserializeAws_restJson1FailedRequestList(data.failedRequests, context);
1401
- }
1402
- if (data.successfulRequests != null) {
1403
- contents.successfulRequests = deserializeAws_restJson1SuccessfulRequestList(data.successfulRequests, context);
1404
- }
1405
- return [2, contents];
1406
- }
1257
+ await collectBody(output.body, context);
1258
+ return contents;
1259
+ };
1260
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1261
+ const parsedOutput = {
1262
+ ...output,
1263
+ body: await parseErrorBody(output.body, context),
1264
+ };
1265
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1266
+ switch (errorCode) {
1267
+ case "AccessDeniedException":
1268
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1269
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1270
+ case "InternalServerException":
1271
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1272
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1273
+ case "ResourceNotFoundException":
1274
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1275
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1276
+ case "ThrottlingException":
1277
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
1278
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1279
+ case "ValidationException":
1280
+ case "com.amazonaws.connectcampaigns#ValidationException":
1281
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1282
+ default:
1283
+ const parsedBody = parsedOutput.body;
1284
+ throwDefaultError({
1285
+ output,
1286
+ parsedBody,
1287
+ exceptionCtor: __BaseException,
1288
+ errorCode,
1289
+ });
1290
+ }
1291
+ };
1292
+ export const deserializeAws_restJson1UpdateCampaignDialerConfigCommand = async (output, context) => {
1293
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1294
+ return deserializeAws_restJson1UpdateCampaignDialerConfigCommandError(output, context);
1295
+ }
1296
+ const contents = map({
1297
+ $metadata: deserializeMetadata(output),
1407
1298
  });
1408
- }); };
1409
- var deserializeAws_restJson1PutDialRequestBatchCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1410
- var parsedOutput, _a, errorCode, _b, parsedBody;
1411
- var _c;
1412
- return __generator(this, function (_d) {
1413
- switch (_d.label) {
1414
- case 0:
1415
- _a = [__assign({}, output)];
1416
- _c = {};
1417
- return [4, parseErrorBody(output.body, context)];
1418
- case 1:
1419
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1420
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1421
- _b = errorCode;
1422
- switch (_b) {
1423
- case "AccessDeniedException": return [3, 2];
1424
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1425
- case "ConflictException": return [3, 4];
1426
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
1427
- case "InternalServerException": return [3, 6];
1428
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
1429
- case "InvalidCampaignStateException": return [3, 8];
1430
- case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": return [3, 8];
1431
- case "ResourceNotFoundException": return [3, 10];
1432
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 10];
1433
- case "ThrottlingException": return [3, 12];
1434
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 12];
1435
- case "ValidationException": return [3, 14];
1436
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 14];
1437
- }
1438
- return [3, 16];
1439
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1440
- case 3: throw _d.sent();
1441
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1442
- case 5: throw _d.sent();
1443
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1444
- case 7: throw _d.sent();
1445
- case 8: return [4, deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context)];
1446
- case 9: throw _d.sent();
1447
- case 10: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1448
- case 11: throw _d.sent();
1449
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1450
- case 13: throw _d.sent();
1451
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1452
- case 15: throw _d.sent();
1453
- case 16:
1454
- parsedBody = parsedOutput.body;
1455
- throwDefaultError({
1456
- output: output,
1457
- parsedBody: parsedBody,
1458
- exceptionCtor: __BaseException,
1459
- errorCode: errorCode,
1460
- });
1461
- _d.label = 17;
1462
- case 17: return [2];
1463
- }
1299
+ await collectBody(output.body, context);
1300
+ return contents;
1301
+ };
1302
+ const deserializeAws_restJson1UpdateCampaignDialerConfigCommandError = async (output, context) => {
1303
+ const parsedOutput = {
1304
+ ...output,
1305
+ body: await parseErrorBody(output.body, context),
1306
+ };
1307
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1308
+ switch (errorCode) {
1309
+ case "AccessDeniedException":
1310
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1311
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1312
+ case "ConflictException":
1313
+ case "com.amazonaws.connectcampaigns#ConflictException":
1314
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1315
+ case "InternalServerException":
1316
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1317
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1318
+ case "ResourceNotFoundException":
1319
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1320
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1321
+ case "ValidationException":
1322
+ case "com.amazonaws.connectcampaigns#ValidationException":
1323
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1324
+ default:
1325
+ const parsedBody = parsedOutput.body;
1326
+ throwDefaultError({
1327
+ output,
1328
+ parsedBody,
1329
+ exceptionCtor: __BaseException,
1330
+ errorCode,
1331
+ });
1332
+ }
1333
+ };
1334
+ export const deserializeAws_restJson1UpdateCampaignNameCommand = async (output, context) => {
1335
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1336
+ return deserializeAws_restJson1UpdateCampaignNameCommandError(output, context);
1337
+ }
1338
+ const contents = map({
1339
+ $metadata: deserializeMetadata(output),
1464
1340
  });
1465
- }); };
1466
- export var deserializeAws_restJson1ResumeCampaignCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1467
- var contents;
1468
- return __generator(this, function (_a) {
1469
- switch (_a.label) {
1470
- case 0:
1471
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1472
- return [2, deserializeAws_restJson1ResumeCampaignCommandError(output, context)];
1473
- }
1474
- contents = map({
1475
- $metadata: deserializeMetadata(output),
1476
- });
1477
- return [4, collectBody(output.body, context)];
1478
- case 1:
1479
- _a.sent();
1480
- return [2, contents];
1481
- }
1341
+ await collectBody(output.body, context);
1342
+ return contents;
1343
+ };
1344
+ const deserializeAws_restJson1UpdateCampaignNameCommandError = async (output, context) => {
1345
+ const parsedOutput = {
1346
+ ...output,
1347
+ body: await parseErrorBody(output.body, context),
1348
+ };
1349
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1350
+ switch (errorCode) {
1351
+ case "AccessDeniedException":
1352
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1353
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1354
+ case "ConflictException":
1355
+ case "com.amazonaws.connectcampaigns#ConflictException":
1356
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1357
+ case "InternalServerException":
1358
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1359
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1360
+ case "ResourceNotFoundException":
1361
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1362
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1363
+ case "ValidationException":
1364
+ case "com.amazonaws.connectcampaigns#ValidationException":
1365
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1366
+ default:
1367
+ const parsedBody = parsedOutput.body;
1368
+ throwDefaultError({
1369
+ output,
1370
+ parsedBody,
1371
+ exceptionCtor: __BaseException,
1372
+ errorCode,
1373
+ });
1374
+ }
1375
+ };
1376
+ export const deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = async (output, context) => {
1377
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1378
+ return deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommandError(output, context);
1379
+ }
1380
+ const contents = map({
1381
+ $metadata: deserializeMetadata(output),
1482
1382
  });
1483
- }); };
1484
- var deserializeAws_restJson1ResumeCampaignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1485
- var parsedOutput, _a, errorCode, _b, parsedBody;
1486
- var _c;
1487
- return __generator(this, function (_d) {
1488
- switch (_d.label) {
1489
- case 0:
1490
- _a = [__assign({}, output)];
1491
- _c = {};
1492
- return [4, parseErrorBody(output.body, context)];
1493
- case 1:
1494
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1495
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1496
- _b = errorCode;
1497
- switch (_b) {
1498
- case "AccessDeniedException": return [3, 2];
1499
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1500
- case "ConflictException": return [3, 4];
1501
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
1502
- case "InternalServerException": return [3, 6];
1503
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
1504
- case "InvalidCampaignStateException": return [3, 8];
1505
- case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": return [3, 8];
1506
- case "ResourceNotFoundException": return [3, 10];
1507
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 10];
1508
- case "ThrottlingException": return [3, 12];
1509
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 12];
1510
- case "ValidationException": return [3, 14];
1511
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 14];
1512
- }
1513
- return [3, 16];
1514
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1515
- case 3: throw _d.sent();
1516
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1517
- case 5: throw _d.sent();
1518
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1519
- case 7: throw _d.sent();
1520
- case 8: return [4, deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context)];
1521
- case 9: throw _d.sent();
1522
- case 10: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1523
- case 11: throw _d.sent();
1524
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1525
- case 13: throw _d.sent();
1526
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1527
- case 15: throw _d.sent();
1528
- case 16:
1529
- parsedBody = parsedOutput.body;
1530
- throwDefaultError({
1531
- output: output,
1532
- parsedBody: parsedBody,
1533
- exceptionCtor: __BaseException,
1534
- errorCode: errorCode,
1535
- });
1536
- _d.label = 17;
1537
- case 17: return [2];
1538
- }
1383
+ await collectBody(output.body, context);
1384
+ return contents;
1385
+ };
1386
+ const deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommandError = async (output, context) => {
1387
+ const parsedOutput = {
1388
+ ...output,
1389
+ body: await parseErrorBody(output.body, context),
1390
+ };
1391
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1392
+ switch (errorCode) {
1393
+ case "AccessDeniedException":
1394
+ case "com.amazonaws.connectcampaigns#AccessDeniedException":
1395
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1396
+ case "ConflictException":
1397
+ case "com.amazonaws.connectcampaigns#ConflictException":
1398
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1399
+ case "InternalServerException":
1400
+ case "com.amazonaws.connectcampaigns#InternalServerException":
1401
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1402
+ case "ResourceNotFoundException":
1403
+ case "com.amazonaws.connectcampaigns#ResourceNotFoundException":
1404
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1405
+ case "ThrottlingException":
1406
+ case "com.amazonaws.connectcampaigns#ThrottlingException":
1407
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1408
+ case "ValidationException":
1409
+ case "com.amazonaws.connectcampaigns#ValidationException":
1410
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1411
+ default:
1412
+ const parsedBody = parsedOutput.body;
1413
+ throwDefaultError({
1414
+ output,
1415
+ parsedBody,
1416
+ exceptionCtor: __BaseException,
1417
+ errorCode,
1418
+ });
1419
+ }
1420
+ };
1421
+ const map = __map;
1422
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1423
+ const contents = map({
1424
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1425
+ });
1426
+ const data = parsedOutput.body;
1427
+ if (data.message != null) {
1428
+ contents.message = __expectString(data.message);
1429
+ }
1430
+ const exception = new AccessDeniedException({
1431
+ $metadata: deserializeMetadata(parsedOutput),
1432
+ ...contents,
1539
1433
  });
1540
- }); };
1541
- export var deserializeAws_restJson1StartCampaignCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1542
- var contents;
1543
- return __generator(this, function (_a) {
1544
- switch (_a.label) {
1545
- case 0:
1546
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1547
- return [2, deserializeAws_restJson1StartCampaignCommandError(output, context)];
1548
- }
1549
- contents = map({
1550
- $metadata: deserializeMetadata(output),
1551
- });
1552
- return [4, collectBody(output.body, context)];
1553
- case 1:
1554
- _a.sent();
1555
- return [2, contents];
1556
- }
1434
+ return __decorateServiceException(exception, parsedOutput.body);
1435
+ };
1436
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1437
+ const contents = map({
1438
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1557
1439
  });
1558
- }); };
1559
- var deserializeAws_restJson1StartCampaignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1560
- var parsedOutput, _a, errorCode, _b, parsedBody;
1561
- var _c;
1562
- return __generator(this, function (_d) {
1563
- switch (_d.label) {
1564
- case 0:
1565
- _a = [__assign({}, output)];
1566
- _c = {};
1567
- return [4, parseErrorBody(output.body, context)];
1568
- case 1:
1569
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1570
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1571
- _b = errorCode;
1572
- switch (_b) {
1573
- case "AccessDeniedException": return [3, 2];
1574
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1575
- case "ConflictException": return [3, 4];
1576
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
1577
- case "InternalServerException": return [3, 6];
1578
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
1579
- case "InvalidCampaignStateException": return [3, 8];
1580
- case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": return [3, 8];
1581
- case "ResourceNotFoundException": return [3, 10];
1582
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 10];
1583
- case "ThrottlingException": return [3, 12];
1584
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 12];
1585
- case "ValidationException": return [3, 14];
1586
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 14];
1587
- }
1588
- return [3, 16];
1589
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1590
- case 3: throw _d.sent();
1591
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1592
- case 5: throw _d.sent();
1593
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1594
- case 7: throw _d.sent();
1595
- case 8: return [4, deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context)];
1596
- case 9: throw _d.sent();
1597
- case 10: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1598
- case 11: throw _d.sent();
1599
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1600
- case 13: throw _d.sent();
1601
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1602
- case 15: throw _d.sent();
1603
- case 16:
1604
- parsedBody = parsedOutput.body;
1605
- throwDefaultError({
1606
- output: output,
1607
- parsedBody: parsedBody,
1608
- exceptionCtor: __BaseException,
1609
- errorCode: errorCode,
1610
- });
1611
- _d.label = 17;
1612
- case 17: return [2];
1613
- }
1440
+ const data = parsedOutput.body;
1441
+ if (data.message != null) {
1442
+ contents.message = __expectString(data.message);
1443
+ }
1444
+ const exception = new ConflictException({
1445
+ $metadata: deserializeMetadata(parsedOutput),
1446
+ ...contents,
1614
1447
  });
1615
- }); };
1616
- export var deserializeAws_restJson1StartInstanceOnboardingJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1617
- var contents, data, _a, _b;
1618
- return __generator(this, function (_c) {
1619
- switch (_c.label) {
1620
- case 0:
1621
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1622
- return [2, deserializeAws_restJson1StartInstanceOnboardingJobCommandError(output, context)];
1623
- }
1624
- contents = map({
1625
- $metadata: deserializeMetadata(output),
1626
- });
1627
- _a = __expectNonNull;
1628
- _b = __expectObject;
1629
- return [4, parseBody(output.body, context)];
1630
- case 1:
1631
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1632
- if (data.connectInstanceOnboardingJobStatus != null) {
1633
- contents.connectInstanceOnboardingJobStatus = deserializeAws_restJson1InstanceOnboardingJobStatus(data.connectInstanceOnboardingJobStatus, context);
1634
- }
1635
- return [2, contents];
1636
- }
1448
+ return __decorateServiceException(exception, parsedOutput.body);
1449
+ };
1450
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1451
+ const contents = map({
1452
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1637
1453
  });
1638
- }); };
1639
- var deserializeAws_restJson1StartInstanceOnboardingJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1640
- var parsedOutput, _a, errorCode, _b, parsedBody;
1641
- var _c;
1642
- return __generator(this, function (_d) {
1643
- switch (_d.label) {
1644
- case 0:
1645
- _a = [__assign({}, output)];
1646
- _c = {};
1647
- return [4, parseErrorBody(output.body, context)];
1648
- case 1:
1649
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1650
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1651
- _b = errorCode;
1652
- switch (_b) {
1653
- case "AccessDeniedException": return [3, 2];
1654
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1655
- case "ConflictException": return [3, 4];
1656
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
1657
- case "InternalServerException": return [3, 6];
1658
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
1659
- case "ResourceNotFoundException": return [3, 8];
1660
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 8];
1661
- case "ThrottlingException": return [3, 10];
1662
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 10];
1663
- case "ValidationException": return [3, 12];
1664
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 12];
1665
- }
1666
- return [3, 14];
1667
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1668
- case 3: throw _d.sent();
1669
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1670
- case 5: throw _d.sent();
1671
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1672
- case 7: throw _d.sent();
1673
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1674
- case 9: throw _d.sent();
1675
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1676
- case 11: throw _d.sent();
1677
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1678
- case 13: throw _d.sent();
1679
- case 14:
1680
- parsedBody = parsedOutput.body;
1681
- throwDefaultError({
1682
- output: output,
1683
- parsedBody: parsedBody,
1684
- exceptionCtor: __BaseException,
1685
- errorCode: errorCode,
1686
- });
1687
- _d.label = 15;
1688
- case 15: return [2];
1689
- }
1454
+ const data = parsedOutput.body;
1455
+ if (data.message != null) {
1456
+ contents.message = __expectString(data.message);
1457
+ }
1458
+ const exception = new InternalServerException({
1459
+ $metadata: deserializeMetadata(parsedOutput),
1460
+ ...contents,
1690
1461
  });
1691
- }); };
1692
- export var deserializeAws_restJson1StopCampaignCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1693
- var contents;
1694
- return __generator(this, function (_a) {
1695
- switch (_a.label) {
1696
- case 0:
1697
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1698
- return [2, deserializeAws_restJson1StopCampaignCommandError(output, context)];
1699
- }
1700
- contents = map({
1701
- $metadata: deserializeMetadata(output),
1702
- });
1703
- return [4, collectBody(output.body, context)];
1704
- case 1:
1705
- _a.sent();
1706
- return [2, contents];
1707
- }
1462
+ return __decorateServiceException(exception, parsedOutput.body);
1463
+ };
1464
+ const deserializeAws_restJson1InvalidCampaignStateExceptionResponse = async (parsedOutput, context) => {
1465
+ const contents = map({
1466
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1708
1467
  });
1709
- }); };
1710
- var deserializeAws_restJson1StopCampaignCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1711
- var parsedOutput, _a, errorCode, _b, parsedBody;
1712
- var _c;
1713
- return __generator(this, function (_d) {
1714
- switch (_d.label) {
1715
- case 0:
1716
- _a = [__assign({}, output)];
1717
- _c = {};
1718
- return [4, parseErrorBody(output.body, context)];
1719
- case 1:
1720
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1721
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1722
- _b = errorCode;
1723
- switch (_b) {
1724
- case "AccessDeniedException": return [3, 2];
1725
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1726
- case "ConflictException": return [3, 4];
1727
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
1728
- case "InternalServerException": return [3, 6];
1729
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
1730
- case "InvalidCampaignStateException": return [3, 8];
1731
- case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": return [3, 8];
1732
- case "ResourceNotFoundException": return [3, 10];
1733
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 10];
1734
- case "ThrottlingException": return [3, 12];
1735
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 12];
1736
- case "ValidationException": return [3, 14];
1737
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 14];
1738
- }
1739
- return [3, 16];
1740
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1741
- case 3: throw _d.sent();
1742
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1743
- case 5: throw _d.sent();
1744
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1745
- case 7: throw _d.sent();
1746
- case 8: return [4, deserializeAws_restJson1InvalidCampaignStateExceptionResponse(parsedOutput, context)];
1747
- case 9: throw _d.sent();
1748
- case 10: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1749
- case 11: throw _d.sent();
1750
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1751
- case 13: throw _d.sent();
1752
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1753
- case 15: throw _d.sent();
1754
- case 16:
1755
- parsedBody = parsedOutput.body;
1756
- throwDefaultError({
1757
- output: output,
1758
- parsedBody: parsedBody,
1759
- exceptionCtor: __BaseException,
1760
- errorCode: errorCode,
1761
- });
1762
- _d.label = 17;
1763
- case 17: return [2];
1764
- }
1468
+ const data = parsedOutput.body;
1469
+ if (data.message != null) {
1470
+ contents.message = __expectString(data.message);
1471
+ }
1472
+ if (data.state != null) {
1473
+ contents.state = __expectString(data.state);
1474
+ }
1475
+ const exception = new InvalidCampaignStateException({
1476
+ $metadata: deserializeMetadata(parsedOutput),
1477
+ ...contents,
1765
1478
  });
1766
- }); };
1767
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1768
- var contents;
1769
- return __generator(this, function (_a) {
1770
- switch (_a.label) {
1771
- case 0:
1772
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1773
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1774
- }
1775
- contents = map({
1776
- $metadata: deserializeMetadata(output),
1777
- });
1778
- return [4, collectBody(output.body, context)];
1779
- case 1:
1780
- _a.sent();
1781
- return [2, contents];
1782
- }
1479
+ return __decorateServiceException(exception, parsedOutput.body);
1480
+ };
1481
+ const deserializeAws_restJson1InvalidStateExceptionResponse = async (parsedOutput, context) => {
1482
+ const contents = map({
1483
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1783
1484
  });
1784
- }); };
1785
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1786
- var parsedOutput, _a, errorCode, _b, parsedBody;
1787
- var _c;
1788
- return __generator(this, function (_d) {
1789
- switch (_d.label) {
1790
- case 0:
1791
- _a = [__assign({}, output)];
1792
- _c = {};
1793
- return [4, parseErrorBody(output.body, context)];
1794
- case 1:
1795
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1796
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1797
- _b = errorCode;
1798
- switch (_b) {
1799
- case "AccessDeniedException": return [3, 2];
1800
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1801
- case "InternalServerException": return [3, 4];
1802
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
1803
- case "ResourceNotFoundException": return [3, 6];
1804
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 6];
1805
- case "ThrottlingException": return [3, 8];
1806
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 8];
1807
- case "ValidationException": return [3, 10];
1808
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 10];
1809
- }
1810
- return [3, 12];
1811
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1812
- case 3: throw _d.sent();
1813
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1814
- case 5: throw _d.sent();
1815
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1816
- case 7: throw _d.sent();
1817
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1818
- case 9: throw _d.sent();
1819
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1820
- case 11: throw _d.sent();
1821
- case 12:
1822
- parsedBody = parsedOutput.body;
1823
- throwDefaultError({
1824
- output: output,
1825
- parsedBody: parsedBody,
1826
- exceptionCtor: __BaseException,
1827
- errorCode: errorCode,
1828
- });
1829
- _d.label = 13;
1830
- case 13: return [2];
1831
- }
1485
+ const data = parsedOutput.body;
1486
+ if (data.message != null) {
1487
+ contents.message = __expectString(data.message);
1488
+ }
1489
+ const exception = new InvalidStateException({
1490
+ $metadata: deserializeMetadata(parsedOutput),
1491
+ ...contents,
1832
1492
  });
1833
- }); };
1834
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1835
- var contents;
1836
- return __generator(this, function (_a) {
1837
- switch (_a.label) {
1838
- case 0:
1839
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1840
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1841
- }
1842
- contents = map({
1843
- $metadata: deserializeMetadata(output),
1844
- });
1845
- return [4, collectBody(output.body, context)];
1846
- case 1:
1847
- _a.sent();
1848
- return [2, contents];
1849
- }
1493
+ return __decorateServiceException(exception, parsedOutput.body);
1494
+ };
1495
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1496
+ const contents = map({
1497
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1850
1498
  });
1851
- }); };
1852
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1853
- var parsedOutput, _a, errorCode, _b, parsedBody;
1854
- var _c;
1855
- return __generator(this, function (_d) {
1856
- switch (_d.label) {
1857
- case 0:
1858
- _a = [__assign({}, output)];
1859
- _c = {};
1860
- return [4, parseErrorBody(output.body, context)];
1861
- case 1:
1862
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1863
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1864
- _b = errorCode;
1865
- switch (_b) {
1866
- case "AccessDeniedException": return [3, 2];
1867
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1868
- case "InternalServerException": return [3, 4];
1869
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 4];
1870
- case "ResourceNotFoundException": return [3, 6];
1871
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 6];
1872
- case "ThrottlingException": return [3, 8];
1873
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 8];
1874
- case "ValidationException": return [3, 10];
1875
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 10];
1876
- }
1877
- return [3, 12];
1878
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1879
- case 3: throw _d.sent();
1880
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1881
- case 5: throw _d.sent();
1882
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1883
- case 7: throw _d.sent();
1884
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1885
- case 9: throw _d.sent();
1886
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1887
- case 11: throw _d.sent();
1888
- case 12:
1889
- parsedBody = parsedOutput.body;
1890
- throwDefaultError({
1891
- output: output,
1892
- parsedBody: parsedBody,
1893
- exceptionCtor: __BaseException,
1894
- errorCode: errorCode,
1895
- });
1896
- _d.label = 13;
1897
- case 13: return [2];
1898
- }
1499
+ const data = parsedOutput.body;
1500
+ if (data.message != null) {
1501
+ contents.message = __expectString(data.message);
1502
+ }
1503
+ const exception = new ResourceNotFoundException({
1504
+ $metadata: deserializeMetadata(parsedOutput),
1505
+ ...contents,
1899
1506
  });
1900
- }); };
1901
- export var deserializeAws_restJson1UpdateCampaignDialerConfigCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1902
- var contents;
1903
- return __generator(this, function (_a) {
1904
- switch (_a.label) {
1905
- case 0:
1906
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1907
- return [2, deserializeAws_restJson1UpdateCampaignDialerConfigCommandError(output, context)];
1908
- }
1909
- contents = map({
1910
- $metadata: deserializeMetadata(output),
1911
- });
1912
- return [4, collectBody(output.body, context)];
1913
- case 1:
1914
- _a.sent();
1915
- return [2, contents];
1916
- }
1507
+ return __decorateServiceException(exception, parsedOutput.body);
1508
+ };
1509
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1510
+ const contents = map({
1511
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1917
1512
  });
1918
- }); };
1919
- var deserializeAws_restJson1UpdateCampaignDialerConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1920
- var parsedOutput, _a, errorCode, _b, parsedBody;
1921
- var _c;
1922
- return __generator(this, function (_d) {
1923
- switch (_d.label) {
1924
- case 0:
1925
- _a = [__assign({}, output)];
1926
- _c = {};
1927
- return [4, parseErrorBody(output.body, context)];
1928
- case 1:
1929
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1930
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1931
- _b = errorCode;
1932
- switch (_b) {
1933
- case "AccessDeniedException": return [3, 2];
1934
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
1935
- case "ConflictException": return [3, 4];
1936
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
1937
- case "InternalServerException": return [3, 6];
1938
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
1939
- case "ResourceNotFoundException": return [3, 8];
1940
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 8];
1941
- case "ValidationException": return [3, 10];
1942
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 10];
1943
- }
1944
- return [3, 12];
1945
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1946
- case 3: throw _d.sent();
1947
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1948
- case 5: throw _d.sent();
1949
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1950
- case 7: throw _d.sent();
1951
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1952
- case 9: throw _d.sent();
1953
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1954
- case 11: throw _d.sent();
1955
- case 12:
1956
- parsedBody = parsedOutput.body;
1957
- throwDefaultError({
1958
- output: output,
1959
- parsedBody: parsedBody,
1960
- exceptionCtor: __BaseException,
1961
- errorCode: errorCode,
1962
- });
1963
- _d.label = 13;
1964
- case 13: return [2];
1965
- }
1513
+ const data = parsedOutput.body;
1514
+ if (data.message != null) {
1515
+ contents.message = __expectString(data.message);
1516
+ }
1517
+ const exception = new ServiceQuotaExceededException({
1518
+ $metadata: deserializeMetadata(parsedOutput),
1519
+ ...contents,
1966
1520
  });
1967
- }); };
1968
- export var deserializeAws_restJson1UpdateCampaignNameCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1969
- var contents;
1970
- return __generator(this, function (_a) {
1971
- switch (_a.label) {
1972
- case 0:
1973
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1974
- return [2, deserializeAws_restJson1UpdateCampaignNameCommandError(output, context)];
1975
- }
1976
- contents = map({
1977
- $metadata: deserializeMetadata(output),
1978
- });
1979
- return [4, collectBody(output.body, context)];
1980
- case 1:
1981
- _a.sent();
1982
- return [2, contents];
1983
- }
1521
+ return __decorateServiceException(exception, parsedOutput.body);
1522
+ };
1523
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1524
+ const contents = map({
1525
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1984
1526
  });
1985
- }); };
1986
- var deserializeAws_restJson1UpdateCampaignNameCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1987
- var parsedOutput, _a, errorCode, _b, parsedBody;
1988
- var _c;
1989
- return __generator(this, function (_d) {
1990
- switch (_d.label) {
1991
- case 0:
1992
- _a = [__assign({}, output)];
1993
- _c = {};
1994
- return [4, parseErrorBody(output.body, context)];
1995
- case 1:
1996
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1997
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1998
- _b = errorCode;
1999
- switch (_b) {
2000
- case "AccessDeniedException": return [3, 2];
2001
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
2002
- case "ConflictException": return [3, 4];
2003
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
2004
- case "InternalServerException": return [3, 6];
2005
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
2006
- case "ResourceNotFoundException": return [3, 8];
2007
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 8];
2008
- case "ValidationException": return [3, 10];
2009
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 10];
2010
- }
2011
- return [3, 12];
2012
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2013
- case 3: throw _d.sent();
2014
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2015
- case 5: throw _d.sent();
2016
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2017
- case 7: throw _d.sent();
2018
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2019
- case 9: throw _d.sent();
2020
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2021
- case 11: throw _d.sent();
2022
- case 12:
2023
- parsedBody = parsedOutput.body;
2024
- throwDefaultError({
2025
- output: output,
2026
- parsedBody: parsedBody,
2027
- exceptionCtor: __BaseException,
2028
- errorCode: errorCode,
2029
- });
2030
- _d.label = 13;
2031
- case 13: return [2];
2032
- }
1527
+ const data = parsedOutput.body;
1528
+ if (data.message != null) {
1529
+ contents.message = __expectString(data.message);
1530
+ }
1531
+ const exception = new ThrottlingException({
1532
+ $metadata: deserializeMetadata(parsedOutput),
1533
+ ...contents,
2033
1534
  });
2034
- }); };
2035
- export var deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2036
- var contents;
2037
- return __generator(this, function (_a) {
2038
- switch (_a.label) {
2039
- case 0:
2040
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2041
- return [2, deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommandError(output, context)];
2042
- }
2043
- contents = map({
2044
- $metadata: deserializeMetadata(output),
2045
- });
2046
- return [4, collectBody(output.body, context)];
2047
- case 1:
2048
- _a.sent();
2049
- return [2, contents];
2050
- }
1535
+ return __decorateServiceException(exception, parsedOutput.body);
1536
+ };
1537
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1538
+ const contents = map({
1539
+ xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2051
1540
  });
2052
- }); };
2053
- var deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2054
- var parsedOutput, _a, errorCode, _b, parsedBody;
2055
- var _c;
2056
- return __generator(this, function (_d) {
2057
- switch (_d.label) {
2058
- case 0:
2059
- _a = [__assign({}, output)];
2060
- _c = {};
2061
- return [4, parseErrorBody(output.body, context)];
2062
- case 1:
2063
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2064
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2065
- _b = errorCode;
2066
- switch (_b) {
2067
- case "AccessDeniedException": return [3, 2];
2068
- case "com.amazonaws.connectcampaigns#AccessDeniedException": return [3, 2];
2069
- case "ConflictException": return [3, 4];
2070
- case "com.amazonaws.connectcampaigns#ConflictException": return [3, 4];
2071
- case "InternalServerException": return [3, 6];
2072
- case "com.amazonaws.connectcampaigns#InternalServerException": return [3, 6];
2073
- case "ResourceNotFoundException": return [3, 8];
2074
- case "com.amazonaws.connectcampaigns#ResourceNotFoundException": return [3, 8];
2075
- case "ThrottlingException": return [3, 10];
2076
- case "com.amazonaws.connectcampaigns#ThrottlingException": return [3, 10];
2077
- case "ValidationException": return [3, 12];
2078
- case "com.amazonaws.connectcampaigns#ValidationException": return [3, 12];
2079
- }
2080
- return [3, 14];
2081
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2082
- case 3: throw _d.sent();
2083
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2084
- case 5: throw _d.sent();
2085
- case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2086
- case 7: throw _d.sent();
2087
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2088
- case 9: throw _d.sent();
2089
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
2090
- case 11: throw _d.sent();
2091
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2092
- case 13: throw _d.sent();
2093
- case 14:
2094
- parsedBody = parsedOutput.body;
2095
- throwDefaultError({
2096
- output: output,
2097
- parsedBody: parsedBody,
2098
- exceptionCtor: __BaseException,
2099
- errorCode: errorCode,
2100
- });
2101
- _d.label = 15;
2102
- case 15: return [2];
2103
- }
1541
+ const data = parsedOutput.body;
1542
+ if (data.message != null) {
1543
+ contents.message = __expectString(data.message);
1544
+ }
1545
+ const exception = new ValidationException({
1546
+ $metadata: deserializeMetadata(parsedOutput),
1547
+ ...contents,
2104
1548
  });
2105
- }); };
2106
- var map = __map;
2107
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2108
- var contents, data, exception;
2109
- return __generator(this, function (_a) {
2110
- contents = map({
2111
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2112
- });
2113
- data = parsedOutput.body;
2114
- if (data.message != null) {
2115
- contents.message = __expectString(data.message);
2116
- }
2117
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2118
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2119
- });
2120
- }); };
2121
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2122
- var contents, data, exception;
2123
- return __generator(this, function (_a) {
2124
- contents = map({
2125
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2126
- });
2127
- data = parsedOutput.body;
2128
- if (data.message != null) {
2129
- contents.message = __expectString(data.message);
2130
- }
2131
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2132
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2133
- });
2134
- }); };
2135
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2136
- var contents, data, exception;
2137
- return __generator(this, function (_a) {
2138
- contents = map({
2139
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2140
- });
2141
- data = parsedOutput.body;
2142
- if (data.message != null) {
2143
- contents.message = __expectString(data.message);
2144
- }
2145
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2146
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2147
- });
2148
- }); };
2149
- var deserializeAws_restJson1InvalidCampaignStateExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2150
- var contents, data, exception;
2151
- return __generator(this, function (_a) {
2152
- contents = map({
2153
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2154
- });
2155
- data = parsedOutput.body;
2156
- if (data.message != null) {
2157
- contents.message = __expectString(data.message);
2158
- }
2159
- if (data.state != null) {
2160
- contents.state = __expectString(data.state);
2161
- }
2162
- exception = new InvalidCampaignStateException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2163
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2164
- });
2165
- }); };
2166
- var deserializeAws_restJson1InvalidStateExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2167
- var contents, data, exception;
2168
- return __generator(this, function (_a) {
2169
- contents = map({
2170
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2171
- });
2172
- data = parsedOutput.body;
2173
- if (data.message != null) {
2174
- contents.message = __expectString(data.message);
2175
- }
2176
- exception = new InvalidStateException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2177
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2178
- });
2179
- }); };
2180
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2181
- var contents, data, exception;
2182
- return __generator(this, function (_a) {
2183
- contents = map({
2184
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2185
- });
2186
- data = parsedOutput.body;
2187
- if (data.message != null) {
2188
- contents.message = __expectString(data.message);
2189
- }
2190
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2191
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2192
- });
2193
- }); };
2194
- var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2195
- var contents, data, exception;
2196
- return __generator(this, function (_a) {
2197
- contents = map({
2198
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2199
- });
2200
- data = parsedOutput.body;
2201
- if (data.message != null) {
2202
- contents.message = __expectString(data.message);
2203
- }
2204
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2205
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2206
- });
2207
- }); };
2208
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2209
- var contents, data, exception;
2210
- return __generator(this, function (_a) {
2211
- contents = map({
2212
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2213
- });
2214
- data = parsedOutput.body;
2215
- if (data.message != null) {
2216
- contents.message = __expectString(data.message);
2217
- }
2218
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2219
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2220
- });
2221
- }); };
2222
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2223
- var contents, data, exception;
2224
- return __generator(this, function (_a) {
2225
- contents = map({
2226
- xAmzErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
2227
- });
2228
- data = parsedOutput.body;
2229
- if (data.message != null) {
2230
- contents.message = __expectString(data.message);
2231
- }
2232
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2233
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2234
- });
2235
- }); };
2236
- var serializeAws_restJson1AnswerMachineDetectionConfig = function (input, context) {
2237
- return __assign({}, (input.enableAnswerMachineDetection != null && {
2238
- enableAnswerMachineDetection: input.enableAnswerMachineDetection,
2239
- }));
2240
- };
2241
- var serializeAws_restJson1Attributes = function (input, context) {
2242
- return Object.entries(input).reduce(function (acc, _a) {
2243
- var _b;
2244
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1549
+ return __decorateServiceException(exception, parsedOutput.body);
1550
+ };
1551
+ const serializeAws_restJson1AnswerMachineDetectionConfig = (input, context) => {
1552
+ return {
1553
+ ...(input.enableAnswerMachineDetection != null && {
1554
+ enableAnswerMachineDetection: input.enableAnswerMachineDetection,
1555
+ }),
1556
+ };
1557
+ };
1558
+ const serializeAws_restJson1Attributes = (input, context) => {
1559
+ return Object.entries(input).reduce((acc, [key, value]) => {
2245
1560
  if (value === null) {
2246
1561
  return acc;
2247
1562
  }
2248
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1563
+ return {
1564
+ ...acc,
1565
+ [key]: value,
1566
+ };
2249
1567
  }, {});
2250
1568
  };
2251
- var serializeAws_restJson1CampaignFilters = function (input, context) {
2252
- return __assign({}, (input.instanceIdFilter != null && {
2253
- instanceIdFilter: serializeAws_restJson1InstanceIdFilter(input.instanceIdFilter, context),
2254
- }));
1569
+ const serializeAws_restJson1CampaignFilters = (input, context) => {
1570
+ return {
1571
+ ...(input.instanceIdFilter != null && {
1572
+ instanceIdFilter: serializeAws_restJson1InstanceIdFilter(input.instanceIdFilter, context),
1573
+ }),
1574
+ };
2255
1575
  };
2256
- var serializeAws_restJson1CampaignIdList = function (input, context) {
1576
+ const serializeAws_restJson1CampaignIdList = (input, context) => {
2257
1577
  return input
2258
- .filter(function (e) { return e != null; })
2259
- .map(function (entry) {
1578
+ .filter((e) => e != null)
1579
+ .map((entry) => {
2260
1580
  return entry;
2261
1581
  });
2262
1582
  };
2263
- var serializeAws_restJson1DialerConfig = function (input, context) {
1583
+ const serializeAws_restJson1DialerConfig = (input, context) => {
2264
1584
  return DialerConfig.visit(input, {
2265
- predictiveDialerConfig: function (value) { return ({
1585
+ predictiveDialerConfig: (value) => ({
2266
1586
  predictiveDialerConfig: serializeAws_restJson1PredictiveDialerConfig(value, context),
2267
- }); },
2268
- progressiveDialerConfig: function (value) { return ({
1587
+ }),
1588
+ progressiveDialerConfig: (value) => ({
2269
1589
  progressiveDialerConfig: serializeAws_restJson1ProgressiveDialerConfig(value, context),
2270
- }); },
2271
- _: function (name, value) { return ({ name: value }); },
1590
+ }),
1591
+ _: (name, value) => ({ name: value }),
2272
1592
  });
2273
1593
  };
2274
- var serializeAws_restJson1DialRequest = function (input, context) {
2275
- return __assign(__assign(__assign(__assign({}, (input.attributes != null && { attributes: serializeAws_restJson1Attributes(input.attributes, context) })), (input.clientToken != null && { clientToken: input.clientToken })), (input.expirationTime != null && { expirationTime: input.expirationTime.toISOString().split(".")[0] + "Z" })), (input.phoneNumber != null && { phoneNumber: input.phoneNumber }));
1594
+ const serializeAws_restJson1DialRequest = (input, context) => {
1595
+ return {
1596
+ ...(input.attributes != null && { attributes: serializeAws_restJson1Attributes(input.attributes, context) }),
1597
+ ...(input.clientToken != null && { clientToken: input.clientToken }),
1598
+ ...(input.expirationTime != null && { expirationTime: input.expirationTime.toISOString().split(".")[0] + "Z" }),
1599
+ ...(input.phoneNumber != null && { phoneNumber: input.phoneNumber }),
1600
+ };
2276
1601
  };
2277
- var serializeAws_restJson1DialRequestList = function (input, context) {
1602
+ const serializeAws_restJson1DialRequestList = (input, context) => {
2278
1603
  return input
2279
- .filter(function (e) { return e != null; })
2280
- .map(function (entry) {
1604
+ .filter((e) => e != null)
1605
+ .map((entry) => {
2281
1606
  return serializeAws_restJson1DialRequest(entry, context);
2282
1607
  });
2283
1608
  };
2284
- var serializeAws_restJson1EncryptionConfig = function (input, context) {
2285
- return __assign(__assign(__assign({}, (input.enabled != null && { enabled: input.enabled })), (input.encryptionType != null && { encryptionType: input.encryptionType })), (input.keyArn != null && { keyArn: input.keyArn }));
1609
+ const serializeAws_restJson1EncryptionConfig = (input, context) => {
1610
+ return {
1611
+ ...(input.enabled != null && { enabled: input.enabled }),
1612
+ ...(input.encryptionType != null && { encryptionType: input.encryptionType }),
1613
+ ...(input.keyArn != null && { keyArn: input.keyArn }),
1614
+ };
2286
1615
  };
2287
- var serializeAws_restJson1InstanceIdFilter = function (input, context) {
2288
- return __assign(__assign({}, (input.operator != null && { operator: input.operator })), (input.value != null && { value: input.value }));
1616
+ const serializeAws_restJson1InstanceIdFilter = (input, context) => {
1617
+ return {
1618
+ ...(input.operator != null && { operator: input.operator }),
1619
+ ...(input.value != null && { value: input.value }),
1620
+ };
2289
1621
  };
2290
- var serializeAws_restJson1OutboundCallConfig = function (input, context) {
2291
- return __assign(__assign(__assign(__assign({}, (input.answerMachineDetectionConfig != null && {
2292
- answerMachineDetectionConfig: serializeAws_restJson1AnswerMachineDetectionConfig(input.answerMachineDetectionConfig, context),
2293
- })), (input.connectContactFlowId != null && { connectContactFlowId: input.connectContactFlowId })), (input.connectQueueId != null && { connectQueueId: input.connectQueueId })), (input.connectSourcePhoneNumber != null && { connectSourcePhoneNumber: input.connectSourcePhoneNumber }));
1622
+ const serializeAws_restJson1OutboundCallConfig = (input, context) => {
1623
+ return {
1624
+ ...(input.answerMachineDetectionConfig != null && {
1625
+ answerMachineDetectionConfig: serializeAws_restJson1AnswerMachineDetectionConfig(input.answerMachineDetectionConfig, context),
1626
+ }),
1627
+ ...(input.connectContactFlowId != null && { connectContactFlowId: input.connectContactFlowId }),
1628
+ ...(input.connectQueueId != null && { connectQueueId: input.connectQueueId }),
1629
+ ...(input.connectSourcePhoneNumber != null && { connectSourcePhoneNumber: input.connectSourcePhoneNumber }),
1630
+ };
2294
1631
  };
2295
- var serializeAws_restJson1PredictiveDialerConfig = function (input, context) {
2296
- return __assign({}, (input.bandwidthAllocation != null && { bandwidthAllocation: __serializeFloat(input.bandwidthAllocation) }));
1632
+ const serializeAws_restJson1PredictiveDialerConfig = (input, context) => {
1633
+ return {
1634
+ ...(input.bandwidthAllocation != null && { bandwidthAllocation: __serializeFloat(input.bandwidthAllocation) }),
1635
+ };
2297
1636
  };
2298
- var serializeAws_restJson1ProgressiveDialerConfig = function (input, context) {
2299
- return __assign({}, (input.bandwidthAllocation != null && { bandwidthAllocation: __serializeFloat(input.bandwidthAllocation) }));
1637
+ const serializeAws_restJson1ProgressiveDialerConfig = (input, context) => {
1638
+ return {
1639
+ ...(input.bandwidthAllocation != null && { bandwidthAllocation: __serializeFloat(input.bandwidthAllocation) }),
1640
+ };
2300
1641
  };
2301
- var serializeAws_restJson1TagMap = function (input, context) {
2302
- return Object.entries(input).reduce(function (acc, _a) {
2303
- var _b;
2304
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1642
+ const serializeAws_restJson1TagMap = (input, context) => {
1643
+ return Object.entries(input).reduce((acc, [key, value]) => {
2305
1644
  if (value === null) {
2306
1645
  return acc;
2307
1646
  }
2308
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1647
+ return {
1648
+ ...acc,
1649
+ [key]: value,
1650
+ };
2309
1651
  }, {});
2310
1652
  };
2311
- var deserializeAws_restJson1AnswerMachineDetectionConfig = function (output, context) {
1653
+ const deserializeAws_restJson1AnswerMachineDetectionConfig = (output, context) => {
2312
1654
  return {
2313
1655
  enableAnswerMachineDetection: __expectBoolean(output.enableAnswerMachineDetection),
2314
1656
  };
2315
1657
  };
2316
- var deserializeAws_restJson1Campaign = function (output, context) {
1658
+ const deserializeAws_restJson1Campaign = (output, context) => {
2317
1659
  return {
2318
1660
  arn: __expectString(output.arn),
2319
1661
  connectInstanceId: __expectString(output.connectInstanceId),
@@ -2328,7 +1670,7 @@ var deserializeAws_restJson1Campaign = function (output, context) {
2328
1670
  tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
2329
1671
  };
2330
1672
  };
2331
- var deserializeAws_restJson1CampaignSummary = function (output, context) {
1673
+ const deserializeAws_restJson1CampaignSummary = (output, context) => {
2332
1674
  return {
2333
1675
  arn: __expectString(output.arn),
2334
1676
  connectInstanceId: __expectString(output.connectInstanceId),
@@ -2336,10 +1678,10 @@ var deserializeAws_restJson1CampaignSummary = function (output, context) {
2336
1678
  name: __expectString(output.name),
2337
1679
  };
2338
1680
  };
2339
- var deserializeAws_restJson1CampaignSummaryList = function (output, context) {
2340
- var retVal = (output || [])
2341
- .filter(function (e) { return e != null; })
2342
- .map(function (entry) {
1681
+ const deserializeAws_restJson1CampaignSummaryList = (output, context) => {
1682
+ const retVal = (output || [])
1683
+ .filter((e) => e != null)
1684
+ .map((entry) => {
2343
1685
  if (entry === null) {
2344
1686
  return null;
2345
1687
  }
@@ -2347,7 +1689,7 @@ var deserializeAws_restJson1CampaignSummaryList = function (output, context) {
2347
1689
  });
2348
1690
  return retVal;
2349
1691
  };
2350
- var deserializeAws_restJson1DialerConfig = function (output, context) {
1692
+ const deserializeAws_restJson1DialerConfig = (output, context) => {
2351
1693
  if (output.predictiveDialerConfig != null) {
2352
1694
  return {
2353
1695
  predictiveDialerConfig: deserializeAws_restJson1PredictiveDialerConfig(output.predictiveDialerConfig, context),
@@ -2360,23 +1702,23 @@ var deserializeAws_restJson1DialerConfig = function (output, context) {
2360
1702
  }
2361
1703
  return { $unknown: Object.entries(output)[0] };
2362
1704
  };
2363
- var deserializeAws_restJson1EncryptionConfig = function (output, context) {
1705
+ const deserializeAws_restJson1EncryptionConfig = (output, context) => {
2364
1706
  return {
2365
1707
  enabled: __expectBoolean(output.enabled),
2366
1708
  encryptionType: __expectString(output.encryptionType),
2367
1709
  keyArn: __expectString(output.keyArn),
2368
1710
  };
2369
1711
  };
2370
- var deserializeAws_restJson1FailedCampaignStateResponse = function (output, context) {
1712
+ const deserializeAws_restJson1FailedCampaignStateResponse = (output, context) => {
2371
1713
  return {
2372
1714
  campaignId: __expectString(output.campaignId),
2373
1715
  failureCode: __expectString(output.failureCode),
2374
1716
  };
2375
1717
  };
2376
- var deserializeAws_restJson1FailedCampaignStateResponseList = function (output, context) {
2377
- var retVal = (output || [])
2378
- .filter(function (e) { return e != null; })
2379
- .map(function (entry) {
1718
+ const deserializeAws_restJson1FailedCampaignStateResponseList = (output, context) => {
1719
+ const retVal = (output || [])
1720
+ .filter((e) => e != null)
1721
+ .map((entry) => {
2380
1722
  if (entry === null) {
2381
1723
  return null;
2382
1724
  }
@@ -2384,17 +1726,17 @@ var deserializeAws_restJson1FailedCampaignStateResponseList = function (output,
2384
1726
  });
2385
1727
  return retVal;
2386
1728
  };
2387
- var deserializeAws_restJson1FailedRequest = function (output, context) {
1729
+ const deserializeAws_restJson1FailedRequest = (output, context) => {
2388
1730
  return {
2389
1731
  clientToken: __expectString(output.clientToken),
2390
1732
  failureCode: __expectString(output.failureCode),
2391
1733
  id: __expectString(output.id),
2392
1734
  };
2393
1735
  };
2394
- var deserializeAws_restJson1FailedRequestList = function (output, context) {
2395
- var retVal = (output || [])
2396
- .filter(function (e) { return e != null; })
2397
- .map(function (entry) {
1736
+ const deserializeAws_restJson1FailedRequestList = (output, context) => {
1737
+ const retVal = (output || [])
1738
+ .filter((e) => e != null)
1739
+ .map((entry) => {
2398
1740
  if (entry === null) {
2399
1741
  return null;
2400
1742
  }
@@ -2402,7 +1744,7 @@ var deserializeAws_restJson1FailedRequestList = function (output, context) {
2402
1744
  });
2403
1745
  return retVal;
2404
1746
  };
2405
- var deserializeAws_restJson1InstanceConfig = function (output, context) {
1747
+ const deserializeAws_restJson1InstanceConfig = (output, context) => {
2406
1748
  return {
2407
1749
  connectInstanceId: __expectString(output.connectInstanceId),
2408
1750
  encryptionConfig: output.encryptionConfig != null
@@ -2411,14 +1753,14 @@ var deserializeAws_restJson1InstanceConfig = function (output, context) {
2411
1753
  serviceLinkedRoleArn: __expectString(output.serviceLinkedRoleArn),
2412
1754
  };
2413
1755
  };
2414
- var deserializeAws_restJson1InstanceOnboardingJobStatus = function (output, context) {
1756
+ const deserializeAws_restJson1InstanceOnboardingJobStatus = (output, context) => {
2415
1757
  return {
2416
1758
  connectInstanceId: __expectString(output.connectInstanceId),
2417
1759
  failureCode: __expectString(output.failureCode),
2418
1760
  status: __expectString(output.status),
2419
1761
  };
2420
1762
  };
2421
- var deserializeAws_restJson1OutboundCallConfig = function (output, context) {
1763
+ const deserializeAws_restJson1OutboundCallConfig = (output, context) => {
2422
1764
  return {
2423
1765
  answerMachineDetectionConfig: output.answerMachineDetectionConfig != null
2424
1766
  ? deserializeAws_restJson1AnswerMachineDetectionConfig(output.answerMachineDetectionConfig, context)
@@ -2428,26 +1770,26 @@ var deserializeAws_restJson1OutboundCallConfig = function (output, context) {
2428
1770
  connectSourcePhoneNumber: __expectString(output.connectSourcePhoneNumber),
2429
1771
  };
2430
1772
  };
2431
- var deserializeAws_restJson1PredictiveDialerConfig = function (output, context) {
1773
+ const deserializeAws_restJson1PredictiveDialerConfig = (output, context) => {
2432
1774
  return {
2433
1775
  bandwidthAllocation: __limitedParseDouble(output.bandwidthAllocation),
2434
1776
  };
2435
1777
  };
2436
- var deserializeAws_restJson1ProgressiveDialerConfig = function (output, context) {
1778
+ const deserializeAws_restJson1ProgressiveDialerConfig = (output, context) => {
2437
1779
  return {
2438
1780
  bandwidthAllocation: __limitedParseDouble(output.bandwidthAllocation),
2439
1781
  };
2440
1782
  };
2441
- var deserializeAws_restJson1SuccessfulCampaignStateResponse = function (output, context) {
1783
+ const deserializeAws_restJson1SuccessfulCampaignStateResponse = (output, context) => {
2442
1784
  return {
2443
1785
  campaignId: __expectString(output.campaignId),
2444
1786
  state: __expectString(output.state),
2445
1787
  };
2446
1788
  };
2447
- var deserializeAws_restJson1SuccessfulCampaignStateResponseList = function (output, context) {
2448
- var retVal = (output || [])
2449
- .filter(function (e) { return e != null; })
2450
- .map(function (entry) {
1789
+ const deserializeAws_restJson1SuccessfulCampaignStateResponseList = (output, context) => {
1790
+ const retVal = (output || [])
1791
+ .filter((e) => e != null)
1792
+ .map((entry) => {
2451
1793
  if (entry === null) {
2452
1794
  return null;
2453
1795
  }
@@ -2455,16 +1797,16 @@ var deserializeAws_restJson1SuccessfulCampaignStateResponseList = function (outp
2455
1797
  });
2456
1798
  return retVal;
2457
1799
  };
2458
- var deserializeAws_restJson1SuccessfulRequest = function (output, context) {
1800
+ const deserializeAws_restJson1SuccessfulRequest = (output, context) => {
2459
1801
  return {
2460
1802
  clientToken: __expectString(output.clientToken),
2461
1803
  id: __expectString(output.id),
2462
1804
  };
2463
1805
  };
2464
- var deserializeAws_restJson1SuccessfulRequestList = function (output, context) {
2465
- var retVal = (output || [])
2466
- .filter(function (e) { return e != null; })
2467
- .map(function (entry) {
1806
+ const deserializeAws_restJson1SuccessfulRequestList = (output, context) => {
1807
+ const retVal = (output || [])
1808
+ .filter((e) => e != null)
1809
+ .map((entry) => {
2468
1810
  if (entry === null) {
2469
1811
  return null;
2470
1812
  }
@@ -2472,67 +1814,50 @@ var deserializeAws_restJson1SuccessfulRequestList = function (output, context) {
2472
1814
  });
2473
1815
  return retVal;
2474
1816
  };
2475
- var deserializeAws_restJson1TagMap = function (output, context) {
2476
- return Object.entries(output).reduce(function (acc, _a) {
2477
- var _b;
2478
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1817
+ const deserializeAws_restJson1TagMap = (output, context) => {
1818
+ return Object.entries(output).reduce((acc, [key, value]) => {
2479
1819
  if (value === null) {
2480
1820
  return acc;
2481
1821
  }
2482
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1822
+ return {
1823
+ ...acc,
1824
+ [key]: __expectString(value),
1825
+ };
2483
1826
  }, {});
2484
1827
  };
2485
- var deserializeMetadata = function (output) {
2486
- var _a, _b;
2487
- return ({
2488
- httpStatusCode: output.statusCode,
2489
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
2490
- extendedRequestId: output.headers["x-amz-id-2"],
2491
- cfId: output.headers["x-amz-cf-id"],
2492
- });
2493
- };
2494
- var collectBody = function (streamBody, context) {
2495
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1828
+ const deserializeMetadata = (output) => ({
1829
+ httpStatusCode: output.statusCode,
1830
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1831
+ extendedRequestId: output.headers["x-amz-id-2"],
1832
+ cfId: output.headers["x-amz-cf-id"],
1833
+ });
1834
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2496
1835
  if (streamBody instanceof Uint8Array) {
2497
1836
  return Promise.resolve(streamBody);
2498
1837
  }
2499
1838
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2500
1839
  };
2501
- var collectBodyString = function (streamBody, context) {
2502
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2503
- };
2504
- var isSerializableHeaderValue = function (value) {
2505
- return value !== undefined &&
2506
- value !== null &&
2507
- value !== "" &&
2508
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2509
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1840
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1841
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1842
+ value !== null &&
1843
+ value !== "" &&
1844
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1845
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1846
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1847
+ if (encoded.length) {
1848
+ return JSON.parse(encoded);
1849
+ }
1850
+ return {};
1851
+ });
1852
+ const parseErrorBody = async (errorBody, context) => {
1853
+ const value = await parseBody(errorBody, context);
1854
+ value.message = value.message ?? value.Message;
1855
+ return value;
2510
1856
  };
2511
- var parseBody = function (streamBody, context) {
2512
- return collectBodyString(streamBody, context).then(function (encoded) {
2513
- if (encoded.length) {
2514
- return JSON.parse(encoded);
2515
- }
2516
- return {};
2517
- });
2518
- };
2519
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2520
- var value;
2521
- var _a;
2522
- return __generator(this, function (_b) {
2523
- switch (_b.label) {
2524
- case 0: return [4, parseBody(errorBody, context)];
2525
- case 1:
2526
- value = _b.sent();
2527
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2528
- return [2, value];
2529
- }
2530
- });
2531
- }); };
2532
- var loadRestJsonErrorCode = function (output, data) {
2533
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2534
- var sanitizeErrorCode = function (rawValue) {
2535
- var cleanValue = rawValue;
1857
+ const loadRestJsonErrorCode = (output, data) => {
1858
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1859
+ const sanitizeErrorCode = (rawValue) => {
1860
+ let cleanValue = rawValue;
2536
1861
  if (typeof cleanValue === "number") {
2537
1862
  cleanValue = cleanValue.toString();
2538
1863
  }
@@ -2547,7 +1872,7 @@ var loadRestJsonErrorCode = function (output, data) {
2547
1872
  }
2548
1873
  return cleanValue;
2549
1874
  };
2550
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1875
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2551
1876
  if (headerKey !== undefined) {
2552
1877
  return sanitizeErrorCode(output.headers[headerKey]);
2553
1878
  }