@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.
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { FinspaceServiceException as __BaseException } from "../models/FinspaceServiceException";
5
5
  import { AccessDeniedException, InternalServerException, InvalidRequestException, LimitExceededException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1CreateEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -32,7 +32,7 @@ export var serializeAws_restJson1CreateEnvironmentCommand = function (input, con
32
32
  });
33
33
  }); };
34
34
  export var serializeAws_restJson1DeleteEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
35
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
35
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
36
36
  return __generator(this, function (_c) {
37
37
  switch (_c.label) {
38
38
  case 0: return [4, context.endpoint()];
@@ -40,16 +40,7 @@ export var serializeAws_restJson1DeleteEnvironmentCommand = function (input, con
40
40
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
41
41
  headers = {};
42
42
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment/{environmentId}";
43
- if (input.environmentId !== undefined) {
44
- labelValue = input.environmentId;
45
- if (labelValue.length <= 0) {
46
- throw new Error("Empty value provided for input HTTP label: environmentId.");
47
- }
48
- resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
49
- }
50
- else {
51
- throw new Error("No value provided for input HTTP label: environmentId.");
52
- }
43
+ resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", function () { return input.environmentId; }, "{environmentId}", false);
53
44
  return [2, new __HttpRequest({
54
45
  protocol: protocol,
55
46
  hostname: hostname,
@@ -63,7 +54,7 @@ export var serializeAws_restJson1DeleteEnvironmentCommand = function (input, con
63
54
  });
64
55
  }); };
65
56
  export var serializeAws_restJson1GetEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
66
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
57
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
67
58
  return __generator(this, function (_c) {
68
59
  switch (_c.label) {
69
60
  case 0: return [4, context.endpoint()];
@@ -71,16 +62,7 @@ export var serializeAws_restJson1GetEnvironmentCommand = function (input, contex
71
62
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
72
63
  headers = {};
73
64
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment/{environmentId}";
74
- if (input.environmentId !== undefined) {
75
- labelValue = input.environmentId;
76
- if (labelValue.length <= 0) {
77
- throw new Error("Empty value provided for input HTTP label: environmentId.");
78
- }
79
- resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
80
- }
81
- else {
82
- throw new Error("No value provided for input HTTP label: environmentId.");
83
- }
65
+ resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", function () { return input.environmentId; }, "{environmentId}", false);
84
66
  return [2, new __HttpRequest({
85
67
  protocol: protocol,
86
68
  hostname: hostname,
@@ -102,7 +84,10 @@ export var serializeAws_restJson1ListEnvironmentsCommand = function (input, cont
102
84
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
103
85
  headers = {};
104
86
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment";
105
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
87
+ query = map({
88
+ nextToken: [, input.nextToken],
89
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
90
+ });
106
91
  return [2, new __HttpRequest({
107
92
  protocol: protocol,
108
93
  hostname: hostname,
@@ -117,7 +102,7 @@ export var serializeAws_restJson1ListEnvironmentsCommand = function (input, cont
117
102
  });
118
103
  }); };
119
104
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
120
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
105
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
121
106
  return __generator(this, function (_c) {
122
107
  switch (_c.label) {
123
108
  case 0: return [4, context.endpoint()];
@@ -125,16 +110,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
125
110
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
126
111
  headers = {};
127
112
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
128
- if (input.resourceArn !== undefined) {
129
- labelValue = input.resourceArn;
130
- if (labelValue.length <= 0) {
131
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
132
- }
133
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
134
- }
135
- else {
136
- throw new Error("No value provided for input HTTP label: resourceArn.");
137
- }
113
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
138
114
  return [2, new __HttpRequest({
139
115
  protocol: protocol,
140
116
  hostname: hostname,
@@ -148,7 +124,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
148
124
  });
149
125
  }); };
150
126
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
151
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
127
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
152
128
  return __generator(this, function (_c) {
153
129
  switch (_c.label) {
154
130
  case 0: return [4, context.endpoint()];
@@ -158,16 +134,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
158
134
  "content-type": "application/json",
159
135
  };
160
136
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
161
- if (input.resourceArn !== undefined) {
162
- labelValue = input.resourceArn;
163
- if (labelValue.length <= 0) {
164
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
165
- }
166
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
167
- }
168
- else {
169
- throw new Error("No value provided for input HTTP label: resourceArn.");
170
- }
137
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
171
138
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
172
139
  return [2, new __HttpRequest({
173
140
  protocol: protocol,
@@ -182,7 +149,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
182
149
  });
183
150
  }); };
184
151
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
185
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
152
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
186
153
  return __generator(this, function (_c) {
187
154
  switch (_c.label) {
188
155
  case 0: return [4, context.endpoint()];
@@ -190,17 +157,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
190
157
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
191
158
  headers = {};
192
159
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
193
- if (input.resourceArn !== undefined) {
194
- labelValue = input.resourceArn;
195
- if (labelValue.length <= 0) {
196
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
197
- }
198
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
199
- }
200
- else {
201
- throw new Error("No value provided for input HTTP label: resourceArn.");
202
- }
203
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
160
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
161
+ query = map({
162
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
163
+ });
204
164
  return [2, new __HttpRequest({
205
165
  protocol: protocol,
206
166
  hostname: hostname,
@@ -215,7 +175,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
215
175
  });
216
176
  }); };
217
177
  export var serializeAws_restJson1UpdateEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
218
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
178
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
219
179
  return __generator(this, function (_c) {
220
180
  switch (_c.label) {
221
181
  case 0: return [4, context.endpoint()];
@@ -225,16 +185,7 @@ export var serializeAws_restJson1UpdateEnvironmentCommand = function (input, con
225
185
  "content-type": "application/json",
226
186
  };
227
187
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment/{environmentId}";
228
- if (input.environmentId !== undefined) {
229
- labelValue = input.environmentId;
230
- if (labelValue.length <= 0) {
231
- throw new Error("Empty value provided for input HTTP label: environmentId.");
232
- }
233
- resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
234
- }
235
- else {
236
- throw new Error("No value provided for input HTTP label: environmentId.");
237
- }
188
+ resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", function () { return input.environmentId; }, "{environmentId}", false);
238
189
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.description != null && { description: input.description })), (input.federationMode != null && { federationMode: input.federationMode })), (input.federationParameters != null && {
239
190
  federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
240
191
  })), (input.name != null && { name: input.name })));
@@ -258,32 +209,29 @@ export var deserializeAws_restJson1CreateEnvironmentCommand = function (output,
258
209
  if (output.statusCode !== 200 && output.statusCode >= 300) {
259
210
  return [2, deserializeAws_restJson1CreateEnvironmentCommandError(output, context)];
260
211
  }
261
- contents = {
212
+ contents = map({
262
213
  $metadata: deserializeMetadata(output),
263
- environmentArn: undefined,
264
- environmentId: undefined,
265
- environmentUrl: undefined,
266
- };
214
+ });
267
215
  _a = __expectNonNull;
268
216
  _b = __expectObject;
269
217
  return [4, parseBody(output.body, context)];
270
218
  case 1:
271
219
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
272
- if (data.environmentArn !== undefined && data.environmentArn !== null) {
220
+ if (data.environmentArn != null) {
273
221
  contents.environmentArn = __expectString(data.environmentArn);
274
222
  }
275
- if (data.environmentId !== undefined && data.environmentId !== null) {
223
+ if (data.environmentId != null) {
276
224
  contents.environmentId = __expectString(data.environmentId);
277
225
  }
278
- if (data.environmentUrl !== undefined && data.environmentUrl !== null) {
226
+ if (data.environmentUrl != null) {
279
227
  contents.environmentUrl = __expectString(data.environmentUrl);
280
228
  }
281
- return [2, Promise.resolve(contents)];
229
+ return [2, contents];
282
230
  }
283
231
  });
284
232
  }); };
285
233
  var deserializeAws_restJson1CreateEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
286
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
234
+ var parsedOutput, _a, errorCode, _b, parsedBody;
287
235
  var _c;
288
236
  return __generator(this, function (_d) {
289
237
  switch (_d.label) {
@@ -324,14 +272,14 @@ var deserializeAws_restJson1CreateEnvironmentCommandError = function (output, co
324
272
  case 13: throw _d.sent();
325
273
  case 14:
326
274
  parsedBody = parsedOutput.body;
327
- $metadata = deserializeMetadata(output);
328
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
329
- response = new __BaseException({
330
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
331
- $fault: "client",
332
- $metadata: $metadata,
275
+ throwDefaultError({
276
+ output: output,
277
+ parsedBody: parsedBody,
278
+ exceptionCtor: __BaseException,
279
+ errorCode: errorCode,
333
280
  });
334
- throw __decorateServiceException(response, parsedBody);
281
+ _d.label = 15;
282
+ case 15: return [2];
335
283
  }
336
284
  });
337
285
  }); };
@@ -343,18 +291,18 @@ export var deserializeAws_restJson1DeleteEnvironmentCommand = function (output,
343
291
  if (output.statusCode !== 200 && output.statusCode >= 300) {
344
292
  return [2, deserializeAws_restJson1DeleteEnvironmentCommandError(output, context)];
345
293
  }
346
- contents = {
294
+ contents = map({
347
295
  $metadata: deserializeMetadata(output),
348
- };
296
+ });
349
297
  return [4, collectBody(output.body, context)];
350
298
  case 1:
351
299
  _a.sent();
352
- return [2, Promise.resolve(contents)];
300
+ return [2, contents];
353
301
  }
354
302
  });
355
303
  }); };
356
304
  var deserializeAws_restJson1DeleteEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
357
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
305
+ var parsedOutput, _a, errorCode, _b, parsedBody;
358
306
  var _c;
359
307
  return __generator(this, function (_d) {
360
308
  switch (_d.label) {
@@ -391,14 +339,14 @@ var deserializeAws_restJson1DeleteEnvironmentCommandError = function (output, co
391
339
  case 11: throw _d.sent();
392
340
  case 12:
393
341
  parsedBody = parsedOutput.body;
394
- $metadata = deserializeMetadata(output);
395
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
396
- response = new __BaseException({
397
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
398
- $fault: "client",
399
- $metadata: $metadata,
342
+ throwDefaultError({
343
+ output: output,
344
+ parsedBody: parsedBody,
345
+ exceptionCtor: __BaseException,
346
+ errorCode: errorCode,
400
347
  });
401
- throw __decorateServiceException(response, parsedBody);
348
+ _d.label = 13;
349
+ case 13: return [2];
402
350
  }
403
351
  });
404
352
  }); };
@@ -410,24 +358,23 @@ export var deserializeAws_restJson1GetEnvironmentCommand = function (output, con
410
358
  if (output.statusCode !== 200 && output.statusCode >= 300) {
411
359
  return [2, deserializeAws_restJson1GetEnvironmentCommandError(output, context)];
412
360
  }
413
- contents = {
361
+ contents = map({
414
362
  $metadata: deserializeMetadata(output),
415
- environment: undefined,
416
- };
363
+ });
417
364
  _a = __expectNonNull;
418
365
  _b = __expectObject;
419
366
  return [4, parseBody(output.body, context)];
420
367
  case 1:
421
368
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
422
- if (data.environment !== undefined && data.environment !== null) {
369
+ if (data.environment != null) {
423
370
  contents.environment = deserializeAws_restJson1Environment(data.environment, context);
424
371
  }
425
- return [2, Promise.resolve(contents)];
372
+ return [2, contents];
426
373
  }
427
374
  });
428
375
  }); };
