@aws-sdk/client-finspace 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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.150.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.149.0...v3.150.0) (2022-08-15)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-finspace
9
+
10
+
11
+
12
+
13
+
14
+ # [3.145.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.144.0...v3.145.0) (2022-08-08)
15
+
16
+ **Note:** Version bump only for package @aws-sdk/client-finspace
17
+
18
+
19
+
20
+
21
+
22
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
23
+
24
+
25
+ ### Features
26
+
27
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
7
34
 
8
35
 
@@ -41,16 +41,7 @@ const serializeAws_restJson1DeleteEnvironmentCommand = async (input, context) =>
41
41
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
42
42
  const headers = {};
43
43
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
44
- if (input.environmentId !== undefined) {
45
- const labelValue = input.environmentId;
46
- if (labelValue.length <= 0) {
47
- throw new Error("Empty value provided for input HTTP label: environmentId.");
48
- }
49
- resolvedPath = resolvedPath.replace("{environmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
50
- }
51
- else {
52
- throw new Error("No value provided for input HTTP label: environmentId.");
53
- }
44
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "environmentId", () => input.environmentId, "{environmentId}", false);
54
45
  let body;
55
46
  return new protocol_http_1.HttpRequest({
56
47
  protocol,
@@ -67,16 +58,7 @@ const serializeAws_restJson1GetEnvironmentCommand = async (input, context) => {
67
58
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
68
59
  const headers = {};
69
60
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
70
- if (input.environmentId !== undefined) {
71
- const labelValue = input.environmentId;
72
- if (labelValue.length <= 0) {
73
- throw new Error("Empty value provided for input HTTP label: environmentId.");
74
- }
75
- resolvedPath = resolvedPath.replace("{environmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
76
- }
77
- else {
78
- throw new Error("No value provided for input HTTP label: environmentId.");
79
- }
61
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "environmentId", () => input.environmentId, "{environmentId}", false);
80
62
  let body;
81
63
  return new protocol_http_1.HttpRequest({
82
64
  protocol,
@@ -93,10 +75,10 @@ const serializeAws_restJson1ListEnvironmentsCommand = async (input, context) =>
93
75
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
94
76
  const headers = {};
95
77
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
96
- const query = {
97
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
98
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
99
- };
78
+ const query = map({
79
+ nextToken: [, input.nextToken],
80
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
81
+ });
100
82
  let body;
101
83
  return new protocol_http_1.HttpRequest({
102
84
  protocol,
@@ -114,16 +96,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
114
96
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
115
97
  const headers = {};
116
98
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
117
- if (input.resourceArn !== undefined) {
118
- const labelValue = input.resourceArn;
119
- if (labelValue.length <= 0) {
120
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
121
- }
122
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
123
- }
124
- else {
125
- throw new Error("No value provided for input HTTP label: resourceArn.");
126
- }
99
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
127
100
  let body;
128
101
  return new protocol_http_1.HttpRequest({
129
102
  protocol,
@@ -142,16 +115,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
142
115
  "content-type": "application/json",
143
116
  };
144
117
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
145
- if (input.resourceArn !== undefined) {
146
- const labelValue = input.resourceArn;
147
- if (labelValue.length <= 0) {
148
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
149
- }
150
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
151
- }
152
- else {
153
- throw new Error("No value provided for input HTTP label: resourceArn.");
154
- }
118
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
155
119
  let body;
156
120
  body = JSON.stringify({
157
121
  ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
@@ -171,19 +135,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
171
135
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
172
136
  const headers = {};
173
137
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
174
- if (input.resourceArn !== undefined) {
175
- const labelValue = input.resourceArn;
176
- if (labelValue.length <= 0) {
177
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
178
- }
179
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
180
- }
181
- else {
182
- throw new Error("No value provided for input HTTP label: resourceArn.");
183
- }
184
- const query = {
185
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
186
- };
138
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
139
+ const query = map({
140
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
141
+ });
187
142
  let body;
188
143
  return new protocol_http_1.HttpRequest({
189
144
  protocol,
@@ -203,16 +158,7 @@ const serializeAws_restJson1UpdateEnvironmentCommand = async (input, context) =>
203
158
  "content-type": "application/json",
204
159
  };
205
160
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
206
- if (input.environmentId !== undefined) {
207
- const labelValue = input.environmentId;
208
- if (labelValue.length <= 0) {
209
- throw new Error("Empty value provided for input HTTP label: environmentId.");
210
- }
211
- resolvedPath = resolvedPath.replace("{environmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
212
- }
213
- else {
214
- throw new Error("No value provided for input HTTP label: environmentId.");
215
- }
161
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "environmentId", () => input.environmentId, "{environmentId}", false);
216
162
  let body;
217
163
  body = JSON.stringify({
218
164
  ...(input.description != null && { description: input.description }),
@@ -237,23 +183,20 @@ const deserializeAws_restJson1CreateEnvironmentCommand = async (output, context)
237
183
  if (output.statusCode !== 200 && output.statusCode >= 300) {
238
184
  return deserializeAws_restJson1CreateEnvironmentCommandError(output, context);
239
185
  }
240
- const contents = {
186
+ const contents = map({
241
187
  $metadata: deserializeMetadata(output),
242
- environmentArn: undefined,
243
- environmentId: undefined,
244
- environmentUrl: undefined,
245
- };
188
+ });
246
189
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
247
- if (data.environmentArn !== undefined && data.environmentArn !== null) {
190
+ if (data.environmentArn != null) {
248
191
  contents.environmentArn = (0, smithy_client_1.expectString)(data.environmentArn);
249
192
  }
250
- if (data.environmentId !== undefined && data.environmentId !== null) {
193
+ if (data.environmentId != null) {
251
194
  contents.environmentId = (0, smithy_client_1.expectString)(data.environmentId);
252
195
  }
253
- if (data.environmentUrl !== undefined && data.environmentUrl !== null) {
196
+ if (data.environmentUrl != null) {
254
197
  contents.environmentUrl = (0, smithy_client_1.expectString)(data.environmentUrl);
255
198
  }
256
- return Promise.resolve(contents);
199
+ return contents;
257
200
  };
258
201
  exports.deserializeAws_restJson1CreateEnvironmentCommand = deserializeAws_restJson1CreateEnvironmentCommand;
259
202
  const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, context) => {
@@ -261,7 +204,6 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, con
261
204
  ...output,
262
205
  body: await parseBody(output.body, context),
263
206
  };
264
- let response;
265
207
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
266
208
  switch (errorCode) {
267
209
  case "AccessDeniedException":
@@ -284,25 +226,23 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, con
284
226
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
285
227
  default:
286
228
  const parsedBody = parsedOutput.body;
287
- const $metadata = deserializeMetadata(output);
288
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
289
- response = new FinspaceServiceException_1.FinspaceServiceException({
290
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
291
- $fault: "client",
292
- $metadata,
229
+ (0, smithy_client_1.throwDefaultError)({
230
+ output,
231
+ parsedBody,
232
+ exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
233
+ errorCode,
293
234
  });
294
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
295
235
  }
296
236
  };
297
237
  const deserializeAws_restJson1DeleteEnvironmentCommand = async (output, context) => {
298
238
  if (output.statusCode !== 200 && output.statusCode >= 300) {
299
239
  return deserializeAws_restJson1DeleteEnvironmentCommandError(output, context);
300
240
  }
301
- const contents = {
241
+ const contents = map({
302
242
  $metadata: deserializeMetadata(output),
303
- };
243
+ });
304
244
  await collectBody(output.body, context);
305
- return Promise.resolve(contents);
245
+ return contents;
306
246
  };
307
247
  exports.deserializeAws_restJson1DeleteEnvironmentCommand = deserializeAws_restJson1DeleteEnvironmentCommand;
308
248
  const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, context) => {
@@ -310,7 +250,6 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, con
310
250
  ...output,
311
251
  body: await parseBody(output.body, context),
312
252
  };
313
- let response;
314
253
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
315
254
  switch (errorCode) {
316
255
  case "AccessDeniedException":
@@ -330,29 +269,26 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, con
330
269
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
331
270
  default:
332
271
  const parsedBody = parsedOutput.body;
333
- const $metadata = deserializeMetadata(output);
334
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
335
- response = new FinspaceServiceException_1.FinspaceServiceException({
336
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
337
- $fault: "client",
338
- $metadata,
272
+ (0, smithy_client_1.throwDefaultError)({
273
+ output,
274
+ parsedBody,
275
+ exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
276
+ errorCode,
339
277
  });
340
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
341
278
  }
342
279
  };
343
280
  const deserializeAws_restJson1GetEnvironmentCommand = async (output, context) => {
344
281
  if (output.statusCode !== 200 && output.statusCode >= 300) {
345
282
  return deserializeAws_restJson1GetEnvironmentCommandError(output, context);
346
283
  }
347
- const contents = {
284
+ const contents = map({
348
285
  $metadata: deserializeMetadata(output),
349
- environment: undefined,
350
- };
286
+ });
351
287
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
352
- if (data.environment !== undefined && data.environment !== null) {
288
+ if (data.environment != null) {
353
289
  contents.environment = deserializeAws_restJson1Environment(data.environment, context);
354
290
  }
355
- return Promise.resolve(contents);
291
+ return contents;
356
292
  };
357
293
  exports.deserializeAws_restJson1GetEnvironmentCommand = deserializeAws_restJson1GetEnvironmentCommand;
358
294
  const deserializeAws_restJson1GetEnvironmentCommandError = async (output, context) => {
@@ -360,7 +296,6 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, contex
360
296
  ...output,
361
297
  body: await parseBody(output.body, context),
362
298
  };
363
- let response;
364
299
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
365
300
  switch (errorCode) {
366
301
  case "AccessDeniedException":
@@ -377,33 +312,29 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, contex
377
312
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
378
313
  default:
379
314
  const parsedBody = parsedOutput.body;
380
- const $metadata = deserializeMetadata(output);
381
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
382
- response = new FinspaceServiceException_1.FinspaceServiceException({
383
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
384
- $fault: "client",
385
- $metadata,
315
+ (0, smithy_client_1.throwDefaultError)({
316
+ output,
317
+ parsedBody,
318
+ exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
319
+ errorCode,
386
320
  });
387
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
388
321
  }
389
322
  };
390
323
  const deserializeAws_restJson1ListEnvironmentsCommand = async (output, context) => {
391
324
  if (output.statusCode !== 200 && output.statusCode >= 300) {
392
325
  return deserializeAws_restJson1ListEnvironmentsCommandError(output, context);
393
326
  }
394
- const contents = {
327
+ const contents = map({
395
328
  $metadata: deserializeMetadata(output),
396
- environments: undefined,
397
- nextToken: undefined,
398
- };
329
+ });
399
330
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
400
- if (data.environments !== undefined && data.environments !== null) {
331
+ if (data.environments != null) {
401
332
  contents.environments = deserializeAws_restJson1EnvironmentList(data.environments, context);
402
333
  }
403
- if (data.nextToken !== undefined && data.nextToken !== null) {
334
+ if (data.nextToken != null) {
404
335
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
405
336
  }
406
- return Promise.resolve(contents);
337
+ return contents;
407
338
  };
408
339
  exports.deserializeAws_restJson1ListEnvironmentsCommand = deserializeAws_restJson1ListEnvironmentsCommand;
409
340
  const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, context) => {
@@ -411,7 +342,6 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, cont
411
342
  ...output,
412
343
  body: await parseBody(output.body, context),
413
344
  };
414
- let response;
415
345
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
416
346
  switch (errorCode) {
417
347
  case "InternalServerException":
@@ -422,29 +352,26 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, cont
422
352
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
423
353
  default:
424
354
  const parsedBody = parsedOutput.body;
425
- const $metadata = deserializeMetadata(output);
426
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
427
- response = new FinspaceServiceException_1.FinspaceServiceException({
428
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
429
- $fault: "client",
430
- $metadata,
355
+ (0, smithy_client_1.throwDefaultError)({
356
+ output,
357
+ parsedBody,
358
+ exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
359
+ errorCode,
431
360
  });
432
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
433
361
  }
434
362
  };
435
363
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
436
364
  if (output.statusCode !== 200 && output.statusCode >= 300) {
437
365
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
438
366
  }
439
- const contents = {
367
+ const contents = map({
440
368
  $metadata: deserializeMetadata(output),
441
- tags: undefined,
442
- };
369
+ });
443
370
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
444
- if (data.tags !== undefined && data.tags !== null) {
371
+ if (data.tags != null) {
445
372
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
446
373
  }
447
- return Promise.resolve(contents);
374
+ return contents;
448
375
  };
449
376
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
450
377
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -452,7 +379,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
452
379
  ...output,
453
380
  body: await parseBody(output.body, context),
454
381
  };
455
- let response;
456
382
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
457
383
  switch (errorCode) {
458
384
  case "InternalServerException":
@@ -466,25 +392,23 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
466
392
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
467
393
  default:
468
394
  const parsedBody = parsedOutput.body;
469
- const $metadata = deserializeMetadata(output);
470
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
471
- response = new FinspaceServiceException_1.FinspaceServiceException({
472
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
473
- $fault: "client",
474
- $metadata,
395
+ (0, smithy_client_1.throwDefaultError)({
396
+ output,
397
+ parsedBody,
398
+ exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
399
+ errorCode,
475
400
  });
476
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
477
401
  }
478
402
  };
479
403
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
480
404
  if (output.statusCode !== 200 && output.statusCode >= 300) {
481
405
  return deserializeAws_restJson1TagResourceCommandError(output, context);
482
406
  }
483
- const contents = {
407
+ const contents = map({
484
408
  $metadata: deserializeMetadata(output),
485
- };
409
+ });
486
410
  await collectBody(output.body, context);
487
- return Promise.resolve(contents);
411
+ return contents;
488
412
  };
489
413
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
490
414
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -492,7 +416,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
492
416
  ...output,
493
417
  body: await parseBody(output.body, context),
494
418
  };
495
- let response;
496
419
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
497
420
  switch (errorCode) {
498
421
  case "InternalServerException":
@@ -506,25 +429,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
506
429
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
507
430
  default:
508
431
  const parsedBody = parsedOutput.body;
509
- const $metadata = deserializeMetadata(output);
510
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
511
- response = new FinspaceServiceException_1.FinspaceServiceException({
512
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
513
- $fault: "client",
514
- $metadata,
432
+ (0, smithy_client_1.throwDefaultError)({
433
+ output,
434
+ parsedBody,
435
+ exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
436
+ errorCode,
515
437
  });
516
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
517
438
  }
518
439
  };
519
440
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
520
441
  if (output.statusCode !== 200 && output.statusCode >= 300) {
521
442
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
522
443
  }
523
- const contents = {
444
+ const contents = map({
524
445
  $metadata: deserializeMetadata(output),
525
- };
446
+ });
526
447
  await collectBody(output.body, context);
527
- return Promise.resolve(contents);
448
+ return contents;
528
449
  };
529
450
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
530
451
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -532,7 +453,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
532
453
  ...output,
533
454
  body: await parseBody(output.body, context),
534
455
  };
535
- let response;
536
456
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
537
457
  switch (errorCode) {
538
458
  case "InternalServerException":
@@ -546,29 +466,26 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
546
466
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
547
467
  default:
548
468
  const parsedBody = parsedOutput.body;
549
- const $metadata = deserializeMetadata(output);
550
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
551
- response = new FinspaceServiceException_1.FinspaceServiceException({
552
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
553
- $fault: "client",
554
- $metadata,
469
+ (0, smithy_client_1.throwDefaultError)({
470
+ output,
471
+ parsedBody,
472
+ exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
473
+ errorCode,
555
474
  });
556
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
557
475
  }
558
476
  };
559
477
  const deserializeAws_restJson1UpdateEnvironmentCommand = async (output, context) => {
560
478
  if (output.statusCode !== 200 && output.statusCode >= 300) {
561
479
  return deserializeAws_restJson1UpdateEnvironmentCommandError(output, context);
562
480
  }
563
- const contents = {
481
+ const contents = map({
564
482
  $metadata: deserializeMetadata(output),
565
- environment: undefined,
566
- };
483
+ });
567
484
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
568
- if (data.environment !== undefined && data.environment !== null) {
485
+ if (data.environment != null) {
569
486
  contents.environment = deserializeAws_restJson1Environment(data.environment, context);
570
487
  }
571
- return Promise.resolve(contents);
488
+ return contents;
572
489
  };
573
490
  exports.deserializeAws_restJson1UpdateEnvironmentCommand = deserializeAws_restJson1UpdateEnvironmentCommand;
574
491
  const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, context) => {
@@ -576,7 +493,6 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, con
576
493
  ...output,
577
494
  body: await parseBody(output.body, context),
578
495
  };
579
- let response;
580
496
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
581
497
  switch (errorCode) {
582
498
  case "AccessDeniedException":
@@ -596,18 +512,17 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, con
596
512
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
597
513
  default:
598
514
  const parsedBody = parsedOutput.body;
599
- const $metadata = deserializeMetadata(output);
600
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
601
- response = new FinspaceServiceException_1.FinspaceServiceException({
602
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
603
- $fault: "client",
604
- $metadata,
515
+ (0, smithy_client_1.throwDefaultError)({
516
+ output,
517
+ parsedBody,
518
+ exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
519
+ errorCode,
605
520
  });
606
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
607
521
  }
608
522
  };
523
+ const map = smithy_client_1.map;
609
524
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
610
- const contents = {};
525
+ const contents = map({});
611
526
  const data = parsedOutput.body;
612
527
  const exception = new models_0_1.AccessDeniedException({
613
528
  $metadata: deserializeMetadata(parsedOutput),
@@ -616,9 +531,9 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
616
531
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
617
532
  };
618
533
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
619
- const contents = {};
534
+ const contents = map({});
620
535
  const data = parsedOutput.body;
621
- if (data.message !== undefined && data.message !== null) {
536
+ if (data.message != null) {
622
537
  contents.message = (0, smithy_client_1.expectString)(data.message);
623
538
  }
624
539
  const exception = new models_0_1.InternalServerException({
@@ -628,9 +543,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
628
543
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
629
544
  };
630
545
  const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
631
- const contents = {};
546
+ const contents = map({});
632
547
  const data = parsedOutput.body;
633
- if (data.message !== undefined && data.message !== null) {
548
+ if (data.message != null) {
634
549
  contents.message = (0, smithy_client_1.expectString)(data.message);
635
550
  }
636
551
  const exception = new models_0_1.InvalidRequestException({
@@ -640,9 +555,9 @@ const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOut
640
555
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
641
556
  };
642
557
  const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
643
- const contents = {};
558
+ const contents = map({});
644
559
  const data = parsedOutput.body;
645
- if (data.message !== undefined && data.message !== null) {
560
+ if (data.message != null) {
646
561
  contents.message = (0, smithy_client_1.expectString)(data.message);
647
562
  }
648
563
  const exception = new models_0_1.LimitExceededException({
@@ -652,9 +567,9 @@ const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutp
652
567
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
653
568
  };
654
569
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
655
- const contents = {};
570
+ const contents = map({});
656
571
  const data = parsedOutput.body;
657
- if (data.message !== undefined && data.message !== null) {
572
+ if (data.message != null) {
658
573
  contents.message = (0, smithy_client_1.expectString)(data.message);
659
574
  }
660
575
  const exception = new models_0_1.ResourceNotFoundException({
@@ -664,9 +579,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
664
579
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
665
580
  };
666
581
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
667
- const contents = {};
582
+ const contents = map({});
668
583
  const data = parsedOutput.body;
669
- if (data.message !== undefined && data.message !== null) {
584
+ if (data.message != null) {
670
585
  contents.message = (0, smithy_client_1.expectString)(data.message);
671
586
  }
672
587
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -676,7 +591,7 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
676
591
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
677
592
  };
678
593
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
679
- const contents = {};
594
+ const contents = map({});
680
595
  const data = parsedOutput.body;
681
596
  const exception = new models_0_1.ThrottlingException({
682
597
  $metadata: deserializeMetadata(parsedOutput),
@@ -685,9 +600,9 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
685
600
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
686
601
  };
687
602
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
688
- const contents = {};
603
+ const contents = map({});
689
604
  const data = parsedOutput.body;
690
- if (data.message !== undefined && data.message !== null) {
605
+ if (data.message != null) {
691
606
  contents.message = (0, smithy_client_1.expectString)(data.message);
692
607
  }
693
608
  const exception = new models_0_1.ValidationException({
@@ -711,9 +626,6 @@ const serializeAws_restJson1DataBundleArns = (input, context) => {
711
626
  return input
712
627
  .filter((e) => e != null)
713
628
  .map((entry) => {
714
- if (entry === null) {
715
- return null;
716
- }
717
629
  return entry;
718
630
  });
719
631
  };