@aws-sdk/client-finspace 3.312.0 → 3.316.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,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Finspace = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
4
5
  const CreateEnvironmentCommand_1 = require("./commands/CreateEnvironmentCommand");
5
6
  const DeleteEnvironmentCommand_1 = require("./commands/DeleteEnvironmentCommand");
6
7
  const GetEnvironmentCommand_1 = require("./commands/GetEnvironmentCommand");
@@ -10,118 +11,17 @@ const TagResourceCommand_1 = require("./commands/TagResourceCommand");
10
11
  const UntagResourceCommand_1 = require("./commands/UntagResourceCommand");
11
12
  const UpdateEnvironmentCommand_1 = require("./commands/UpdateEnvironmentCommand");
12
13
  const FinspaceClient_1 = require("./FinspaceClient");
14
+ const commands = {
15
+ CreateEnvironmentCommand: CreateEnvironmentCommand_1.CreateEnvironmentCommand,
16
+ DeleteEnvironmentCommand: DeleteEnvironmentCommand_1.DeleteEnvironmentCommand,
17
+ GetEnvironmentCommand: GetEnvironmentCommand_1.GetEnvironmentCommand,
18
+ ListEnvironmentsCommand: ListEnvironmentsCommand_1.ListEnvironmentsCommand,
19
+ ListTagsForResourceCommand: ListTagsForResourceCommand_1.ListTagsForResourceCommand,
20
+ TagResourceCommand: TagResourceCommand_1.TagResourceCommand,
21
+ UntagResourceCommand: UntagResourceCommand_1.UntagResourceCommand,
22
+ UpdateEnvironmentCommand: UpdateEnvironmentCommand_1.UpdateEnvironmentCommand,
23
+ };
13
24
  class Finspace extends FinspaceClient_1.FinspaceClient {
14
- createEnvironment(args, optionsOrCb, cb) {
15
- const command = new CreateEnvironmentCommand_1.CreateEnvironmentCommand(args);
16
- if (typeof optionsOrCb === "function") {
17
- this.send(command, optionsOrCb);
18
- }
19
- else if (typeof cb === "function") {
20
- if (typeof optionsOrCb !== "object")
21
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
22
- this.send(command, optionsOrCb || {}, cb);
23
- }
24
- else {
25
- return this.send(command, optionsOrCb);
26
- }
27
- }
28
- deleteEnvironment(args, optionsOrCb, cb) {
29
- const command = new DeleteEnvironmentCommand_1.DeleteEnvironmentCommand(args);
30
- if (typeof optionsOrCb === "function") {
31
- this.send(command, optionsOrCb);
32
- }
33
- else if (typeof cb === "function") {
34
- if (typeof optionsOrCb !== "object")
35
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
36
- this.send(command, optionsOrCb || {}, cb);
37
- }
38
- else {
39
- return this.send(command, optionsOrCb);
40
- }
41
- }
42
- getEnvironment(args, optionsOrCb, cb) {
43
- const command = new GetEnvironmentCommand_1.GetEnvironmentCommand(args);
44
- if (typeof optionsOrCb === "function") {
45
- this.send(command, optionsOrCb);
46
- }
47
- else if (typeof cb === "function") {
48
- if (typeof optionsOrCb !== "object")
49
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
50
- this.send(command, optionsOrCb || {}, cb);
51
- }
52
- else {
53
- return this.send(command, optionsOrCb);
54
- }
55
- }
56
- listEnvironments(args, optionsOrCb, cb) {
57
- const command = new ListEnvironmentsCommand_1.ListEnvironmentsCommand(args);
58
- if (typeof optionsOrCb === "function") {
59
- this.send(command, optionsOrCb);
60
- }
61
- else if (typeof cb === "function") {
62
- if (typeof optionsOrCb !== "object")
63
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
64
- this.send(command, optionsOrCb || {}, cb);
65
- }
66
- else {
67
- return this.send(command, optionsOrCb);
68
- }
69
- }
70
- listTagsForResource(args, optionsOrCb, cb) {
71
- const command = new ListTagsForResourceCommand_1.ListTagsForResourceCommand(args);
72
- if (typeof optionsOrCb === "function") {
73
- this.send(command, optionsOrCb);
74
- }
75
- else if (typeof cb === "function") {
76
- if (typeof optionsOrCb !== "object")
77
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
78
- this.send(command, optionsOrCb || {}, cb);
79
- }
80
- else {
81
- return this.send(command, optionsOrCb);
82
- }
83
- }
84
- tagResource(args, optionsOrCb, cb) {
85
- const command = new TagResourceCommand_1.TagResourceCommand(args);
86
- if (typeof optionsOrCb === "function") {
87
- this.send(command, optionsOrCb);
88
- }
89
- else if (typeof cb === "function") {
90
- if (typeof optionsOrCb !== "object")
91
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
92
- this.send(command, optionsOrCb || {}, cb);
93
- }
94
- else {
95
- return this.send(command, optionsOrCb);
96
- }
97
- }
98
- untagResource(args, optionsOrCb, cb) {
99
- const command = new UntagResourceCommand_1.UntagResourceCommand(args);
100
- if (typeof optionsOrCb === "function") {
101
- this.send(command, optionsOrCb);
102
- }
103
- else if (typeof cb === "function") {
104
- if (typeof optionsOrCb !== "object")
105
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
106
- this.send(command, optionsOrCb || {}, cb);
107
- }
108
- else {
109
- return this.send(command, optionsOrCb);
110
- }
111
- }
112
- updateEnvironment(args, optionsOrCb, cb) {
113
- const command = new UpdateEnvironmentCommand_1.UpdateEnvironmentCommand(args);
114
- if (typeof optionsOrCb === "function") {
115
- this.send(command, optionsOrCb);
116
- }
117
- else if (typeof cb === "function") {
118
- if (typeof optionsOrCb !== "object")
119
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
120
- this.send(command, optionsOrCb || {}, cb);
121
- }
122
- else {
123
- return this.send(command, optionsOrCb);
124
- }
125
- }
126
25
  }
