@aws-sdk/client-chime-sdk-identity 3.181.0 → 3.183.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 (40) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/ChimeSDKIdentity.js +98 -105
  3. package/dist-es/ChimeSDKIdentityClient.js +22 -28
  4. package/dist-es/commands/CreateAppInstanceAdminCommand.js +21 -28
  5. package/dist-es/commands/CreateAppInstanceCommand.js +21 -28
  6. package/dist-es/commands/CreateAppInstanceUserCommand.js +21 -28
  7. package/dist-es/commands/DeleteAppInstanceAdminCommand.js +22 -29
  8. package/dist-es/commands/DeleteAppInstanceCommand.js +22 -29
  9. package/dist-es/commands/DeleteAppInstanceUserCommand.js +22 -29
  10. package/dist-es/commands/DeregisterAppInstanceUserEndpointCommand.js +22 -29
  11. package/dist-es/commands/DescribeAppInstanceAdminCommand.js +21 -28
  12. package/dist-es/commands/DescribeAppInstanceCommand.js +21 -28
  13. package/dist-es/commands/DescribeAppInstanceUserCommand.js +21 -28
  14. package/dist-es/commands/DescribeAppInstanceUserEndpointCommand.js +21 -28
  15. package/dist-es/commands/GetAppInstanceRetentionSettingsCommand.js +21 -28
  16. package/dist-es/commands/ListAppInstanceAdminsCommand.js +21 -28
  17. package/dist-es/commands/ListAppInstanceUserEndpointsCommand.js +21 -28
  18. package/dist-es/commands/ListAppInstanceUsersCommand.js +21 -28
  19. package/dist-es/commands/ListAppInstancesCommand.js +21 -28
  20. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  21. package/dist-es/commands/PutAppInstanceRetentionSettingsCommand.js +21 -28
  22. package/dist-es/commands/RegisterAppInstanceUserEndpointCommand.js +21 -28
  23. package/dist-es/commands/TagResourceCommand.js +22 -29
  24. package/dist-es/commands/UntagResourceCommand.js +22 -29
  25. package/dist-es/commands/UpdateAppInstanceCommand.js +21 -28
  26. package/dist-es/commands/UpdateAppInstanceUserCommand.js +21 -28
  27. package/dist-es/commands/UpdateAppInstanceUserEndpointCommand.js +21 -28
  28. package/dist-es/endpoints.js +8 -8
  29. package/dist-es/models/ChimeSDKIdentityServiceException.js +5 -10
  30. package/dist-es/models/models_0.js +352 -170
  31. package/dist-es/pagination/ListAppInstanceAdminsPaginator.js +25 -68
  32. package/dist-es/pagination/ListAppInstanceUserEndpointsPaginator.js +25 -68
  33. package/dist-es/pagination/ListAppInstanceUsersPaginator.js +25 -68
  34. package/dist-es/pagination/ListAppInstancesPaginator.js +25 -68
  35. package/dist-es/protocols/Aws_restJson1.js +1873 -2670
  36. package/dist-es/runtimeConfig.browser.js +26 -12
  37. package/dist-es/runtimeConfig.js +30 -12
  38. package/dist-es/runtimeConfig.native.js +8 -5
  39. package/dist-es/runtimeConfig.shared.js +8 -11
  40. package/package.json +33 -33
@@ -1,2667 +1,1888 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { ChimeSDKIdentityServiceException as __BaseException } from "../models/ChimeSDKIdentityServiceException";
6
5
  import { BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ServiceFailureException, ServiceUnavailableException, ThrottledClientException, UnauthorizedClientException, } from "../models/models_0";
7
- export var serializeAws_restJson1CreateAppInstanceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
- var _c;
10
- return __generator(this, function (_d) {
11
- switch (_d.label) {
12
- case 0: return [4, context.endpoint()];
13
- case 1:
14
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
15
- headers = {
16
- "content-type": "application/json",
17
- };
18
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instances";
19
- body = JSON.stringify(__assign(__assign(__assign({ ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.Metadata != null && { Metadata: input.Metadata })), (input.Name != null && { Name: input.Name })), (input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) })));
20
- return [2, new __HttpRequest({
21
- protocol: protocol,
22
- hostname: hostname,
23
- port: port,
24
- method: "POST",
25
- headers: headers,
26
- path: resolvedPath,
27
- body: body,
28
- })];
29
- }
30
- });
31
- }); };
32
- export var serializeAws_restJson1CreateAppInstanceAdminCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
33
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
34
- return __generator(this, function (_c) {
35
- switch (_c.label) {
36
- case 0: return [4, context.endpoint()];
37
- case 1:
38
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
39
- headers = {
40
- "content-type": "application/json",
41
- };
42
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instances/{AppInstanceArn}/admins";
43
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
44
- body = JSON.stringify(__assign({}, (input.AppInstanceAdminArn != null && { AppInstanceAdminArn: input.AppInstanceAdminArn })));
45
- return [2, new __HttpRequest({
46
- protocol: protocol,
47
- hostname: hostname,
48
- port: port,
49
- method: "POST",
50
- headers: headers,
51
- path: resolvedPath,
52
- body: body,
53
- })];
54
- }
55
- });
56
- }); };
57
- export var serializeAws_restJson1CreateAppInstanceUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
58
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
59
- var _c;
60
- return __generator(this, function (_d) {
61
- switch (_d.label) {
62
- case 0: return [4, context.endpoint()];
63
- case 1:
64
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
65
- headers = {
66
- "content-type": "application/json",
67
- };
68
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instance-users";
69
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AppInstanceArn != null && { AppInstanceArn: input.AppInstanceArn })), (input.AppInstanceUserId != null && { AppInstanceUserId: input.AppInstanceUserId })), { ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.Metadata != null && { Metadata: input.Metadata })), (input.Name != null && { Name: input.Name })), (input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) })));
70
- return [2, new __HttpRequest({
71
- protocol: protocol,
72
- hostname: hostname,
73
- port: port,
74
- method: "POST",
75
- headers: headers,
76
- path: resolvedPath,
77
- body: body,
78
- })];
79
- }
80
- });
81
- }); };
82
- export var serializeAws_restJson1DeleteAppInstanceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
83
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
84
- return __generator(this, function (_c) {
85
- switch (_c.label) {
86
- case 0: return [4, context.endpoint()];
87
- case 1:
88
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
89
- headers = {};
90
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instances/{AppInstanceArn}";
91
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
92
- return [2, new __HttpRequest({
93
- protocol: protocol,
94
- hostname: hostname,
95
- port: port,
96
- method: "DELETE",
97
- headers: headers,
98
- path: resolvedPath,
99
- body: body,
100
- })];
101
- }
102
- });
103
- }); };
104
- export var serializeAws_restJson1DeleteAppInstanceAdminCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
105
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
106
- return __generator(this, function (_c) {
107
- switch (_c.label) {
108
- case 0: return [4, context.endpoint()];
109
- case 1:
110
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
111
- headers = {};
112
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
113
- "/app-instances/{AppInstanceArn}/admins/{AppInstanceAdminArn}";
114
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceAdminArn", function () { return input.AppInstanceAdminArn; }, "{AppInstanceAdminArn}", false);
115
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
116
- return [2, new __HttpRequest({
117
- protocol: protocol,
118
- hostname: hostname,
119
- port: port,
120
- method: "DELETE",
121
- headers: headers,
122
- path: resolvedPath,
123
- body: body,
124
- })];
125
- }
126
- });
127
- }); };
128
- export var serializeAws_restJson1DeleteAppInstanceUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
129
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
130
- return __generator(this, function (_c) {
131
- switch (_c.label) {
132
- case 0: return [4, context.endpoint()];
133
- case 1:
134
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
135
- headers = {};
136
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instance-users/{AppInstanceUserArn}";
137
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", function () { return input.AppInstanceUserArn; }, "{AppInstanceUserArn}", false);
138
- return [2, new __HttpRequest({
139
- protocol: protocol,
140
- hostname: hostname,
141
- port: port,
142
- method: "DELETE",
143
- headers: headers,
144
- path: resolvedPath,
145
- body: body,
146
- })];
147
- }
148
- });
149
- }); };
150
- export var serializeAws_restJson1DeregisterAppInstanceUserEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
151
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
152
- return __generator(this, function (_c) {
153
- switch (_c.label) {
154
- case 0: return [4, context.endpoint()];
155
- case 1:
156
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
157
- headers = {};
158
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
159
- "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
160
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", function () { return input.AppInstanceUserArn; }, "{AppInstanceUserArn}", false);
161
- resolvedPath = __resolvedPath(resolvedPath, input, "EndpointId", function () { return input.EndpointId; }, "{EndpointId}", false);
162
- return [2, new __HttpRequest({
163
- protocol: protocol,
164
- hostname: hostname,
165
- port: port,
166
- method: "DELETE",
167
- headers: headers,
168
- path: resolvedPath,
169
- body: body,
170
- })];
171
- }
172
- });
173
- }); };
174
- export var serializeAws_restJson1DescribeAppInstanceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
175
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
176
- return __generator(this, function (_c) {
177
- switch (_c.label) {
178
- case 0: return [4, context.endpoint()];
179
- case 1:
180
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
181
- headers = {};
182
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instances/{AppInstanceArn}";
183
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
184
- return [2, new __HttpRequest({
185
- protocol: protocol,
186
- hostname: hostname,
187
- port: port,
188
- method: "GET",
189
- headers: headers,
190
- path: resolvedPath,
191
- body: body,
192
- })];
193
- }
194
- });
195
- }); };
196
- export var serializeAws_restJson1DescribeAppInstanceAdminCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
197
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
198
- return __generator(this, function (_c) {
199
- switch (_c.label) {
200
- case 0: return [4, context.endpoint()];
201
- case 1:
202
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
203
- headers = {};
204
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
205
- "/app-instances/{AppInstanceArn}/admins/{AppInstanceAdminArn}";
206
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceAdminArn", function () { return input.AppInstanceAdminArn; }, "{AppInstanceAdminArn}", false);
207
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
208
- return [2, new __HttpRequest({
209
- protocol: protocol,
210
- hostname: hostname,
211
- port: port,
212
- method: "GET",
213
- headers: headers,
214
- path: resolvedPath,
215
- body: body,
216
- })];
217
- }
218
- });
219
- }); };
220
- export var serializeAws_restJson1DescribeAppInstanceUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
221
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
222
- return __generator(this, function (_c) {
223
- switch (_c.label) {
224
- case 0: return [4, context.endpoint()];
225
- case 1:
226
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
227
- headers = {};
228
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instance-users/{AppInstanceUserArn}";
229
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", function () { return input.AppInstanceUserArn; }, "{AppInstanceUserArn}", false);
230
- return [2, new __HttpRequest({
231
- protocol: protocol,
232
- hostname: hostname,
233
- port: port,
234
- method: "GET",
235
- headers: headers,
236
- path: resolvedPath,
237
- body: body,
238
- })];
239
- }
240
- });
241
- }); };
242
- export var serializeAws_restJson1DescribeAppInstanceUserEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
243
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
244
- return __generator(this, function (_c) {
245
- switch (_c.label) {
246
- case 0: return [4, context.endpoint()];
247
- case 1:
248
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
249
- headers = {};
250
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
251
- "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
252
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", function () { return input.AppInstanceUserArn; }, "{AppInstanceUserArn}", false);
253
- resolvedPath = __resolvedPath(resolvedPath, input, "EndpointId", function () { return input.EndpointId; }, "{EndpointId}", false);
254
- return [2, new __HttpRequest({
255
- protocol: protocol,
256
- hostname: hostname,
257
- port: port,
258
- method: "GET",
259
- headers: headers,
260
- path: resolvedPath,
261
- body: body,
262
- })];
263
- }
264
- });
265
- }); };
266
- export var serializeAws_restJson1GetAppInstanceRetentionSettingsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
267
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
268
- return __generator(this, function (_c) {
269
- switch (_c.label) {
270
- case 0: return [4, context.endpoint()];
271
- case 1:
272
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
273
- headers = {};
274
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
275
- "/app-instances/{AppInstanceArn}/retention-settings";
276
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
277
- return [2, new __HttpRequest({
278
- protocol: protocol,
279
- hostname: hostname,
280
- port: port,
281
- method: "GET",
282
- headers: headers,
283
- path: resolvedPath,
284
- body: body,
285
- })];
286
- }
287
- });
288
- }); };
289
- export var serializeAws_restJson1ListAppInstanceAdminsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
290
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
291
- return __generator(this, function (_c) {
292
- switch (_c.label) {
293
- case 0: return [4, context.endpoint()];
294
- case 1:
295
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
296
- headers = {};
297
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instances/{AppInstanceArn}/admins";
298
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
299
- query = map({
300
- "max-results": [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
301
- "next-token": [, input.NextToken],
302
- });
303
- return [2, new __HttpRequest({
304
- protocol: protocol,
305
- hostname: hostname,
306
- port: port,
307
- method: "GET",
308
- headers: headers,
309
- path: resolvedPath,
310
- query: query,
311
- body: body,
312
- })];
313
- }
314
- });
315
- }); };
316
- export var serializeAws_restJson1ListAppInstancesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
317
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
318
- return __generator(this, function (_c) {
319
- switch (_c.label) {
320
- case 0: return [4, context.endpoint()];
321
- case 1:
322
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
323
- headers = {};
324
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instances";
325
- query = map({
326
- "max-results": [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
327
- "next-token": [, input.NextToken],
328
- });
329
- return [2, new __HttpRequest({
330
- protocol: protocol,
331
- hostname: hostname,
332
- port: port,
333
- method: "GET",
334
- headers: headers,
335
- path: resolvedPath,
336
- query: query,
337
- body: body,
338
- })];
339
- }
340
- });
341
- }); };
342
- export var serializeAws_restJson1ListAppInstanceUserEndpointsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
343
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
344
- return __generator(this, function (_c) {
345
- switch (_c.label) {
346
- case 0: return [4, context.endpoint()];
347
- case 1:
348
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
349
- headers = {};
350
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
351
- "/app-instance-users/{AppInstanceUserArn}/endpoints";
352
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", function () { return input.AppInstanceUserArn; }, "{AppInstanceUserArn}", false);
353
- query = map({
354
- "max-results": [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
355
- "next-token": [, input.NextToken],
356
- });
357
- return [2, new __HttpRequest({
358
- protocol: protocol,
359
- hostname: hostname,
360
- port: port,
361
- method: "GET",
362
- headers: headers,
363
- path: resolvedPath,
364
- query: query,
365
- body: body,
366
- })];
367
- }
368
- });
369
- }); };
370
- export var serializeAws_restJson1ListAppInstanceUsersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
371
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
372
- return __generator(this, function (_c) {
373
- switch (_c.label) {
374
- case 0: return [4, context.endpoint()];
375
- case 1:
376
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
377
- headers = {};
378
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instance-users";
379
- query = map({
380
- "app-instance-arn": [, input.AppInstanceArn],
381
- "max-results": [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
382
- "next-token": [, input.NextToken],
383
- });
384
- return [2, new __HttpRequest({
385
- protocol: protocol,
386
- hostname: hostname,
387
- port: port,
388
- method: "GET",
389
- headers: headers,
390
- path: resolvedPath,
391
- query: query,
392
- body: body,
393
- })];
394
- }
395
- });
396
- }); };
397
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
398
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
399
- return __generator(this, function (_c) {
400
- switch (_c.label) {
401
- case 0: return [4, context.endpoint()];
402
- case 1:
403
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
404
- headers = {};
405
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags";
406
- query = map({
407
- arn: [, input.ResourceARN],
408
- });
409
- return [2, new __HttpRequest({
410
- protocol: protocol,
411
- hostname: hostname,
412
- port: port,
413
- method: "GET",
414
- headers: headers,
415
- path: resolvedPath,
416
- query: query,
417
- body: body,
418
- })];
419
- }
420
- });
421
- }); };
422
- export var serializeAws_restJson1PutAppInstanceRetentionSettingsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
423
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
424
- return __generator(this, function (_c) {
425
- switch (_c.label) {
426
- case 0: return [4, context.endpoint()];
427
- case 1:
428
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
429
- headers = {
430
- "content-type": "application/json",
431
- };
432
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
433
- "/app-instances/{AppInstanceArn}/retention-settings";
434
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
435
- body = JSON.stringify(__assign({}, (input.AppInstanceRetentionSettings != null && {
436
- AppInstanceRetentionSettings: serializeAws_restJson1AppInstanceRetentionSettings(input.AppInstanceRetentionSettings, context),
437
- })));
438
- return [2, new __HttpRequest({
439
- protocol: protocol,
440
- hostname: hostname,
441
- port: port,
442
- method: "PUT",
443
- headers: headers,
444
- path: resolvedPath,
445
- body: body,
446
- })];
447
- }
6
+ export const serializeAws_restJson1CreateAppInstanceCommand = async (input, context) => {
7
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const headers = {
9
+ "content-type": "application/json",
10
+ };
11
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances";
12
+ let body;
13
+ body = JSON.stringify({
14
+ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
15
+ ...(input.Metadata != null && { Metadata: input.Metadata }),
16
+ ...(input.Name != null && { Name: input.Name }),
17
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
18
+ });
19
+ return new __HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "POST",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
448
27
  });
449
- }); };
450
- export var serializeAws_restJson1RegisterAppInstanceUserEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
451
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
452
- var _c;
453
- return __generator(this, function (_d) {
454
- switch (_d.label) {
455
- case 0: return [4, context.endpoint()];
456
- case 1:
457
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
458
- headers = {
459
- "content-type": "application/json",
460
- };
461
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
462
- "/app-instance-users/{AppInstanceUserArn}/endpoints";
463
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", function () { return input.AppInstanceUserArn; }, "{AppInstanceUserArn}", false);
464
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AllowMessages != null && { AllowMessages: input.AllowMessages })), { ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.EndpointAttributes != null && {
465
- EndpointAttributes: serializeAws_restJson1EndpointAttributes(input.EndpointAttributes, context),
466
- })), (input.Name != null && { Name: input.Name })), (input.ResourceArn != null && { ResourceArn: input.ResourceArn })), (input.Type != null && { Type: input.Type })));
467
- return [2, new __HttpRequest({
468
- protocol: protocol,
469
- hostname: hostname,
470
- port: port,
471
- method: "POST",
472
- headers: headers,
473
- path: resolvedPath,
474
- body: body,
475
- })];
476
- }
28
+ };
29
+ export const serializeAws_restJson1CreateAppInstanceAdminCommand = async (input, context) => {
30
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
31
+ const headers = {
32
+ "content-type": "application/json",
33
+ };
34
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}/admins";
35
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
36
+ let body;
37
+ body = JSON.stringify({
38
+ ...(input.AppInstanceAdminArn != null && { AppInstanceAdminArn: input.AppInstanceAdminArn }),
39
+ });
40
+ return new __HttpRequest({
41
+ protocol,
42
+ hostname,
43
+ port,
44
+ method: "POST",
45
+ headers,
46
+ path: resolvedPath,
47
+ body,
477
48
  });