429
376
  var deserializeAws_restJson1GetEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
430
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
377
+ var parsedOutput, _a, errorCode, _b, parsedBody;
431
378
  var _c;
432
379
  return __generator(this, function (_d) {
433
380
  switch (_d.label) {
@@ -460,14 +407,14 @@ var deserializeAws_restJson1GetEnvironmentCommandError = function (output, conte
460
407
  case 9: throw _d.sent();
461
408
  case 10:
462
409
  parsedBody = parsedOutput.body;
463
- $metadata = deserializeMetadata(output);
464
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
465
- response = new __BaseException({
466
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
467
- $fault: "client",
468
- $metadata: $metadata,
410
+ throwDefaultError({
411
+ output: output,
412
+ parsedBody: parsedBody,
413
+ exceptionCtor: __BaseException,
414
+ errorCode: errorCode,
469
415
  });
470
- throw __decorateServiceException(response, parsedBody);
416
+ _d.label = 11;
417
+ case 11: return [2];
471
418
  }
472
419
  });
473
420
  }); };
@@ -479,28 +426,26 @@ export var deserializeAws_restJson1ListEnvironmentsCommand = function (output, c
479
426
  if (output.statusCode !== 200 && output.statusCode >= 300) {
480
427
  return [2, deserializeAws_restJson1ListEnvironmentsCommandError(output, context)];
481
428
  }
482
- contents = {
429
+ contents = map({
483
430
  $metadata: deserializeMetadata(output),
484
- environments: undefined,
485
- nextToken: undefined,
486
- };
431
+ });
487
432
  _a = __expectNonNull;
488
433
  _b = __expectObject;
489
434
  return [4, parseBody(output.body, context)];
490
435
  case 1:
491
436
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
492
- if (data.environments !== undefined && data.environments !== null) {
437
+ if (data.environments != null) {
493
438
  contents.environments = deserializeAws_restJson1EnvironmentList(data.environments, context);
494
439
  }
495
- if (data.nextToken !== undefined && data.nextToken !== null) {
440
+ if (data.nextToken != null) {
496
441
  contents.nextToken = __expectString(data.nextToken);
497
442
  }
498
- return [2, Promise.resolve(contents)];
443
+ return [2, contents];
499
444
  }
500
445
  });
