@aws-sdk/client-chime-sdk-identity 3.141.0 → 3.150.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.
@@ -37,16 +37,7 @@ const serializeAws_restJson1CreateAppInstanceAdminCommand = async (input, contex
37
37
  "content-type": "application/json",
38
38
  };
39
39
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}/admins";
40
- if (input.AppInstanceArn !== undefined) {
41
- const labelValue = input.AppInstanceArn;
42
- if (labelValue.length <= 0) {
43
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
44
- }
45
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
46
- }
47
- else {
48
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
49
- }
40
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
50
41
  let body;
51
42
  body = JSON.stringify({
52
43
  ...(input.AppInstanceAdminArn != null && { AppInstanceAdminArn: input.AppInstanceAdminArn }),
@@ -93,16 +84,7 @@ const serializeAws_restJson1DeleteAppInstanceCommand = async (input, context) =>
93
84
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
94
85
  const headers = {};
95
86
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}";
96
- if (input.AppInstanceArn !== undefined) {
97
- const labelValue = input.AppInstanceArn;
98
- if (labelValue.length <= 0) {
99
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
100
- }
101
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
102
- }
103
- else {
104
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
105
- }
87
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
106
88
  let body;
107
89
  return new protocol_http_1.HttpRequest({
108
90
  protocol,
@@ -120,26 +102,8 @@ const serializeAws_restJson1DeleteAppInstanceAdminCommand = async (input, contex
120
102
  const headers = {};
121
103
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
122
104
  "/app-instances/{AppInstanceArn}/admins/{AppInstanceAdminArn}";
123
- if (input.AppInstanceAdminArn !== undefined) {
124
- const labelValue = input.AppInstanceAdminArn;
125
- if (labelValue.length <= 0) {
126
- throw new Error("Empty value provided for input HTTP label: AppInstanceAdminArn.");
127
- }
128
- resolvedPath = resolvedPath.replace("{AppInstanceAdminArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
129
- }
130
- else {
131
- throw new Error("No value provided for input HTTP label: AppInstanceAdminArn.");
132
- }
133
- if (input.AppInstanceArn !== undefined) {
134
- const labelValue = input.AppInstanceArn;
135
- if (labelValue.length <= 0) {
136
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
137
- }
138
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
139
- }
140
- else {
141
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
142
- }
105
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceAdminArn", () => input.AppInstanceAdminArn, "{AppInstanceAdminArn}", false);
106
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
143
107
  let body;
144
108
  return new protocol_http_1.HttpRequest({
145
109
  protocol,
@@ -156,16 +120,7 @@ const serializeAws_restJson1DeleteAppInstanceUserCommand = async (input, context
156
120
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
157
121
  const headers = {};
158
122
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users/{AppInstanceUserArn}";
159
- if (input.AppInstanceUserArn !== undefined) {
160
- const labelValue = input.AppInstanceUserArn;
161
- if (labelValue.length <= 0) {
162
- throw new Error("Empty value provided for input HTTP label: AppInstanceUserArn.");
163
- }
164
- resolvedPath = resolvedPath.replace("{AppInstanceUserArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
165
- }
166
- else {
167
- throw new Error("No value provided for input HTTP label: AppInstanceUserArn.");
168
- }
123
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
169
124
  let body;
170
125
  return new protocol_http_1.HttpRequest({
171
126
  protocol,
@@ -183,26 +138,8 @@ const serializeAws_restJson1DeregisterAppInstanceUserEndpointCommand = async (in
183
138
  const headers = {};
184
139
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
185
140
  "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
186
- if (input.AppInstanceUserArn !== undefined) {
187
- const labelValue = input.AppInstanceUserArn;
188
- if (labelValue.length <= 0) {
189
- throw new Error("Empty value provided for input HTTP label: AppInstanceUserArn.");
190
- }
191
- resolvedPath = resolvedPath.replace("{AppInstanceUserArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
192
- }
193
- else {
194
- throw new Error("No value provided for input HTTP label: AppInstanceUserArn.");
195
- }
196
- if (input.EndpointId !== undefined) {
197
- const labelValue = input.EndpointId;
198
- if (labelValue.length <= 0) {
199
- throw new Error("Empty value provided for input HTTP label: EndpointId.");
200
- }
201
- resolvedPath = resolvedPath.replace("{EndpointId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
202
- }
203
- else {
204
- throw new Error("No value provided for input HTTP label: EndpointId.");
205
- }
141
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
142
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EndpointId", () => input.EndpointId, "{EndpointId}", false);
206
143
  let body;
207
144
  return new protocol_http_1.HttpRequest({
208
145
  protocol,
@@ -219,16 +156,7 @@ const serializeAws_restJson1DescribeAppInstanceCommand = async (input, context)
219
156
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
220
157
  const headers = {};
221
158
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}";
222
- if (input.AppInstanceArn !== undefined) {
223
- const labelValue = input.AppInstanceArn;
224
- if (labelValue.length <= 0) {
225
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
226
- }
227
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
228
- }
229
- else {
230
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
231
- }
159
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
232
160
  let body;
233
161
  return new protocol_http_1.HttpRequest({
234
162
  protocol,
@@ -246,26 +174,8 @@ const serializeAws_restJson1DescribeAppInstanceAdminCommand = async (input, cont
246
174
  const headers = {};
247
175
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
248
176
  "/app-instances/{AppInstanceArn}/admins/{AppInstanceAdminArn}";
249
- if (input.AppInstanceAdminArn !== undefined) {
250
- const labelValue = input.AppInstanceAdminArn;
251
- if (labelValue.length <= 0) {
252
- throw new Error("Empty value provided for input HTTP label: AppInstanceAdminArn.");
253
- }
254
- resolvedPath = resolvedPath.replace("{AppInstanceAdminArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
255
- }
256
- else {
257
- throw new Error("No value provided for input HTTP label: AppInstanceAdminArn.");
258
- }
259
- if (input.AppInstanceArn !== undefined) {
260
- const labelValue = input.AppInstanceArn;
261
- if (labelValue.length <= 0) {
262
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
263
- }
264
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
265
- }
266
- else {
267
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
268
- }
177
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceAdminArn", () => input.AppInstanceAdminArn, "{AppInstanceAdminArn}", false);
178
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
269
179
  let body;
270
180
  return new protocol_http_1.HttpRequest({
271
181
  protocol,
@@ -282,16 +192,7 @@ const serializeAws_restJson1DescribeAppInstanceUserCommand = async (input, conte
282
192
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
283
193
  const headers = {};
284
194
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users/{AppInstanceUserArn}";
285
- if (input.AppInstanceUserArn !== undefined) {
286
- const labelValue = input.AppInstanceUserArn;
287
- if (labelValue.length <= 0) {
288
- throw new Error("Empty value provided for input HTTP label: AppInstanceUserArn.");
289
- }
290
- resolvedPath = resolvedPath.replace("{AppInstanceUserArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
291
- }
292
- else {
293
- throw new Error("No value provided for input HTTP label: AppInstanceUserArn.");
294
- }
195
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
295
196
  let body;
296
197
  return new protocol_http_1.HttpRequest({
297
198
  protocol,
@@ -309,26 +210,8 @@ const serializeAws_restJson1DescribeAppInstanceUserEndpointCommand = async (inpu
309
210
  const headers = {};
310
211
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
311
212
  "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
312
- if (input.AppInstanceUserArn !== undefined) {
313
- const labelValue = input.AppInstanceUserArn;
314
- if (labelValue.length <= 0) {
315
- throw new Error("Empty value provided for input HTTP label: AppInstanceUserArn.");
316
- }
317
- resolvedPath = resolvedPath.replace("{AppInstanceUserArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
318
- }
319
- else {
320
- throw new Error("No value provided for input HTTP label: AppInstanceUserArn.");
321
- }
322
- if (input.EndpointId !== undefined) {
323
- const labelValue = input.EndpointId;
324
- if (labelValue.length <= 0) {
325
- throw new Error("Empty value provided for input HTTP label: EndpointId.");
326
- }
327
- resolvedPath = resolvedPath.replace("{EndpointId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
328
- }
329
- else {
330
- throw new Error("No value provided for input HTTP label: EndpointId.");
331
- }
213
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
214
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EndpointId", () => input.EndpointId, "{EndpointId}", false);
332
215
  let body;
333
216
  return new protocol_http_1.HttpRequest({
334
217
  protocol,
@@ -346,16 +229,7 @@ const serializeAws_restJson1GetAppInstanceRetentionSettingsCommand = async (inpu
346
229
  const headers = {};
347
230
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
348
231
  "/app-instances/{AppInstanceArn}/retention-settings";
349
- if (input.AppInstanceArn !== undefined) {
350
- const labelValue = input.AppInstanceArn;
351
- if (labelValue.length <= 0) {
352
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
353
- }
354
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
355
- }
356
- else {
357
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
358
- }
232
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
359
233
  let body;
360
234
  return new protocol_http_1.HttpRequest({
361
235
  protocol,
@@ -372,20 +246,11 @@ const serializeAws_restJson1ListAppInstanceAdminsCommand = async (input, context
372
246
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
373
247
  const headers = {};
374
248
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}/admins";
375
- if (input.AppInstanceArn !== undefined) {
376
- const labelValue = input.AppInstanceArn;
377
- if (labelValue.length <= 0) {
378
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
379
- }
380
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
381
- }
382
- else {
383
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
384
- }
385
- const query = {
386
- ...(input.MaxResults !== undefined && { "max-results": input.MaxResults.toString() }),
387
- ...(input.NextToken !== undefined && { "next-token": input.NextToken }),
388
- };
249
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
250
+ const query = map({
251
+ "max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
252
+ "next-token": [, input.NextToken],
253
+ });
389
254
  let body;
390
255
  return new protocol_http_1.HttpRequest({
391
256
  protocol,
@@ -403,10 +268,10 @@ const serializeAws_restJson1ListAppInstancesCommand = async (input, context) =>
403
268
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
404
269
  const headers = {};
405
270
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances";
406
- const query = {
407
- ...(input.MaxResults !== undefined && { "max-results": input.MaxResults.toString() }),
408
- ...(input.NextToken !== undefined && { "next-token": input.NextToken }),
409
- };
271
+ const query = map({
272
+ "max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
273
+ "next-token": [, input.NextToken],
274
+ });
410
275
  let body;
411
276
  return new protocol_http_1.HttpRequest({
412
277
  protocol,
@@ -425,20 +290,11 @@ const serializeAws_restJson1ListAppInstanceUserEndpointsCommand = async (input,
425
290
  const headers = {};
426
291
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
427
292
  "/app-instance-users/{AppInstanceUserArn}/endpoints";
428
- if (input.AppInstanceUserArn !== undefined) {
429
- const labelValue = input.AppInstanceUserArn;
430
- if (labelValue.length <= 0) {
431
- throw new Error("Empty value provided for input HTTP label: AppInstanceUserArn.");
432
- }
433
- resolvedPath = resolvedPath.replace("{AppInstanceUserArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
434
- }
435
- else {
436
- throw new Error("No value provided for input HTTP label: AppInstanceUserArn.");
437
- }
438
- const query = {
439
- ...(input.MaxResults !== undefined && { "max-results": input.MaxResults.toString() }),
440
- ...(input.NextToken !== undefined && { "next-token": input.NextToken }),
441
- };
293
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
294
+ const query = map({
295
+ "max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
296
+ "next-token": [, input.NextToken],
297
+ });
442
298
  let body;
443
299
  return new protocol_http_1.HttpRequest({
444
300
  protocol,
@@ -456,11 +312,11 @@ const serializeAws_restJson1ListAppInstanceUsersCommand = async (input, context)
456
312
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
457
313
  const headers = {};
458
314
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users";
459
- const query = {
460
- ...(input.AppInstanceArn !== undefined && { "app-instance-arn": input.AppInstanceArn }),
461
- ...(input.MaxResults !== undefined && { "max-results": input.MaxResults.toString() }),
462
- ...(input.NextToken !== undefined && { "next-token": input.NextToken }),
463
- };
315
+ const query = map({
316
+ "app-instance-arn": [, input.AppInstanceArn],
317
+ "max-results": [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
318
+ "next-token": [, input.NextToken],
319
+ });
464
320
  let body;
465
321
  return new protocol_http_1.HttpRequest({
466
322
  protocol,
@@ -478,9 +334,9 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
478
334
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
479
335
  const headers = {};
480
336
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
481
- const query = {
482
- ...(input.ResourceARN !== undefined && { arn: input.ResourceARN }),
483
- };
337
+ const query = map({
338
+ arn: [, input.ResourceARN],
339
+ });
484
340
  let body;
485
341
  return new protocol_http_1.HttpRequest({
486
342
  protocol,
@@ -501,16 +357,7 @@ const serializeAws_restJson1PutAppInstanceRetentionSettingsCommand = async (inpu
501
357
  };
502
358
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
503
359
  "/app-instances/{AppInstanceArn}/retention-settings";
504
- if (input.AppInstanceArn !== undefined) {
505
- const labelValue = input.AppInstanceArn;
506
- if (labelValue.length <= 0) {
507
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
508
- }
509
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
510
- }
511
- else {
512
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
513
- }
360
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
514
361
  let body;
515
362
  body = JSON.stringify({
516
363
  ...(input.AppInstanceRetentionSettings != null && {
@@ -536,16 +383,7 @@ const serializeAws_restJson1RegisterAppInstanceUserEndpointCommand = async (inpu
536
383
  };
537
384
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
538
385
  "/app-instance-users/{AppInstanceUserArn}/endpoints";
539
- if (input.AppInstanceUserArn !== undefined) {
540
- const labelValue = input.AppInstanceUserArn;
541
- if (labelValue.length <= 0) {
542
- throw new Error("Empty value provided for input HTTP label: AppInstanceUserArn.");
543
- }
544
- resolvedPath = resolvedPath.replace("{AppInstanceUserArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
545
- }
546
- else {
547
- throw new Error("No value provided for input HTTP label: AppInstanceUserArn.");
548
- }
386
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
549
387
  let body;
550
388
  body = JSON.stringify({
551
389
  ...(input.AllowMessages != null && { AllowMessages: input.AllowMessages }),
@@ -574,9 +412,9 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
574
412
  "content-type": "application/json",
575
413
  };
576
414
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
577
- const query = {
578
- operation: "tag-resource",
579
- };
415
+ const query = map({
416
+ operation: [, "tag-resource"],
417
+ });
580
418
  let body;
581
419
  body = JSON.stringify({
582
420
  ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
@@ -600,9 +438,9 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
600
438
  "content-type": "application/json",
601
439
  };
602
440
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
603
- const query = {
604
- operation: "untag-resource",
605
- };
441
+ const query = map({
442
+ operation: [, "untag-resource"],
443
+ });
606
444
  let body;
607
445
  body = JSON.stringify({
608
446
  ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
@@ -626,16 +464,7 @@ const serializeAws_restJson1UpdateAppInstanceCommand = async (input, context) =>
626
464
  "content-type": "application/json",
627
465
  };
628
466
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instances/{AppInstanceArn}";
629
- if (input.AppInstanceArn !== undefined) {
630
- const labelValue = input.AppInstanceArn;
631
- if (labelValue.length <= 0) {
632
- throw new Error("Empty value provided for input HTTP label: AppInstanceArn.");
633
- }
634
- resolvedPath = resolvedPath.replace("{AppInstanceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
635
- }
636
- else {
637
- throw new Error("No value provided for input HTTP label: AppInstanceArn.");
638
- }
467
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceArn", () => input.AppInstanceArn, "{AppInstanceArn}", false);
639
468
  let body;
640
469
  body = JSON.stringify({
641
470
  ...(input.Metadata != null && { Metadata: input.Metadata }),
@@ -658,16 +487,7 @@ const serializeAws_restJson1UpdateAppInstanceUserCommand = async (input, context
658
487
  "content-type": "application/json",
659
488
  };
660
489
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/app-instance-users/{AppInstanceUserArn}";
661
- if (input.AppInstanceUserArn !== undefined) {
662
- const labelValue = input.AppInstanceUserArn;
663
- if (labelValue.length <= 0) {
664
- throw new Error("Empty value provided for input HTTP label: AppInstanceUserArn.");
665
- }
666
- resolvedPath = resolvedPath.replace("{AppInstanceUserArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
667
- }
668
- else {
669
- throw new Error("No value provided for input HTTP label: AppInstanceUserArn.");
670
- }
490
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
671
491
  let body;
672
492
  body = JSON.stringify({
673
493
  ...(input.Metadata != null && { Metadata: input.Metadata }),
@@ -691,26 +511,8 @@ const serializeAws_restJson1UpdateAppInstanceUserEndpointCommand = async (input,
691
511
  };
692
512
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
693
513
  "/app-instance-users/{AppInstanceUserArn}/endpoints/{EndpointId}";
694
- if (input.AppInstanceUserArn !== undefined) {
695
- const labelValue = input.AppInstanceUserArn;
696
- if (labelValue.length <= 0) {
697
- throw new Error("Empty value provided for input HTTP label: AppInstanceUserArn.");
698
- }
699
- resolvedPath = resolvedPath.replace("{AppInstanceUserArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
700
- }
701
- else {
702
- throw new Error("No value provided for input HTTP label: AppInstanceUserArn.");
703
- }
704
- if (input.EndpointId !== undefined) {
705
- const labelValue = input.EndpointId;
706
- if (labelValue.length <= 0) {
707
- throw new Error("Empty value provided for input HTTP label: EndpointId.");
708
- }
709
- resolvedPath = resolvedPath.replace("{EndpointId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
710
- }
711
- else {
712
- throw new Error("No value provided for input HTTP label: EndpointId.");
713
- }
514
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AppInstanceUserArn", () => input.AppInstanceUserArn, "{AppInstanceUserArn}", false);
515
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EndpointId", () => input.EndpointId, "{EndpointId}", false);
714
516
  let body;
715
517
  body = JSON.stringify({
716
518
  ...(input.AllowMessages != null && { AllowMessages: input.AllowMessages }),
@@ -731,15 +533,14 @@ const deserializeAws_restJson1CreateAppInstanceCommand = async (output, context)
731
533
  if (output.statusCode !== 201 && output.statusCode >= 300) {
732
534
  return deserializeAws_restJson1CreateAppInstanceCommandError(output, context);
733
535
  }
734
- const contents = {
536
+ const contents = map({
735
537
  $metadata: deserializeMetadata(output),
736
- AppInstanceArn: undefined,
737
- };
538
+ });
738
539
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
739
- if (data.AppInstanceArn !== undefined && data.AppInstanceArn !== null) {
540
+ if (data.AppInstanceArn != null) {
740
541
  contents.AppInstanceArn = (0, smithy_client_1.expectString)(data.AppInstanceArn);
741
542
  }
742
- return Promise.resolve(contents);
543
+ return contents;
743
544
  };
744
545
  exports.deserializeAws_restJson1CreateAppInstanceCommand = deserializeAws_restJson1CreateAppInstanceCommand;
745
546
  const deserializeAws_restJson1CreateAppInstanceCommandError = async (output, context) => {
@@ -747,7 +548,6 @@ const deserializeAws_restJson1CreateAppInstanceCommandError = async (output, con
747
548
  ...output,
748
549
  body: await parseBody(output.body, context),
749
550
  };
750
- let response;
751
551
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
752
552
  switch (errorCode) {
753
553
  case "BadRequestException":
@@ -776,33 +576,29 @@ const deserializeAws_restJson1CreateAppInstanceCommandError = async (output, con
776
576
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
777
577
  default:
778
578
  const parsedBody = parsedOutput.body;
779
- const $metadata = deserializeMetadata(output);
780
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
781
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
782
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
783
- $fault: "client",
784
- $metadata,
579
+ (0, smithy_client_1.throwDefaultError)({
580
+ output,
581
+ parsedBody,
582
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
583
+ errorCode,
785
584
  });
786
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
787
585
  }
788
586
  };
789
587
  const deserializeAws_restJson1CreateAppInstanceAdminCommand = async (output, context) => {
790
588
  if (output.statusCode !== 201 && output.statusCode >= 300) {
791
589
  return deserializeAws_restJson1CreateAppInstanceAdminCommandError(output, context);
792
590
  }
793
- const contents = {
591
+ const contents = map({
794
592
  $metadata: deserializeMetadata(output),
795
- AppInstanceAdmin: undefined,
796
- AppInstanceArn: undefined,
797
- };
593
+ });
798
594
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
799
- if (data.AppInstanceAdmin !== undefined && data.AppInstanceAdmin !== null) {
595
+ if (data.AppInstanceAdmin != null) {
800
596
  contents.AppInstanceAdmin = deserializeAws_restJson1Identity(data.AppInstanceAdmin, context);
801
597
  }
802
- if (data.AppInstanceArn !== undefined && data.AppInstanceArn !== null) {
598
+ if (data.AppInstanceArn != null) {
803
599
  contents.AppInstanceArn = (0, smithy_client_1.expectString)(data.AppInstanceArn);
804
600
  }
805
- return Promise.resolve(contents);
601
+ return contents;
806
602
  };
807
603
  exports.deserializeAws_restJson1CreateAppInstanceAdminCommand = deserializeAws_restJson1CreateAppInstanceAdminCommand;
808
604
  const deserializeAws_restJson1CreateAppInstanceAdminCommandError = async (output, context) => {
@@ -810,7 +606,6 @@ const deserializeAws_restJson1CreateAppInstanceAdminCommandError = async (output
810
606
  ...output,
811
607
  body: await parseBody(output.body, context),
812
608
  };
813
- let response;
814
609
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
815
610
  switch (errorCode) {
816
611
  case "BadRequestException":
@@ -839,29 +634,26 @@ const deserializeAws_restJson1CreateAppInstanceAdminCommandError = async (output
839
634
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
840
635
  default:
841
636
  const parsedBody = parsedOutput.body;
842
- const $metadata = deserializeMetadata(output);
843
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
844
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
845
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
846
- $fault: "client",
847
- $metadata,
637
+ (0, smithy_client_1.throwDefaultError)({
638
+ output,
639
+ parsedBody,
640
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
641
+ errorCode,
848
642
  });
849
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
850
643
  }
851
644
  };
852
645
  const deserializeAws_restJson1CreateAppInstanceUserCommand = async (output, context) => {
853
646
  if (output.statusCode !== 201 && output.statusCode >= 300) {
854
647
  return deserializeAws_restJson1CreateAppInstanceUserCommandError(output, context);
855
648
  }
856
- const contents = {
649
+ const contents = map({
857
650
  $metadata: deserializeMetadata(output),
858
- AppInstanceUserArn: undefined,
859
- };
651
+ });
860
652
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
861
- if (data.AppInstanceUserArn !== undefined && data.AppInstanceUserArn !== null) {
653
+ if (data.AppInstanceUserArn != null) {
862
654
  contents.AppInstanceUserArn = (0, smithy_client_1.expectString)(data.AppInstanceUserArn);
863
655
  }
864
- return Promise.resolve(contents);
656
+ return contents;
865
657
  };
866
658
  exports.deserializeAws_restJson1CreateAppInstanceUserCommand = deserializeAws_restJson1CreateAppInstanceUserCommand;
867
659
  const deserializeAws_restJson1CreateAppInstanceUserCommandError = async (output, context) => {
@@ -869,7 +661,6 @@ const deserializeAws_restJson1CreateAppInstanceUserCommandError = async (output,
869
661
  ...output,
870
662
  body: await parseBody(output.body, context),
871
663
  };
872
- let response;
873
664
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
874
665
  switch (errorCode) {
875
666
  case "BadRequestException":
@@ -898,25 +689,23 @@ const deserializeAws_restJson1CreateAppInstanceUserCommandError = async (output,
898
689
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
899
690
  default:
900
691
  const parsedBody = parsedOutput.body;
901
- const $metadata = deserializeMetadata(output);
902
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
903
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
904
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
905
- $fault: "client",
906
- $metadata,
692
+ (0, smithy_client_1.throwDefaultError)({
693
+ output,
694
+ parsedBody,
695
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
696
+ errorCode,
907
697
  });
908
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
909
698
  }
910
699
  };
911
700
  const deserializeAws_restJson1DeleteAppInstanceCommand = async (output, context) => {
912
701
  if (output.statusCode !== 204 && output.statusCode >= 300) {
913
702
  return deserializeAws_restJson1DeleteAppInstanceCommandError(output, context);
914
703
  }
915
- const contents = {
704
+ const contents = map({
916
705
  $metadata: deserializeMetadata(output),
917
- };
706
+ });
918
707
  await collectBody(output.body, context);
919
- return Promise.resolve(contents);
708
+ return contents;
920
709
  };
921
710
  exports.deserializeAws_restJson1DeleteAppInstanceCommand = deserializeAws_restJson1DeleteAppInstanceCommand;
922
711
  const deserializeAws_restJson1DeleteAppInstanceCommandError = async (output, context) => {
@@ -924,7 +713,6 @@ const deserializeAws_restJson1DeleteAppInstanceCommandError = async (output, con
924
713
  ...output,
925
714
  body: await parseBody(output.body, context),
926
715
  };
927
- let response;
928
716
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
929
717
  switch (errorCode) {
930
718
  case "BadRequestException":
@@ -950,25 +738,23 @@ const deserializeAws_restJson1DeleteAppInstanceCommandError = async (output, con
950
738
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
951
739
  default:
952
740
  const parsedBody = parsedOutput.body;
953
- const $metadata = deserializeMetadata(output);
954
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
955
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
956
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
957
- $fault: "client",
958
- $metadata,
741
+ (0, smithy_client_1.throwDefaultError)({
742
+ output,
743
+ parsedBody,
744
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
745
+ errorCode,
959
746
  });
960
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
961
747
  }
962
748
  };
963
749
  const deserializeAws_restJson1DeleteAppInstanceAdminCommand = async (output, context) => {
964
750
  if (output.statusCode !== 204 && output.statusCode >= 300) {
965
751
  return deserializeAws_restJson1DeleteAppInstanceAdminCommandError(output, context);
966
752
  }
967
- const contents = {
753
+ const contents = map({
968
754
  $metadata: deserializeMetadata(output),
969
- };
755
+ });
970
756
  await collectBody(output.body, context);
971
- return Promise.resolve(contents);
757
+ return contents;
972
758
  };
973
759
  exports.deserializeAws_restJson1DeleteAppInstanceAdminCommand = deserializeAws_restJson1DeleteAppInstanceAdminCommand;
974
760
  const deserializeAws_restJson1DeleteAppInstanceAdminCommandError = async (output, context) => {
@@ -976,7 +762,6 @@ const deserializeAws_restJson1DeleteAppInstanceAdminCommandError = async (output
976
762
  ...output,
977
763
  body: await parseBody(output.body, context),
978
764
  };
979
- let response;
980
765
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
981
766
  switch (errorCode) {
982
767
  case "BadRequestException":
@@ -1005,25 +790,23 @@ const deserializeAws_restJson1DeleteAppInstanceAdminCommandError = async (output
1005
790
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1006
791
  default:
1007
792
  const parsedBody = parsedOutput.body;
1008
- const $metadata = deserializeMetadata(output);
1009
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1010
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1011
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1012
- $fault: "client",
1013
- $metadata,
793
+ (0, smithy_client_1.throwDefaultError)({
794
+ output,
795
+ parsedBody,
796
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
797
+ errorCode,
1014
798
  });
1015
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1016
799
  }
1017
800
  };
1018
801
  const deserializeAws_restJson1DeleteAppInstanceUserCommand = async (output, context) => {
1019
802
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1020
803
  return deserializeAws_restJson1DeleteAppInstanceUserCommandError(output, context);
1021
804
  }
1022
- const contents = {
805
+ const contents = map({
1023
806
  $metadata: deserializeMetadata(output),
1024
- };
807
+ });
1025
808
  await collectBody(output.body, context);
1026
- return Promise.resolve(contents);
809
+ return contents;
1027
810
  };
1028
811
  exports.deserializeAws_restJson1DeleteAppInstanceUserCommand = deserializeAws_restJson1DeleteAppInstanceUserCommand;
1029
812
  const deserializeAws_restJson1DeleteAppInstanceUserCommandError = async (output, context) => {
@@ -1031,7 +814,6 @@ const deserializeAws_restJson1DeleteAppInstanceUserCommandError = async (output,
1031
814
  ...output,
1032
815
  body: await parseBody(output.body, context),
1033
816
  };
1034
- let response;
1035
817
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1036
818
  switch (errorCode) {
1037
819
  case "BadRequestException":
@@ -1060,25 +842,23 @@ const deserializeAws_restJson1DeleteAppInstanceUserCommandError = async (output,
1060
842
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1061
843
  default:
1062
844
  const parsedBody = parsedOutput.body;
1063
- const $metadata = deserializeMetadata(output);
1064
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1065
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1066
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1067
- $fault: "client",
1068
- $metadata,
845
+ (0, smithy_client_1.throwDefaultError)({
846
+ output,
847
+ parsedBody,
848
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
849
+ errorCode,
1069
850
  });
1070
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1071
851
  }
1072
852
  };
1073
853
  const deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommand = async (output, context) => {
1074
854
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1075
855
  return deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError(output, context);
1076
856
  }
1077
- const contents = {
857
+ const contents = map({
1078
858
  $metadata: deserializeMetadata(output),
1079
- };
859
+ });
1080
860
  await collectBody(output.body, context);
1081
- return Promise.resolve(contents);
861
+ return contents;
1082
862
  };
1083
863
  exports.deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommand = deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommand;
1084
864
  const deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError = async (output, context) => {
@@ -1086,7 +866,6 @@ const deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError = as
1086
866
  ...output,
1087
867
  body: await parseBody(output.body, context),
1088
868
  };
1089
- let response;
1090
869
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1091
870
  switch (errorCode) {
1092
871
  case "BadRequestException":
@@ -1109,29 +888,26 @@ const deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError = as
1109
888
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1110
889
  default:
1111
890
  const parsedBody = parsedOutput.body;
1112
- const $metadata = deserializeMetadata(output);
1113
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1114
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1115
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1116
- $fault: "client",
1117
- $metadata,
891
+ (0, smithy_client_1.throwDefaultError)({
892
+ output,
893
+ parsedBody,
894
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
895
+ errorCode,
1118
896
  });
1119
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1120
897
  }
1121
898
  };
1122
899
  const deserializeAws_restJson1DescribeAppInstanceCommand = async (output, context) => {
1123
900
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1124
901
  return deserializeAws_restJson1DescribeAppInstanceCommandError(output, context);
1125
902
  }
1126
- const contents = {
903
+ const contents = map({
1127
904
  $metadata: deserializeMetadata(output),
1128
- AppInstance: undefined,
1129
- };
905
+ });
1130
906
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1131
- if (data.AppInstance !== undefined && data.AppInstance !== null) {
907
+ if (data.AppInstance != null) {
1132
908
  contents.AppInstance = deserializeAws_restJson1AppInstance(data.AppInstance, context);
1133
909
  }
1134
- return Promise.resolve(contents);
910
+ return contents;
1135
911
  };
1136
912
  exports.deserializeAws_restJson1DescribeAppInstanceCommand = deserializeAws_restJson1DescribeAppInstanceCommand;
1137
913
  const deserializeAws_restJson1DescribeAppInstanceCommandError = async (output, context) => {
@@ -1139,7 +915,6 @@ const deserializeAws_restJson1DescribeAppInstanceCommandError = async (output, c
1139
915
  ...output,
1140
916
  body: await parseBody(output.body, context),
1141
917
  };
1142
- let response;
1143
918
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1144
919
  switch (errorCode) {
1145
920
  case "BadRequestException":
@@ -1162,29 +937,26 @@ const deserializeAws_restJson1DescribeAppInstanceCommandError = async (output, c
1162
937
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1163
938
  default:
1164
939
  const parsedBody = parsedOutput.body;
1165
- const $metadata = deserializeMetadata(output);
1166
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1167
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1168
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1169
- $fault: "client",
1170
- $metadata,
940
+ (0, smithy_client_1.throwDefaultError)({
941
+ output,
942
+ parsedBody,
943
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
944
+ errorCode,
1171
945
  });
1172
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1173
946
  }
1174
947
  };
1175
948
  const deserializeAws_restJson1DescribeAppInstanceAdminCommand = async (output, context) => {
1176
949
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1177
950
  return deserializeAws_restJson1DescribeAppInstanceAdminCommandError(output, context);
1178
951
  }
1179
- const contents = {
952
+ const contents = map({
1180
953
  $metadata: deserializeMetadata(output),
1181
- AppInstanceAdmin: undefined,
1182
- };
954
+ });
1183
955
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1184
- if (data.AppInstanceAdmin !== undefined && data.AppInstanceAdmin !== null) {
956
+ if (data.AppInstanceAdmin != null) {
1185
957
  contents.AppInstanceAdmin = deserializeAws_restJson1AppInstanceAdmin(data.AppInstanceAdmin, context);
1186
958
  }
1187
- return Promise.resolve(contents);
959
+ return contents;
1188
960
  };
1189
961
  exports.deserializeAws_restJson1DescribeAppInstanceAdminCommand = deserializeAws_restJson1DescribeAppInstanceAdminCommand;
1190
962
  const deserializeAws_restJson1DescribeAppInstanceAdminCommandError = async (output, context) => {
@@ -1192,7 +964,6 @@ const deserializeAws_restJson1DescribeAppInstanceAdminCommandError = async (outp
1192
964
  ...output,
1193
965
  body: await parseBody(output.body, context),
1194
966
  };
1195
- let response;
1196
967
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1197
968
  switch (errorCode) {
1198
969
  case "BadRequestException":
@@ -1215,29 +986,26 @@ const deserializeAws_restJson1DescribeAppInstanceAdminCommandError = async (outp
1215
986
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1216
987
  default:
1217
988
  const parsedBody = parsedOutput.body;
1218
- const $metadata = deserializeMetadata(output);
1219
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1220
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1221
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1222
- $fault: "client",
1223
- $metadata,
989
+ (0, smithy_client_1.throwDefaultError)({
990
+ output,
991
+ parsedBody,
992
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
993
+ errorCode,
1224
994
  });
1225
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1226
995
  }
1227
996
  };
1228
997
  const deserializeAws_restJson1DescribeAppInstanceUserCommand = async (output, context) => {
1229
998
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1230
999
  return deserializeAws_restJson1DescribeAppInstanceUserCommandError(output, context);
1231
1000
  }
1232
- const contents = {
1001
+ const contents = map({
1233
1002
  $metadata: deserializeMetadata(output),
1234
- AppInstanceUser: undefined,
1235
- };
1003
+ });
1236
1004
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1237
- if (data.AppInstanceUser !== undefined && data.AppInstanceUser !== null) {
1005
+ if (data.AppInstanceUser != null) {
1238
1006
  contents.AppInstanceUser = deserializeAws_restJson1AppInstanceUser(data.AppInstanceUser, context);
1239
1007
  }
1240
- return Promise.resolve(contents);
1008
+ return contents;
1241
1009
  };
1242
1010
  exports.deserializeAws_restJson1DescribeAppInstanceUserCommand = deserializeAws_restJson1DescribeAppInstanceUserCommand;
1243
1011
  const deserializeAws_restJson1DescribeAppInstanceUserCommandError = async (output, context) => {
@@ -1245,7 +1013,6 @@ const deserializeAws_restJson1DescribeAppInstanceUserCommandError = async (outpu
1245
1013
  ...output,
1246
1014
  body: await parseBody(output.body, context),
1247
1015
  };
1248
- let response;
1249
1016
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1250
1017
  switch (errorCode) {
1251
1018
  case "BadRequestException":
@@ -1268,29 +1035,26 @@ const deserializeAws_restJson1DescribeAppInstanceUserCommandError = async (outpu
1268
1035
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1269
1036
  default:
1270
1037
  const parsedBody = parsedOutput.body;
1271
- const $metadata = deserializeMetadata(output);
1272
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1273
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1274
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1275
- $fault: "client",
1276
- $metadata,
1038
+ (0, smithy_client_1.throwDefaultError)({
1039
+ output,
1040
+ parsedBody,
1041
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1042
+ errorCode,
1277
1043
  });
1278
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1279
1044
  }
1280
1045
  };
1281
1046
  const deserializeAws_restJson1DescribeAppInstanceUserEndpointCommand = async (output, context) => {
1282
1047
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1283
1048
  return deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError(output, context);
1284
1049
  }
1285
- const contents = {
1050
+ const contents = map({
1286
1051
  $metadata: deserializeMetadata(output),
1287
- AppInstanceUserEndpoint: undefined,
1288
- };
1052
+ });
1289
1053
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1290
- if (data.AppInstanceUserEndpoint !== undefined && data.AppInstanceUserEndpoint !== null) {
1054
+ if (data.AppInstanceUserEndpoint != null) {
1291
1055
  contents.AppInstanceUserEndpoint = deserializeAws_restJson1AppInstanceUserEndpoint(data.AppInstanceUserEndpoint, context);
1292
1056
  }
1293
- return Promise.resolve(contents);
1057
+ return contents;
1294
1058
  };
1295
1059
  exports.deserializeAws_restJson1DescribeAppInstanceUserEndpointCommand = deserializeAws_restJson1DescribeAppInstanceUserEndpointCommand;
1296
1060
  const deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError = async (output, context) => {
@@ -1298,7 +1062,6 @@ const deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError = asyn
1298
1062
  ...output,
1299
1063
  body: await parseBody(output.body, context),
1300
1064
  };
1301
- let response;
1302
1065
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1303
1066
  switch (errorCode) {
1304
1067
  case "BadRequestException":
@@ -1321,33 +1084,29 @@ const deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError = asyn
1321
1084
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1322
1085
  default:
1323
1086
  const parsedBody = parsedOutput.body;
1324
- const $metadata = deserializeMetadata(output);
1325
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1326
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1327
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1328
- $fault: "client",
1329
- $metadata,
1087
+ (0, smithy_client_1.throwDefaultError)({
1088
+ output,
1089
+ parsedBody,
1090
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1091
+ errorCode,
1330
1092
  });
1331
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1332
1093
  }
1333
1094
  };
1334
1095
  const deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand = async (output, context) => {
1335
1096
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1336
1097
  return deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError(output, context);
1337
1098
  }
1338
- const contents = {
1099
+ const contents = map({
1339
1100
  $metadata: deserializeMetadata(output),
1340
- AppInstanceRetentionSettings: undefined,
1341
- InitiateDeletionTimestamp: undefined,
1342
- };
1101
+ });
1343
1102
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1344
- if (data.AppInstanceRetentionSettings !== undefined && data.AppInstanceRetentionSettings !== null) {
1103
+ if (data.AppInstanceRetentionSettings != null) {
1345
1104
  contents.AppInstanceRetentionSettings = deserializeAws_restJson1AppInstanceRetentionSettings(data.AppInstanceRetentionSettings, context);
1346
1105
  }
1347
- if (data.InitiateDeletionTimestamp !== undefined && data.InitiateDeletionTimestamp !== null) {
1106
+ if (data.InitiateDeletionTimestamp != null) {
1348
1107
  contents.InitiateDeletionTimestamp = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.InitiateDeletionTimestamp)));
1349
1108
  }
1350
- return Promise.resolve(contents);
1109
+ return contents;
1351
1110
  };
1352
1111
  exports.deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand = deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand;
1353
1112
  const deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError = async (output, context) => {
@@ -1355,7 +1114,6 @@ const deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError = asyn
1355
1114
  ...output,
1356
1115
  body: await parseBody(output.body, context),
1357
1116
  };
1358
- let response;
1359
1117
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1360
1118
  switch (errorCode) {
1361
1119
  case "BadRequestException":
@@ -1378,37 +1136,32 @@ const deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError = asyn
1378
1136
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1379
1137
  default:
1380
1138
  const parsedBody = parsedOutput.body;
1381
- const $metadata = deserializeMetadata(output);
1382
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1383
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1384
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1385
- $fault: "client",
1386
- $metadata,
1139
+ (0, smithy_client_1.throwDefaultError)({
1140
+ output,
1141
+ parsedBody,
1142
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1143
+ errorCode,
1387
1144
  });
1388
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1389
1145
  }
1390
1146
  };
1391
1147
  const deserializeAws_restJson1ListAppInstanceAdminsCommand = async (output, context) => {
1392
1148
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1393
1149
  return deserializeAws_restJson1ListAppInstanceAdminsCommandError(output, context);
1394
1150
  }
1395
- const contents = {
1151
+ const contents = map({
1396
1152
  $metadata: deserializeMetadata(output),
1397
- AppInstanceAdmins: undefined,
1398
- AppInstanceArn: undefined,
1399
- NextToken: undefined,
1400
- };
1153
+ });
1401
1154
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1402
- if (data.AppInstanceAdmins !== undefined && data.AppInstanceAdmins !== null) {
1155
+ if (data.AppInstanceAdmins != null) {
1403
1156
  contents.AppInstanceAdmins = deserializeAws_restJson1AppInstanceAdminList(data.AppInstanceAdmins, context);
1404
1157
  }
1405
- if (data.AppInstanceArn !== undefined && data.AppInstanceArn !== null) {
1158
+ if (data.AppInstanceArn != null) {
1406
1159
  contents.AppInstanceArn = (0, smithy_client_1.expectString)(data.AppInstanceArn);
1407
1160
  }
1408
- if (data.NextToken !== undefined && data.NextToken !== null) {
1161
+ if (data.NextToken != null) {
1409
1162
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1410
1163
  }
1411
- return Promise.resolve(contents);
1164
+ return contents;
1412
1165
  };
1413
1166
  exports.deserializeAws_restJson1ListAppInstanceAdminsCommand = deserializeAws_restJson1ListAppInstanceAdminsCommand;
1414
1167
  const deserializeAws_restJson1ListAppInstanceAdminsCommandError = async (output, context) => {
@@ -1416,7 +1169,6 @@ const deserializeAws_restJson1ListAppInstanceAdminsCommandError = async (output,
1416
1169
  ...output,
1417
1170
  body: await parseBody(output.body, context),
1418
1171
  };
1419
- let response;
1420
1172
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1421
1173
  switch (errorCode) {
1422
1174
  case "BadRequestException":
@@ -1442,33 +1194,29 @@ const deserializeAws_restJson1ListAppInstanceAdminsCommandError = async (output,
1442
1194
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1443
1195
  default:
1444
1196
  const parsedBody = parsedOutput.body;
1445
- const $metadata = deserializeMetadata(output);
1446
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1447
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1448
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1449
- $fault: "client",
1450
- $metadata,
1197
+ (0, smithy_client_1.throwDefaultError)({
1198
+ output,
1199
+ parsedBody,
1200
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1201
+ errorCode,
1451
1202
  });
1452
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1453
1203
  }
1454
1204
  };
1455
1205
  const deserializeAws_restJson1ListAppInstancesCommand = async (output, context) => {
1456
1206
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1457
1207
  return deserializeAws_restJson1ListAppInstancesCommandError(output, context);
1458
1208
  }
1459
- const contents = {
1209
+ const contents = map({
1460
1210
  $metadata: deserializeMetadata(output),
1461
- AppInstances: undefined,
1462
- NextToken: undefined,
1463
- };
1211
+ });
1464
1212
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1465
- if (data.AppInstances !== undefined && data.AppInstances !== null) {
1213
+ if (data.AppInstances != null) {
1466
1214
  contents.AppInstances = deserializeAws_restJson1AppInstanceList(data.AppInstances, context);
1467
1215
  }
1468
- if (data.NextToken !== undefined && data.NextToken !== null) {
1216
+ if (data.NextToken != null) {
1469
1217
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1470
1218
  }
1471
- return Promise.resolve(contents);
1219
+ return contents;
1472
1220
  };
1473
1221
  exports.deserializeAws_restJson1ListAppInstancesCommand = deserializeAws_restJson1ListAppInstancesCommand;
1474
1222
  const deserializeAws_restJson1ListAppInstancesCommandError = async (output, context) => {
@@ -1476,7 +1224,6 @@ const deserializeAws_restJson1ListAppInstancesCommandError = async (output, cont
1476
1224
  ...output,
1477
1225
  body: await parseBody(output.body, context),
1478
1226
  };
1479
- let response;
1480
1227
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1481
1228
  switch (errorCode) {
1482
1229
  case "BadRequestException":
@@ -1499,33 +1246,29 @@ const deserializeAws_restJson1ListAppInstancesCommandError = async (output, cont
1499
1246
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1500
1247
  default:
1501
1248
  const parsedBody = parsedOutput.body;
1502
- const $metadata = deserializeMetadata(output);
1503
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1504
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1505
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1506
- $fault: "client",
1507
- $metadata,
1249
+ (0, smithy_client_1.throwDefaultError)({
1250
+ output,
1251
+ parsedBody,
1252
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1253
+ errorCode,
1508
1254
  });
1509
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1510
1255
  }
1511
1256
  };
1512
1257
  const deserializeAws_restJson1ListAppInstanceUserEndpointsCommand = async (output, context) => {
1513
1258
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1514
1259
  return deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError(output, context);
1515
1260
  }
1516
- const contents = {
1261
+ const contents = map({
1517
1262
  $metadata: deserializeMetadata(output),
1518
- AppInstanceUserEndpoints: undefined,
1519
- NextToken: undefined,
1520
- };
1263
+ });
1521
1264
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1522
- if (data.AppInstanceUserEndpoints !== undefined && data.AppInstanceUserEndpoints !== null) {
1265
+ if (data.AppInstanceUserEndpoints != null) {
1523
1266
  contents.AppInstanceUserEndpoints = deserializeAws_restJson1AppInstanceUserEndpointSummaryList(data.AppInstanceUserEndpoints, context);
1524
1267
  }
1525
- if (data.NextToken !== undefined && data.NextToken !== null) {
1268
+ if (data.NextToken != null) {
1526
1269
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1527
1270
  }
1528
- return Promise.resolve(contents);
1271
+ return contents;
1529
1272
  };
1530
1273
  exports.deserializeAws_restJson1ListAppInstanceUserEndpointsCommand = deserializeAws_restJson1ListAppInstanceUserEndpointsCommand;
1531
1274
  const deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError = async (output, context) => {
@@ -1533,7 +1276,6 @@ const deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError = async (
1533
1276
  ...output,
1534
1277
  body: await parseBody(output.body, context),
1535
1278
  };
1536
- let response;
1537
1279
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1538
1280
  switch (errorCode) {
1539
1281
  case "BadRequestException":
@@ -1556,37 +1298,32 @@ const deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError = async (
1556
1298
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1557
1299
  default:
1558
1300
  const parsedBody = parsedOutput.body;
1559
- const $metadata = deserializeMetadata(output);
1560
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1561
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1562
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1563
- $fault: "client",
1564
- $metadata,
1301
+ (0, smithy_client_1.throwDefaultError)({
1302
+ output,
1303
+ parsedBody,
1304
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1305
+ errorCode,
1565
1306
  });
1566
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1567
1307
  }
1568
1308
  };
1569
1309
  const deserializeAws_restJson1ListAppInstanceUsersCommand = async (output, context) => {
1570
1310
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1571
1311
  return deserializeAws_restJson1ListAppInstanceUsersCommandError(output, context);
1572
1312
  }
1573
- const contents = {
1313
+ const contents = map({
1574
1314
  $metadata: deserializeMetadata(output),
1575
- AppInstanceArn: undefined,
1576
- AppInstanceUsers: undefined,
1577
- NextToken: undefined,
1578
- };
1315
+ });
1579
1316
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1580
- if (data.AppInstanceArn !== undefined && data.AppInstanceArn !== null) {
1317
+ if (data.AppInstanceArn != null) {
1581
1318
  contents.AppInstanceArn = (0, smithy_client_1.expectString)(data.AppInstanceArn);
1582
1319
  }
1583
- if (data.AppInstanceUsers !== undefined && data.AppInstanceUsers !== null) {
1320
+ if (data.AppInstanceUsers != null) {
1584
1321
  contents.AppInstanceUsers = deserializeAws_restJson1AppInstanceUserList(data.AppInstanceUsers, context);
1585
1322
  }
1586
- if (data.NextToken !== undefined && data.NextToken !== null) {
1323
+ if (data.NextToken != null) {
1587
1324
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1588
1325
  }
1589
- return Promise.resolve(contents);
1326
+ return contents;
1590
1327
  };
1591
1328
  exports.deserializeAws_restJson1ListAppInstanceUsersCommand = deserializeAws_restJson1ListAppInstanceUsersCommand;
1592
1329
  const deserializeAws_restJson1ListAppInstanceUsersCommandError = async (output, context) => {
@@ -1594,7 +1331,6 @@ const deserializeAws_restJson1ListAppInstanceUsersCommandError = async (output,
1594
1331
  ...output,
1595
1332
  body: await parseBody(output.body, context),
1596
1333
  };
1597
- let response;
1598
1334
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1599
1335
  switch (errorCode) {
1600
1336
  case "BadRequestException":
@@ -1617,29 +1353,26 @@ const deserializeAws_restJson1ListAppInstanceUsersCommandError = async (output,
1617
1353
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1618
1354
  default:
1619
1355
  const parsedBody = parsedOutput.body;
1620
- const $metadata = deserializeMetadata(output);
1621
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1622
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1623
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1624
- $fault: "client",
1625
- $metadata,
1356
+ (0, smithy_client_1.throwDefaultError)({
1357
+ output,
1358
+ parsedBody,
1359
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1360
+ errorCode,
1626
1361
  });
1627
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1628
1362
  }
1629
1363
  };
1630
1364
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1631
1365
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1632
1366
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1633
1367
  }
1634
- const contents = {
1368
+ const contents = map({
1635
1369
  $metadata: deserializeMetadata(output),
1636
- Tags: undefined,
1637
- };
1370
+ });
1638
1371
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1639
- if (data.Tags !== undefined && data.Tags !== null) {
1372
+ if (data.Tags != null) {
1640
1373
  contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
1641
1374
  }
1642
- return Promise.resolve(contents);
1375
+ return contents;
1643
1376
  };
1644
1377
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1645
1378
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -1647,7 +1380,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1647
1380
  ...output,
1648
1381
  body: await parseBody(output.body, context),
1649
1382
  };
1650
- let response;
1651
1383
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1652
1384
  switch (errorCode) {
1653
1385
  case "BadRequestException":
@@ -1670,33 +1402,29 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1670
1402
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1671
1403
  default:
1672
1404
  const parsedBody = parsedOutput.body;
1673
- const $metadata = deserializeMetadata(output);
1674
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1675
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1676
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1677
- $fault: "client",
1678
- $metadata,
1405
+ (0, smithy_client_1.throwDefaultError)({
1406
+ output,
1407
+ parsedBody,
1408
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1409
+ errorCode,
1679
1410
  });
1680
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1681
1411
  }
1682
1412
  };
1683
1413
  const deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand = async (output, context) => {
1684
1414
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1685
1415
  return deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError(output, context);
1686
1416
  }
1687
- const contents = {
1417
+ const contents = map({
1688
1418
  $metadata: deserializeMetadata(output),
1689
- AppInstanceRetentionSettings: undefined,
1690
- InitiateDeletionTimestamp: undefined,
1691
- };
1419
+ });
1692
1420
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1693
- if (data.AppInstanceRetentionSettings !== undefined && data.AppInstanceRetentionSettings !== null) {
1421
+ if (data.AppInstanceRetentionSettings != null) {
1694
1422
  contents.AppInstanceRetentionSettings = deserializeAws_restJson1AppInstanceRetentionSettings(data.AppInstanceRetentionSettings, context);
1695
1423
  }
1696
- if (data.InitiateDeletionTimestamp !== undefined && data.InitiateDeletionTimestamp !== null) {
1424
+ if (data.InitiateDeletionTimestamp != null) {
1697
1425
  contents.InitiateDeletionTimestamp = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.InitiateDeletionTimestamp)));
1698
1426
  }
1699
- return Promise.resolve(contents);
1427
+ return contents;
1700
1428
  };
1701
1429
  exports.deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand = deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand;
1702
1430
  const deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError = async (output, context) => {
@@ -1704,7 +1432,6 @@ const deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError = asyn
1704
1432
  ...output,
1705
1433
  body: await parseBody(output.body, context),
1706
1434
  };
1707
- let response;
1708
1435
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1709
1436
  switch (errorCode) {
1710
1437
  case "BadRequestException":
@@ -1727,33 +1454,29 @@ const deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError = asyn
1727
1454
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1728
1455
  default:
1729
1456
  const parsedBody = parsedOutput.body;
1730
- const $metadata = deserializeMetadata(output);
1731
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1732
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1733
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1734
- $fault: "client",
1735
- $metadata,
1457
+ (0, smithy_client_1.throwDefaultError)({
1458
+ output,
1459
+ parsedBody,
1460
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1461
+ errorCode,
1736
1462
  });
1737
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1738
1463
  }
1739
1464
  };
1740
1465
  const deserializeAws_restJson1RegisterAppInstanceUserEndpointCommand = async (output, context) => {
1741
1466
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1742
1467
  return deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError(output, context);
1743
1468
  }
1744
- const contents = {
1469
+ const contents = map({
1745
1470
  $metadata: deserializeMetadata(output),
1746
- AppInstanceUserArn: undefined,
1747
- EndpointId: undefined,
1748
- };
1471
+ });
1749
1472
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1750
- if (data.AppInstanceUserArn !== undefined && data.AppInstanceUserArn !== null) {
1473
+ if (data.AppInstanceUserArn != null) {
1751
1474
  contents.AppInstanceUserArn = (0, smithy_client_1.expectString)(data.AppInstanceUserArn);
1752
1475
  }
1753
- if (data.EndpointId !== undefined && data.EndpointId !== null) {
1476
+ if (data.EndpointId != null) {
1754
1477
  contents.EndpointId = (0, smithy_client_1.expectString)(data.EndpointId);
1755
1478
  }
1756
- return Promise.resolve(contents);
1479
+ return contents;
1757
1480
  };
1758
1481
  exports.deserializeAws_restJson1RegisterAppInstanceUserEndpointCommand = deserializeAws_restJson1RegisterAppInstanceUserEndpointCommand;
1759
1482
  const deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError = async (output, context) => {
@@ -1761,7 +1484,6 @@ const deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError = asyn
1761
1484
  ...output,
1762
1485
  body: await parseBody(output.body, context),
1763
1486
  };
1764
- let response;
1765
1487
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1766
1488
  switch (errorCode) {
1767
1489
  case "BadRequestException":
@@ -1790,25 +1512,23 @@ const deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError = asyn
1790
1512
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1791
1513
  default:
1792
1514
  const parsedBody = parsedOutput.body;
1793
- const $metadata = deserializeMetadata(output);
1794
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1795
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1796
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1797
- $fault: "client",
1798
- $metadata,
1515
+ (0, smithy_client_1.throwDefaultError)({
1516
+ output,
1517
+ parsedBody,
1518
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1519
+ errorCode,
1799
1520
  });
1800
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1801
1521
  }
1802
1522
  };
1803
1523
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1804
1524
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1805
1525
  return deserializeAws_restJson1TagResourceCommandError(output, context);
1806
1526
  }
1807
- const contents = {
1527
+ const contents = map({
1808
1528
  $metadata: deserializeMetadata(output),
1809
- };
1529
+ });
1810
1530
  await collectBody(output.body, context);
1811
- return Promise.resolve(contents);
1531
+ return contents;
1812
1532
  };
1813
1533
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1814
1534
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -1816,7 +1536,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1816
1536
  ...output,
1817
1537
  body: await parseBody(output.body, context),
1818
1538
  };
1819
- let response;
1820
1539
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1821
1540
  switch (errorCode) {
1822
1541
  case "BadRequestException":
@@ -1842,25 +1561,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1842
1561
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1843
1562
  default:
1844
1563
  const parsedBody = parsedOutput.body;
1845
- const $metadata = deserializeMetadata(output);
1846
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1847
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1848
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1849
- $fault: "client",
1850
- $metadata,
1564
+ (0, smithy_client_1.throwDefaultError)({
1565
+ output,
1566
+ parsedBody,
1567
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1568
+ errorCode,
1851
1569
  });
1852
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1853
1570
  }
1854
1571
  };
1855
1572
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1856
1573
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1857
1574
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
1858
1575
  }
1859
- const contents = {
1576
+ const contents = map({
1860
1577
  $metadata: deserializeMetadata(output),
1861
- };
1578
+ });
1862
1579
  await collectBody(output.body, context);
1863
- return Promise.resolve(contents);
1580
+ return contents;
1864
1581
  };
1865
1582
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1866
1583
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -1868,7 +1585,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1868
1585
  ...output,
1869
1586
  body: await parseBody(output.body, context),
1870
1587
  };
1871
- let response;
1872
1588
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1873
1589
  switch (errorCode) {
1874
1590
  case "BadRequestException":
@@ -1891,29 +1607,26 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1891
1607
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1892
1608
  default:
1893
1609
  const parsedBody = parsedOutput.body;
1894
- const $metadata = deserializeMetadata(output);
1895
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1896
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1897
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1898
- $fault: "client",
1899
- $metadata,
1610
+ (0, smithy_client_1.throwDefaultError)({
1611
+ output,
1612
+ parsedBody,
1613
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1614
+ errorCode,
1900
1615
  });
1901
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1902
1616
  }
1903
1617
  };
1904
1618
  const deserializeAws_restJson1UpdateAppInstanceCommand = async (output, context) => {
1905
1619
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1906
1620
  return deserializeAws_restJson1UpdateAppInstanceCommandError(output, context);
1907
1621
  }
1908
- const contents = {
1622
+ const contents = map({
1909
1623
  $metadata: deserializeMetadata(output),
1910
- AppInstanceArn: undefined,
1911
- };
1624
+ });
1912
1625
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1913
- if (data.AppInstanceArn !== undefined && data.AppInstanceArn !== null) {
1626
+ if (data.AppInstanceArn != null) {
1914
1627
  contents.AppInstanceArn = (0, smithy_client_1.expectString)(data.AppInstanceArn);
1915
1628
  }
1916
- return Promise.resolve(contents);
1629
+ return contents;
1917
1630
  };
1918
1631
  exports.deserializeAws_restJson1UpdateAppInstanceCommand = deserializeAws_restJson1UpdateAppInstanceCommand;
1919
1632
  const deserializeAws_restJson1UpdateAppInstanceCommandError = async (output, context) => {
@@ -1921,7 +1634,6 @@ const deserializeAws_restJson1UpdateAppInstanceCommandError = async (output, con
1921
1634
  ...output,
1922
1635
  body: await parseBody(output.body, context),
1923
1636
  };
1924
- let response;
1925
1637
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1926
1638
  switch (errorCode) {
1927
1639
  case "BadRequestException":
@@ -1947,29 +1659,26 @@ const deserializeAws_restJson1UpdateAppInstanceCommandError = async (output, con
1947
1659
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
1948
1660
  default:
1949
1661
  const parsedBody = parsedOutput.body;
1950
- const $metadata = deserializeMetadata(output);
1951
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1952
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
1953
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1954
- $fault: "client",
1955
- $metadata,
1662
+ (0, smithy_client_1.throwDefaultError)({
1663
+ output,
1664
+ parsedBody,
1665
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1666
+ errorCode,
1956
1667
  });
1957
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1958
1668
  }
1959
1669
  };
1960
1670
  const deserializeAws_restJson1UpdateAppInstanceUserCommand = async (output, context) => {
1961
1671
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1962
1672
  return deserializeAws_restJson1UpdateAppInstanceUserCommandError(output, context);
1963
1673
  }
1964
- const contents = {
1674
+ const contents = map({
1965
1675
  $metadata: deserializeMetadata(output),
1966
- AppInstanceUserArn: undefined,
1967
- };
1676
+ });
1968
1677
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1969
- if (data.AppInstanceUserArn !== undefined && data.AppInstanceUserArn !== null) {
1678
+ if (data.AppInstanceUserArn != null) {
1970
1679
  contents.AppInstanceUserArn = (0, smithy_client_1.expectString)(data.AppInstanceUserArn);
1971
1680
  }
1972
- return Promise.resolve(contents);
1681
+ return contents;
1973
1682
  };
1974
1683
  exports.deserializeAws_restJson1UpdateAppInstanceUserCommand = deserializeAws_restJson1UpdateAppInstanceUserCommand;
1975
1684
  const deserializeAws_restJson1UpdateAppInstanceUserCommandError = async (output, context) => {
@@ -1977,7 +1686,6 @@ const deserializeAws_restJson1UpdateAppInstanceUserCommandError = async (output,
1977
1686
  ...output,
1978
1687
  body: await parseBody(output.body, context),
1979
1688
  };
1980
- let response;
1981
1689
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1982
1690
  switch (errorCode) {
1983
1691
  case "BadRequestException":
@@ -2006,33 +1714,29 @@ const deserializeAws_restJson1UpdateAppInstanceUserCommandError = async (output,
2006
1714
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
2007
1715
  default:
2008
1716
  const parsedBody = parsedOutput.body;
2009
- const $metadata = deserializeMetadata(output);
2010
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2011
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
2012
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2013
- $fault: "client",
2014
- $metadata,
1717
+ (0, smithy_client_1.throwDefaultError)({
1718
+ output,
1719
+ parsedBody,
1720
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1721
+ errorCode,
2015
1722
  });
2016
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2017
1723
  }
2018
1724
  };
2019
1725
  const deserializeAws_restJson1UpdateAppInstanceUserEndpointCommand = async (output, context) => {
2020
1726
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2021
1727
  return deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError(output, context);
2022
1728
  }
2023
- const contents = {
1729
+ const contents = map({
2024
1730
  $metadata: deserializeMetadata(output),
2025
- AppInstanceUserArn: undefined,
2026
- EndpointId: undefined,
2027
- };
1731
+ });
2028
1732
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2029
- if (data.AppInstanceUserArn !== undefined && data.AppInstanceUserArn !== null) {
1733
+ if (data.AppInstanceUserArn != null) {
2030
1734
  contents.AppInstanceUserArn = (0, smithy_client_1.expectString)(data.AppInstanceUserArn);
2031
1735
  }
2032
- if (data.EndpointId !== undefined && data.EndpointId !== null) {
1736
+ if (data.EndpointId != null) {
2033
1737
  contents.EndpointId = (0, smithy_client_1.expectString)(data.EndpointId);
2034
1738
  }
2035
- return Promise.resolve(contents);
1739
+ return contents;
2036
1740
  };
2037
1741
  exports.deserializeAws_restJson1UpdateAppInstanceUserEndpointCommand = deserializeAws_restJson1UpdateAppInstanceUserEndpointCommand;
2038
1742
  const deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError = async (output, context) => {
@@ -2040,7 +1744,6 @@ const deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError = async
2040
1744
  ...output,
2041
1745
  body: await parseBody(output.body, context),
2042
1746
  };
2043
- let response;
2044
1747
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2045
1748
  switch (errorCode) {
2046
1749
  case "BadRequestException":
@@ -2066,23 +1769,22 @@ const deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError = async
2066
1769
  throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
2067
1770
  default:
2068
1771
  const parsedBody = parsedOutput.body;
2069
- const $metadata = deserializeMetadata(output);
2070
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2071
- response = new ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException({
2072
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2073
- $fault: "client",
2074
- $metadata,
1772
+ (0, smithy_client_1.throwDefaultError)({
1773
+ output,
1774
+ parsedBody,
1775
+ exceptionCtor: ChimeSDKIdentityServiceException_1.ChimeSDKIdentityServiceException,
1776
+ errorCode,
2075
1777
  });
2076
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2077
1778
  }
2078
1779
  };
1780
+ const map = smithy_client_1.map;
2079
1781
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
2080
- const contents = {};
1782
+ const contents = map({});
2081
1783
  const data = parsedOutput.body;
2082
- if (data.Code !== undefined && data.Code !== null) {
1784
+ if (data.Code != null) {
2083
1785
  contents.Code = (0, smithy_client_1.expectString)(data.Code);
2084
1786
  }
2085
- if (data.Message !== undefined && data.Message !== null) {
1787
+ if (data.Message != null) {
2086
1788
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2087
1789
  }
2088
1790
  const exception = new models_0_1.BadRequestException({
@@ -2092,12 +1794,12 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
2092
1794
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2093
1795
  };
2094
1796
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2095
- const contents = {};
1797
+ const contents = map({});
2096
1798
  const data = parsedOutput.body;
2097
- if (data.Code !== undefined && data.Code !== null) {
1799
+ if (data.Code != null) {
2098
1800
  contents.Code = (0, smithy_client_1.expectString)(data.Code);
2099
1801
  }
2100
- if (data.Message !== undefined && data.Message !== null) {
1802
+ if (data.Message != null) {
2101
1803
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2102
1804
  }
2103
1805
  const exception = new models_0_1.ConflictException({
@@ -2107,12 +1809,12 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
2107
1809
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2108
1810
  };
2109
1811
  const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
2110
- const contents = {};
1812
+ const contents = map({});
2111
1813
  const data = parsedOutput.body;
2112
- if (data.Code !== undefined && data.Code !== null) {
1814
+ if (data.Code != null) {
2113
1815
  contents.Code = (0, smithy_client_1.expectString)(data.Code);
2114
1816
  }
2115
- if (data.Message !== undefined && data.Message !== null) {
1817
+ if (data.Message != null) {
2116
1818
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2117
1819
  }
2118
1820
  const exception = new models_0_1.ForbiddenException({
@@ -2122,12 +1824,12 @@ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput,
2122
1824
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2123
1825
  };
2124
1826
  const deserializeAws_restJson1ResourceLimitExceededExceptionResponse = async (parsedOutput, context) => {
2125
- const contents = {};
1827
+ const contents = map({});
2126
1828
  const data = parsedOutput.body;
2127
- if (data.Code !== undefined && data.Code !== null) {
1829
+ if (data.Code != null) {
2128
1830
  contents.Code = (0, smithy_client_1.expectString)(data.Code);
2129
1831
  }
2130
- if (data.Message !== undefined && data.Message !== null) {
1832
+ if (data.Message != null) {
2131
1833
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2132
1834
  }
2133
1835
  const exception = new models_0_1.ResourceLimitExceededException({
@@ -2137,12 +1839,12 @@ const deserializeAws_restJson1ResourceLimitExceededExceptionResponse = async (pa
2137
1839
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2138
1840
  };
2139
1841
  const deserializeAws_restJson1ServiceFailureExceptionResponse = async (parsedOutput, context) => {
2140
- const contents = {};
1842
+ const contents = map({});
2141
1843
  const data = parsedOutput.body;
2142
- if (data.Code !== undefined && data.Code !== null) {
1844
+ if (data.Code != null) {
2143
1845
  contents.Code = (0, smithy_client_1.expectString)(data.Code);
2144
1846
  }
2145
- if (data.Message !== undefined && data.Message !== null) {
1847
+ if (data.Message != null) {
2146
1848
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2147
1849
  }
2148
1850
  const exception = new models_0_1.ServiceFailureException({
@@ -2152,12 +1854,12 @@ const deserializeAws_restJson1ServiceFailureExceptionResponse = async (parsedOut
2152
1854
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2153
1855
  };
2154
1856
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
2155
- const contents = {};
1857
+ const contents = map({});
2156
1858
  const data = parsedOutput.body;
2157
- if (data.Code !== undefined && data.Code !== null) {
1859
+ if (data.Code != null) {
2158
1860
  contents.Code = (0, smithy_client_1.expectString)(data.Code);
2159
1861
  }
2160
- if (data.Message !== undefined && data.Message !== null) {
1862
+ if (data.Message != null) {
2161
1863
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2162
1864
  }
2163
1865
  const exception = new models_0_1.ServiceUnavailableException({
@@ -2167,12 +1869,12 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parse
2167
1869
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2168
1870
  };
2169
1871
  const deserializeAws_restJson1ThrottledClientExceptionResponse = async (parsedOutput, context) => {
2170
- const contents = {};
1872
+ const contents = map({});
2171
1873
  const data = parsedOutput.body;
2172
- if (data.Code !== undefined && data.Code !== null) {
1874
+ if (data.Code != null) {
2173
1875
  contents.Code = (0, smithy_client_1.expectString)(data.Code);
2174
1876
  }
2175
- if (data.Message !== undefined && data.Message !== null) {
1877
+ if (data.Message != null) {
2176
1878
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2177
1879
  }
2178
1880
  const exception = new models_0_1.ThrottledClientException({
@@ -2182,12 +1884,12 @@ const deserializeAws_restJson1ThrottledClientExceptionResponse = async (parsedOu
2182
1884
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2183
1885
  };
2184
1886
  const deserializeAws_restJson1UnauthorizedClientExceptionResponse = async (parsedOutput, context) => {
2185
- const contents = {};
1887
+ const contents = map({});
2186
1888
  const data = parsedOutput.body;
2187
- if (data.Code !== undefined && data.Code !== null) {
1889
+ if (data.Code != null) {
2188
1890
  contents.Code = (0, smithy_client_1.expectString)(data.Code);
2189
1891
  }
2190
- if (data.Message !== undefined && data.Message !== null) {
1892
+ if (data.Message != null) {
2191
1893
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2192
1894
  }
2193
1895
  const exception = new models_0_1.UnauthorizedClientException({
@@ -2224,9 +1926,6 @@ const serializeAws_restJson1TagKeyList = (input, context) => {
2224
1926
  return input
2225
1927
  .filter((e) => e != null)
2226
1928
  .map((entry) => {
2227
- if (entry === null) {
2228
- return null;
2229
- }
2230
1929
  return entry;
2231
1930
  });
2232
1931
  };
@@ -2234,9 +1933,6 @@ const serializeAws_restJson1TagList = (input, context) => {
2234
1933
  return input
2235
1934
  .filter((e) => e != null)
2236
1935
  .map((entry) => {
2237
- if (entry === null) {
2238
- return null;
2239
- }
2240
1936
  return serializeAws_restJson1Tag(entry, context);
2241
1937
  });
2242
1938
  };