478
- }); };
479
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
480
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
481
- return __generator(this, function (_c) {
482
- switch (_c.label) {
483
- case 0: return [4, context.endpoint()];
484
- case 1:
485
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
486
- headers = {
487
- "content-type": "application/json",
488
- };
489
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags";
490
- query = map({
491
- operation: [, "tag-resource"],
492
- });
493
- body = JSON.stringify(__assign(__assign({}, (input.ResourceARN != null && { ResourceARN: input.ResourceARN })), (input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) })));
494
- return [2, new __HttpRequest({
495
- protocol: protocol,
496
- hostname: hostname,
497
- port: port,
498
- method: "POST",
499
- headers: headers,
500
- path: resolvedPath,
501
- query: query,
502
- body: body,
503
- })];
504
- }
49
+ };
50
+ export const serializeAws_restJson1CreateAppInstanceUserCommand = async (input, context) => {
51
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
52
+ const headers = {
53
+ "content-type": "application/json",
54
+ };
55
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users";
56
+ let body;
57
+ body = JSON.stringify({
58
+ ...(input.AppInstanceArn != null && { AppInstanceArn: input.AppInstanceArn }),
59
+ ...(input.AppInstanceUserId != null && { AppInstanceUserId: input.AppInstanceUserId }),
60
+ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
61
+ ...(input.Metadata != null && { Metadata: input.Metadata }),
62
+ ...(input.Name != null && { Name: input.Name }),
63
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
64
+ });
65
+ return new __HttpRequest({
66
+ protocol,
67
+ hostname,
68
+ port,
69
+ method: "POST",
70
+ headers,
71
+ path: resolvedPath,
72
+ body,
505
73
  });
506
- }); };
507
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
508
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
509
- return __generator(this, function (_c) {
510
- switch (_c.label) {
511
- case 0: return [4, context.endpoint()];
512
- case 1:
513
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
514
- headers = {
515
- "content-type": "application/json",
516
- };
517
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags";
518
- query = map({
519
- operation: [, "untag-resource"],
520
- });
521
- body = JSON.stringify(__assign(__assign({}, (input.ResourceARN != null && { ResourceARN: input.ResourceARN })), (input.TagKeys != null && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) })));
522
- return [2, new __HttpRequest({
523
- protocol: protocol,
524
- hostname: hostname,
525
- port: port,
526
- method: "POST",
527
- headers: headers,
528
- path: resolvedPath,
529
- query: query,
530
- body: body,
531
- })];
532
- }
74
+ };
75
+ export const serializeAws_restJson1DeleteAppInstanceCommand = async (input, context) => {
76
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
77
+ const headers = {};
78
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}";
79
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
80
+ let body;
81
+ return new __HttpRequest({
82
+ protocol,
83
+ hostname,
84
+ port,
85
+ method: "DELETE",
86
+ headers,
87
+ path: resolvedPath,
88
+ body,
533
89
  });
534
- }); };
535
- export var serializeAws_restJson1UpdateAppInstanceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
536
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
537
- return __generator(this, function (_c) {
538
- switch (_c.label) {
539
- case 0: return [4, context.endpoint()];
540
- case 1:
541
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
542
- headers = {
543
- "content-type": "application/json",
544
- };
545
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instances/{AppInstanceArn}";
546
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", function () { return input.AppInstanceArn; }, "{AppInstanceArn}", false);
547
- body = JSON.stringify(__assign(__assign({}, (input.Metadata != null && { Metadata: input.Metadata })), (input.Name != null && { Name: input.Name })));
548
- return [2, new __HttpRequest({
549
- protocol: protocol,
550
- hostname: hostname,
551
- port: port,
552
- method: "PUT",
553
- headers: headers,
554
- path: resolvedPath,
555
- body: body,
556
- })];
557
- }
90
+ };
91
+ export const serializeAws_restJson1DeleteAppInstanceAdminCommand = async (input, context) => {
92
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
93
+ const headers = {};
94
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
95
+ "/app-instances/{AppInstanceArn}/admins/{AppInstanceAdminArn}";
96
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceAdminArn", () => input.AppInstanceAdminArn, "{AppInstanceAdminArn}", false);
97
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
98
+ let body;
99
+ return new __HttpRequest({
100
+ protocol,
101
+ hostname,
102
+ port,
103
+ method: "DELETE",
104
+ headers,
105
+ path: resolvedPath,
106
+ body,
558
107
  });
559
- }); };
560
- export var serializeAws_restJson1UpdateAppInstanceUserCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
561
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
562
- return __generator(this, function (_c) {
563
- switch (_c.label) {
564
- case 0: return [4, context.endpoint()];
565
- case 1:
566
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
567
- headers = {
568
- "content-type": "application/json",
569
- };
570
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/app-instance-users/{AppInstanceUserArn}";
571
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", function () { return input.AppInstanceUserArn; }, "{AppInstanceUserArn}", false);
572
- body = JSON.stringify(__assign(__assign({}, (input.Metadata != null && { Metadata: input.Metadata })), (input.Name != null && { Name: input.Name })));
573
- return [2, new __HttpRequest({
574
- protocol: protocol,
575
- hostname: hostname,
576
- port: port,
577
- method: "PUT",
578
- headers: headers,
579
- path: resolvedPath,
580
- body: body,
581
- })];
582
- }
108
+ };
109
+ export const serializeAws_restJson1DeleteAppInstanceUserCommand = async (input, context) => {
110
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
111
+ const headers = {};
112
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users/{AppInstanceUserArn}";
113
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
114
+ let body;
115
+ return new __HttpRequest({
116
+ protocol,
117
+ hostname,
118
+ port,
119
+ method: "DELETE",
120
+ headers,
121
+ path: resolvedPath,
122
+ body,
583
123
  });
584
- }); };
585
- export var serializeAws_restJson1UpdateAppInstanceUserEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
586
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
587
- return __generator(this, function (_c) {
588
- switch (_c.label) {
589
- case 0: return [4, context.endpoint()];
590
- case 1:
591
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
592
- headers = {
593
- "content-type": "application/json",
594
- };
595
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
596
- "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
597
- resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", function () { return input.AppInstanceUserArn; }, "{AppInstanceUserArn}", false);
598
- resolvedPath = __resolvedPath(resolvedPath, input, "EndpointId", function () { return input.EndpointId; }, "{EndpointId}", false);
599
- body = JSON.stringify(__assign(__assign({}, (input.AllowMessages != null && { AllowMessages: input.AllowMessages })), (input.Name != null && { Name: input.Name })));
600
- return [2, new __HttpRequest({
601
- protocol: protocol,
602
- hostname: hostname,
603
- port: port,
604
- method: "PUT",
605
- headers: headers,
606
- path: resolvedPath,
607
- body: body,
608
- })];
609
- }
124
+ };
125
+ export const serializeAws_restJson1DeregisterAppInstanceUserEndpointCommand = async (input, context) => {
126
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
127
+ const headers = {};
128
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
129
+ "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
130
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
131
+ resolvedPath = __resolvedPath(resolvedPath, input, "EndpointId", () => input.EndpointId, "{EndpointId}", false);
132
+ let body;
133
+ return new __HttpRequest({
134
+ protocol,
135
+ hostname,
136
+ port,
137
+ method: "DELETE",
138
+ headers,
139
+ path: resolvedPath,
140
+ body,
610
141
  });
611
- }); };
612
- export var deserializeAws_restJson1CreateAppInstanceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
613
- var contents, data, _a, _b;
614
- return __generator(this, function (_c) {
615
- switch (_c.label) {
616
- case 0:
617
- if (output.statusCode !== 201 && output.statusCode >= 300) {
618
- return [2, deserializeAws_restJson1CreateAppInstanceCommandError(output, context)];
619
- }
620
- contents = map({
621
- $metadata: deserializeMetadata(output),
622
- });
623
- _a = __expectNonNull;
624
- _b = __expectObject;
625
- return [4, parseBody(output.body, context)];
626
- case 1:
627
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
628
- if (data.AppInstanceArn != null) {
629
- contents.AppInstanceArn = __expectString(data.AppInstanceArn);
630
- }
631
- return [2, contents];
632
- }
142
+ };
143
+ export const serializeAws_restJson1DescribeAppInstanceCommand = async (input, context) => {
144
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
145
+ const headers = {};
146
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}";
147
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
148
+ let body;
149
+ return new __HttpRequest({
150
+ protocol,
151
+ hostname,
152
+ port,
153
+ method: "GET",
154
+ headers,
155
+ path: resolvedPath,
156
+ body,
633
157
  });
634
- }); };
635
- var deserializeAws_restJson1CreateAppInstanceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
636
- var parsedOutput, _a, errorCode, _b, parsedBody;
637
- var _c;
638
- return __generator(this, function (_d) {
639
- switch (_d.label) {
640
- case 0:
641
- _a = [__assign({}, output)];
642
- _c = {};
643
- return [4, parseErrorBody(output.body, context)];
644
- case 1:
645
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
646
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
647
- _b = errorCode;
648
- switch (_b) {
649
- case "BadRequestException": return [3, 2];
650
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
651
- case "ConflictException": return [3, 4];
652
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
653
- case "ForbiddenException": return [3, 6];
654
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
655
- case "ResourceLimitExceededException": return [3, 8];
656
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 8];
657
- case "ServiceFailureException": return [3, 10];
658
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 10];
659
- case "ServiceUnavailableException": return [3, 12];
660
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 12];
661
- case "ThrottledClientException": return [3, 14];
662
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 14];
663
- case "UnauthorizedClientException": return [3, 16];
664
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 16];
665
- }
666
- return [3, 18];
667
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
668
- case 3: throw _d.sent();
669
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
670
- case 5: throw _d.sent();
671
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
672
- case 7: throw _d.sent();
673
- case 8: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
674
- case 9: throw _d.sent();
675
- case 10: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
676
- case 11: throw _d.sent();
677
- case 12: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
678
- case 13: throw _d.sent();
679
- case 14: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
680
- case 15: throw _d.sent();
681
- case 16: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
682
- case 17: throw _d.sent();
683
- case 18:
684
- parsedBody = parsedOutput.body;
685
- throwDefaultError({
686
- output: output,
687
- parsedBody: parsedBody,
688
- exceptionCtor: __BaseException,
689
- errorCode: errorCode,
690
- });
691
- _d.label = 19;
692
- case 19: return [2];
693
- }
158
+ };
159
+ export const serializeAws_restJson1DescribeAppInstanceAdminCommand = async (input, context) => {
160
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
161
+ const headers = {};
162
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
163
+ "/app-instances/{AppInstanceArn}/admins/{AppInstanceAdminArn}";
164
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceAdminArn", () => input.AppInstanceAdminArn, "{AppInstanceAdminArn}", false);
165
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
166
+ let body;
167
+ return new __HttpRequest({
168
+ protocol,
169
+ hostname,
170
+ port,
171
+ method: "GET",
172
+ headers,
173
+ path: resolvedPath,
174
+ body,
694
175
  });
695
- }); };
696
- export var deserializeAws_restJson1CreateAppInstanceAdminCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
697
- var contents, data, _a, _b;
698
- return __generator(this, function (_c) {
699
- switch (_c.label) {
700
- case 0:
701
- if (output.statusCode !== 201 && output.statusCode >= 300) {
702
- return [2, deserializeAws_restJson1CreateAppInstanceAdminCommandError(output, context)];
703
- }
704
- contents = map({
705
- $metadata: deserializeMetadata(output),
706
- });
707
- _a = __expectNonNull;
708
- _b = __expectObject;
709
- return [4, parseBody(output.body, context)];
710
- case 1:
711
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
712
- if (data.AppInstanceAdmin != null) {
713
- contents.AppInstanceAdmin = deserializeAws_restJson1Identity(data.AppInstanceAdmin, context);
714
- }
715
- if (data.AppInstanceArn != null) {
716
- contents.AppInstanceArn = __expectString(data.AppInstanceArn);
717
- }
718
- return [2, contents];
719
- }
176
+ };
177
+ export const serializeAws_restJson1DescribeAppInstanceUserCommand = async (input, context) => {
178
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
179
+ const headers = {};
180
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users/{AppInstanceUserArn}";
181
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
182
+ let body;
183
+ return new __HttpRequest({
184
+ protocol,
185
+ hostname,
186
+ port,
187
+ method: "GET",
188
+ headers,
189
+ path: resolvedPath,
190
+ body,
720
191
  });
721
- }); };
722
- var deserializeAws_restJson1CreateAppInstanceAdminCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
723
- var parsedOutput, _a, errorCode, _b, parsedBody;
724
- var _c;
725
- return __generator(this, function (_d) {
726
- switch (_d.label) {
727
- case 0:
728
- _a = [__assign({}, output)];
729
- _c = {};
730
- return [4, parseErrorBody(output.body, context)];
731
- case 1:
732
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
733
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
734
- _b = errorCode;
735
- switch (_b) {
736
- case "BadRequestException": return [3, 2];
737
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
738
- case "ConflictException": return [3, 4];
739
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
740
- case "ForbiddenException": return [3, 6];
741
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
742
- case "ResourceLimitExceededException": return [3, 8];
743
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 8];
744
- case "ServiceFailureException": return [3, 10];
745
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 10];
746
- case "ServiceUnavailableException": return [3, 12];
747
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 12];
748
- case "ThrottledClientException": return [3, 14];
749
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 14];
750
- case "UnauthorizedClientException": return [3, 16];
751
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 16];
752
- }
753
- return [3, 18];
754
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
755
- case 3: throw _d.sent();
756
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
757
- case 5: throw _d.sent();
758
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
759
- case 7: throw _d.sent();
760
- case 8: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
761
- case 9: throw _d.sent();
762
- case 10: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
763
- case 11: throw _d.sent();
764
- case 12: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
765
- case 13: throw _d.sent();
766
- case 14: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
767
- case 15: throw _d.sent();
768
- case 16: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
769
- case 17: throw _d.sent();
770
- case 18:
771
- parsedBody = parsedOutput.body;
772
- throwDefaultError({
773
- output: output,
774
- parsedBody: parsedBody,
775
- exceptionCtor: __BaseException,
776
- errorCode: errorCode,
777
- });
778
- _d.label = 19;
779
- case 19: return [2];
780
- }
192
+ };
193
+ export const serializeAws_restJson1DescribeAppInstanceUserEndpointCommand = async (input, context) => {
194
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
195
+ const headers = {};
196
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
197
+ "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
198
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
199
+ resolvedPath = __resolvedPath(resolvedPath, input, "EndpointId", () => input.EndpointId, "{EndpointId}", false);
200
+ let body;
201
+ return new __HttpRequest({
202
+ protocol,
203
+ hostname,
204
+ port,
205
+ method: "GET",
206
+ headers,
207
+ path: resolvedPath,
208
+ body,
781
209
  });
782
- }); };
783
- export var deserializeAws_restJson1CreateAppInstanceUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
784
- var contents, data, _a, _b;
785
- return __generator(this, function (_c) {
786
- switch (_c.label) {
787
- case 0:
788
- if (output.statusCode !== 201 && output.statusCode >= 300) {
789
- return [2, deserializeAws_restJson1CreateAppInstanceUserCommandError(output, context)];
790
- }
791
- contents = map({
792
- $metadata: deserializeMetadata(output),
793
- });
794
- _a = __expectNonNull;
795
- _b = __expectObject;
796
- return [4, parseBody(output.body, context)];
797
- case 1:
798
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
799
- if (data.AppInstanceUserArn != null) {
800
- contents.AppInstanceUserArn = __expectString(data.AppInstanceUserArn);
801
- }
802
- return [2, contents];
803
- }
210
+ };
211
+ export const serializeAws_restJson1GetAppInstanceRetentionSettingsCommand = async (input, context) => {
212
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
213
+ const headers = {};
214
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
215
+ "/app-instances/{AppInstanceArn}/retention-settings";
216
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
217
+ let body;
218
+ return new __HttpRequest({
219
+ protocol,
220
+ hostname,
221
+ port,
222
+ method: "GET",
223
+ headers,
224
+ path: resolvedPath,
225
+ body,
804
226
  });
805
- }); };
806
- var deserializeAws_restJson1CreateAppInstanceUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
807
- var parsedOutput, _a, errorCode, _b, parsedBody;
808
- var _c;
809
- return __generator(this, function (_d) {
810
- switch (_d.label) {
811
- case 0:
812
- _a = [__assign({}, output)];
813
- _c = {};
814
- return [4, parseErrorBody(output.body, context)];
815
- case 1:
816
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
817
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
818
- _b = errorCode;
819
- switch (_b) {
820
- case "BadRequestException": return [3, 2];
821
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
822
- case "ConflictException": return [3, 4];
823
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
824
- case "ForbiddenException": return [3, 6];
825
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
826
- case "ResourceLimitExceededException": return [3, 8];
827
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 8];
828
- case "ServiceFailureException": return [3, 10];
829
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 10];
830
- case "ServiceUnavailableException": return [3, 12];
831
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 12];
832
- case "ThrottledClientException": return [3, 14];
833
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 14];
834
- case "UnauthorizedClientException": return [3, 16];
835
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 16];
836
- }
837
- return [3, 18];
838
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
839
- case 3: throw _d.sent();
840
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
841
- case 5: throw _d.sent();
842
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
843
- case 7: throw _d.sent();
844
- case 8: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
845
- case 9: throw _d.sent();
846
- case 10: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
847
- case 11: throw _d.sent();
848
- case 12: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
849
- case 13: throw _d.sent();
850
- case 14: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
851
- case 15: throw _d.sent();
852
- case 16: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
853
- case 17: throw _d.sent();
854
- case 18:
855
- parsedBody = parsedOutput.body;
856
- throwDefaultError({
857
- output: output,
858
- parsedBody: parsedBody,
859
- exceptionCtor: __BaseException,
860
- errorCode: errorCode,
861
- });
862
- _d.label = 19;
863
- case 19: return [2];
864
- }
227
+ };
228
+ export const serializeAws_restJson1ListAppInstanceAdminsCommand = async (input, context) => {
229
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
230
+ const headers = {};
231
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}/admins";
232
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
233
+ const query = map({
234
+ "max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
235
+ "next-token": [, input.NextToken],
236
+ });
237
+ let body;
238
+ return new __HttpRequest({
239
+ protocol,
240
+ hostname,
241
+ port,
242
+ method: "GET",
243
+ headers,
244
+ path: resolvedPath,
245
+ query,
246
+ body,
865
247
  });