501
446
  }); };
502
447
  var deserializeAws_restJson1ListEnvironmentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
503
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
448
+ var parsedOutput, _a, errorCode, _b, parsedBody;
504
449
  var _c;
505
450
  return __generator(this, function (_d) {
506
451
  switch (_d.label) {
@@ -525,14 +470,14 @@ var deserializeAws_restJson1ListEnvironmentsCommandError = function (output, con
525
470
  case 5: throw _d.sent();
526
471
  case 6:
527
472
  parsedBody = parsedOutput.body;
528
- $metadata = deserializeMetadata(output);
529
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
530
- response = new __BaseException({
531
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
532
- $fault: "client",
533
- $metadata: $metadata,
473
+ throwDefaultError({
474
+ output: output,
475
+ parsedBody: parsedBody,
476
+ exceptionCtor: __BaseException,
477
+ errorCode: errorCode,
534
478
  });
535
- throw __decorateServiceException(response, parsedBody);
479
+ _d.label = 7;
480
+ case 7: return [2];
536
481
  }
537
482
  });
538
483
  }); };
@@ -544,24 +489,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
544
489
  if (output.statusCode !== 200 && output.statusCode >= 300) {
545
490
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
546
491
  }
547
- contents = {
492
+ contents = map({
548
493
  $metadata: deserializeMetadata(output),
549
- tags: undefined,
550
- };
494
+ });
551
495
  _a = __expectNonNull;