127
26
  exports.Finspace = Finspace;
27
+ (0, smithy_client_1.createAggregatedClient)(commands, Finspace);
@@ -12,20 +12,16 @@ const se_CreateEnvironmentCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.dataBundles != null && { dataBundles: se_DataBundleArns(input.dataBundles, context) }),
17
- ...(input.description != null && { description: input.description }),
18
- ...(input.federationMode != null && { federationMode: input.federationMode }),
19
- ...(input.federationParameters != null && {
20
- federationParameters: se_FederationParameters(input.federationParameters, context),
21
- }),
22
- ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
23
- ...(input.name != null && { name: input.name }),
24
- ...(input.superuserParameters != null && {
25
- superuserParameters: se_SuperuserParameters(input.superuserParameters, context),
26
- }),
27
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
28
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ dataBundles: (_) => (0, smithy_client_1._json)(_),
17
+ description: [],
18
+ federationMode: [],
19
+ federationParameters: (_) => (0, smithy_client_1._json)(_),
20
+ kmsKeyId: [],
21
+ name: [],
22
+ superuserParameters: (_) => (0, smithy_client_1._json)(_),
23
+ tags: (_) => (0, smithy_client_1._json)(_),
24
+ }));
29
25
  return new protocol_http_1.HttpRequest({
30
26
  protocol,
31
27
  hostname,
@@ -75,7 +71,7 @@ const se_ListEnvironmentsCommand = async (input, context) => {
75
71
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
76
72
  const headers = {};
77
73
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
78
- const query = map({
74
+ const query = (0, smithy_client_1.map)({
79
75
  nextToken: [, input.nextToken],
80
76
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
81
77
  });
@@ -117,9 +113,9 @@ const se_TagResourceCommand = async (input, context) => {
117
113
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
118
114
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
119
115
  let body;
120
- body = JSON.stringify({
121
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
122
- });
116
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
117
+ tags: (_) => (0, smithy_client_1._json)(_),
118
+ }));
123
119
  return new protocol_http_1.HttpRequest({
124
120
  protocol,
125
121
  hostname,
@@ -136,7 +132,7 @@ const se_UntagResourceCommand = async (input, context) => {
136
132
  const headers = {};
137
133
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
138
134
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
139
- const query = map({
135
+ const query = (0, smithy_client_1.map)({
140
136
  tagKeys: [
141
137
  (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
142
138
  () => (input.tagKeys || []).map((_entry) => _entry),
@@ -163,14 +159,12 @@ const se_UpdateEnvironmentCommand = async (input, context) => {
163
159
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
164
160
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "environmentId", () => input.environmentId, "{environmentId}", false);
165
161
  let body;
166
- body = JSON.stringify({
167
- ...(input.description != null && { description: input.description }),
168
- ...(input.federationMode != null && { federationMode: input.federationMode }),
169
- ...(input.federationParameters != null && {
170
- federationParameters: se_FederationParameters(input.federationParameters, context),
171
- }),
172
- ...(input.name != null && { name: input.name }),
173
- });
162
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
163
+ description: [],
164
+ federationMode: [],
165
+ federationParameters: (_) => (0, smithy_client_1._json)(_),
166
+ name: [],
167
+ }));
174
168
  return new protocol_http_1.HttpRequest({
175
169
  protocol,
176
170
  hostname,
@@ -186,19 +180,16 @@ const de_CreateEnvironmentCommand = async (output, context) => {
186
180
  if (output.statusCode !== 200 && output.statusCode >= 300) {
187
181
  return de_CreateEnvironmentCommandError(output, context);
188
182
  }
189
- const contents = map({
183
+ const contents = (0, smithy_client_1.map)({
190
184
  $metadata: deserializeMetadata(output),
191
185
  });
192
186
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
193
- if (data.environmentArn != null) {
194
- contents.environmentArn = (0, smithy_client_1.expectString)(data.environmentArn);
195
- }
196
- if (data.environmentId != null) {
197
- contents.environmentId = (0, smithy_client_1.expectString)(data.environmentId);
198
- }
199
- if (data.environmentUrl != null) {
200
- contents.environmentUrl = (0, smithy_client_1.expectString)(data.environmentUrl);
201
- }
187
+ const doc = (0, smithy_client_1.take)(data, {
188
+ environmentArn: smithy_client_1.expectString,
189
+ environmentId: smithy_client_1.expectString,
190
+ environmentUrl: smithy_client_1.expectString,
191
+ });
192
+ Object.assign(contents, doc);
202
193
  return contents;
203
194
  };
204
195
  exports.de_CreateEnvironmentCommand = de_CreateEnvironmentCommand;
@@ -229,10 +220,9 @@ const de_CreateEnvironmentCommandError = async (output, context) => {
229
220
  throw await de_ValidationExceptionRes(parsedOutput, context);
230
221
  default:
231
222
  const parsedBody = parsedOutput.body;
232
- (0, smithy_client_1.throwDefaultError)({
223
+ return throwDefaultError({
233
224
  output,
234
225
  parsedBody,
235
- exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
236
226
  errorCode,
237
227
  });
238
228
  }
@@ -241,7 +231,7 @@ const de_DeleteEnvironmentCommand = async (output, context) => {
241
231
  if (output.statusCode !== 200 && output.statusCode >= 300) {
242
232
  return de_DeleteEnvironmentCommandError(output, context);
243
233
  }
244
- const contents = map({
234
+ const contents = (0, smithy_client_1.map)({
245
235
  $metadata: deserializeMetadata(output),
246
236
  });
247
237
  await collectBody(output.body, context);
@@ -272,10 +262,9 @@ const de_DeleteEnvironmentCommandError = async (output, context) => {
272
262
  throw await de_ValidationExceptionRes(parsedOutput, context);
273
263
  default:
274
264
  const parsedBody = parsedOutput.body;
275
- (0, smithy_client_1.throwDefaultError)({
265
+ return throwDefaultError({
276
266
  output,
277
267
  parsedBody,
278
- exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
279
268
  errorCode,
280
269
  });
281
270
  }
@@ -284,13 +273,14 @@ const de_GetEnvironmentCommand = async (output, context) => {
284
273
  if (output.statusCode !== 200 && output.statusCode >= 300) {
285
274
  return de_GetEnvironmentCommandError(output, context);
286
275
  }
287
- const contents = map({
276
+ const contents = (0, smithy_client_1.map)({
288
277
  $metadata: deserializeMetadata(output),
289
278
  });
290
279
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
291
- if (data.environment != null) {
292
- contents.environment = de_Environment(data.environment, context);
293
- }
280
+ const doc = (0, smithy_client_1.take)(data, {
281
+ environment: smithy_client_1._json,
282
+ });
283
+ Object.assign(contents, doc);
294
284
  return contents;
295
285
  };
296
286
  exports.de_GetEnvironmentCommand = de_GetEnvironmentCommand;
@@ -315,10 +305,9 @@ const de_GetEnvironmentCommandError = async (output, context) => {
315
305
  throw await de_ValidationExceptionRes(parsedOutput, context);
316
306
  default:
317
307
  const parsedBody = parsedOutput.body;
318
- (0, smithy_client_1.throwDefaultError)({
308
+ return throwDefaultError({
319
309
  output,
320
310
  parsedBody,
321
- exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
322
311
  errorCode,
323
312
  });
324
313
  }
@@ -327,16 +316,15 @@ const de_ListEnvironmentsCommand = async (output, context) => {
327
316
  if (output.statusCode !== 200 && output.statusCode >= 300) {
328
317
  return de_ListEnvironmentsCommandError(output, context);
329
318
  }
330
- const contents = map({
319
+ const contents = (0, smithy_client_1.map)({
331
320
  $metadata: deserializeMetadata(output),
332
321
  });
333
322
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
334
- if (data.environments != null) {
335
- contents.environments = de_EnvironmentList(data.environments, context);
336
- }
337
- if (data.nextToken != null) {
338
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
339
- }
323
+ const doc = (0, smithy_client_1.take)(data, {
324
+ environments: smithy_client_1._json,
325
+ nextToken: smithy_client_1.expectString,
326
+ });
327
+ Object.assign(contents, doc);
340
328
  return contents;
341
329
  };
342
330
  exports.de_ListEnvironmentsCommand = de_ListEnvironmentsCommand;
@@ -355,10 +343,9 @@ const de_ListEnvironmentsCommandError = async (output, context) => {
355
343
  throw await de_ValidationExceptionRes(parsedOutput, context);
356
344
  default:
357
345
  const parsedBody = parsedOutput.body;
358
- (0, smithy_client_1.throwDefaultError)({
346
+ return throwDefaultError({
359
347
  output,
360
348
  parsedBody,
361
- exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
362
349
  errorCode,
363
350
  });
364
351
  }
@@ -367,13 +354,14 @@ const de_ListTagsForResourceCommand = async (output, context) => {
367
354
  if (output.statusCode !== 200 && output.statusCode >= 300) {
368
355
  return de_ListTagsForResourceCommandError(output, context);
369
356
  }
370
- const contents = map({
357
+ const contents = (0, smithy_client_1.map)({
371
358
  $metadata: deserializeMetadata(output),
372
359
  });
373
360
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
374
- if (data.tags != null) {
375
- contents.tags = de_TagMap(data.tags, context);
376
- }
361
+ const doc = (0, smithy_client_1.take)(data, {
362
+ tags: smithy_client_1._json,
363
+ });
364
+ Object.assign(contents, doc);
377
365
  return contents;
378
366
  };
379
367
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
@@ -395,10 +383,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
395
383
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
396
384
  default:
397
385
  const parsedBody = parsedOutput.body;
398
- (0, smithy_client_1.throwDefaultError)({
386
+ return throwDefaultError({
399
387
  output,
400
388
  parsedBody,
401
- exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
402
389
  errorCode,
403
390
  });
404
391
  }
@@ -407,7 +394,7 @@ const de_TagResourceCommand = async (output, context) => {
407
394
  if (output.statusCode !== 200 && output.statusCode >= 300) {
408
395
  return de_TagResourceCommandError(output, context);
409
396
  }
410
- const contents = map({
397
+ const contents = (0, smithy_client_1.map)({
411
398
  $metadata: deserializeMetadata(output),
412
399
  });
413
400
  await collectBody(output.body, context);
@@ -432,10 +419,9 @@ const de_TagResourceCommandError = async (output, context) => {
432
419
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
433
420
  default:
434
421
  const parsedBody = parsedOutput.body;
435
- (0, smithy_client_1.throwDefaultError)({
422
+ return throwDefaultError({
436
423
  output,
437
424
  parsedBody,
438
- exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
439
425
  errorCode,
440
426
  });
441
427
  }
@@ -444,7 +430,7 @@ const de_UntagResourceCommand = async (output, context) => {
444
430
  if (output.statusCode !== 200 && output.statusCode >= 300) {
445
431
  return de_UntagResourceCommandError(output, context);
446
432
  }
447
- const contents = map({
433
+ const contents = (0, smithy_client_1.map)({
448
434
  $metadata: deserializeMetadata(output),
449
435
  });
450
436
  await collectBody(output.body, context);
@@ -469,10 +455,9 @@ const de_UntagResourceCommandError = async (output, context) => {
469
455
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
470
456
  default:
471
457
  const parsedBody = parsedOutput.body;
472
- (0, smithy_client_1.throwDefaultError)({
458
+ return throwDefaultError({
473
459
  output,
474
460
  parsedBody,
475
- exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
476
461
  errorCode,
477
462
  });
478
463
  }
@@ -481,13 +466,14 @@ const de_UpdateEnvironmentCommand = async (output, context) => {
481
466
  if (output.statusCode !== 200 && output.statusCode >= 300) {
482
467
  return de_UpdateEnvironmentCommandError(output, context);
483
468
  }
484
- const contents = map({
469
+ const contents = (0, smithy_client_1.map)({
485
470
  $metadata: deserializeMetadata(output),
486
471
  });
487
472
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
488
- if (data.environment != null) {
489
- contents.environment = de_Environment(data.environment, context);
490
- }
473
+ const doc = (0, smithy_client_1.take)(data, {
474
+ environment: smithy_client_1._json,
475
+ });
476
+ Object.assign(contents, doc);
491
477
  return contents;
492
478
  };
493
479
  exports.de_UpdateEnvironmentCommand = de_UpdateEnvironmentCommand;
@@ -515,18 +501,19 @@ const de_UpdateEnvironmentCommandError = async (output, context) => {
515
501
  throw await de_ValidationExceptionRes(parsedOutput, context);
516
502
  default:
517
503
  const parsedBody = parsedOutput.body;
518
- (0, smithy_client_1.throwDefaultError)({
504
+ return throwDefaultError({
519
505
  output,
520
506
  parsedBody,
521
- exceptionCtor: FinspaceServiceException_1.FinspaceServiceException,
522
507
  errorCode,
523
508
  });
524
509
  }
525
510
  };
526
- const map = smithy_client_1.map;
511
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(FinspaceServiceException_1.FinspaceServiceException);
527
512
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
528
- const contents = map({});
513
+ const contents = (0, smithy_client_1.map)({});
529
514
  const data = parsedOutput.body;
515
+ const doc = (0, smithy_client_1.take)(data, {});
516
+ Object.assign(contents, doc);
530
517
  const exception = new models_0_1.AccessDeniedException({
531
518
  $metadata: deserializeMetadata(parsedOutput),
532
519
  ...contents,
@@ -534,11 +521,12 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
534
521
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
535
522
  };
536
523
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
537
- const contents = map({});
524
+ const contents = (0, smithy_client_1.map)({});
538
525
  const data = parsedOutput.body;
539
- if (data.message != null) {
540
- contents.message = (0, smithy_client_1.expectString)(data.message);
541
- }
526
+ const doc = (0, smithy_client_1.take)(data, {
527
+ message: smithy_client_1.expectString,
528
+ });
529
+ Object.assign(contents, doc);
542
530
  const exception = new models_0_1.InternalServerException({
543
531
  $metadata: deserializeMetadata(parsedOutput),
544
532
  ...contents,
@@ -546,11 +534,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
546
534
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
547
535
  };
548
536
  const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
549
- const contents = map({});
537
+ const contents = (0, smithy_client_1.map)({});
550
538
  const data = parsedOutput.body;
551
- if (data.message != null) {
552
- contents.message = (0, smithy_client_1.expectString)(data.message);
553
- }
539
+ const doc = (0, smithy_client_1.take)(data, {
540
+ message: smithy_client_1.expectString,
541
+ });
542
+ Object.assign(contents, doc);
554
543
  const exception = new models_0_1.InvalidRequestException({
555
544
  $metadata: deserializeMetadata(parsedOutput),
556
545
  ...contents,
@@ -558,11 +547,12 @@ const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
558
547
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
559
548
  };
560
549
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
561
- const contents = map({});
550
+ const contents = (0, smithy_client_1.map)({});
562
551
  const data = parsedOutput.body;
563
- if (data.message != null) {
564
- contents.message = (0, smithy_client_1.expectString)(data.message);
565
- }
552
+ const doc = (0, smithy_client_1.take)(data, {
553
+ message: smithy_client_1.expectString,
554
+ });
555
+ Object.assign(contents, doc);
566
556
  const exception = new models_0_1.LimitExceededException({
567
557
  $metadata: deserializeMetadata(parsedOutput),
568
558
  ...contents,
@@ -570,11 +560,12 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
570
560
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
571
561
  };
572
562
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
573
- const contents = map({});
563
+ const contents = (0, smithy_client_1.map)({});
574
564
  const data = parsedOutput.body;
575
- if (data.message != null) {
576
- contents.message = (0, smithy_client_1.expectString)(data.message);
577
- }
565
+ const doc = (0, smithy_client_1.take)(data, {
566
+ message: smithy_client_1.expectString,
567
+ });
568
+ Object.assign(contents, doc);
578
569
  const exception = new models_0_1.ResourceNotFoundException({
579
570
  $metadata: deserializeMetadata(parsedOutput),
580
571
  ...contents,
@@ -582,11 +573,12 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
582
573
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
583
574
  };
584
575
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
585
- const contents = map({});
576
+ const contents = (0, smithy_client_1.map)({});
586
577
  const data = parsedOutput.body;
587
- if (data.message != null) {
588
- contents.message = (0, smithy_client_1.expectString)(data.message);
589
- }
578
+ const doc = (0, smithy_client_1.take)(data, {
579
+ message: smithy_client_1.expectString,
580
+ });
581
+ Object.assign(contents, doc);
590
582
  const exception = new models_0_1.ServiceQuotaExceededException({
591
583
  $metadata: deserializeMetadata(parsedOutput),
592
584
  ...contents,
@@ -594,8 +586,10 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
594
586
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
595
587
  };
596
588
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
597
- const contents = map({});
589
+ const contents = (0, smithy_client_1.map)({});
598
590
  const data = parsedOutput.body;
591
+ const doc = (0, smithy_client_1.take)(data, {});
592
+ Object.assign(contents, doc);
599
593
  const exception = new models_0_1.ThrottlingException({
600
594
  $metadata: deserializeMetadata(parsedOutput),
601
595
  ...contents,
@@ -603,114 +597,18 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
603
597
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
604
598
  };
605
599
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
606
- const contents = map({});
600
+ const contents = (0, smithy_client_1.map)({});
607
601
  const data = parsedOutput.body;
608
- if (data.message != null) {
609
- contents.message = (0, smithy_client_1.expectString)(data.message);
610
- }
602
+ const doc = (0, smithy_client_1.take)(data, {
603
+ message: smithy_client_1.expectString,
604
+ });
605
+ Object.assign(contents, doc);
611
606
  const exception = new models_0_1.ValidationException({
612
607
  $metadata: deserializeMetadata(parsedOutput),
613
608
  ...contents,
614
609
  });
615
610
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
616
611
  };
617
- const se_AttributeMap = (input, context) => {
618
- return Object.entries(input).reduce((acc, [key, value]) => {
619
- if (value === null) {
620
- return acc;
621
- }
622
- acc[key] = value;
623
- return acc;
624
- }, {});
625
- };
626
- const se_DataBundleArns = (input, context) => {
627
- return input
628
- .filter((e) => e != null)
629
- .map((entry) => {
630
- return entry;
631
- });
632
- };
633
- const se_FederationParameters = (input, context) => {
634
- return {
635
- ...(input.applicationCallBackURL != null && { applicationCallBackURL: input.applicationCallBackURL }),
636
- ...(input.attributeMap != null && { attributeMap: se_AttributeMap(input.attributeMap, context) }),
637
- ...(input.federationProviderName != null && { federationProviderName: input.federationProviderName }),
638
- ...(input.federationURN != null && { federationURN: input.federationURN }),
639
- ...(input.samlMetadataDocument != null && { samlMetadataDocument: input.samlMetadataDocument }),
640
- ...(input.samlMetadataURL != null && { samlMetadataURL: input.samlMetadataURL }),
641
- };
642
- };
643
- const se_SuperuserParameters = (input, context) => {
644
- return {
645
- ...(input.emailAddress != null && { emailAddress: input.emailAddress }),
646
- ...(input.firstName != null && { firstName: input.firstName }),
647
- ...(input.lastName != null && { lastName: input.lastName }),
648
- };
649
- };
650
- const se_TagMap = (input, context) => {
651
- return Object.entries(input).reduce((acc, [key, value]) => {
652
- if (value === null) {
653
- return acc;
654
- }
655
- acc[key] = value;
656
- return acc;
657
- }, {});
658
- };
659
- const de_AttributeMap = (output, context) => {
660
- return Object.entries(output).reduce((acc, [key, value]) => {
661
- if (value === null) {
662
- return acc;
663
- }
664
- acc[key] = (0, smithy_client_1.expectString)(value);
665
- return acc;
666
- }, {});
667
- };
668
- const de_Environment = (output, context) => {
669
- return {
670
- awsAccountId: (0, smithy_client_1.expectString)(output.awsAccountId),
671
- dedicatedServiceAccountId: (0, smithy_client_1.expectString)(output.dedicatedServiceAccountId),
672
- description: (0, smithy_client_1.expectString)(output.description),
673
- environmentArn: (0, smithy_client_1.expectString)(output.environmentArn),
674
- environmentId: (0, smithy_client_1.expectString)(output.environmentId),
675
- environmentUrl: (0, smithy_client_1.expectString)(output.environmentUrl),
676
- federationMode: (0, smithy_client_1.expectString)(output.federationMode),
677
- federationParameters: output.federationParameters != null ? de_FederationParameters(output.federationParameters, context) : undefined,
678
- kmsKeyId: (0, smithy_client_1.expectString)(output.kmsKeyId),
679
- name: (0, smithy_client_1.expectString)(output.name),
680
- sageMakerStudioDomainUrl: (0, smithy_client_1.expectString)(output.sageMakerStudioDomainUrl),
681
- status: (0, smithy_client_1.expectString)(output.status),
682
- };
683
- };
684
- const de_EnvironmentList = (output, context) => {
685
- const retVal = (output || [])
686
- .filter((e) => e != null)
687
- .map((entry) => {
688
- if (entry === null) {
689
- return null;
690
- }
691
- return de_Environment(entry, context);
692
- });
693
- return retVal;
694
- };
695
- const de_FederationParameters = (output, context) => {
696
- return {
697
- applicationCallBackURL: (0, smithy_client_1.expectString)(output.applicationCallBackURL),
698
- attributeMap: output.attributeMap != null ? de_AttributeMap(output.attributeMap, context) : undefined,
699
- federationProviderName: (0, smithy_client_1.expectString)(output.federationProviderName),
700
- federationURN: (0, smithy_client_1.expectString)(output.federationURN),
701
- samlMetadataDocument: (0, smithy_client_1.expectString)(output.samlMetadataDocument),
702
- samlMetadataURL: (0, smithy_client_1.expectString)(output.samlMetadataURL),
703
- };
704
- };
705
- const de_TagMap = (output, context) => {
706
- return Object.entries(output).reduce((acc, [key, value]) => {
707
- if (value === null) {
708
- return acc;
709
- }
710
- acc[key] = (0, smithy_client_1.expectString)(value);
711
- return acc;
712
- }, {});
713
- };
714
612
  const deserializeMetadata = (output) => ({
715
613
  httpStatusCode: output.statusCode,
716
614
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],