866
- }); };
867
- export var deserializeAws_restJson1DeleteAppInstanceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
868
- var contents;
869
- return __generator(this, function (_a) {
870
- switch (_a.label) {
871
- case 0:
872
- if (output.statusCode !== 204 && output.statusCode >= 300) {
873
- return [2, deserializeAws_restJson1DeleteAppInstanceCommandError(output, context)];
874
- }
875
- contents = map({
876
- $metadata: deserializeMetadata(output),
877
- });
878
- return [4, collectBody(output.body, context)];
879
- case 1:
880
- _a.sent();
881
- return [2, contents];
882
- }
248
+ };
249
+ export const serializeAws_restJson1ListAppInstancesCommand = async (input, context) => {
250
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
251
+ const headers = {};
252
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances";
253
+ const query = map({
254
+ "max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
255
+ "next-token": [, input.NextToken],
256
+ });
257
+ let body;
258
+ return new __HttpRequest({
259
+ protocol,
260
+ hostname,
261
+ port,
262
+ method: "GET",
263
+ headers,
264
+ path: resolvedPath,
265
+ query,
266
+ body,
883
267
  });
884
- }); };
885
- var deserializeAws_restJson1DeleteAppInstanceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
886
- var parsedOutput, _a, errorCode, _b, parsedBody;
887
- var _c;
888
- return __generator(this, function (_d) {
889
- switch (_d.label) {
890
- case 0:
891
- _a = [__assign({}, output)];
892
- _c = {};
893
- return [4, parseErrorBody(output.body, context)];
894
- case 1:
895
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
896
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
897
- _b = errorCode;
898
- switch (_b) {
899
- case "BadRequestException": return [3, 2];
900
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
901
- case "ForbiddenException": return [3, 4];
902
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
903
- case "ResourceLimitExceededException": return [3, 6];
904
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 6];
905
- case "ServiceFailureException": return [3, 8];
906
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 8];
907
- case "ServiceUnavailableException": return [3, 10];
908
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 10];
909
- case "ThrottledClientException": return [3, 12];
910
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 12];
911
- case "UnauthorizedClientException": return [3, 14];
912
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 14];
913
- }
914
- return [3, 16];
915
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
916
- case 3: throw _d.sent();
917
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
918
- case 5: throw _d.sent();
919
- case 6: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
920
- case 7: throw _d.sent();
921
- case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
922
- case 9: throw _d.sent();
923
- case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
924
- case 11: throw _d.sent();
925
- case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
926
- case 13: throw _d.sent();
927
- case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
928
- case 15: throw _d.sent();
929
- case 16:
930
- parsedBody = parsedOutput.body;
931
- throwDefaultError({
932
- output: output,
933
- parsedBody: parsedBody,
934
- exceptionCtor: __BaseException,
935
- errorCode: errorCode,
936
- });
937
- _d.label = 17;
938
- case 17: return [2];
939
- }
268
+ };
269
+ export const serializeAws_restJson1ListAppInstanceUserEndpointsCommand = async (input, context) => {
270
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
271
+ const headers = {};
272
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
273
+ "/app-instance-users/{AppInstanceUserArn}/endpoints";
274
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
275
+ const query = map({
276
+ "max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
277
+ "next-token": [, input.NextToken],
278
+ });
279
+ let body;
280
+ return new __HttpRequest({
281
+ protocol,
282
+ hostname,
283
+ port,
284
+ method: "GET",
285
+ headers,
286
+ path: resolvedPath,
287
+ query,
288
+ body,
940
289
  });
941
- }); };
942
- export var deserializeAws_restJson1DeleteAppInstanceAdminCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
943
- var contents;
944
- return __generator(this, function (_a) {
945
- switch (_a.label) {
946
- case 0:
947
- if (output.statusCode !== 204 && output.statusCode >= 300) {
948
- return [2, deserializeAws_restJson1DeleteAppInstanceAdminCommandError(output, context)];
949
- }
950
- contents = map({
951
- $metadata: deserializeMetadata(output),
952
- });
953
- return [4, collectBody(output.body, context)];
954
- case 1:
955
- _a.sent();
956
- return [2, contents];
957
- }
290
+ };
291
+ export const serializeAws_restJson1ListAppInstanceUsersCommand = async (input, context) => {
292
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
293
+ const headers = {};
294
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users";
295
+ const query = map({
296
+ "app-instance-arn": [, input.AppInstanceArn],
297
+ "max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
298
+ "next-token": [, input.NextToken],
299
+ });
300
+ let body;
301
+ return new __HttpRequest({
302
+ protocol,
303
+ hostname,
304
+ port,
305
+ method: "GET",
306
+ headers,
307
+ path: resolvedPath,
308
+ query,
309
+ body,
958
310
  });
959
- }); };
960
- var deserializeAws_restJson1DeleteAppInstanceAdminCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
961
- var parsedOutput, _a, errorCode, _b, parsedBody;
962
- var _c;
963
- return __generator(this, function (_d) {
964
- switch (_d.label) {
965
- case 0:
966
- _a = [__assign({}, output)];
967
- _c = {};
968
- return [4, parseErrorBody(output.body, context)];
969
- case 1:
970
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
971
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
972
- _b = errorCode;
973
- switch (_b) {
974
- case "BadRequestException": return [3, 2];
975
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
976
- case "ConflictException": return [3, 4];
977
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
978
- case "ForbiddenException": return [3, 6];
979
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
980
- case "ResourceLimitExceededException": return [3, 8];
981
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 8];
982
- case "ServiceFailureException": return [3, 10];
983
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 10];
984
- case "ServiceUnavailableException": return [3, 12];
985
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 12];
986
- case "ThrottledClientException": return [3, 14];
987
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 14];
988
- case "UnauthorizedClientException": return [3, 16];
989
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 16];
990
- }
991
- return [3, 18];
992
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
993
- case 3: throw _d.sent();
994
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
995
- case 5: throw _d.sent();
996
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
997
- case 7: throw _d.sent();
998
- case 8: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
999
- case 9: throw _d.sent();
1000
- case 10: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1001
- case 11: throw _d.sent();
1002
- case 12: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1003
- case 13: throw _d.sent();
1004
- case 14: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1005
- case 15: throw _d.sent();
1006
- case 16: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1007
- case 17: throw _d.sent();
1008
- case 18:
1009
- parsedBody = parsedOutput.body;
1010
- throwDefaultError({
1011
- output: output,
1012
- parsedBody: parsedBody,
1013
- exceptionCtor: __BaseException,
1014
- errorCode: errorCode,
1015
- });
1016
- _d.label = 19;
1017
- case 19: return [2];
1018
- }
311
+ };
312
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
313
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
314
+ const headers = {};
315
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
316
+ const query = map({
317
+ arn: [, input.ResourceARN],
318
+ });
319
+ let body;
320
+ return new __HttpRequest({
321
+ protocol,
322
+ hostname,
323
+ port,
324
+ method: "GET",
325
+ headers,
326
+ path: resolvedPath,
327
+ query,
328
+ body,
1019
329
  });
1020
- }); };
1021
- export var deserializeAws_restJson1DeleteAppInstanceUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1022
- var contents;
1023
- return __generator(this, function (_a) {
1024
- switch (_a.label) {
1025
- case 0:
1026
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1027
- return [2, deserializeAws_restJson1DeleteAppInstanceUserCommandError(output, context)];
1028
- }
1029
- contents = map({
1030
- $metadata: deserializeMetadata(output),
1031
- });
1032
- return [4, collectBody(output.body, context)];
1033
- case 1:
1034
- _a.sent();
1035
- return [2, contents];
1036
- }
330
+ };
331
+ export const serializeAws_restJson1PutAppInstanceRetentionSettingsCommand = async (input, context) => {
332
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
333
+ const headers = {
334
+ "content-type": "application/json",
335
+ };
336
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
337
+ "/app-instances/{AppInstanceArn}/retention-settings";
338
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
339
+ let body;
340
+ body = JSON.stringify({
341
+ ...(input.AppInstanceRetentionSettings != null && {
342
+ AppInstanceRetentionSettings: serializeAws_restJson1AppInstanceRetentionSettings(input.AppInstanceRetentionSettings, context),
343
+ }),
344
+ });
345
+ return new __HttpRequest({
346
+ protocol,
347
+ hostname,
348
+ port,
349
+ method: "PUT",
350
+ headers,
351
+ path: resolvedPath,
352
+ body,
1037
353
  });
1038
- }); };
1039
- var deserializeAws_restJson1DeleteAppInstanceUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1040
- var parsedOutput, _a, errorCode, _b, parsedBody;
1041
- var _c;
1042
- return __generator(this, function (_d) {
1043
- switch (_d.label) {
1044
- case 0:
1045
- _a = [__assign({}, output)];
1046
- _c = {};
1047
- return [4, parseErrorBody(output.body, context)];
1048
- case 1:
1049
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1050
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1051
- _b = errorCode;
1052
- switch (_b) {
1053
- case "BadRequestException": return [3, 2];
1054
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1055
- case "ConflictException": return [3, 4];
1056
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
1057
- case "ForbiddenException": return [3, 6];
1058
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
1059
- case "ResourceLimitExceededException": return [3, 8];
1060
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 8];
1061
- case "ServiceFailureException": return [3, 10];
1062
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 10];
1063
- case "ServiceUnavailableException": return [3, 12];
1064
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 12];
1065
- case "ThrottledClientException": return [3, 14];
1066
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 14];
1067
- case "UnauthorizedClientException": return [3, 16];
1068
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 16];
1069
- }
1070
- return [3, 18];
1071
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1072
- case 3: throw _d.sent();
1073
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1074
- case 5: throw _d.sent();
1075
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1076
- case 7: throw _d.sent();
1077
- case 8: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
1078
- case 9: throw _d.sent();
1079
- case 10: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1080
- case 11: throw _d.sent();
1081
- case 12: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1082
- case 13: throw _d.sent();
1083
- case 14: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1084
- case 15: throw _d.sent();
1085
- case 16: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1086
- case 17: throw _d.sent();
1087
- case 18:
1088
- parsedBody = parsedOutput.body;
1089
- throwDefaultError({
1090
- output: output,
1091
- parsedBody: parsedBody,
1092
- exceptionCtor: __BaseException,
1093
- errorCode: errorCode,
1094
- });
1095
- _d.label = 19;
1096
- case 19: return [2];
1097
- }
354
+ };
355
+ export const serializeAws_restJson1RegisterAppInstanceUserEndpointCommand = async (input, context) => {
356
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
357
+ const headers = {
358
+ "content-type": "application/json",
359
+ };
360
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
361
+ "/app-instance-users/{AppInstanceUserArn}/endpoints";
362
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
363
+ let body;
364
+ body = JSON.stringify({
365
+ ...(input.AllowMessages != null && { AllowMessages: input.AllowMessages }),
366
+ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
367
+ ...(input.EndpointAttributes != null && {
368
+ EndpointAttributes: serializeAws_restJson1EndpointAttributes(input.EndpointAttributes, context),
369
+ }),
370
+ ...(input.Name != null && { Name: input.Name }),
371
+ ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
372
+ ...(input.Type != null && { Type: input.Type }),
373
+ });
374
+ return new __HttpRequest({
375
+ protocol,
376
+ hostname,
377
+ port,
378
+ method: "POST",
379
+ headers,
380
+ path: resolvedPath,
381
+ body,
1098
382
  });
1099
- }); };
1100
- export var deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1101
- var contents;
1102
- return __generator(this, function (_a) {
1103
- switch (_a.label) {
1104
- case 0:
1105
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1106
- return [2, deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError(output, context)];
1107
- }
1108
- contents = map({
1109
- $metadata: deserializeMetadata(output),
1110
- });
1111
- return [4, collectBody(output.body, context)];
1112
- case 1:
1113
- _a.sent();
1114
- return [2, contents];
1115
- }
383
+ };
384
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
385
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
386
+ const headers = {
387
+ "content-type": "application/json",
388
+ };
389
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
390
+ const query = map({
391
+ operation: [, "tag-resource"],
392
+ });
393
+ let body;
394
+ body = JSON.stringify({
395
+ ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
396
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
397
+ });
398
+ return new __HttpRequest({
399
+ protocol,
400
+ hostname,
401
+ port,
402
+ method: "POST",
403
+ headers,
404
+ path: resolvedPath,
405
+ query,
406
+ body,
1116
407
  });
1117
- }); };
1118
- var deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1119
- var parsedOutput, _a, errorCode, _b, parsedBody;
1120
- var _c;
1121
- return __generator(this, function (_d) {
1122
- switch (_d.label) {
1123
- case 0:
1124
- _a = [__assign({}, output)];
1125
- _c = {};
1126
- return [4, parseErrorBody(output.body, context)];
1127
- case 1:
1128
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1129
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1130
- _b = errorCode;
1131
- switch (_b) {
1132
- case "BadRequestException": return [3, 2];
1133
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1134
- case "ForbiddenException": return [3, 4];
1135
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1136
- case "ServiceFailureException": return [3, 6];
1137
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1138
- case "ServiceUnavailableException": return [3, 8];
1139
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1140
- case "ThrottledClientException": return [3, 10];
1141
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1142
- case "UnauthorizedClientException": return [3, 12];
1143
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1144
- }
1145
- return [3, 14];
1146
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1147
- case 3: throw _d.sent();
1148
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1149
- case 5: throw _d.sent();
1150
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1151
- case 7: throw _d.sent();
1152
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1153
- case 9: throw _d.sent();
1154
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1155
- case 11: throw _d.sent();
1156
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1157
- case 13: throw _d.sent();
1158
- case 14:
1159
- parsedBody = parsedOutput.body;
1160
- throwDefaultError({
1161
- output: output,
1162
- parsedBody: parsedBody,
1163
- exceptionCtor: __BaseException,
1164
- errorCode: errorCode,
1165
- });
1166
- _d.label = 15;
1167
- case 15: return [2];
1168
- }
408
+ };
409
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
410
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
411
+ const headers = {
412
+ "content-type": "application/json",
413
+ };
414
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
415
+ const query = map({
416
+ operation: [, "untag-resource"],
417
+ });
418
+ let body;
419
+ body = JSON.stringify({
420
+ ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
421
+ ...(input.TagKeys != null && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }),
422
+ });
423
+ return new __HttpRequest({
424
+ protocol,
425
+ hostname,
426
+ port,
427
+ method: "POST",
428
+ headers,
429
+ path: resolvedPath,
430
+ query,
431
+ body,
1169
432
  });
1170
- }); };
1171
- export var deserializeAws_restJson1DescribeAppInstanceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1172
- var contents, data, _a, _b;
1173
- return __generator(this, function (_c) {
1174
- switch (_c.label) {
1175
- case 0:
1176
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1177
- return [2, deserializeAws_restJson1DescribeAppInstanceCommandError(output, context)];
1178
- }
1179
- contents = map({
1180
- $metadata: deserializeMetadata(output),
1181
- });
1182
- _a = __expectNonNull;
1183
- _b = __expectObject;
1184
- return [4, parseBody(output.body, context)];
1185
- case 1:
1186
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1187
- if (data.AppInstance != null) {
1188
- contents.AppInstance = deserializeAws_restJson1AppInstance(data.AppInstance, context);
1189
- }
1190
- return [2, contents];
1191
- }
433
+ };
434
+ export const serializeAws_restJson1UpdateAppInstanceCommand = async (input, context) => {
435
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
436
+ const headers = {
437
+ "content-type": "application/json",
438
+ };
439
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}";
440
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
441
+ let body;
442
+ body = JSON.stringify({
443
+ ...(input.Metadata != null && { Metadata: input.Metadata }),
444
+ ...(input.Name != null && { Name: input.Name }),
445
+ });
446
+ return new __HttpRequest({
447
+ protocol,
448
+ hostname,
449
+ port,
450
+ method: "PUT",
451
+ headers,
452
+ path: resolvedPath,
453
+ body,
1192
454
  });
1193
- }); };
1194
- var deserializeAws_restJson1DescribeAppInstanceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1195
- var parsedOutput, _a, errorCode, _b, parsedBody;
1196
- var _c;
1197
- return __generator(this, function (_d) {
1198
- switch (_d.label) {
1199
- case 0:
1200
- _a = [__assign({}, output)];
1201
- _c = {};
1202
- return [4, parseErrorBody(output.body, context)];
1203
- case 1:
1204
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1205
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1206
- _b = errorCode;
1207
- switch (_b) {
1208
- case "BadRequestException": return [3, 2];
1209
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1210
- case "ForbiddenException": return [3, 4];
1211
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1212
- case "ServiceFailureException": return [3, 6];
1213
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1214
- case "ServiceUnavailableException": return [3, 8];
1215
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1216
- case "ThrottledClientException": return [3, 10];
1217
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1218
- case "UnauthorizedClientException": return [3, 12];
1219
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1220
- }
1221
- return [3, 14];
1222
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1223
- case 3: throw _d.sent();
1224
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1225
- case 5: throw _d.sent();
1226
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1227
- case 7: throw _d.sent();
1228
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1229
- case 9: throw _d.sent();
1230
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1231
- case 11: throw _d.sent();
1232
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1233
- case 13: throw _d.sent();
1234
- case 14:
1235
- parsedBody = parsedOutput.body;
1236
- throwDefaultError({
1237
- output: output,
1238
- parsedBody: parsedBody,
1239
- exceptionCtor: __BaseException,
1240
- errorCode: errorCode,
1241
- });
1242
- _d.label = 15;
1243
- case 15: return [2];
1244
- }
455
+ };
456
+ export const serializeAws_restJson1UpdateAppInstanceUserCommand = async (input, context) => {
457
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
458
+ const headers = {
459
+ "content-type": "application/json",
460
+ };
461
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users/{AppInstanceUserArn}";
462
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
463
+ let body;
464
+ body = JSON.stringify({
465
+ ...(input.Metadata != null && { Metadata: input.Metadata }),
466
+ ...(input.Name != null && { Name: input.Name }),
467
+ });
468
+ return new __HttpRequest({
469
+ protocol,
470
+ hostname,
471
+ port,
472
+ method: "PUT",
473
+ headers,
474
+ path: resolvedPath,
475
+ body,
1245
476
  });
1246
- }); };
1247
- export var deserializeAws_restJson1DescribeAppInstanceAdminCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1248
- var contents, data, _a, _b;
1249
- return __generator(this, function (_c) {
1250
- switch (_c.label) {
1251
- case 0:
1252
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1253
- return [2, deserializeAws_restJson1DescribeAppInstanceAdminCommandError(output, context)];
1254
- }
1255
- contents = map({
1256
- $metadata: deserializeMetadata(output),
1257
- });
1258
- _a = __expectNonNull;
1259
- _b = __expectObject;
1260
- return [4, parseBody(output.body, context)];
1261
- case 1:
1262
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1263
- if (data.AppInstanceAdmin != null) {
1264
- contents.AppInstanceAdmin = deserializeAws_restJson1AppInstanceAdmin(data.AppInstanceAdmin, context);
1265
- }
1266
- return [2, contents];
1267
- }
477
+ };
478
+ export const serializeAws_restJson1UpdateAppInstanceUserEndpointCommand = async (input, context) => {
479
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
480
+ const headers = {
481
+ "content-type": "application/json",
482
+ };
483
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
484
+ "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
485
+ resolvedPath = __resolvedPath(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
486
+ resolvedPath = __resolvedPath(resolvedPath, input, "EndpointId", () => input.EndpointId, "{EndpointId}", false);
487
+ let body;
488
+ body = JSON.stringify({
489
+ ...(input.AllowMessages != null && { AllowMessages: input.AllowMessages }),
490
+ ...(input.Name != null && { Name: input.Name }),
491
+ });
492
+ return new __HttpRequest({
493
+ protocol,
494
+ hostname,
495
+ port,
496
+ method: "PUT",
497
+ headers,
498
+ path: resolvedPath,
499
+ body,
1268
500
  });
1269
- }); };
1270
- var deserializeAws_restJson1DescribeAppInstanceAdminCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1271
- var parsedOutput, _a, errorCode, _b, parsedBody;
1272
- var _c;
1273
- return __generator(this, function (_d) {
1274
- switch (_d.label) {
1275
- case 0:
1276
- _a = [__assign({}, output)];
1277
- _c = {};
1278
- return [4, parseErrorBody(output.body, context)];
1279
- case 1:
1280
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1281
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1282
- _b = errorCode;
1283
- switch (_b) {
1284
- case "BadRequestException": return [3, 2];
1285
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1286
- case "ForbiddenException": return [3, 4];
1287
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1288
- case "ServiceFailureException": return [3, 6];
1289
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1290
- case "ServiceUnavailableException": return [3, 8];
1291
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1292
- case "ThrottledClientException": return [3, 10];
1293
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1294
- case "UnauthorizedClientException": return [3, 12];
1295
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1296
- }
1297
- return [3, 14];
1298
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1299
- case 3: throw _d.sent();
1300
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1301
- case 5: throw _d.sent();
1302
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1303
- case 7: throw _d.sent();
1304
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1305
- case 9: throw _d.sent();
1306
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1307
- case 11: throw _d.sent();
1308
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1309
- case 13: throw _d.sent();
1310
- case 14:
1311
- parsedBody = parsedOutput.body;
1312
- throwDefaultError({
1313
- output: output,
1314
- parsedBody: parsedBody,
1315
- exceptionCtor: __BaseException,
1316
- errorCode: errorCode,
1317
- });
1318
- _d.label = 15;
1319
- case 15: return [2];
1320
- }
501
+ };
502
+ export const deserializeAws_restJson1CreateAppInstanceCommand = async (output, context) => {
503
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
504
+ return deserializeAws_restJson1CreateAppInstanceCommandError(output, context);
505
+ }
506
+ const contents = map({
507
+ $metadata: deserializeMetadata(output),
1321
508
  });
1322
- }); };
1323
- export var deserializeAws_restJson1DescribeAppInstanceUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1324
- var contents, data, _a, _b;
1325
- return __generator(this, function (_c) {
1326
- switch (_c.label) {
1327
- case 0:
1328
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1329
- return [2, deserializeAws_restJson1DescribeAppInstanceUserCommandError(output, context)];
1330
- }
1331
- contents = map({
1332
- $metadata: deserializeMetadata(output),
1333
- });
1334
- _a = __expectNonNull;
1335
- _b = __expectObject;
1336
- return [4, parseBody(output.body, context)];
1337
- case 1:
1338
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1339
- if (data.AppInstanceUser != null) {
1340
- contents.AppInstanceUser = deserializeAws_restJson1AppInstanceUser(data.AppInstanceUser, context);
1341
- }
1342
- return [2, contents];
1343
- }
509
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
510
+ if (data.AppInstanceArn != null) {
511
+ contents.AppInstanceArn = __expectString(data.AppInstanceArn);
512
+ }
513
+ return contents;
514
+ };
515
+ const deserializeAws_restJson1CreateAppInstanceCommandError = async (output, context) => {
516
+ const parsedOutput = {
517
+ ...output,
518
+ body: await parseErrorBody(output.body, context),
519
+ };
520
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
521
+ switch (errorCode) {
522
+ case "BadRequestException":
523
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
524
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
525
+ case "ConflictException":
526
+ case "com.amazonaws.chimesdkidentity#ConflictException":
527
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
528
+ case "ForbiddenException":
529
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
530
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
531
+ case "ResourceLimitExceededException":
532
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
533
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
534
+ case "ServiceFailureException":
535
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
536
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
537
+ case "ServiceUnavailableException":
538
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
539
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
540
+ case "ThrottledClientException":
541
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
542
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
543
+ case "UnauthorizedClientException":
544
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
545
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
546
+ default:
547
+ const parsedBody = parsedOutput.body;
548
+ throwDefaultError({
549
+ output,
550
+ parsedBody,
551
+ exceptionCtor: __BaseException,
552
+ errorCode,
553
+ });
554
+ }
555
+ };
556
+ export const deserializeAws_restJson1CreateAppInstanceAdminCommand = async (output, context) => {
557
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
558
+ return deserializeAws_restJson1CreateAppInstanceAdminCommandError(output, context);
559
+ }
560
+ const contents = map({
561
+ $metadata: deserializeMetadata(output),
1344
562
  });