552
496
  _b = __expectObject;
553
497
  return [4, parseBody(output.body, context)];
554
498
  case 1:
555
499
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
556
- if (data.tags !== undefined && data.tags !== null) {
500
+ if (data.tags != null) {
557
501
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
558
502
  }
559
- return [2, Promise.resolve(contents)];
503
+ return [2, contents];
560
504
  }
561
505
  });
562
506
  }); };
563
507
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
564
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
508
+ var parsedOutput, _a, errorCode, _b, parsedBody;
565
509
  var _c;
566
510
  return __generator(this, function (_d) {
567
511
  switch (_d.label) {
@@ -590,14 +534,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
590
534
  case 7: throw _d.sent();
591
535
  case 8:
592
536
  parsedBody = parsedOutput.body;
593
- $metadata = deserializeMetadata(output);
594
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
595
- response = new __BaseException({
596
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
597
- $fault: "client",
598
- $metadata: $metadata,
537
+ throwDefaultError({
538
+ output: output,
539
+ parsedBody: parsedBody,
540
+ exceptionCtor: __BaseException,
541
+ errorCode: errorCode,
599
542
  });
600
- throw __decorateServiceException(response, parsedBody);
543
+ _d.label = 9;
544
+ case 9: return [2];
601
545
  }
602
546
  });
603
547
  }); };