1345
- }); };
1346
- var deserializeAws_restJson1DescribeAppInstanceUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1347
- var parsedOutput, _a, errorCode, _b, parsedBody;
1348
- var _c;
1349
- return __generator(this, function (_d) {
1350
- switch (_d.label) {
1351
- case 0:
1352
- _a = [__assign({}, output)];
1353
- _c = {};
1354
- return [4, parseErrorBody(output.body, context)];
1355
- case 1:
1356
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1357
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1358
- _b = errorCode;
1359
- switch (_b) {
1360
- case "BadRequestException": return [3, 2];
1361
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1362
- case "ForbiddenException": return [3, 4];
1363
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1364
- case "ServiceFailureException": return [3, 6];
1365
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1366
- case "ServiceUnavailableException": return [3, 8];
1367
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1368
- case "ThrottledClientException": return [3, 10];
1369
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1370
- case "UnauthorizedClientException": return [3, 12];
1371
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1372
- }
1373
- return [3, 14];
1374
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1375
- case 3: throw _d.sent();
1376
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1377
- case 5: throw _d.sent();
1378
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1379
- case 7: throw _d.sent();
1380
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1381
- case 9: throw _d.sent();
1382
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1383
- case 11: throw _d.sent();
1384
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1385
- case 13: throw _d.sent();
1386
- case 14:
1387
- parsedBody = parsedOutput.body;
1388
- throwDefaultError({
1389
- output: output,
1390
- parsedBody: parsedBody,
1391
- exceptionCtor: __BaseException,
1392
- errorCode: errorCode,
1393
- });
1394
- _d.label = 15;
1395
- case 15: return [2];
1396
- }
563
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
564
+ if (data.AppInstanceAdmin != null) {
565
+ contents.AppInstanceAdmin = deserializeAws_restJson1Identity(data.AppInstanceAdmin, context);
566
+ }
567
+ if (data.AppInstanceArn != null) {
568
+ contents.AppInstanceArn = __expectString(data.AppInstanceArn);
569
+ }
570
+ return contents;
571
+ };
572
+ const deserializeAws_restJson1CreateAppInstanceAdminCommandError = async (output, context) => {
573
+ const parsedOutput = {
574
+ ...output,
575
+ body: await parseErrorBody(output.body, context),
576
+ };
577
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
578
+ switch (errorCode) {
579
+ case "BadRequestException":
580
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
581
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
582
+ case "ConflictException":
583
+ case "com.amazonaws.chimesdkidentity#ConflictException":
584
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
585
+ case "ForbiddenException":
586
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
587
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
588
+ case "ResourceLimitExceededException":
589
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
590
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
591
+ case "ServiceFailureException":
592
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
593
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
594
+ case "ServiceUnavailableException":
595
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
596
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
597
+ case "ThrottledClientException":
598
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
599
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
600
+ case "UnauthorizedClientException":
601
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
602
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
603
+ default:
604
+ const parsedBody = parsedOutput.body;
605
+ throwDefaultError({
606
+ output,
607
+ parsedBody,
608
+ exceptionCtor: __BaseException,
609
+ errorCode,
610
+ });
611
+ }
612
+ };
613
+ export const deserializeAws_restJson1CreateAppInstanceUserCommand = async (output, context) => {
614
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
615
+ return deserializeAws_restJson1CreateAppInstanceUserCommandError(output, context);
616
+ }
617
+ const contents = map({
618
+ $metadata: deserializeMetadata(output),
1397
619
  });
1398
- }); };
1399
- export var deserializeAws_restJson1DescribeAppInstanceUserEndpointCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1400
- var contents, data, _a, _b;
1401
- return __generator(this, function (_c) {
1402
- switch (_c.label) {
1403
- case 0:
1404
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1405
- return [2, deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError(output, context)];
1406
- }
1407
- contents = map({
1408
- $metadata: deserializeMetadata(output),
1409
- });
1410
- _a = __expectNonNull;
1411
- _b = __expectObject;
1412
- return [4, parseBody(output.body, context)];
1413
- case 1:
1414
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1415
- if (data.AppInstanceUserEndpoint != null) {
1416
- contents.AppInstanceUserEndpoint = deserializeAws_restJson1AppInstanceUserEndpoint(data.AppInstanceUserEndpoint, context);
1417
- }
1418
- return [2, contents];
1419
- }
620
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
621
+ if (data.AppInstanceUserArn != null) {
622
+ contents.AppInstanceUserArn = __expectString(data.AppInstanceUserArn);
623
+ }
624
+ return contents;
625
+ };
626
+ const deserializeAws_restJson1CreateAppInstanceUserCommandError = async (output, context) => {
627
+ const parsedOutput = {
628
+ ...output,
629
+ body: await parseErrorBody(output.body, context),
630
+ };
631
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
632
+ switch (errorCode) {
633
+ case "BadRequestException":
634
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
635
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
636
+ case "ConflictException":
637
+ case "com.amazonaws.chimesdkidentity#ConflictException":
638
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
639
+ case "ForbiddenException":
640
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
641
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
642
+ case "ResourceLimitExceededException":
643
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
644
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
645
+ case "ServiceFailureException":
646
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
647
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
648
+ case "ServiceUnavailableException":
649
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
650
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
651
+ case "ThrottledClientException":
652
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
653
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
654
+ case "UnauthorizedClientException":
655
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
656
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
657
+ default:
658
+ const parsedBody = parsedOutput.body;
659
+ throwDefaultError({
660
+ output,
661
+ parsedBody,
662
+ exceptionCtor: __BaseException,
663
+ errorCode,
664
+ });
665
+ }
666
+ };
667
+ export const deserializeAws_restJson1DeleteAppInstanceCommand = async (output, context) => {
668
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
669
+ return deserializeAws_restJson1DeleteAppInstanceCommandError(output, context);
670
+ }
671
+ const contents = map({
672
+ $metadata: deserializeMetadata(output),
1420
673
  });
1421
- }); };
1422
- var deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1423
- var parsedOutput, _a, errorCode, _b, parsedBody;
1424
- var _c;
1425
- return __generator(this, function (_d) {
1426
- switch (_d.label) {
1427
- case 0:
1428
- _a = [__assign({}, output)];
1429
- _c = {};
1430
- return [4, parseErrorBody(output.body, context)];
1431
- case 1:
1432
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1433
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1434
- _b = errorCode;
1435
- switch (_b) {
1436
- case "BadRequestException": return [3, 2];
1437
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1438
- case "ForbiddenException": return [3, 4];
1439
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1440
- case "ServiceFailureException": return [3, 6];
1441
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1442
- case "ServiceUnavailableException": return [3, 8];
1443
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1444
- case "ThrottledClientException": return [3, 10];
1445
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1446
- case "UnauthorizedClientException": return [3, 12];
1447
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1448
- }
1449
- return [3, 14];
1450
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1451
- case 3: throw _d.sent();
1452
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1453
- case 5: throw _d.sent();
1454
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1455
- case 7: throw _d.sent();
1456
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1457
- case 9: throw _d.sent();
1458
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1459
- case 11: throw _d.sent();
1460
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1461
- case 13: throw _d.sent();
1462
- case 14:
1463
- parsedBody = parsedOutput.body;
1464
- throwDefaultError({
1465
- output: output,
1466
- parsedBody: parsedBody,
1467
- exceptionCtor: __BaseException,
1468
- errorCode: errorCode,
1469
- });
1470
- _d.label = 15;
1471
- case 15: return [2];
1472
- }
674
+ await collectBody(output.body, context);
675
+ return contents;
676
+ };
677
+ const deserializeAws_restJson1DeleteAppInstanceCommandError = async (output, context) => {
678
+ const parsedOutput = {
679
+ ...output,
680
+ body: await parseErrorBody(output.body, context),
681
+ };
682
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
683
+ switch (errorCode) {
684
+ case "BadRequestException":
685
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
686
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
687
+ case "ForbiddenException":
688
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
689
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
690
+ case "ResourceLimitExceededException":
691
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
692
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
693
+ case "ServiceFailureException":
694
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
695
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
696
+ case "ServiceUnavailableException":
697
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
698
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
699
+ case "ThrottledClientException":
700
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
701
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
702
+ case "UnauthorizedClientException":
703
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
704
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
705
+ default:
706
+ const parsedBody = parsedOutput.body;
707
+ throwDefaultError({
708
+ output,
709
+ parsedBody,
710
+ exceptionCtor: __BaseException,
711
+ errorCode,
712
+ });
713
+ }
714
+ };
715
+ export const deserializeAws_restJson1DeleteAppInstanceAdminCommand = async (output, context) => {
716
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
717
+ return deserializeAws_restJson1DeleteAppInstanceAdminCommandError(output, context);
718
+ }
719
+ const contents = map({
720
+ $metadata: deserializeMetadata(output),
1473
721
  });
1474
- }); };
1475
- export var deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1476
- var contents, data, _a, _b;
1477
- return __generator(this, function (_c) {
1478
- switch (_c.label) {
1479
- case 0:
1480
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1481
- return [2, deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError(output, context)];
1482
- }
1483
- contents = map({
1484
- $metadata: deserializeMetadata(output),
1485
- });
1486
- _a = __expectNonNull;
1487
- _b = __expectObject;
1488
- return [4, parseBody(output.body, context)];
1489
- case 1:
1490
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1491
- if (data.AppInstanceRetentionSettings != null) {
1492
- contents.AppInstanceRetentionSettings = deserializeAws_restJson1AppInstanceRetentionSettings(data.AppInstanceRetentionSettings, context);
1493
- }
1494
- if (data.InitiateDeletionTimestamp != null) {
1495
- contents.InitiateDeletionTimestamp = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.InitiateDeletionTimestamp)));
1496
- }
1497
- return [2, contents];
1498
- }
722
+ await collectBody(output.body, context);
723
+ return contents;
724
+ };
725
+ const deserializeAws_restJson1DeleteAppInstanceAdminCommandError = async (output, context) => {
726
+ const parsedOutput = {
727
+ ...output,
728
+ body: await parseErrorBody(output.body, context),
729
+ };
730
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
731
+ switch (errorCode) {
732
+ case "BadRequestException":
733
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
734
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
735
+ case "ConflictException":
736
+ case "com.amazonaws.chimesdkidentity#ConflictException":
737
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
738
+ case "ForbiddenException":
739
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
740
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
741
+ case "ResourceLimitExceededException":
742
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
743
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
744
+ case "ServiceFailureException":
745
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
746
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
747
+ case "ServiceUnavailableException":
748
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
749
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
750
+ case "ThrottledClientException":
751
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
752
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
753
+ case "UnauthorizedClientException":
754
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
755
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
756
+ default:
757
+ const parsedBody = parsedOutput.body;
758
+ throwDefaultError({
759
+ output,
760
+ parsedBody,
761
+ exceptionCtor: __BaseException,
762
+ errorCode,
763
+ });
764
+ }
765
+ };
766
+ export const deserializeAws_restJson1DeleteAppInstanceUserCommand = async (output, context) => {
767
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
768
+ return deserializeAws_restJson1DeleteAppInstanceUserCommandError(output, context);
769
+ }
770
+ const contents = map({
771
+ $metadata: deserializeMetadata(output),
1499
772
  });
1500
- }); };
1501
- var deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1502
- var parsedOutput, _a, errorCode, _b, parsedBody;
1503
- var _c;
1504
- return __generator(this, function (_d) {
1505
- switch (_d.label) {
1506
- case 0:
1507
- _a = [__assign({}, output)];
1508
- _c = {};
1509
- return [4, parseErrorBody(output.body, context)];
1510
- case 1:
1511
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1512
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1513
- _b = errorCode;
1514
- switch (_b) {
1515
- case "BadRequestException": return [3, 2];
1516
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1517
- case "ForbiddenException": return [3, 4];
1518
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1519
- case "ServiceFailureException": return [3, 6];
1520
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1521
- case "ServiceUnavailableException": return [3, 8];
1522
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1523
- case "ThrottledClientException": return [3, 10];
1524
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1525
- case "UnauthorizedClientException": return [3, 12];
1526
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1527
- }
1528
- return [3, 14];
1529
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1530
- case 3: throw _d.sent();
1531
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1532
- case 5: throw _d.sent();
1533
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1534
- case 7: throw _d.sent();
1535
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1536
- case 9: throw _d.sent();
1537
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1538
- case 11: throw _d.sent();
1539
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1540
- case 13: throw _d.sent();
1541
- case 14:
1542
- parsedBody = parsedOutput.body;
1543
- throwDefaultError({
1544
- output: output,
1545
- parsedBody: parsedBody,
1546
- exceptionCtor: __BaseException,
1547
- errorCode: errorCode,
1548
- });
1549
- _d.label = 15;
1550
- case 15: return [2];
1551
- }
773
+ await collectBody(output.body, context);
774
+ return contents;
775
+ };
776
+ const deserializeAws_restJson1DeleteAppInstanceUserCommandError = async (output, context) => {
777
+ const parsedOutput = {
778
+ ...output,
779
+ body: await parseErrorBody(output.body, context),
780
+ };
781
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
782
+ switch (errorCode) {
783
+ case "BadRequestException":
784
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
785
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
786
+ case "ConflictException":
787
+ case "com.amazonaws.chimesdkidentity#ConflictException":
788
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
789
+ case "ForbiddenException":
790
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
791
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
792
+ case "ResourceLimitExceededException":
793
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
794
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
795
+ case "ServiceFailureException":
796
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
797
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
798
+ case "ServiceUnavailableException":
799
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
800
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
801
+ case "ThrottledClientException":
802
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
803
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
804
+ case "UnauthorizedClientException":
805
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
806
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
807
+ default:
808
+ const parsedBody = parsedOutput.body;
809
+ throwDefaultError({
810
+ output,
811
+ parsedBody,
812
+ exceptionCtor: __BaseException,
813
+ errorCode,
814
+ });
815
+ }
816
+ };
817
+ export const deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommand = async (output, context) => {
818
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
819
+ return deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError(output, context);
820
+ }
821
+ const contents = map({
822
+ $metadata: deserializeMetadata(output),
1552
823
  });
1553
- }); };
1554
- export var deserializeAws_restJson1ListAppInstanceAdminsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1555
- var contents, data, _a, _b;
1556
- return __generator(this, function (_c) {
1557
- switch (_c.label) {
1558
- case 0:
1559
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1560
- return [2, deserializeAws_restJson1ListAppInstanceAdminsCommandError(output, context)];
1561
- }
1562
- contents = map({
1563
- $metadata: deserializeMetadata(output),
1564
- });
1565
- _a = __expectNonNull;
1566
- _b = __expectObject;
1567
- return [4, parseBody(output.body, context)];
1568
- case 1:
1569
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1570
- if (data.AppInstanceAdmins != null) {
1571
- contents.AppInstanceAdmins = deserializeAws_restJson1AppInstanceAdminList(data.AppInstanceAdmins, context);
1572
- }
1573
- if (data.AppInstanceArn != null) {
1574
- contents.AppInstanceArn = __expectString(data.AppInstanceArn);
1575
- }
1576
- if (data.NextToken != null) {
1577
- contents.NextToken = __expectString(data.NextToken);
1578
- }
1579
- return [2, contents];
1580
- }
824
+ await collectBody(output.body, context);
825
+ return contents;
826
+ };
827
+ const deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError = async (output, context) => {
828
+ const parsedOutput = {
829
+ ...output,
830
+ body: await parseErrorBody(output.body, context),
831
+ };
832
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
833
+ switch (errorCode) {
834
+ case "BadRequestException":
835
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
836
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
837
+ case "ForbiddenException":
838
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
839
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
840
+ case "ServiceFailureException":
841
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
842
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
843
+ case "ServiceUnavailableException":
844
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
845
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
846
+ case "ThrottledClientException":
847
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
848
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
849
+ case "UnauthorizedClientException":
850
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
851
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
852
+ default:
853
+ const parsedBody = parsedOutput.body;
854
+ throwDefaultError({
855
+ output,
856
+ parsedBody,
857
+ exceptionCtor: __BaseException,
858
+ errorCode,
859
+ });
860
+ }
861
+ };
862
+ export const deserializeAws_restJson1DescribeAppInstanceCommand = async (output, context) => {
863
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
864
+ return deserializeAws_restJson1DescribeAppInstanceCommandError(output, context);
865
+ }
866
+ const contents = map({
867
+ $metadata: deserializeMetadata(output),
1581
868
  });
1582
- }); };
1583
- var deserializeAws_restJson1ListAppInstanceAdminsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1584
- var parsedOutput, _a, errorCode, _b, parsedBody;
1585
- var _c;
1586
- return __generator(this, function (_d) {
1587
- switch (_d.label) {
1588
- case 0:
1589
- _a = [__assign({}, output)];
1590
- _c = {};
1591
- return [4, parseErrorBody(output.body, context)];
1592
- case 1:
1593
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1594
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1595
- _b = errorCode;
1596
- switch (_b) {
1597
- case "BadRequestException": return [3, 2];
1598
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1599
- case "ForbiddenException": return [3, 4];
1600
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1601
- case "ResourceLimitExceededException": return [3, 6];
1602
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 6];
1603
- case "ServiceFailureException": return [3, 8];
1604
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 8];
1605
- case "ServiceUnavailableException": return [3, 10];
1606
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 10];
1607
- case "ThrottledClientException": return [3, 12];
1608
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 12];
1609
- case "UnauthorizedClientException": return [3, 14];
1610
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 14];
1611
- }
1612
- return [3, 16];
1613
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1614
- case 3: throw _d.sent();
1615
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1616
- case 5: throw _d.sent();
1617
- case 6: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
1618
- case 7: throw _d.sent();
1619
- case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1620
- case 9: throw _d.sent();
1621
- case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1622
- case 11: throw _d.sent();
1623
- case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1624
- case 13: throw _d.sent();
1625
- case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1626
- case 15: throw _d.sent();
1627
- case 16:
1628
- parsedBody = parsedOutput.body;
1629
- throwDefaultError({
1630
- output: output,
1631
- parsedBody: parsedBody,
1632
- exceptionCtor: __BaseException,
1633
- errorCode: errorCode,
1634
- });
1635
- _d.label = 17;
1636
- case 17: return [2];
1637
- }
869
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
870
+ if (data.AppInstance != null) {
871
+ contents.AppInstance = deserializeAws_restJson1AppInstance(data.AppInstance, context);
872
+ }
873
+ return contents;
874
+ };
875
+ const deserializeAws_restJson1DescribeAppInstanceCommandError = async (output, context) => {
876
+ const parsedOutput = {
877
+ ...output,
878
+ body: await parseErrorBody(output.body, context),
879
+ };
880
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
881
+ switch (errorCode) {
882
+ case "BadRequestException":
883
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
884
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
885
+ case "ForbiddenException":
886
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
887
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
888
+ case "ServiceFailureException":
889
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
890
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
891
+ case "ServiceUnavailableException":
892
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
893
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
894
+ case "ThrottledClientException":
895
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
896
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
897
+ case "UnauthorizedClientException":
898
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
899
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
900
+ default:
901
+ const parsedBody = parsedOutput.body;
902
+ throwDefaultError({
903
+ output,
904
+ parsedBody,
905
+ exceptionCtor: __BaseException,
906
+ errorCode,
907
+ });
908
+ }
909
+ };
910
+ export const deserializeAws_restJson1DescribeAppInstanceAdminCommand = async (output, context) => {
911
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
912
+ return deserializeAws_restJson1DescribeAppInstanceAdminCommandError(output, context);
913
+ }
914
+ const contents = map({
915
+ $metadata: deserializeMetadata(output),
1638
916
  });
1639
- }); };
1640
- export var deserializeAws_restJson1ListAppInstancesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1641
- var contents, data, _a, _b;
1642
- return __generator(this, function (_c) {
1643
- switch (_c.label) {
1644
- case 0:
1645
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1646
- return [2, deserializeAws_restJson1ListAppInstancesCommandError(output, context)];
1647
- }
1648
- contents = map({
1649
- $metadata: deserializeMetadata(output),
1650
- });
1651
- _a = __expectNonNull;
1652
- _b = __expectObject;
1653
- return [4, parseBody(output.body, context)];
1654
- case 1:
1655
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1656
- if (data.AppInstances != null) {
1657
- contents.AppInstances = deserializeAws_restJson1AppInstanceList(data.AppInstances, context);
1658
- }
1659
- if (data.NextToken != null) {
1660
- contents.NextToken = __expectString(data.NextToken);
1661
- }
1662
- return [2, contents];
1663
- }
917
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
918
+ if (data.AppInstanceAdmin != null) {
919
+ contents.AppInstanceAdmin = deserializeAws_restJson1AppInstanceAdmin(data.AppInstanceAdmin, context);
920
+ }
921
+ return contents;
922
+ };
923
+ const deserializeAws_restJson1DescribeAppInstanceAdminCommandError = async (output, context) => {
924
+ const parsedOutput = {
925
+ ...output,
926
+ body: await parseErrorBody(output.body, context),
927
+ };
928
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
929
+ switch (errorCode) {
930
+ case "BadRequestException":
931
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
932
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
933
+ case "ForbiddenException":
934
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
935
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
936
+ case "ServiceFailureException":
937
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
938
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
939
+ case "ServiceUnavailableException":
940
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
941
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
942
+ case "ThrottledClientException":
943
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
944
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
945
+ case "UnauthorizedClientException":
946
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
947
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
948
+ default:
949
+ const parsedBody = parsedOutput.body;
950
+ throwDefaultError({
951
+ output,
952
+ parsedBody,
953
+ exceptionCtor: __BaseException,
954
+ errorCode,
955
+ });
956
+ }
957
+ };
958
+ export const deserializeAws_restJson1DescribeAppInstanceUserCommand = async (output, context) => {
959
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
960
+ return deserializeAws_restJson1DescribeAppInstanceUserCommandError(output, context);
961
+ }
962
+ const contents = map({
963
+ $metadata: deserializeMetadata(output),
1664
964
  });
1665
- }); };
1666
- var deserializeAws_restJson1ListAppInstancesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1667
- var parsedOutput, _a, errorCode, _b, parsedBody;
1668
- var _c;
1669
- return __generator(this, function (_d) {
1670
- switch (_d.label) {
1671
- case 0:
1672
- _a = [__assign({}, output)];
1673
- _c = {};
1674
- return [4, parseErrorBody(output.body, context)];
1675
- case 1:
1676
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1677
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1678
- _b = errorCode;
1679
- switch (_b) {
1680
- case "BadRequestException": return [3, 2];
1681
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1682
- case "ForbiddenException": return [3, 4];
1683
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1684
- case "ServiceFailureException": return [3, 6];
1685
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1686
- case "ServiceUnavailableException": return [3, 8];
1687
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1688
- case "ThrottledClientException": return [3, 10];
1689
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1690
- case "UnauthorizedClientException": return [3, 12];
1691
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1692
- }
1693
- return [3, 14];
1694
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1695
- case 3: throw _d.sent();
1696
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1697
- case 5: throw _d.sent();
1698
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1699
- case 7: throw _d.sent();
1700
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1701
- case 9: throw _d.sent();
1702
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1703
- case 11: throw _d.sent();
1704
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1705
- case 13: throw _d.sent();
1706
- case 14:
1707
- parsedBody = parsedOutput.body;
1708
- throwDefaultError({
1709
- output: output,
1710
- parsedBody: parsedBody,
1711
- exceptionCtor: __BaseException,
1712
- errorCode: errorCode,
1713
- });
1714
- _d.label = 15;
1715
- case 15: return [2];
1716
- }
965
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
966
+ if (data.AppInstanceUser != null) {
967
+ contents.AppInstanceUser = deserializeAws_restJson1AppInstanceUser(data.AppInstanceUser, context);
968
+ }
969
+ return contents;
970
+ };
971
+ const deserializeAws_restJson1DescribeAppInstanceUserCommandError = async (output, context) => {
972
+ const parsedOutput = {
973
+ ...output,
974
+ body: await parseErrorBody(output.body, context),
975
+ };
976
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
977
+ switch (errorCode) {
978
+ case "BadRequestException":
979
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
980
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
981
+ case "ForbiddenException":
982
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
983
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
984
+ case "ServiceFailureException":
985
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
986
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
987
+ case "ServiceUnavailableException":
988
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
989
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
990
+ case "ThrottledClientException":
991
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
992
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
993
+ case "UnauthorizedClientException":
994
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
995
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
996
+ default:
997
+ const parsedBody = parsedOutput.body;
998
+ throwDefaultError({
999
+ output,
1000
+ parsedBody,
1001
+ exceptionCtor: __BaseException,
1002
+ errorCode,
1003
+ });
1004
+ }
1005
+ };
1006
+ export const deserializeAws_restJson1DescribeAppInstanceUserEndpointCommand = async (output, context) => {
1007
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1008
+ return deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError(output, context);
1009
+ }
1010
+ const contents = map({
1011
+ $metadata: deserializeMetadata(output),
1717
1012
  });
1718
- }); };
1719
- export var deserializeAws_restJson1ListAppInstanceUserEndpointsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1720
- var contents, data, _a, _b;
1721
- return __generator(this, function (_c) {
1722
- switch (_c.label) {
1723
- case 0:
1724
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1725
- return [2, deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError(output, context)];
1726
- }
1727
- contents = map({
1728
- $metadata: deserializeMetadata(output),
1729
- });
1730
- _a = __expectNonNull;
1731
- _b = __expectObject;
1732
- return [4, parseBody(output.body, context)];
1733
- case 1:
1734
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1735
- if (data.AppInstanceUserEndpoints != null) {
1736
- contents.AppInstanceUserEndpoints = deserializeAws_restJson1AppInstanceUserEndpointSummaryList(data.AppInstanceUserEndpoints, context);
1737
- }
1738
- if (data.NextToken != null) {
1739
- contents.NextToken = __expectString(data.NextToken);
1740
- }
1741
- return [2, contents];
1742
- }
1013
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1014
+ if (data.AppInstanceUserEndpoint != null) {
1015
+ contents.AppInstanceUserEndpoint = deserializeAws_restJson1AppInstanceUserEndpoint(data.AppInstanceUserEndpoint, context);
1016
+ }
1017
+ return contents;
1018
+ };
1019
+ const deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError = async (output, context) => {
1020
+ const parsedOutput = {
1021
+ ...output,
1022
+ body: await parseErrorBody(output.body, context),
1023
+ };
1024
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1025
+ switch (errorCode) {
1026
+ case "BadRequestException":
1027
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1028
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1029
+ case "ForbiddenException":
1030
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1031
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1032
+ case "ServiceFailureException":
1033
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1034
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1035
+ case "ServiceUnavailableException":
1036
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1037
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1038
+ case "ThrottledClientException":
1039
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1040
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1041
+ case "UnauthorizedClientException":
1042
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1043
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1044
+ default:
1045
+ const parsedBody = parsedOutput.body;
1046
+ throwDefaultError({
1047
+ output,
1048
+ parsedBody,
1049
+ exceptionCtor: __BaseException,
1050
+ errorCode,
1051
+ });
1052
+ }
1053
+ };
1054
+ export const deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand = async (output, context) => {
1055
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1056
+ return deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError(output, context);
1057
+ }
1058
+ const contents = map({
1059
+ $metadata: deserializeMetadata(output),
1743
1060
  });
1744
- }); };
1745
- var deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1746
- var parsedOutput, _a, errorCode, _b, parsedBody;
1747
- var _c;
1748
- return __generator(this, function (_d) {
1749
- switch (_d.label) {
1750
- case 0:
1751
- _a = [__assign({}, output)];
1752
- _c = {};
1753
- return [4, parseErrorBody(output.body, context)];
1754
- case 1:
1755
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1756
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1757
- _b = errorCode;
1758
- switch (_b) {
1759
- case "BadRequestException": return [3, 2];
1760
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1761
- case "ForbiddenException": return [3, 4];
1762
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1763
- case "ServiceFailureException": return [3, 6];
1764
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1765
- case "ServiceUnavailableException": return [3, 8];
1766
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1767
- case "ThrottledClientException": return [3, 10];
1768
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1769
- case "UnauthorizedClientException": return [3, 12];
1770
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1771
- }
1772
- return [3, 14];
1773
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1774
- case 3: throw _d.sent();
1775
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1776
- case 5: throw _d.sent();
1777
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1778
- case 7: throw _d.sent();
1779
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1780
- case 9: throw _d.sent();
1781
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1782
- case 11: throw _d.sent();
1783
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1784
- case 13: throw _d.sent();
1785
- case 14:
1786
- parsedBody = parsedOutput.body;
1787
- throwDefaultError({
1788
- output: output,
1789
- parsedBody: parsedBody,
1790
- exceptionCtor: __BaseException,
1791
- errorCode: errorCode,
1792
- });
1793
- _d.label = 15;
1794
- case 15: return [2];
1795
- }
1061
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1062
+ if (data.AppInstanceRetentionSettings != null) {
1063
+ contents.AppInstanceRetentionSettings = deserializeAws_restJson1AppInstanceRetentionSettings(data.AppInstanceRetentionSettings, context);
1064
+ }
1065
+ if (data.InitiateDeletionTimestamp != null) {
1066
+ contents.InitiateDeletionTimestamp = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.InitiateDeletionTimestamp)));
1067
+ }
1068
+ return contents;
1069
+ };
1070
+ const deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError = async (output, context) => {
1071
+ const parsedOutput = {
1072
+ ...output,
1073
+ body: await parseErrorBody(output.body, context),
1074
+ };
1075
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1076
+ switch (errorCode) {
1077
+ case "BadRequestException":
1078
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1079
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1080
+ case "ForbiddenException":
1081
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1082
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1083
+ case "ServiceFailureException":
1084
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1085
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1086
+ case "ServiceUnavailableException":
1087
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1088
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1089
+ case "ThrottledClientException":
1090
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1091
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1092
+ case "UnauthorizedClientException":
1093
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1094
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1095
+ default:
1096
+ const parsedBody = parsedOutput.body;
1097
+ throwDefaultError({
1098
+ output,
1099
+ parsedBody,
1100
+ exceptionCtor: __BaseException,
1101
+ errorCode,
1102
+ });
1103
+ }
1104
+ };
1105
+ export const deserializeAws_restJson1ListAppInstanceAdminsCommand = async (output, context) => {
1106
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1107
+ return deserializeAws_restJson1ListAppInstanceAdminsCommandError(output, context);
1108
+ }
1109
+ const contents = map({
1110
+ $metadata: deserializeMetadata(output),
1796
1111
  });
1797
- }); };
1798
- export var deserializeAws_restJson1ListAppInstanceUsersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1799
- var contents, data, _a, _b;
1800
- return __generator(this, function (_c) {
1801
- switch (_c.label) {
1802
- case 0:
1803
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1804
- return [2, deserializeAws_restJson1ListAppInstanceUsersCommandError(output, context)];
1805
- }
1806
- contents = map({
1807
- $metadata: deserializeMetadata(output),
1808
- });
1809
- _a = __expectNonNull;
1810
- _b = __expectObject;
1811
- return [4, parseBody(output.body, context)];
1812
- case 1:
1813
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1814
- if (data.AppInstanceArn != null) {
1815
- contents.AppInstanceArn = __expectString(data.AppInstanceArn);
1816
- }
1817
- if (data.AppInstanceUsers != null) {
1818
- contents.AppInstanceUsers = deserializeAws_restJson1AppInstanceUserList(data.AppInstanceUsers, context);
1819
- }
1820
- if (data.NextToken != null) {
1821
- contents.NextToken = __expectString(data.NextToken);
1822
- }
1823
- return [2, contents];
1824
- }
1112
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1113
+ if (data.AppInstanceAdmins != null) {
1114
+ contents.AppInstanceAdmins = deserializeAws_restJson1AppInstanceAdminList(data.AppInstanceAdmins, context);
1115
+ }
1116
+ if (data.AppInstanceArn != null) {
1117
+ contents.AppInstanceArn = __expectString(data.AppInstanceArn);
1118
+ }
1119
+ if (data.NextToken != null) {
1120
+ contents.NextToken = __expectString(data.NextToken);
1121
+ }
1122
+ return contents;
1123
+ };
1124
+ const deserializeAws_restJson1ListAppInstanceAdminsCommandError = async (output, context) => {
1125
+ const parsedOutput = {
1126
+ ...output,
1127
+ body: await parseErrorBody(output.body, context),
1128
+ };
1129
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1130
+ switch (errorCode) {
1131
+ case "BadRequestException":
1132
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1133
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1134
+ case "ForbiddenException":
1135
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1136
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1137
+ case "ResourceLimitExceededException":
1138
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
1139
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
1140
+ case "ServiceFailureException":
1141
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1142
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1143
+ case "ServiceUnavailableException":
1144
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1145
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1146
+ case "ThrottledClientException":
1147
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1148
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1149
+ case "UnauthorizedClientException":
1150
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1151
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1152
+ default:
1153
+ const parsedBody = parsedOutput.body;
1154
+ throwDefaultError({
1155
+ output,
1156
+ parsedBody,
1157
+ exceptionCtor: __BaseException,
1158
+ errorCode,
1159
+ });
1160
+ }
1161
+ };
1162
+ export const deserializeAws_restJson1ListAppInstancesCommand = async (output, context) => {
1163
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1164
+ return deserializeAws_restJson1ListAppInstancesCommandError(output, context);
1165
+ }
1166
+ const contents = map({
1167
+ $metadata: deserializeMetadata(output),
1825
1168
  });
1826
- }); };
1827
- var deserializeAws_restJson1ListAppInstanceUsersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1828
- var parsedOutput, _a, errorCode, _b, parsedBody;
1829
- var _c;
1830
- return __generator(this, function (_d) {
1831
- switch (_d.label) {
1832
- case 0:
1833
- _a = [__assign({}, output)];
1834
- _c = {};
1835
- return [4, parseErrorBody(output.body, context)];
1836
- case 1:
1837
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1838
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1839
- _b = errorCode;
1840
- switch (_b) {
1841
- case "BadRequestException": return [3, 2];
1842
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1843
- case "ForbiddenException": return [3, 4];
1844
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1845
- case "ServiceFailureException": return [3, 6];
1846
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1847
- case "ServiceUnavailableException": return [3, 8];
1848
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1849
- case "ThrottledClientException": return [3, 10];
1850
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1851
- case "UnauthorizedClientException": return [3, 12];
1852
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1853
- }
1854
- return [3, 14];
1855
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1856
- case 3: throw _d.sent();
1857
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1858
- case 5: throw _d.sent();
1859
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1860
- case 7: throw _d.sent();
1861
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1862
- case 9: throw _d.sent();
1863
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1864
- case 11: throw _d.sent();
1865
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1866
- case 13: throw _d.sent();
1867
- case 14:
1868
- parsedBody = parsedOutput.body;
1869
- throwDefaultError({
1870
- output: output,
1871
- parsedBody: parsedBody,
1872
- exceptionCtor: __BaseException,
1873
- errorCode: errorCode,
1874
- });
1875
- _d.label = 15;
1876
- case 15: return [2];
1877
- }
1169
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1170
+ if (data.AppInstances != null) {
1171
+ contents.AppInstances = deserializeAws_restJson1AppInstanceList(data.AppInstances, context);
1172
+ }
1173
+ if (data.NextToken != null) {
1174
+ contents.NextToken = __expectString(data.NextToken);
1175
+ }
1176
+ return contents;
1177
+ };
1178
+ const deserializeAws_restJson1ListAppInstancesCommandError = async (output, context) => {
1179
+ const parsedOutput = {
1180
+ ...output,
1181
+ body: await parseErrorBody(output.body, context),
1182
+ };
1183
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1184
+ switch (errorCode) {
1185
+ case "BadRequestException":
1186
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1187
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1188
+ case "ForbiddenException":
1189
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1190
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1191
+ case "ServiceFailureException":
1192
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1193
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1194
+ case "ServiceUnavailableException":
1195
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1196
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1197
+ case "ThrottledClientException":
1198
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1199
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1200
+ case "UnauthorizedClientException":
1201
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1202
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1203
+ default:
1204
+ const parsedBody = parsedOutput.body;
1205
+ throwDefaultError({
1206
+ output,
1207
+ parsedBody,
1208
+ exceptionCtor: __BaseException,
1209
+ errorCode,
1210
+ });
1211
+ }
1212
+ };
1213
+ export const deserializeAws_restJson1ListAppInstanceUserEndpointsCommand = async (output, context) => {
1214
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1215
+ return deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError(output, context);
1216
+ }
1217
+ const contents = map({
1218
+ $metadata: deserializeMetadata(output),
1878
1219
  });
1879
- }); };
1880
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1881
- var contents, data, _a, _b;
1882
- return __generator(this, function (_c) {
1883
- switch (_c.label) {
1884
- case 0:
1885
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1886
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1887
- }
1888
- contents = map({
1889
- $metadata: deserializeMetadata(output),
1890
- });
1891
- _a = __expectNonNull;
1892
- _b = __expectObject;
1893
- return [4, parseBody(output.body, context)];
1894
- case 1:
1895
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1896
- if (data.Tags != null) {
1897
- contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
1898
- }
1899
- return [2, contents];
1900
- }
1220
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1221
+ if (data.AppInstanceUserEndpoints != null) {
1222
+ contents.AppInstanceUserEndpoints = deserializeAws_restJson1AppInstanceUserEndpointSummaryList(data.AppInstanceUserEndpoints, context);
1223
+ }
1224
+ if (data.NextToken != null) {
1225
+ contents.NextToken = __expectString(data.NextToken);
1226
+ }
1227
+ return contents;
1228
+ };
1229
+ const deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError = async (output, context) => {
1230
+ const parsedOutput = {
1231
+ ...output,
1232
+ body: await parseErrorBody(output.body, context),
1233
+ };
1234
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1235
+ switch (errorCode) {
1236
+ case "BadRequestException":
1237
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1238
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1239
+ case "ForbiddenException":
1240
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1241
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1242
+ case "ServiceFailureException":
1243
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1244
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1245
+ case "ServiceUnavailableException":
1246
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1247
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1248
+ case "ThrottledClientException":
1249
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1250
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1251
+ case "UnauthorizedClientException":
1252
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1253
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1254
+ default:
1255
+ const parsedBody = parsedOutput.body;
1256
+ throwDefaultError({
1257
+ output,
1258
+ parsedBody,
1259
+ exceptionCtor: __BaseException,
1260
+ errorCode,
1261
+ });
1262
+ }
1263
+ };
1264
+ export const deserializeAws_restJson1ListAppInstanceUsersCommand = async (output, context) => {
1265
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1266
+ return deserializeAws_restJson1ListAppInstanceUsersCommandError(output, context);
1267
+ }
1268
+ const contents = map({
1269
+ $metadata: deserializeMetadata(output),
1901
1270
  });