@@ -609,18 +553,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
609
553
  if (output.statusCode !== 200 && output.statusCode >= 300) {
610
554
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
611
555
  }
612
- contents = {
556
+ contents = map({
613
557
  $metadata: deserializeMetadata(output),
614
- };
558
+ });
615
559
  return [4, collectBody(output.body, context)];
616
560
  case 1:
617
561
  _a.sent();
618
- return [2, Promise.resolve(contents)];
562
+ return [2, contents];
619
563
  }
620
564
  });
621
565
  }); };
622
566
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
623
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
567
+ var parsedOutput, _a, errorCode, _b, parsedBody;
624
568
  var _c;
625
569
  return __generator(this, function (_d) {
626
570
  switch (_d.label) {
@@ -649,14 +593,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
649
593
  case 7: throw _d.sent();
650
594
  case 8:
651
595
  parsedBody = parsedOutput.body;
652
- $metadata = deserializeMetadata(output);
653
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
654
- response = new __BaseException({
655
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
656
- $fault: "client",
657
- $metadata: $metadata,
596
+ throwDefaultError({
597
+ output: output,
598
+ parsedBody: parsedBody,
599
+ exceptionCtor: __BaseException,
600
+ errorCode: errorCode,
658
601
  });
659
- throw __decorateServiceException(response, parsedBody);
602
+ _d.label = 9;
603
+ case 9: return [2];
660
604
  }
661
605
  });
662
606
  }); };
@@ -668,18 +612,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
668
612
  if (output.statusCode !== 200 && output.statusCode >= 300) {
669
613
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
670
614
  }
671
- contents = {
615
+ contents = map({
672
616
  $metadata: deserializeMetadata(output),
673
- };
617
+ });
674
618
  return [4, collectBody(output.body, context)];
675
619
  case 1:
676
620
  _a.sent();
677
- return [2, Promise.resolve(contents)];
621
+ return [2, contents];
678
622
  }
679
623
  });
680
624
  }); };
681
625
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
682
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
626
+ var parsedOutput, _a, errorCode, _b, parsedBody;
683
627
  var _c;
684
628
  return __generator(this, function (_d) {
685
629
  switch (_d.label) {
@@ -708,14 +652,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
708
652
  case 7: throw _d.sent();
709
653
  case 8:
710
654
  parsedBody = parsedOutput.body;
711
- $metadata = deserializeMetadata(output);
712
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
713
- response = new __BaseException({
714
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
715
- $fault: "client",
716
- $metadata: $metadata,
655
+ throwDefaultError({
656
+ output: output,
657
+ parsedBody: parsedBody,
658
+ exceptionCtor: __BaseException,
659
+ errorCode: errorCode,
717
660
  });
718
- throw __decorateServiceException(response, parsedBody);
661
+ _d.label = 9;
662
+ case 9: return [2];
719
663
  }
720
664
  });
721
665
  }); };
@@ -727,24 +671,23 @@ export var deserializeAws_restJson1UpdateEnvironmentCommand = function (output,
727
671
  if (output.statusCode !== 200 && output.statusCode >= 300) {
728
672
  return [2, deserializeAws_restJson1UpdateEnvironmentCommandError(output, context)];
729
673
  }
730
- contents = {
674
+ contents = map({
731
675
  $metadata: deserializeMetadata(output),
732
- environment: undefined,
733
- };
676
+ });
734
677
  _a = __expectNonNull;
735
678
  _b = __expectObject;
736
679
  return [4, parseBody(output.body, context)];
737
680
  case 1:
738
681
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
739
- if (data.environment !== undefined && data.environment !== null) {
682
+ if (data.environment != null) {
740
683
  contents.environment = deserializeAws_restJson1Environment(data.environment, context);
741
684
  }
742
- return [2, Promise.resolve(contents)];
685
+ return [2, contents];
743
686
  }
744
687
  });
745
688
  }); };
746
689
  var deserializeAws_restJson1UpdateEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
747
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
690
+ var parsedOutput, _a, errorCode, _b, parsedBody;
748
691
  var _c;