1902
- }); };
1903
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1904
- var parsedOutput, _a, errorCode, _b, parsedBody;
1905
- var _c;
1906
- return __generator(this, function (_d) {
1907
- switch (_d.label) {
1908
- case 0:
1909
- _a = [__assign({}, output)];
1910
- _c = {};
1911
- return [4, parseErrorBody(output.body, context)];
1912
- case 1:
1913
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1914
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1915
- _b = errorCode;
1916
- switch (_b) {
1917
- case "BadRequestException": return [3, 2];
1918
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1919
- case "ForbiddenException": return [3, 4];
1920
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
1921
- case "ServiceFailureException": return [3, 6];
1922
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
1923
- case "ServiceUnavailableException": return [3, 8];
1924
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
1925
- case "ThrottledClientException": return [3, 10];
1926
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
1927
- case "UnauthorizedClientException": return [3, 12];
1928
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
1929
- }
1930
- return [3, 14];
1931
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1932
- case 3: throw _d.sent();
1933
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1934
- case 5: throw _d.sent();
1935
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
1936
- case 7: throw _d.sent();
1937
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1938
- case 9: throw _d.sent();
1939
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
1940
- case 11: throw _d.sent();
1941
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
1942
- case 13: throw _d.sent();
1943
- case 14:
1944
- parsedBody = parsedOutput.body;
1945
- throwDefaultError({
1946
- output: output,
1947
- parsedBody: parsedBody,
1948
- exceptionCtor: __BaseException,
1949
- errorCode: errorCode,
1950
- });
1951
- _d.label = 15;
1952
- case 15: return [2];
1953
- }
1271
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1272
+ if (data.AppInstanceArn != null) {
1273
+ contents.AppInstanceArn = __expectString(data.AppInstanceArn);
1274
+ }
1275
+ if (data.AppInstanceUsers != null) {
1276
+ contents.AppInstanceUsers = deserializeAws_restJson1AppInstanceUserList(data.AppInstanceUsers, context);
1277
+ }
1278
+ if (data.NextToken != null) {
1279
+ contents.NextToken = __expectString(data.NextToken);
1280
+ }
1281
+ return contents;
1282
+ };
1283
+ const deserializeAws_restJson1ListAppInstanceUsersCommandError = async (output, context) => {
1284
+ const parsedOutput = {
1285
+ ...output,
1286
+ body: await parseErrorBody(output.body, context),
1287
+ };
1288
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1289
+ switch (errorCode) {
1290
+ case "BadRequestException":
1291
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1292
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1293
+ case "ForbiddenException":
1294
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1295
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1296
+ case "ServiceFailureException":
1297
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1298
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1299
+ case "ServiceUnavailableException":
1300
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1301
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1302
+ case "ThrottledClientException":
1303
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1304
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1305
+ case "UnauthorizedClientException":
1306
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1307
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1308
+ default:
1309
+ const parsedBody = parsedOutput.body;
1310
+ throwDefaultError({
1311
+ output,
1312
+ parsedBody,
1313
+ exceptionCtor: __BaseException,
1314
+ errorCode,
1315
+ });
1316
+ }
1317
+ };
1318
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1319
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1320
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1321
+ }
1322
+ const contents = map({
1323
+ $metadata: deserializeMetadata(output),
1954
1324
  });
1955
- }); };
1956
- export var deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1957
- var contents, data, _a, _b;
1958
- return __generator(this, function (_c) {
1959
- switch (_c.label) {
1960
- case 0:
1961
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1962
- return [2, deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError(output, context)];
1963
- }
1964
- contents = map({
1965
- $metadata: deserializeMetadata(output),
1966
- });
1967
- _a = __expectNonNull;
1968
- _b = __expectObject;
1969
- return [4, parseBody(output.body, context)];
1970
- case 1:
1971
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1972
- if (data.AppInstanceRetentionSettings != null) {
1973
- contents.AppInstanceRetentionSettings = deserializeAws_restJson1AppInstanceRetentionSettings(data.AppInstanceRetentionSettings, context);
1974
- }
1975
- if (data.InitiateDeletionTimestamp != null) {
1976
- contents.InitiateDeletionTimestamp = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.InitiateDeletionTimestamp)));
1977
- }
1978
- return [2, contents];
1979
- }
1325
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1326
+ if (data.Tags != null) {
1327
+ contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
1328
+ }
1329
+ return contents;
1330
+ };
1331
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
1332
+ const parsedOutput = {
1333
+ ...output,
1334
+ body: await parseErrorBody(output.body, context),
1335
+ };
1336
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1337
+ switch (errorCode) {
1338
+ case "BadRequestException":
1339
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1340
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1341
+ case "ForbiddenException":
1342
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1343
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1344
+ case "ServiceFailureException":
1345
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1346
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1347
+ case "ServiceUnavailableException":
1348
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1349
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1350
+ case "ThrottledClientException":
1351
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1352
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1353
+ case "UnauthorizedClientException":
1354
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1355
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1356
+ default:
1357
+ const parsedBody = parsedOutput.body;
1358
+ throwDefaultError({
1359
+ output,
1360
+ parsedBody,
1361
+ exceptionCtor: __BaseException,
1362
+ errorCode,
1363
+ });
1364
+ }
1365
+ };
1366
+ export const deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand = async (output, context) => {
1367
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1368
+ return deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError(output, context);
1369
+ }
1370
+ const contents = map({
1371
+ $metadata: deserializeMetadata(output),
1980
1372
  });
1981
- }); };
1982
- var deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1983
- var parsedOutput, _a, errorCode, _b, parsedBody;
1984
- var _c;
1985
- return __generator(this, function (_d) {
1986
- switch (_d.label) {
1987
- case 0:
1988
- _a = [__assign({}, output)];
1989
- _c = {};
1990
- return [4, parseErrorBody(output.body, context)];
1991
- case 1:
1992
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1993
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1994
- _b = errorCode;
1995
- switch (_b) {
1996
- case "BadRequestException": return [3, 2];
1997
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
1998
- case "ForbiddenException": return [3, 4];
1999
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
2000
- case "ServiceFailureException": return [3, 6];
2001
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
2002
- case "ServiceUnavailableException": return [3, 8];
2003
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
2004
- case "ThrottledClientException": return [3, 10];
2005
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
2006
- case "UnauthorizedClientException": return [3, 12];
2007
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
2008
- }
2009
- return [3, 14];
2010
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2011
- case 3: throw _d.sent();
2012
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2013
- case 5: throw _d.sent();
2014
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
2015
- case 7: throw _d.sent();
2016
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
2017
- case 9: throw _d.sent();
2018
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
2019
- case 11: throw _d.sent();
2020
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
2021
- case 13: throw _d.sent();
2022
- case 14:
2023
- parsedBody = parsedOutput.body;
2024
- throwDefaultError({
2025
- output: output,
2026
- parsedBody: parsedBody,
2027
- exceptionCtor: __BaseException,
2028
- errorCode: errorCode,
2029
- });
2030
- _d.label = 15;
2031
- case 15: return [2];
2032
- }
1373
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1374
+ if (data.AppInstanceRetentionSettings != null) {
1375
+ contents.AppInstanceRetentionSettings = deserializeAws_restJson1AppInstanceRetentionSettings(data.AppInstanceRetentionSettings, context);
1376
+ }
1377
+ if (data.InitiateDeletionTimestamp != null) {
1378
+ contents.InitiateDeletionTimestamp = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.InitiateDeletionTimestamp)));
1379
+ }
1380
+ return contents;
1381
+ };
1382
+ const deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError = async (output, context) => {
1383
+ const parsedOutput = {
1384
+ ...output,
1385
+ body: await parseErrorBody(output.body, context),
1386
+ };
1387
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1388
+ switch (errorCode) {
1389
+ case "BadRequestException":
1390
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1391
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1392
+ case "ForbiddenException":
1393
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1394
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1395
+ case "ServiceFailureException":
1396
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1397
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1398
+ case "ServiceUnavailableException":
1399
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1400
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1401
+ case "ThrottledClientException":
1402
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1403
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1404
+ case "UnauthorizedClientException":
1405
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1406
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1407
+ default:
1408
+ const parsedBody = parsedOutput.body;
1409
+ throwDefaultError({
1410
+ output,
1411
+ parsedBody,
1412
+ exceptionCtor: __BaseException,
1413
+ errorCode,
1414
+ });
1415
+ }
1416
+ };
1417
+ export const deserializeAws_restJson1RegisterAppInstanceUserEndpointCommand = async (output, context) => {
1418
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1419
+ return deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError(output, context);
1420
+ }
1421
+ const contents = map({
1422
+ $metadata: deserializeMetadata(output),
2033
1423
  });
2034
- }); };
2035
- export var deserializeAws_restJson1RegisterAppInstanceUserEndpointCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2036
- var contents, data, _a, _b;
2037
- return __generator(this, function (_c) {
2038
- switch (_c.label) {
2039
- case 0:
2040
- if (output.statusCode !== 201 && output.statusCode >= 300) {
2041
- return [2, deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError(output, context)];
2042
- }
2043
- contents = map({
2044
- $metadata: deserializeMetadata(output),
2045
- });
2046
- _a = __expectNonNull;
2047
- _b = __expectObject;
2048
- return [4, parseBody(output.body, context)];
2049
- case 1:
2050
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2051
- if (data.AppInstanceUserArn != null) {
2052
- contents.AppInstanceUserArn = __expectString(data.AppInstanceUserArn);
2053
- }
2054
- if (data.EndpointId != null) {
2055
- contents.EndpointId = __expectString(data.EndpointId);
2056
- }
2057
- return [2, contents];
2058
- }
1424
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1425
+ if (data.AppInstanceUserArn != null) {
1426
+ contents.AppInstanceUserArn = __expectString(data.AppInstanceUserArn);
1427
+ }
1428
+ if (data.EndpointId != null) {
1429
+ contents.EndpointId = __expectString(data.EndpointId);
1430
+ }
1431
+ return contents;
1432
+ };
1433
+ const deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError = async (output, context) => {
1434
+ const parsedOutput = {
1435
+ ...output,
1436
+ body: await parseErrorBody(output.body, context),
1437
+ };
1438
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1439
+ switch (errorCode) {
1440
+ case "BadRequestException":
1441
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1442
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1443
+ case "ConflictException":
1444
+ case "com.amazonaws.chimesdkidentity#ConflictException":
1445
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1446
+ case "ForbiddenException":
1447
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1448
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1449
+ case "ResourceLimitExceededException":
1450
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
1451
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
1452
+ case "ServiceFailureException":
1453
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1454
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1455
+ case "ServiceUnavailableException":
1456
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1457
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1458
+ case "ThrottledClientException":
1459
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1460
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1461
+ case "UnauthorizedClientException":
1462
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1463
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1464
+ default:
1465
+ const parsedBody = parsedOutput.body;
1466
+ throwDefaultError({
1467
+ output,
1468
+ parsedBody,
1469
+ exceptionCtor: __BaseException,
1470
+ errorCode,
1471
+ });
1472
+ }
1473
+ };
1474
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1475
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1476
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1477
+ }
1478
+ const contents = map({
1479
+ $metadata: deserializeMetadata(output),
2059
1480
  });
2060
- }); };
2061
- var deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2062
- var parsedOutput, _a, errorCode, _b, parsedBody;
2063
- var _c;
2064
- return __generator(this, function (_d) {
2065
- switch (_d.label) {
2066
- case 0:
2067
- _a = [__assign({}, output)];
2068
- _c = {};
2069
- return [4, parseErrorBody(output.body, context)];
2070
- case 1:
2071
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2072
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2073
- _b = errorCode;
2074
- switch (_b) {
2075
- case "BadRequestException": return [3, 2];
2076
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
2077
- case "ConflictException": return [3, 4];
2078
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
2079
- case "ForbiddenException": return [3, 6];
2080
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
2081
- case "ResourceLimitExceededException": return [3, 8];
2082
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 8];
2083
- case "ServiceFailureException": return [3, 10];
2084
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 10];
2085
- case "ServiceUnavailableException": return [3, 12];
2086
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 12];
2087
- case "ThrottledClientException": return [3, 14];
2088
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 14];
2089
- case "UnauthorizedClientException": return [3, 16];
2090
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 16];
2091
- }
2092
- return [3, 18];
2093
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2094
- case 3: throw _d.sent();
2095
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2096
- case 5: throw _d.sent();
2097
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2098
- case 7: throw _d.sent();
2099
- case 8: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
2100
- case 9: throw _d.sent();
2101
- case 10: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
2102
- case 11: throw _d.sent();
2103
- case 12: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
2104
- case 13: throw _d.sent();
2105
- case 14: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
2106
- case 15: throw _d.sent();
2107
- case 16: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
2108
- case 17: throw _d.sent();
2109
- case 18:
2110
- parsedBody = parsedOutput.body;
2111
- throwDefaultError({
2112
- output: output,
2113
- parsedBody: parsedBody,
2114
- exceptionCtor: __BaseException,
2115
- errorCode: errorCode,
2116
- });
2117
- _d.label = 19;
2118
- case 19: return [2];
2119
- }
1481
+ await collectBody(output.body, context);
1482
+ return contents;
1483
+ };
1484
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1485
+ const parsedOutput = {
1486
+ ...output,
1487
+ body: await parseErrorBody(output.body, context),
1488
+ };
1489
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1490
+ switch (errorCode) {
1491
+ case "BadRequestException":
1492
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1493
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1494
+ case "ForbiddenException":
1495
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1496
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1497
+ case "ResourceLimitExceededException":
1498
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
1499
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
1500
+ case "ServiceFailureException":
1501
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1502
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1503
+ case "ServiceUnavailableException":
1504
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1505
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1506
+ case "ThrottledClientException":
1507
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1508
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1509
+ case "UnauthorizedClientException":
1510
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1511
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1512
+ default:
1513
+ const parsedBody = parsedOutput.body;
1514
+ throwDefaultError({
1515
+ output,
1516
+ parsedBody,
1517
+ exceptionCtor: __BaseException,
1518
+ errorCode,
1519
+ });
1520
+ }
1521
+ };
1522
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1523
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1524
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1525
+ }
1526
+ const contents = map({
1527
+ $metadata: deserializeMetadata(output),
2120
1528
  });
2121
- }); };
2122
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2123
- var contents;
2124
- return __generator(this, function (_a) {
2125
- switch (_a.label) {
2126
- case 0:
2127
- if (output.statusCode !== 204 && output.statusCode >= 300) {
2128
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2129
- }
2130
- contents = map({
2131
- $metadata: deserializeMetadata(output),
2132
- });
2133
- return [4, collectBody(output.body, context)];
2134
- case 1:
2135
- _a.sent();
2136
- return [2, contents];
2137
- }
1529
+ await collectBody(output.body, context);
1530
+ return contents;
1531
+ };
1532
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1533
+ const parsedOutput = {
1534
+ ...output,
1535
+ body: await parseErrorBody(output.body, context),
1536
+ };
1537
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1538
+ switch (errorCode) {
1539
+ case "BadRequestException":
1540
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1541
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1542
+ case "ForbiddenException":
1543
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1544
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1545
+ case "ServiceFailureException":
1546
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1547
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1548
+ case "ServiceUnavailableException":
1549
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1550
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1551
+ case "ThrottledClientException":
1552
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1553
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1554
+ case "UnauthorizedClientException":
1555
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1556
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1557
+ default:
1558
+ const parsedBody = parsedOutput.body;
1559
+ throwDefaultError({
1560
+ output,
1561
+ parsedBody,
1562
+ exceptionCtor: __BaseException,
1563
+ errorCode,
1564
+ });
1565
+ }
1566
+ };
1567
+ export const deserializeAws_restJson1UpdateAppInstanceCommand = async (output, context) => {
1568
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1569
+ return deserializeAws_restJson1UpdateAppInstanceCommandError(output, context);
1570
+ }
1571
+ const contents = map({
1572
+ $metadata: deserializeMetadata(output),
2138
1573
  });
2139
- }); };
2140
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2141
- var parsedOutput, _a, errorCode, _b, parsedBody;
2142
- var _c;
2143
- return __generator(this, function (_d) {
2144
- switch (_d.label) {
2145
- case 0:
2146
- _a = [__assign({}, output)];
2147
- _c = {};
2148
- return [4, parseErrorBody(output.body, context)];
2149
- case 1:
2150
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2151
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2152
- _b = errorCode;
2153
- switch (_b) {
2154
- case "BadRequestException": return [3, 2];
2155
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
2156
- case "ForbiddenException": return [3, 4];
2157
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
2158
- case "ResourceLimitExceededException": return [3, 6];
2159
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 6];
2160
- case "ServiceFailureException": return [3, 8];
2161
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 8];
2162
- case "ServiceUnavailableException": return [3, 10];
2163
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 10];
2164
- case "ThrottledClientException": return [3, 12];
2165
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 12];
2166
- case "UnauthorizedClientException": return [3, 14];
2167
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 14];
2168
- }
2169
- return [3, 16];
2170
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2171
- case 3: throw _d.sent();
2172
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2173
- case 5: throw _d.sent();
2174
- case 6: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
2175
- case 7: throw _d.sent();
2176
- case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
2177
- case 9: throw _d.sent();
2178
- case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
2179
- case 11: throw _d.sent();
2180
- case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
2181
- case 13: throw _d.sent();
2182
- case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
2183
- case 15: throw _d.sent();
2184
- case 16:
2185
- parsedBody = parsedOutput.body;
2186
- throwDefaultError({
2187
- output: output,
2188
- parsedBody: parsedBody,
2189
- exceptionCtor: __BaseException,
2190
- errorCode: errorCode,
2191
- });
2192
- _d.label = 17;
2193
- case 17: return [2];
2194
- }
1574
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1575
+ if (data.AppInstanceArn != null) {
1576
+ contents.AppInstanceArn = __expectString(data.AppInstanceArn);
1577
+ }
1578
+ return contents;
1579
+ };
1580
+ const deserializeAws_restJson1UpdateAppInstanceCommandError = async (output, context) => {
1581
+ const parsedOutput = {
1582
+ ...output,
1583
+ body: await parseErrorBody(output.body, context),
1584
+ };
1585
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1586
+ switch (errorCode) {
1587
+ case "BadRequestException":
1588
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1589
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1590
+ case "ConflictException":
1591
+ case "com.amazonaws.chimesdkidentity#ConflictException":
1592
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1593
+ case "ForbiddenException":
1594
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1595
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1596
+ case "ServiceFailureException":
1597
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1598
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1599
+ case "ServiceUnavailableException":
1600
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1601
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1602
+ case "ThrottledClientException":
1603
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1604
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1605
+ case "UnauthorizedClientException":
1606
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1607
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1608
+ default:
1609
+ const parsedBody = parsedOutput.body;
1610
+ throwDefaultError({
1611
+ output,
1612
+ parsedBody,
1613
+ exceptionCtor: __BaseException,
1614
+ errorCode,
1615
+ });
1616
+ }
1617
+ };
1618
+ export const deserializeAws_restJson1UpdateAppInstanceUserCommand = async (output, context) => {
1619
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1620
+ return deserializeAws_restJson1UpdateAppInstanceUserCommandError(output, context);
1621
+ }
1622
+ const contents = map({
1623
+ $metadata: deserializeMetadata(output),
2195
1624
  });
2196
- }); };
2197
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2198
- var contents;
2199
- return __generator(this, function (_a) {
2200
- switch (_a.label) {
2201
- case 0:
2202
- if (output.statusCode !== 204 && output.statusCode >= 300) {
2203
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2204
- }
2205
- contents = map({
2206
- $metadata: deserializeMetadata(output),
2207
- });
2208
- return [4, collectBody(output.body, context)];
2209
- case 1:
2210
- _a.sent();
2211
- return [2, contents];
2212
- }
1625
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1626
+ if (data.AppInstanceUserArn != null) {
1627
+ contents.AppInstanceUserArn = __expectString(data.AppInstanceUserArn);
1628
+ }
1629
+ return contents;
1630
+ };
1631
+ const deserializeAws_restJson1UpdateAppInstanceUserCommandError = async (output, context) => {
1632
+ const parsedOutput = {
1633
+ ...output,
1634
+ body: await parseErrorBody(output.body, context),
1635
+ };
1636
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1637
+ switch (errorCode) {
1638
+ case "BadRequestException":
1639
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1640
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1641
+ case "ConflictException":
1642
+ case "com.amazonaws.chimesdkidentity#ConflictException":
1643
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1644
+ case "ForbiddenException":
1645
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1646
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1647
+ case "ResourceLimitExceededException":
1648
+ case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException":
1649
+ throw await deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context);
1650
+ case "ServiceFailureException":
1651
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1652
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1653
+ case "ServiceUnavailableException":
1654
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1655
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1656
+ case "ThrottledClientException":
1657
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1658
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1659
+ case "UnauthorizedClientException":
1660
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1661
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1662
+ default:
1663
+ const parsedBody = parsedOutput.body;
1664
+ throwDefaultError({
1665
+ output,
1666
+ parsedBody,
1667
+ exceptionCtor: __BaseException,
1668
+ errorCode,
1669
+ });
1670
+ }
1671
+ };
1672
+ export const deserializeAws_restJson1UpdateAppInstanceUserEndpointCommand = async (output, context) => {
1673
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1674
+ return deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError(output, context);
1675
+ }
1676
+ const contents = map({
1677
+ $metadata: deserializeMetadata(output),
2213
1678
  });
2214
- }); };
2215
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2216
- var parsedOutput, _a, errorCode, _b, parsedBody;
2217
- var _c;
2218
- return __generator(this, function (_d) {
2219
- switch (_d.label) {
2220
- case 0:
2221
- _a = [__assign({}, output)];
2222
- _c = {};
2223
- return [4, parseErrorBody(output.body, context)];
2224
- case 1:
2225
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2226
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2227
- _b = errorCode;
2228
- switch (_b) {
2229
- case "BadRequestException": return [3, 2];
2230
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
2231
- case "ForbiddenException": return [3, 4];
2232
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 4];
2233
- case "ServiceFailureException": return [3, 6];
2234
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 6];
2235
- case "ServiceUnavailableException": return [3, 8];
2236
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 8];
2237
- case "ThrottledClientException": return [3, 10];
2238
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 10];
2239
- case "UnauthorizedClientException": return [3, 12];
2240
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 12];
2241
- }
2242
- return [3, 14];
2243
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2244
- case 3: throw _d.sent();
2245
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2246
- case 5: throw _d.sent();
2247
- case 6: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
2248
- case 7: throw _d.sent();
2249
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
2250
- case 9: throw _d.sent();
2251
- case 10: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
2252
- case 11: throw _d.sent();
2253
- case 12: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
2254
- case 13: throw _d.sent();
2255
- case 14:
2256
- parsedBody = parsedOutput.body;
2257
- throwDefaultError({
2258
- output: output,
2259
- parsedBody: parsedBody,
2260
- exceptionCtor: __BaseException,
2261
- errorCode: errorCode,
2262
- });
2263
- _d.label = 15;
2264
- case 15: return [2];
2265
- }
1679
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1680
+ if (data.AppInstanceUserArn != null) {
1681
+ contents.AppInstanceUserArn = __expectString(data.AppInstanceUserArn);
1682
+ }
1683
+ if (data.EndpointId != null) {
1684
+ contents.EndpointId = __expectString(data.EndpointId);
1685
+ }
1686
+ return contents;
1687
+ };
1688
+ const deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError = async (output, context) => {
1689
+ const parsedOutput = {
1690
+ ...output,
1691
+ body: await parseErrorBody(output.body, context),
1692
+ };
1693
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1694
+ switch (errorCode) {
1695
+ case "BadRequestException":
1696
+ case "com.amazonaws.chimesdkidentity#BadRequestException":
1697
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1698
+ case "ConflictException":
1699
+ case "com.amazonaws.chimesdkidentity#ConflictException":
1700
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1701
+ case "ForbiddenException":
1702
+ case "com.amazonaws.chimesdkidentity#ForbiddenException":
1703
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1704
+ case "ServiceFailureException":
1705
+ case "com.amazonaws.chimesdkidentity#ServiceFailureException":
1706
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
1707
+ case "ServiceUnavailableException":
1708
+ case "com.amazonaws.chimesdkidentity#ServiceUnavailableException":
1709
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1710
+ case "ThrottledClientException":
1711
+ case "com.amazonaws.chimesdkidentity#ThrottledClientException":
1712
+ throw await deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context);
1713
+ case "UnauthorizedClientException":
1714
+ case "com.amazonaws.chimesdkidentity#UnauthorizedClientException":
1715
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1716
+ default:
1717
+ const parsedBody = parsedOutput.body;
1718
+ throwDefaultError({
1719
+ output,
1720
+ parsedBody,
1721
+ exceptionCtor: __BaseException,
1722
+ errorCode,
1723
+ });
1724
+ }
1725
+ };
1726
+ const map = __map;
1727
+ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
1728
+ const contents = map({});
1729
+ const data = parsedOutput.body;
1730
+ if (data.Code != null) {
1731
+ contents.Code = __expectString(data.Code);
1732
+ }
1733
+ if (data.Message != null) {
1734
+ contents.Message = __expectString(data.Message);
1735
+ }
1736
+ const exception = new BadRequestException({
1737
+ $metadata: deserializeMetadata(parsedOutput),
1738
+ ...contents,
2266
1739
  });
2267
- }); };
2268
- export var deserializeAws_restJson1UpdateAppInstanceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2269
- var contents, data, _a, _b;
2270
- return __generator(this, function (_c) {
2271
- switch (_c.label) {
2272
- case 0:
2273
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2274
- return [2, deserializeAws_restJson1UpdateAppInstanceCommandError(output, context)];
2275
- }
2276
- contents = map({
2277
- $metadata: deserializeMetadata(output),
2278
- });
2279
- _a = __expectNonNull;
2280
- _b = __expectObject;
2281
- return [4, parseBody(output.body, context)];
2282
- case 1:
2283
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2284
- if (data.AppInstanceArn != null) {
2285
- contents.AppInstanceArn = __expectString(data.AppInstanceArn);
2286
- }
2287
- return [2, contents];
2288
- }
1740
+ return __decorateServiceException(exception, parsedOutput.body);
1741
+ };
1742
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1743
+ const contents = map({});
1744
+ const data = parsedOutput.body;
1745
+ if (data.Code != null) {
1746
+ contents.Code = __expectString(data.Code);
1747
+ }
1748
+ if (data.Message != null) {
1749
+ contents.Message = __expectString(data.Message);
1750
+ }
1751
+ const exception = new ConflictException({
1752
+ $metadata: deserializeMetadata(parsedOutput),
1753
+ ...contents,
2289
1754
  });
2290
- }); };
2291
- var deserializeAws_restJson1UpdateAppInstanceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2292
- var parsedOutput, _a, errorCode, _b, parsedBody;
2293
- var _c;
2294
- return __generator(this, function (_d) {
2295
- switch (_d.label) {
2296
- case 0:
2297
- _a = [__assign({}, output)];
2298
- _c = {};
2299
- return [4, parseErrorBody(output.body, context)];
2300
- case 1:
2301
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2302
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2303
- _b = errorCode;
2304
- switch (_b) {
2305
- case "BadRequestException": return [3, 2];
2306
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
2307
- case "ConflictException": return [3, 4];
2308
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
2309
- case "ForbiddenException": return [3, 6];
2310
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
2311
- case "ServiceFailureException": return [3, 8];
2312
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 8];
2313
- case "ServiceUnavailableException": return [3, 10];
2314
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 10];
2315
- case "ThrottledClientException": return [3, 12];
2316
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 12];
2317
- case "UnauthorizedClientException": return [3, 14];
2318
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 14];
2319
- }
2320
- return [3, 16];
2321
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2322
- case 3: throw _d.sent();
2323
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2324
- case 5: throw _d.sent();
2325
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2326
- case 7: throw _d.sent();
2327
- case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
2328
- case 9: throw _d.sent();
2329
- case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
2330
- case 11: throw _d.sent();
2331
- case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
2332
- case 13: throw _d.sent();
2333
- case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
2334
- case 15: throw _d.sent();
2335
- case 16:
2336
- parsedBody = parsedOutput.body;
2337
- throwDefaultError({
2338
- output: output,
2339
- parsedBody: parsedBody,
2340
- exceptionCtor: __BaseException,
2341
- errorCode: errorCode,
2342
- });
2343
- _d.label = 17;
2344
- case 17: return [2];
2345
- }
1755
+ return __decorateServiceException(exception, parsedOutput.body);
1756
+ };
1757
+ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
1758
+ const contents = map({});
1759
+ const data = parsedOutput.body;
1760
+ if (data.Code != null) {
1761
+ contents.Code = __expectString(data.Code);
1762
+ }
1763
+ if (data.Message != null) {
1764
+ contents.Message = __expectString(data.Message);
1765
+ }
1766
+ const exception = new ForbiddenException({
1767
+ $metadata: deserializeMetadata(parsedOutput),
1768
+ ...contents,
2346
1769
  });
2347
- }); };
2348
- export var deserializeAws_restJson1UpdateAppInstanceUserCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2349
- var contents, data, _a, _b;
2350
- return __generator(this, function (_c) {
2351
- switch (_c.label) {
2352
- case 0:
2353
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2354
- return [2, deserializeAws_restJson1UpdateAppInstanceUserCommandError(output, context)];
2355
- }
2356
- contents = map({
2357
- $metadata: deserializeMetadata(output),
2358
- });
2359
- _a = __expectNonNull;
2360
- _b = __expectObject;
2361
- return [4, parseBody(output.body, context)];
2362
- case 1:
2363
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2364
- if (data.AppInstanceUserArn != null) {
2365
- contents.AppInstanceUserArn = __expectString(data.AppInstanceUserArn);
2366
- }
2367
- return [2, contents];
2368
- }
1770
+ return __decorateServiceException(exception, parsedOutput.body);
1771
+ };
1772
+ const deserializeAws_restJson1ResourceLimitExceededExceptionResponse = async (parsedOutput, context) => {
1773
+ const contents = map({});
1774
+ const data = parsedOutput.body;
1775
+ if (data.Code != null) {
1776
+ contents.Code = __expectString(data.Code);
1777
+ }
1778
+ if (data.Message != null) {
1779
+ contents.Message = __expectString(data.Message);
1780
+ }
1781
+ const exception = new ResourceLimitExceededException({
1782
+ $metadata: deserializeMetadata(parsedOutput),
1783
+ ...contents,
2369
1784
  });
2370
- }); };
2371
- var deserializeAws_restJson1UpdateAppInstanceUserCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2372
- var parsedOutput, _a, errorCode, _b, parsedBody;
2373
- var _c;
2374
- return __generator(this, function (_d) {
2375
- switch (_d.label) {
2376
- case 0:
2377
- _a = [__assign({}, output)];
2378
- _c = {};
2379
- return [4, parseErrorBody(output.body, context)];
2380
- case 1:
2381
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2382
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2383
- _b = errorCode;
2384
- switch (_b) {
2385
- case "BadRequestException": return [3, 2];
2386
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
2387
- case "ConflictException": return [3, 4];
2388
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
2389
- case "ForbiddenException": return [3, 6];
2390
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
2391
- case "ResourceLimitExceededException": return [3, 8];
2392
- case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": return [3, 8];
2393
- case "ServiceFailureException": return [3, 10];
2394
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 10];
2395
- case "ServiceUnavailableException": return [3, 12];
2396
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 12];
2397
- case "ThrottledClientException": return [3, 14];
2398
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 14];
2399
- case "UnauthorizedClientException": return [3, 16];
2400
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 16];
2401
- }
2402
- return [3, 18];
2403
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2404
- case 3: throw _d.sent();
2405
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2406
- case 5: throw _d.sent();
2407
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2408
- case 7: throw _d.sent();
2409
- case 8: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
2410
- case 9: throw _d.sent();
2411
- case 10: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
2412
- case 11: throw _d.sent();
2413
- case 12: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
2414
- case 13: throw _d.sent();
2415
- case 14: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
2416
- case 15: throw _d.sent();
2417
- case 16: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
2418
- case 17: throw _d.sent();
2419
- case 18:
2420
- parsedBody = parsedOutput.body;
2421
- throwDefaultError({
2422
- output: output,
2423
- parsedBody: parsedBody,
2424
- exceptionCtor: __BaseException,
2425
- errorCode: errorCode,
2426
- });
2427
- _d.label = 19;
2428
- case 19: return [2];
2429
- }
1785
+ return __decorateServiceException(exception, parsedOutput.body);
1786
+ };
1787
+ const deserializeAws_restJson1ServiceFailureExceptionResponse = async (parsedOutput, context) => {
1788
+ const contents = map({});
1789
+ const data = parsedOutput.body;
1790
+ if (data.Code != null) {
1791
+ contents.Code = __expectString(data.Code);
1792
+ }
1793
+ if (data.Message != null) {
1794
+ contents.Message = __expectString(data.Message);
1795
+ }
1796
+ const exception = new ServiceFailureException({
1797
+ $metadata: deserializeMetadata(parsedOutput),
1798
+ ...contents,
2430
1799
  });
2431
- }); };
2432
- export var deserializeAws_restJson1UpdateAppInstanceUserEndpointCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2433
- var contents, data, _a, _b;
2434
- return __generator(this, function (_c) {
2435
- switch (_c.label) {
2436
- case 0:
2437
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2438
- return [2, deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError(output, context)];
2439
- }
2440
- contents = map({
2441
- $metadata: deserializeMetadata(output),
2442
- });
2443
- _a = __expectNonNull;
2444
- _b = __expectObject;
2445
- return [4, parseBody(output.body, context)];
2446
- case 1:
2447
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2448
- if (data.AppInstanceUserArn != null) {
2449
- contents.AppInstanceUserArn = __expectString(data.AppInstanceUserArn);
2450
- }
2451
- if (data.EndpointId != null) {
2452
- contents.EndpointId = __expectString(data.EndpointId);
2453
- }
2454
- return [2, contents];
2455
- }
1800
+ return __decorateServiceException(exception, parsedOutput.body);
1801
+ };
1802
+ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
1803
+ const contents = map({});
1804
+ const data = parsedOutput.body;
1805
+ if (data.Code != null) {
1806
+ contents.Code = __expectString(data.Code);
1807
+ }
1808
+ if (data.Message != null) {
1809
+ contents.Message = __expectString(data.Message);
1810
+ }
1811
+ const exception = new ServiceUnavailableException({
1812
+ $metadata: deserializeMetadata(parsedOutput),
1813
+ ...contents,
2456
1814
  });