749
692
  return __generator(this, function (_d) {
750
693
  switch (_d.label) {
@@ -781,21 +724,22 @@ var deserializeAws_restJson1UpdateEnvironmentCommandError = function (output, co
781
724
  case 11: throw _d.sent();
782
725
  case 12:
783
726
  parsedBody = parsedOutput.body;
784
- $metadata = deserializeMetadata(output);
785
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
786
- response = new __BaseException({
787
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
788
- $fault: "client",
789
- $metadata: $metadata,
727
+ throwDefaultError({
728
+ output: output,
729
+ parsedBody: parsedBody,
730
+ exceptionCtor: __BaseException,
731
+ errorCode: errorCode,
790
732
  });
791
- throw __decorateServiceException(response, parsedBody);
733
+ _d.label = 13;
734
+ case 13: return [2];
792
735
  }
793
736
  });
794
737
  }); };
738
+ var map = __map;
795
739
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
796
740
  var contents, data, exception;
797
741
  return __generator(this, function (_a) {
798
- contents = {};
742
+ contents = map({});
799
743
  data = parsedOutput.body;
800
744
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
801
745
  return [2, __decorateServiceException(exception, parsedOutput.body)];
@@ -804,9 +748,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
804
748
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
805
749
  var contents, data, exception;
806
750
  return __generator(this, function (_a) {
807
- contents = {};
751
+ contents = map({});
808
752
  data = parsedOutput.body;
809
- if (data.message !== undefined && data.message !== null) {
753
+ if (data.message != null) {
810
754
  contents.message = __expectString(data.message);
811
755
  }
812
756
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -816,9 +760,9 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
816
760
  var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
817
761
  var contents, data, exception;
818
762
  return __generator(this, function (_a) {
819
- contents = {};
763
+ contents = map({});
820
764
  data = parsedOutput.body;
821
- if (data.message !== undefined && data.message !== null) {
765
+ if (data.message != null) {
822
766
  contents.message = __expectString(data.message);
823
767
  }
824
768
  exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -828,9 +772,9 @@ var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOu
828
772
  var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
829
773
  var contents, data, exception;
830
774
  return __generator(this, function (_a) {
831
- contents = {};
775
+ contents = map({});
832
776
  data = parsedOutput.body;
833
- if (data.message !== undefined && data.message !== null) {
777
+ if (data.message != null) {
834
778
  contents.message = __expectString(data.message);
835
779
  }
836
780
  exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -840,9 +784,9 @@ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOut
840
784
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
841
785
  var contents, data, exception;
842
786
  return __generator(this, function (_a) {
843
- contents = {};
787
+ contents = map({});
844
788
  data = parsedOutput.body;
845
- if (data.message !== undefined && data.message !== null) {
789
+ if (data.message != null) {
846
790
  contents.message = __expectString(data.message);
847
791
  }
848
792
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -852,9 +796,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
852
796
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
853
797
  var contents, data, exception;
854
798
  return __generator(this, function (_a) {
855
- contents = {};
799
+ contents = map({});
856
800
  data = parsedOutput.body;
857
- if (data.message !== undefined && data.message !== null) {
801
+ if (data.message != null) {
858
802
  contents.message = __expectString(data.message);
859
803
  }
860
804
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -864,7 +808,7 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
864
808
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
865
809
  var contents, data, exception;
866
810
  return __generator(this, function (_a) {
867
- contents = {};
811
+ contents = map({});
868
812
  data = parsedOutput.body;
869
813
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
870
814
  return [2, __decorateServiceException(exception, parsedOutput.body)];
@@ -873,9 +817,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
873
817
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
874
818
  var contents, data, exception;
875
819
  return __generator(this, function (_a) {
876
- contents = {};
820
+ contents = map({});
877
821
  data = parsedOutput.body;
878
- if (data.message !== undefined && data.message !== null) {
822
+ if (data.message != null) {
879
823
  contents.message = __expectString(data.message);
880
824
  }
881
825
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -896,9 +840,6 @@ var serializeAws_restJson1DataBundleArns = function (input, context) {
896
840
  return input
897
841
  .filter(function (e) { return e != null; })
898
842
  .map(function (entry) {
899
- if (entry === null) {
900
- return null;
901
- }
902
843
  return entry;
903
844
  });
904
845
  };