2457
- }); };
2458
- var deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2459
- var parsedOutput, _a, errorCode, _b, parsedBody;
2460
- var _c;
2461
- return __generator(this, function (_d) {
2462
- switch (_d.label) {
2463
- case 0:
2464
- _a = [__assign({}, output)];
2465
- _c = {};
2466
- return [4, parseErrorBody(output.body, context)];
2467
- case 1:
2468
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2469
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2470
- _b = errorCode;
2471
- switch (_b) {
2472
- case "BadRequestException": return [3, 2];
2473
- case "com.amazonaws.chimesdkidentity#BadRequestException": return [3, 2];
2474
- case "ConflictException": return [3, 4];
2475
- case "com.amazonaws.chimesdkidentity#ConflictException": return [3, 4];
2476
- case "ForbiddenException": return [3, 6];
2477
- case "com.amazonaws.chimesdkidentity#ForbiddenException": return [3, 6];
2478
- case "ServiceFailureException": return [3, 8];
2479
- case "com.amazonaws.chimesdkidentity#ServiceFailureException": return [3, 8];
2480
- case "ServiceUnavailableException": return [3, 10];
2481
- case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": return [3, 10];
2482
- case "ThrottledClientException": return [3, 12];
2483
- case "com.amazonaws.chimesdkidentity#ThrottledClientException": return [3, 12];
2484
- case "UnauthorizedClientException": return [3, 14];
2485
- case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": return [3, 14];
2486
- }
2487
- return [3, 16];
2488
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
2489
- case 3: throw _d.sent();
2490
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2491
- case 5: throw _d.sent();
2492
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
2493
- case 7: throw _d.sent();
2494
- case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
2495
- case 9: throw _d.sent();
2496
- case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
2497
- case 11: throw _d.sent();
2498
- case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
2499
- case 13: throw _d.sent();
2500
- case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
2501
- case 15: throw _d.sent();
2502
- case 16:
2503
- parsedBody = parsedOutput.body;
2504
- throwDefaultError({
2505
- output: output,
2506
- parsedBody: parsedBody,
2507
- exceptionCtor: __BaseException,
2508
- errorCode: errorCode,
2509
- });
2510
- _d.label = 17;
2511
- case 17: return [2];
2512
- }
1815
+ return __decorateServiceException(exception, parsedOutput.body);
1816
+ };
1817
+ const deserializeAws_restJson1ThrottledClientExceptionResponse = async (parsedOutput, context) => {
1818
+ const contents = map({});
1819
+ const data = parsedOutput.body;
1820
+ if (data.Code != null) {
1821
+ contents.Code = __expectString(data.Code);
1822
+ }
1823
+ if (data.Message != null) {
1824
+ contents.Message = __expectString(data.Message);
1825
+ }
1826
+ const exception = new ThrottledClientException({
1827
+ $metadata: deserializeMetadata(parsedOutput),
1828
+ ...contents,
2513
1829
  });
2514
- }); };
2515
- var map = __map;
2516
- var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2517
- var contents, data, exception;
2518
- return __generator(this, function (_a) {
2519
- contents = map({});
2520
- data = parsedOutput.body;
2521
- if (data.Code != null) {
2522
- contents.Code = __expectString(data.Code);
2523
- }
2524
- if (data.Message != null) {
2525
- contents.Message = __expectString(data.Message);
2526
- }
2527
- exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2528
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2529
- });
2530
- }); };
2531
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2532
- var contents, data, exception;
2533
- return __generator(this, function (_a) {
2534
- contents = map({});
2535
- data = parsedOutput.body;
2536
- if (data.Code != null) {
2537
- contents.Code = __expectString(data.Code);
2538
- }
2539
- if (data.Message != null) {
2540
- contents.Message = __expectString(data.Message);
2541
- }
2542
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2543
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2544
- });
2545
- }); };
2546
- var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2547
- var contents, data, exception;
2548
- return __generator(this, function (_a) {
2549
- contents = map({});
2550
- data = parsedOutput.body;
2551
- if (data.Code != null) {
2552
- contents.Code = __expectString(data.Code);
2553
- }
2554
- if (data.Message != null) {
2555
- contents.Message = __expectString(data.Message);
2556
- }
2557
- exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2558
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2559
- });
2560
- }); };
2561
- var deserializeAws_restJson1ResourceLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2562
- var contents, data, exception;
2563
- return __generator(this, function (_a) {
2564
- contents = map({});
2565
- data = parsedOutput.body;
2566
- if (data.Code != null) {
2567
- contents.Code = __expectString(data.Code);
2568
- }
2569
- if (data.Message != null) {
2570
- contents.Message = __expectString(data.Message);
2571
- }
2572
- exception = new ResourceLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2573
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2574
- });
2575
- }); };
2576
- var deserializeAws_restJson1ServiceFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2577
- var contents, data, exception;
2578
- return __generator(this, function (_a) {
2579
- contents = map({});
2580
- data = parsedOutput.body;
2581
- if (data.Code != null) {
2582
- contents.Code = __expectString(data.Code);
2583
- }
2584
- if (data.Message != null) {
2585
- contents.Message = __expectString(data.Message);
2586
- }
2587
- exception = new ServiceFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2588
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2589
- });
2590
- }); };
2591
- var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2592
- var contents, data, exception;
2593
- return __generator(this, function (_a) {
2594
- contents = map({});
2595
- data = parsedOutput.body;
2596
- if (data.Code != null) {
2597
- contents.Code = __expectString(data.Code);
2598
- }
2599
- if (data.Message != null) {
2600
- contents.Message = __expectString(data.Message);
2601
- }
2602
- exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2603
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2604
- });
2605
- }); };
2606
- var deserializeAws_restJson1ThrottledClientExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2607
- var contents, data, exception;
2608
- return __generator(this, function (_a) {
2609
- contents = map({});
2610
- data = parsedOutput.body;
2611
- if (data.Code != null) {
2612
- contents.Code = __expectString(data.Code);
2613
- }
2614
- if (data.Message != null) {
2615
- contents.Message = __expectString(data.Message);
2616
- }
2617
- exception = new ThrottledClientException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2618
- return [2, __decorateServiceException(exception, parsedOutput.body)];
2619
- });
2620
- }); };
2621
- var deserializeAws_restJson1UnauthorizedClientExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2622
- var contents, data, exception;
2623
- return __generator(this, function (_a) {
2624
- contents = map({});
2625
- data = parsedOutput.body;
2626
- if (data.Code != null) {
2627
- contents.Code = __expectString(data.Code);
2628
- }
2629
- if (data.Message != null) {
2630
- contents.Message = __expectString(data.Message);
2631
- }
2632
- exception = new UnauthorizedClientException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
2633
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1830
+ return __decorateServiceException(exception, parsedOutput.body);
1831
+ };
1832
+ const deserializeAws_restJson1UnauthorizedClientExceptionResponse = async (parsedOutput, context) => {
1833
+ const contents = map({});
1834
+ const data = parsedOutput.body;
1835
+ if (data.Code != null) {
1836
+ contents.Code = __expectString(data.Code);
1837
+ }
1838
+ if (data.Message != null) {
1839
+ contents.Message = __expectString(data.Message);
1840
+ }
1841
+ const exception = new UnauthorizedClientException({
1842
+ $metadata: deserializeMetadata(parsedOutput),
1843
+ ...contents,
2634
1844
  });
2635
- }); };
2636
- var serializeAws_restJson1AppInstanceRetentionSettings = function (input, context) {
2637
- return __assign({}, (input.ChannelRetentionSettings != null && {
2638
- ChannelRetentionSettings: serializeAws_restJson1ChannelRetentionSettings(input.ChannelRetentionSettings, context),
2639
- }));
1845
+ return __decorateServiceException(exception, parsedOutput.body);
1846
+ };
1847
+ const serializeAws_restJson1AppInstanceRetentionSettings = (input, context) => {
1848
+ return {
1849
+ ...(input.ChannelRetentionSettings != null && {
1850
+ ChannelRetentionSettings: serializeAws_restJson1ChannelRetentionSettings(input.ChannelRetentionSettings, context),
1851
+ }),
1852
+ };
2640
1853
  };
2641
- var serializeAws_restJson1ChannelRetentionSettings = function (input, context) {
2642
- return __assign({}, (input.RetentionDays != null && { RetentionDays: input.RetentionDays }));
1854
+ const serializeAws_restJson1ChannelRetentionSettings = (input, context) => {
1855
+ return {
1856
+ ...(input.RetentionDays != null && { RetentionDays: input.RetentionDays }),
1857
+ };
2643
1858
  };
2644
- var serializeAws_restJson1EndpointAttributes = function (input, context) {
2645
- return __assign(__assign({}, (input.DeviceToken != null && { DeviceToken: input.DeviceToken })), (input.VoipDeviceToken != null && { VoipDeviceToken: input.VoipDeviceToken }));
1859
+ const serializeAws_restJson1EndpointAttributes = (input, context) => {
1860
+ return {
1861
+ ...(input.DeviceToken != null && { DeviceToken: input.DeviceToken }),
1862
+ ...(input.VoipDeviceToken != null && { VoipDeviceToken: input.VoipDeviceToken }),
1863
+ };
2646
1864
  };
2647
- var serializeAws_restJson1Tag = function (input, context) {
2648
- return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
1865
+ const serializeAws_restJson1Tag = (input, context) => {
1866
+ return {
1867
+ ...(input.Key != null && { Key: input.Key }),
1868
+ ...(input.Value != null && { Value: input.Value }),
1869
+ };
2649
1870
  };
2650
- var serializeAws_restJson1TagKeyList = function (input, context) {
1871
+ const serializeAws_restJson1TagKeyList = (input, context) => {
2651
1872
  return input
2652
- .filter(function (e) { return e != null; })
2653
- .map(function (entry) {
1873
+ .filter((e) => e != null)
1874
+ .map((entry) => {
2654
1875
  return entry;
2655
1876
  });
2656
1877
  };
2657
- var serializeAws_restJson1TagList = function (input, context) {
1878
+ const serializeAws_restJson1TagList = (input, context) => {
2658
1879
  return input
2659
- .filter(function (e) { return e != null; })
2660
- .map(function (entry) {
1880
+ .filter((e) => e != null)
1881
+ .map((entry) => {
2661
1882
  return serializeAws_restJson1Tag(entry, context);
2662
1883
  });
2663
1884
  };
2664
- var deserializeAws_restJson1AppInstance = function (output, context) {
1885
+ const deserializeAws_restJson1AppInstance = (output, context) => {
2665
1886
  return {
2666
1887
  AppInstanceArn: __expectString(output.AppInstanceArn),
2667
1888
  CreatedTimestamp: output.CreatedTimestamp != null
@@ -2674,7 +1895,7 @@ var deserializeAws_restJson1AppInstance = function (output, context) {
2674
1895
  Name: __expectString(output.Name),
2675
1896
  };
2676
1897
  };
2677
- var deserializeAws_restJson1AppInstanceAdmin = function (output, context) {
1898
+ const deserializeAws_restJson1AppInstanceAdmin = (output, context) => {
2678
1899
  return {
2679
1900
  Admin: output.Admin != null ? deserializeAws_restJson1Identity(output.Admin, context) : undefined,
2680
1901
  AppInstanceArn: __expectString(output.AppInstanceArn),
@@ -2683,10 +1904,10 @@ var deserializeAws_restJson1AppInstanceAdmin = function (output, context) {
2683
1904
  : undefined,
2684
1905
  };
2685
1906
  };
2686
- var deserializeAws_restJson1AppInstanceAdminList = function (output, context) {
2687
- var retVal = (output || [])
2688
- .filter(function (e) { return e != null; })
2689
- .map(function (entry) {
1907
+ const deserializeAws_restJson1AppInstanceAdminList = (output, context) => {
1908
+ const retVal = (output || [])
1909
+ .filter((e) => e != null)
1910
+ .map((entry) => {
2690
1911
  if (entry === null) {
2691
1912
  return null;
2692
1913
  }
@@ -2694,15 +1915,15 @@ var deserializeAws_restJson1AppInstanceAdminList = function (output, context) {
2694
1915
  });
2695
1916
  return retVal;
2696
1917
  };
2697
- var deserializeAws_restJson1AppInstanceAdminSummary = function (output, context) {
1918
+ const deserializeAws_restJson1AppInstanceAdminSummary = (output, context) => {
2698
1919
  return {
2699
1920
  Admin: output.Admin != null ? deserializeAws_restJson1Identity(output.Admin, context) : undefined,
2700
1921
  };
2701
1922
  };
2702
- var deserializeAws_restJson1AppInstanceList = function (output, context) {
2703
- var retVal = (output || [])
2704
- .filter(function (e) { return e != null; })
2705
- .map(function (entry) {
1923
+ const deserializeAws_restJson1AppInstanceList = (output, context) => {
1924
+ const retVal = (output || [])
1925
+ .filter((e) => e != null)
1926
+ .map((entry) => {
2706
1927
  if (entry === null) {
2707
1928
  return null;
2708
1929
  }
@@ -2710,21 +1931,21 @@ var deserializeAws_restJson1AppInstanceList = function (output, context) {
2710
1931
  });
2711
1932
  return retVal;
2712
1933
  };
2713
- var deserializeAws_restJson1AppInstanceRetentionSettings = function (output, context) {
1934
+ const deserializeAws_restJson1AppInstanceRetentionSettings = (output, context) => {
2714
1935
  return {
2715
1936
  ChannelRetentionSettings: output.ChannelRetentionSettings != null
2716
1937
  ? deserializeAws_restJson1ChannelRetentionSettings(output.ChannelRetentionSettings, context)
2717
1938
  : undefined,
2718
1939
  };
2719
1940
  };
2720
- var deserializeAws_restJson1AppInstanceSummary = function (output, context) {
1941
+ const deserializeAws_restJson1AppInstanceSummary = (output, context) => {
2721
1942
  return {
2722
1943
  AppInstanceArn: __expectString(output.AppInstanceArn),
2723
1944
  Metadata: __expectString(output.Metadata),
2724
1945
  Name: __expectString(output.Name),
2725
1946
  };
2726
1947
  };
2727
- var deserializeAws_restJson1AppInstanceUser = function (output, context) {
1948
+ const deserializeAws_restJson1AppInstanceUser = (output, context) => {
2728
1949
  return {
2729
1950
  AppInstanceUserArn: __expectString(output.AppInstanceUserArn),
2730
1951
  CreatedTimestamp: output.CreatedTimestamp != null
@@ -2737,7 +1958,7 @@ var deserializeAws_restJson1AppInstanceUser = function (output, context) {
2737
1958
  Name: __expectString(output.Name),
2738
1959
  };
2739
1960
  };
2740
- var deserializeAws_restJson1AppInstanceUserEndpoint = function (output, context) {
1961
+ const deserializeAws_restJson1AppInstanceUserEndpoint = (output, context) => {
2741
1962
  return {
2742
1963
  AllowMessages: __expectString(output.AllowMessages),
2743
1964
  AppInstanceUserArn: __expectString(output.AppInstanceUserArn),
@@ -2757,7 +1978,7 @@ var deserializeAws_restJson1AppInstanceUserEndpoint = function (output, context)
2757
1978
  Type: __expectString(output.Type),
2758
1979
  };
2759
1980
  };
2760
- var deserializeAws_restJson1AppInstanceUserEndpointSummary = function (output, context) {
1981
+ const deserializeAws_restJson1AppInstanceUserEndpointSummary = (output, context) => {
2761
1982
  return {
2762
1983
  AllowMessages: __expectString(output.AllowMessages),
2763
1984
  AppInstanceUserArn: __expectString(output.AppInstanceUserArn),
@@ -2767,10 +1988,10 @@ var deserializeAws_restJson1AppInstanceUserEndpointSummary = function (output, c
2767
1988
  Type: __expectString(output.Type),
2768
1989
  };
2769
1990
  };
2770
- var deserializeAws_restJson1AppInstanceUserEndpointSummaryList = function (output, context) {
2771
- var retVal = (output || [])
2772
- .filter(function (e) { return e != null; })
2773
- .map(function (entry) {
1991
+ const deserializeAws_restJson1AppInstanceUserEndpointSummaryList = (output, context) => {
1992
+ const retVal = (output || [])
1993
+ .filter((e) => e != null)
1994
+ .map((entry) => {
2774
1995
  if (entry === null) {
2775
1996
  return null;
2776
1997
  }
@@ -2778,10 +1999,10 @@ var deserializeAws_restJson1AppInstanceUserEndpointSummaryList = function (outpu
2778
1999
  });
2779
2000
  return retVal;
2780
2001
  };
2781
- var deserializeAws_restJson1AppInstanceUserList = function (output, context) {
2782
- var retVal = (output || [])
2783
- .filter(function (e) { return e != null; })
2784
- .map(function (entry) {
2002
+ const deserializeAws_restJson1AppInstanceUserList = (output, context) => {
2003
+ const retVal = (output || [])
2004
+ .filter((e) => e != null)
2005
+ .map((entry) => {
2785
2006
  if (entry === null) {
2786
2007
  return null;
2787
2008
  }
@@ -2789,46 +2010,46 @@ var deserializeAws_restJson1AppInstanceUserList = function (output, context) {
2789
2010
  });
2790
2011
  return retVal;
2791
2012
  };
2792
- var deserializeAws_restJson1AppInstanceUserSummary = function (output, context) {
2013
+ const deserializeAws_restJson1AppInstanceUserSummary = (output, context) => {
2793
2014
  return {
2794
2015
  AppInstanceUserArn: __expectString(output.AppInstanceUserArn),
2795
2016
  Metadata: __expectString(output.Metadata),
2796
2017
  Name: __expectString(output.Name),
2797
2018
  };
2798
2019
  };
2799
- var deserializeAws_restJson1ChannelRetentionSettings = function (output, context) {
2020
+ const deserializeAws_restJson1ChannelRetentionSettings = (output, context) => {
2800
2021
  return {
2801
2022
  RetentionDays: __expectInt32(output.RetentionDays),
2802
2023
  };
2803
2024
  };
2804
- var deserializeAws_restJson1EndpointAttributes = function (output, context) {
2025
+ const deserializeAws_restJson1EndpointAttributes = (output, context) => {
2805
2026
  return {
2806
2027
  DeviceToken: __expectString(output.DeviceToken),
2807
2028
  VoipDeviceToken: __expectString(output.VoipDeviceToken),
2808
2029
  };
2809
2030
  };
2810
- var deserializeAws_restJson1EndpointState = function (output, context) {
2031
+ const deserializeAws_restJson1EndpointState = (output, context) => {
2811
2032
  return {
2812
2033
  Status: __expectString(output.Status),
2813
2034
  StatusReason: __expectString(output.StatusReason),
2814
2035
  };
2815
2036
  };
2816
- var deserializeAws_restJson1Identity = function (output, context) {
2037
+ const deserializeAws_restJson1Identity = (output, context) => {
2817
2038
  return {
2818
2039
  Arn: __expectString(output.Arn),
2819
2040
  Name: __expectString(output.Name),
2820
2041
  };
2821
2042
  };
2822
- var deserializeAws_restJson1Tag = function (output, context) {
2043
+ const deserializeAws_restJson1Tag = (output, context) => {
2823
2044
  return {
2824
2045
  Key: __expectString(output.Key),
2825
2046
  Value: __expectString(output.Value),
2826
2047
  };
2827
2048
  };
2828
- var deserializeAws_restJson1TagList = function (output, context) {
2829
- var retVal = (output || [])
2830
- .filter(function (e) { return e != null; })
2831
- .map(function (entry) {
2049
+ const deserializeAws_restJson1TagList = (output, context) => {
2050
+ const retVal = (output || [])
2051
+ .filter((e) => e != null)
2052
+ .map((entry) => {
2832
2053
  if (entry === null) {
2833
2054
  return null;
2834
2055
  }
@@ -2836,57 +2057,39 @@ var deserializeAws_restJson1TagList = function (output, context) {
2836
2057
  });
2837
2058
  return retVal;
2838
2059
  };
2839
- var deserializeMetadata = function (output) {
2840
- var _a;
2841
- return ({
2842
- httpStatusCode: output.statusCode,
2843
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
2844
- extendedRequestId: output.headers["x-amz-id-2"],
2845
- cfId: output.headers["x-amz-cf-id"],
2846
- });
2847
- };
2848
- var collectBody = function (streamBody, context) {
2849
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
2060
+ const deserializeMetadata = (output) => ({
2061
+ httpStatusCode: output.statusCode,
2062
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
2063
+ extendedRequestId: output.headers["x-amz-id-2"],
2064
+ cfId: output.headers["x-amz-cf-id"],
2065
+ });
2066
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2850
2067
  if (streamBody instanceof Uint8Array) {
2851
2068
  return Promise.resolve(streamBody);
2852
2069
  }
2853
2070
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2854
2071
  };
2855
- var collectBodyString = function (streamBody, context) {
2856
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2857
- };
2858
- var isSerializableHeaderValue = function (value) {
2859
- return value !== undefined &&
2860
- value !== null &&
2861
- value !== "" &&
2862
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2863
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2072
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2073
+ const isSerializableHeaderValue = (value) => value !== undefined &&
2074
+ value !== null &&
2075
+ value !== "" &&
2076
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2077
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2078
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2079
+ if (encoded.length) {
2080
+ return JSON.parse(encoded);
2081
+ }
2082
+ return {};
2083
+ });
2084
+ const parseErrorBody = async (errorBody, context) => {
2085
+ const value = await parseBody(errorBody, context);
2086
+ value.message = value.message ?? value.Message;
2087
+ return value;
2864
2088
  };
2865
- var parseBody = function (streamBody, context) {
2866
- return collectBodyString(streamBody, context).then(function (encoded) {
2867
- if (encoded.length) {
2868
- return JSON.parse(encoded);
2869
- }
2870
- return {};
2871
- });
2872
- };
2873
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2874
- var value;
2875
- var _a;
2876
- return __generator(this, function (_b) {
2877
- switch (_b.label) {
2878
- case 0: return [4, parseBody(errorBody, context)];
2879
- case 1:
2880
- value = _b.sent();
2881
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2882
- return [2, value];
2883
- }
2884
- });
2885
- }); };
2886
- var loadRestJsonErrorCode = function (output, data) {
2887
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2888
- var sanitizeErrorCode = function (rawValue) {
2889
- var cleanValue = rawValue;
2089
+ const loadRestJsonErrorCode = (output, data) => {
2090
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2091
+ const sanitizeErrorCode = (rawValue) => {
2092
+ let cleanValue = rawValue;
2890
2093
  if (typeof cleanValue === "number") {
2891
2094
  cleanValue = cleanValue.toString();
2892
2095
  }
@@ -2901,7 +2104,7 @@ var loadRestJsonErrorCode = function (output, data) {
2901
2104
  }
2902
2105
  return cleanValue;
2903
2106
  };
2904
- var headerKey = findKey(output.headers, "x-amzn-errortype");
2107
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2905
2108
  if (headerKey !== undefined) {
2906
2109
  return sanitizeErrorCode(output.headers[headerKey]);
2907
2110
  }