@aws-sdk/client-ssm-sap 3.489.0 → 3.495.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist-cjs/SsmSap.js +1 -47
  2. package/dist-cjs/SsmSapClient.js +1 -43
  3. package/dist-cjs/commands/DeleteResourcePermissionCommand.js +1 -28
  4. package/dist-cjs/commands/DeregisterApplicationCommand.js +1 -28
  5. package/dist-cjs/commands/GetApplicationCommand.js +1 -28
  6. package/dist-cjs/commands/GetComponentCommand.js +1 -28
  7. package/dist-cjs/commands/GetDatabaseCommand.js +1 -29
  8. package/dist-cjs/commands/GetOperationCommand.js +1 -28
  9. package/dist-cjs/commands/GetResourcePermissionCommand.js +1 -28
  10. package/dist-cjs/commands/ListApplicationsCommand.js +1 -28
  11. package/dist-cjs/commands/ListComponentsCommand.js +1 -28
  12. package/dist-cjs/commands/ListDatabasesCommand.js +1 -28
  13. package/dist-cjs/commands/ListOperationsCommand.js +1 -28
  14. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  15. package/dist-cjs/commands/PutResourcePermissionCommand.js +1 -28
  16. package/dist-cjs/commands/RegisterApplicationCommand.js +1 -29
  17. package/dist-cjs/commands/StartApplicationRefreshCommand.js +1 -28
  18. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  19. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  20. package/dist-cjs/commands/UpdateApplicationSettingsCommand.js +1 -29
  21. package/dist-cjs/commands/index.js +1 -21
  22. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  23. package/dist-cjs/extensionConfiguration.js +1 -2
  24. package/dist-cjs/index.js +2024 -11
  25. package/dist-cjs/models/SsmSapServiceException.js +1 -12
  26. package/dist-cjs/models/index.js +1 -4
  27. package/dist-cjs/models/models_0.js +1 -213
  28. package/dist-cjs/pagination/Interfaces.js +1 -2
  29. package/dist-cjs/pagination/ListApplicationsPaginator.js +1 -7
  30. package/dist-cjs/pagination/ListComponentsPaginator.js +1 -7
  31. package/dist-cjs/pagination/ListDatabasesPaginator.js +1 -7
  32. package/dist-cjs/pagination/ListOperationsPaginator.js +1 -7
  33. package/dist-cjs/pagination/index.js +1 -8
  34. package/dist-cjs/protocols/Aws_restJson1.js +1 -1217
  35. package/dist-cjs/runtimeExtensions.js +1 -22
  36. package/package.json +40 -40
@@ -1,1217 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateApplicationSettingsCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StartApplicationRefreshCommand = exports.de_RegisterApplicationCommand = exports.de_PutResourcePermissionCommand = exports.de_ListTagsForResourceCommand = exports.de_ListOperationsCommand = exports.de_ListDatabasesCommand = exports.de_ListComponentsCommand = exports.de_ListApplicationsCommand = exports.de_GetResourcePermissionCommand = exports.de_GetOperationCommand = exports.de_GetDatabaseCommand = exports.de_GetComponentCommand = exports.de_GetApplicationCommand = exports.de_DeregisterApplicationCommand = exports.de_DeleteResourcePermissionCommand = exports.se_UpdateApplicationSettingsCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StartApplicationRefreshCommand = exports.se_RegisterApplicationCommand = exports.se_PutResourcePermissionCommand = exports.se_ListTagsForResourceCommand = exports.se_ListOperationsCommand = exports.se_ListDatabasesCommand = exports.se_ListComponentsCommand = exports.se_ListApplicationsCommand = exports.se_GetResourcePermissionCommand = exports.se_GetOperationCommand = exports.se_GetDatabaseCommand = exports.se_GetComponentCommand = exports.se_GetApplicationCommand = exports.se_DeregisterApplicationCommand = exports.se_DeleteResourcePermissionCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const models_0_1 = require("../models/models_0");
7
- const SsmSapServiceException_1 = require("../models/SsmSapServiceException");
8
- const se_DeleteResourcePermissionCommand = async (input, context) => {
9
- const b = (0, core_1.requestBuilder)(input, context);
10
- const headers = {
11
- "content-type": "application/json",
12
- };
13
- b.bp("/delete-resource-permission");
14
- let body;
15
- body = JSON.stringify((0, smithy_client_1.take)(input, {
16
- ActionType: [],
17
- ResourceArn: [],
18
- SourceResourceArn: [],
19
- }));
20
- b.m("POST").h(headers).b(body);
21
- return b.build();
22
- };
23
- exports.se_DeleteResourcePermissionCommand = se_DeleteResourcePermissionCommand;
24
- const se_DeregisterApplicationCommand = async (input, context) => {
25
- const b = (0, core_1.requestBuilder)(input, context);
26
- const headers = {
27
- "content-type": "application/json",
28
- };
29
- b.bp("/deregister-application");
30
- let body;
31
- body = JSON.stringify((0, smithy_client_1.take)(input, {
32
- ApplicationId: [],
33
- }));
34
- b.m("POST").h(headers).b(body);
35
- return b.build();
36
- };
37
- exports.se_DeregisterApplicationCommand = se_DeregisterApplicationCommand;
38
- const se_GetApplicationCommand = async (input, context) => {
39
- const b = (0, core_1.requestBuilder)(input, context);
40
- const headers = {
41
- "content-type": "application/json",
42
- };
43
- b.bp("/get-application");
44
- let body;
45
- body = JSON.stringify((0, smithy_client_1.take)(input, {
46
- AppRegistryArn: [],
47
- ApplicationArn: [],
48
- ApplicationId: [],
49
- }));
50
- b.m("POST").h(headers).b(body);
51
- return b.build();
52
- };
53
- exports.se_GetApplicationCommand = se_GetApplicationCommand;
54
- const se_GetComponentCommand = async (input, context) => {
55
- const b = (0, core_1.requestBuilder)(input, context);
56
- const headers = {
57
- "content-type": "application/json",
58
- };
59
- b.bp("/get-component");
60
- let body;
61
- body = JSON.stringify((0, smithy_client_1.take)(input, {
62
- ApplicationId: [],
63
- ComponentId: [],
64
- }));
65
- b.m("POST").h(headers).b(body);
66
- return b.build();
67
- };
68
- exports.se_GetComponentCommand = se_GetComponentCommand;
69
- const se_GetDatabaseCommand = async (input, context) => {
70
- const b = (0, core_1.requestBuilder)(input, context);
71
- const headers = {
72
- "content-type": "application/json",
73
- };
74
- b.bp("/get-database");
75
- let body;
76
- body = JSON.stringify((0, smithy_client_1.take)(input, {
77
- ApplicationId: [],
78
- ComponentId: [],
79
- DatabaseArn: [],
80
- DatabaseId: [],
81
- }));
82
- b.m("POST").h(headers).b(body);
83
- return b.build();
84
- };
85
- exports.se_GetDatabaseCommand = se_GetDatabaseCommand;
86
- const se_GetOperationCommand = async (input, context) => {
87
- const b = (0, core_1.requestBuilder)(input, context);
88
- const headers = {
89
- "content-type": "application/json",
90
- };
91
- b.bp("/get-operation");
92
- let body;
93
- body = JSON.stringify((0, smithy_client_1.take)(input, {
94
- OperationId: [],
95
- }));
96
- b.m("POST").h(headers).b(body);
97
- return b.build();
98
- };
99
- exports.se_GetOperationCommand = se_GetOperationCommand;
100
- const se_GetResourcePermissionCommand = async (input, context) => {
101
- const b = (0, core_1.requestBuilder)(input, context);
102
- const headers = {
103
- "content-type": "application/json",
104
- };
105
- b.bp("/get-resource-permission");
106
- let body;
107
- body = JSON.stringify((0, smithy_client_1.take)(input, {
108
- ActionType: [],
109
- ResourceArn: [],
110
- }));
111
- b.m("POST").h(headers).b(body);
112
- return b.build();
113
- };
114
- exports.se_GetResourcePermissionCommand = se_GetResourcePermissionCommand;
115
- const se_ListApplicationsCommand = async (input, context) => {
116
- const b = (0, core_1.requestBuilder)(input, context);
117
- const headers = {
118
- "content-type": "application/json",
119
- };
120
- b.bp("/list-applications");
121
- let body;
122
- body = JSON.stringify((0, smithy_client_1.take)(input, {
123
- Filters: (_) => (0, smithy_client_1._json)(_),
124
- MaxResults: [],
125
- NextToken: [],
126
- }));
127
- b.m("POST").h(headers).b(body);
128
- return b.build();
129
- };
130
- exports.se_ListApplicationsCommand = se_ListApplicationsCommand;
131
- const se_ListComponentsCommand = async (input, context) => {
132
- const b = (0, core_1.requestBuilder)(input, context);
133
- const headers = {
134
- "content-type": "application/json",
135
- };
136
- b.bp("/list-components");
137
- let body;
138
- body = JSON.stringify((0, smithy_client_1.take)(input, {
139
- ApplicationId: [],
140
- MaxResults: [],
141
- NextToken: [],
142
- }));
143
- b.m("POST").h(headers).b(body);
144
- return b.build();
145
- };
146
- exports.se_ListComponentsCommand = se_ListComponentsCommand;
147
- const se_ListDatabasesCommand = async (input, context) => {
148
- const b = (0, core_1.requestBuilder)(input, context);
149
- const headers = {
150
- "content-type": "application/json",
151
- };
152
- b.bp("/list-databases");
153
- let body;
154
- body = JSON.stringify((0, smithy_client_1.take)(input, {
155
- ApplicationId: [],
156
- ComponentId: [],
157
- MaxResults: [],
158
- NextToken: [],
159
- }));
160
- b.m("POST").h(headers).b(body);
161
- return b.build();
162
- };
163
- exports.se_ListDatabasesCommand = se_ListDatabasesCommand;
164
- const se_ListOperationsCommand = async (input, context) => {
165
- const b = (0, core_1.requestBuilder)(input, context);
166
- const headers = {
167
- "content-type": "application/json",
168
- };
169
- b.bp("/list-operations");
170
- let body;
171
- body = JSON.stringify((0, smithy_client_1.take)(input, {
172
- ApplicationId: [],
173
- Filters: (_) => (0, smithy_client_1._json)(_),
174
- MaxResults: [],
175
- NextToken: [],
176
- }));
177
- b.m("POST").h(headers).b(body);
178
- return b.build();
179
- };
180
- exports.se_ListOperationsCommand = se_ListOperationsCommand;
181
- const se_ListTagsForResourceCommand = async (input, context) => {
182
- const b = (0, core_1.requestBuilder)(input, context);
183
- const headers = {};
184
- b.bp("/tags/{resourceArn}");
185
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
186
- let body;
187
- b.m("GET").h(headers).b(body);
188
- return b.build();
189
- };
190
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
191
- const se_PutResourcePermissionCommand = async (input, context) => {
192
- const b = (0, core_1.requestBuilder)(input, context);
193
- const headers = {
194
- "content-type": "application/json",
195
- };
196
- b.bp("/put-resource-permission");
197
- let body;
198
- body = JSON.stringify((0, smithy_client_1.take)(input, {
199
- ActionType: [],
200
- ResourceArn: [],
201
- SourceResourceArn: [],
202
- }));
203
- b.m("POST").h(headers).b(body);
204
- return b.build();
205
- };
206
- exports.se_PutResourcePermissionCommand = se_PutResourcePermissionCommand;
207
- const se_RegisterApplicationCommand = async (input, context) => {
208
- const b = (0, core_1.requestBuilder)(input, context);
209
- const headers = {
210
- "content-type": "application/json",
211
- };
212
- b.bp("/register-application");
213
- let body;
214
- body = JSON.stringify((0, smithy_client_1.take)(input, {
215
- ApplicationId: [],
216
- ApplicationType: [],
217
- Credentials: (_) => (0, smithy_client_1._json)(_),
218
- DatabaseArn: [],
219
- Instances: (_) => (0, smithy_client_1._json)(_),
220
- SapInstanceNumber: [],
221
- Sid: [],
222
- Tags: (_) => (0, smithy_client_1._json)(_),
223
- }));
224
- b.m("POST").h(headers).b(body);
225
- return b.build();
226
- };
227
- exports.se_RegisterApplicationCommand = se_RegisterApplicationCommand;
228
- const se_StartApplicationRefreshCommand = async (input, context) => {
229
- const b = (0, core_1.requestBuilder)(input, context);
230
- const headers = {
231
- "content-type": "application/json",
232
- };
233
- b.bp("/start-application-refresh");
234
- let body;
235
- body = JSON.stringify((0, smithy_client_1.take)(input, {
236
- ApplicationId: [],
237
- }));
238
- b.m("POST").h(headers).b(body);
239
- return b.build();
240
- };
241
- exports.se_StartApplicationRefreshCommand = se_StartApplicationRefreshCommand;
242
- const se_TagResourceCommand = async (input, context) => {
243
- const b = (0, core_1.requestBuilder)(input, context);
244
- const headers = {
245
- "content-type": "application/json",
246
- };
247
- b.bp("/tags/{resourceArn}");
248
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
249
- let body;
250
- body = JSON.stringify((0, smithy_client_1.take)(input, {
251
- tags: (_) => (0, smithy_client_1._json)(_),
252
- }));
253
- b.m("POST").h(headers).b(body);
254
- return b.build();
255
- };
256
- exports.se_TagResourceCommand = se_TagResourceCommand;
257
- const se_UntagResourceCommand = async (input, context) => {
258
- const b = (0, core_1.requestBuilder)(input, context);
259
- const headers = {};
260
- b.bp("/tags/{resourceArn}");
261
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
262
- const query = (0, smithy_client_1.map)({
263
- [_tK]: [
264
- (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
265
- () => (input[_tK] || []).map((_entry) => _entry),
266
- ],
267
- });
268
- let body;
269
- b.m("DELETE").h(headers).q(query).b(body);
270
- return b.build();
271
- };
272
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
273
- const se_UpdateApplicationSettingsCommand = async (input, context) => {
274
- const b = (0, core_1.requestBuilder)(input, context);
275
- const headers = {
276
- "content-type": "application/json",
277
- };
278
- b.bp("/update-application-settings");
279
- let body;
280
- body = JSON.stringify((0, smithy_client_1.take)(input, {
281
- ApplicationId: [],
282
- Backint: (_) => (0, smithy_client_1._json)(_),
283
- CredentialsToAddOrUpdate: (_) => (0, smithy_client_1._json)(_),
284
- CredentialsToRemove: (_) => (0, smithy_client_1._json)(_),
285
- DatabaseArn: [],
286
- }));
287
- b.m("POST").h(headers).b(body);
288
- return b.build();
289
- };
290
- exports.se_UpdateApplicationSettingsCommand = se_UpdateApplicationSettingsCommand;
291
- const de_DeleteResourcePermissionCommand = async (output, context) => {
292
- if (output.statusCode !== 200 && output.statusCode >= 300) {
293
- return de_DeleteResourcePermissionCommandError(output, context);
294
- }
295
- const contents = (0, smithy_client_1.map)({
296
- $metadata: deserializeMetadata(output),
297
- });
298
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
299
- const doc = (0, smithy_client_1.take)(data, {
300
- Policy: smithy_client_1.expectString,
301
- });
302
- Object.assign(contents, doc);
303
- return contents;
304
- };
305
- exports.de_DeleteResourcePermissionCommand = de_DeleteResourcePermissionCommand;
306
- const de_DeleteResourcePermissionCommandError = async (output, context) => {
307
- const parsedOutput = {
308
- ...output,
309
- body: await parseErrorBody(output.body, context),
310
- };
311
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
312
- switch (errorCode) {
313
- case "InternalServerException":
314
- case "com.amazonaws.ssmsap#InternalServerException":
315
- throw await de_InternalServerExceptionRes(parsedOutput, context);
316
- case "ResourceNotFoundException":
317
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
318
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
319
- case "ValidationException":
320
- case "com.amazonaws.ssmsap#ValidationException":
321
- throw await de_ValidationExceptionRes(parsedOutput, context);
322
- default:
323
- const parsedBody = parsedOutput.body;
324
- return throwDefaultError({
325
- output,
326
- parsedBody,
327
- errorCode,
328
- });
329
- }
330
- };
331
- const de_DeregisterApplicationCommand = async (output, context) => {
332
- if (output.statusCode !== 200 && output.statusCode >= 300) {
333
- return de_DeregisterApplicationCommandError(output, context);
334
- }
335
- const contents = (0, smithy_client_1.map)({
336
- $metadata: deserializeMetadata(output),
337
- });
338
- await (0, smithy_client_1.collectBody)(output.body, context);
339
- return contents;
340
- };
341
- exports.de_DeregisterApplicationCommand = de_DeregisterApplicationCommand;
342
- const de_DeregisterApplicationCommandError = async (output, context) => {
343
- const parsedOutput = {
344
- ...output,
345
- body: await parseErrorBody(output.body, context),
346
- };
347
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
348
- switch (errorCode) {
349
- case "InternalServerException":
350
- case "com.amazonaws.ssmsap#InternalServerException":
351
- throw await de_InternalServerExceptionRes(parsedOutput, context);
352
- case "UnauthorizedException":
353
- case "com.amazonaws.ssmsap#UnauthorizedException":
354
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
355
- case "ValidationException":
356
- case "com.amazonaws.ssmsap#ValidationException":
357
- throw await de_ValidationExceptionRes(parsedOutput, context);
358
- default:
359
- const parsedBody = parsedOutput.body;
360
- return throwDefaultError({
361
- output,
362
- parsedBody,
363
- errorCode,
364
- });
365
- }
366
- };
367
- const de_GetApplicationCommand = async (output, context) => {
368
- if (output.statusCode !== 200 && output.statusCode >= 300) {
369
- return de_GetApplicationCommandError(output, context);
370
- }
371
- const contents = (0, smithy_client_1.map)({
372
- $metadata: deserializeMetadata(output),
373
- });
374
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
375
- const doc = (0, smithy_client_1.take)(data, {
376
- Application: (_) => de_Application(_, context),
377
- Tags: smithy_client_1._json,
378
- });
379
- Object.assign(contents, doc);
380
- return contents;
381
- };
382
- exports.de_GetApplicationCommand = de_GetApplicationCommand;
383
- const de_GetApplicationCommandError = async (output, context) => {
384
- const parsedOutput = {
385
- ...output,
386
- body: await parseErrorBody(output.body, context),
387
- };
388
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
389
- switch (errorCode) {
390
- case "InternalServerException":
391
- case "com.amazonaws.ssmsap#InternalServerException":
392
- throw await de_InternalServerExceptionRes(parsedOutput, context);
393
- case "ValidationException":
394
- case "com.amazonaws.ssmsap#ValidationException":
395
- throw await de_ValidationExceptionRes(parsedOutput, context);
396
- default:
397
- const parsedBody = parsedOutput.body;
398
- return throwDefaultError({
399
- output,
400
- parsedBody,
401
- errorCode,
402
- });
403
- }
404
- };
405
- const de_GetComponentCommand = async (output, context) => {
406
- if (output.statusCode !== 200 && output.statusCode >= 300) {
407
- return de_GetComponentCommandError(output, context);
408
- }
409
- const contents = (0, smithy_client_1.map)({
410
- $metadata: deserializeMetadata(output),
411
- });
412
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
413
- const doc = (0, smithy_client_1.take)(data, {
414
- Component: (_) => de_Component(_, context),
415
- Tags: smithy_client_1._json,
416
- });
417
- Object.assign(contents, doc);
418
- return contents;
419
- };
420
- exports.de_GetComponentCommand = de_GetComponentCommand;
421
- const de_GetComponentCommandError = async (output, context) => {
422
- const parsedOutput = {
423
- ...output,
424
- body: await parseErrorBody(output.body, context),
425
- };
426
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
427
- switch (errorCode) {
428
- case "InternalServerException":
429
- case "com.amazonaws.ssmsap#InternalServerException":
430
- throw await de_InternalServerExceptionRes(parsedOutput, context);
431
- case "UnauthorizedException":
432
- case "com.amazonaws.ssmsap#UnauthorizedException":
433
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
434
- case "ValidationException":
435
- case "com.amazonaws.ssmsap#ValidationException":
436
- throw await de_ValidationExceptionRes(parsedOutput, context);
437
- default:
438
- const parsedBody = parsedOutput.body;
439
- return throwDefaultError({
440
- output,
441
- parsedBody,
442
- errorCode,
443
- });
444
- }
445
- };
446
- const de_GetDatabaseCommand = async (output, context) => {
447
- if (output.statusCode !== 200 && output.statusCode >= 300) {
448
- return de_GetDatabaseCommandError(output, context);
449
- }
450
- const contents = (0, smithy_client_1.map)({
451
- $metadata: deserializeMetadata(output),
452
- });
453
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
454
- const doc = (0, smithy_client_1.take)(data, {
455
- Database: (_) => de_Database(_, context),
456
- Tags: smithy_client_1._json,
457
- });
458
- Object.assign(contents, doc);
459
- return contents;
460
- };
461
- exports.de_GetDatabaseCommand = de_GetDatabaseCommand;
462
- const de_GetDatabaseCommandError = async (output, context) => {
463
- const parsedOutput = {
464
- ...output,
465
- body: await parseErrorBody(output.body, context),
466
- };
467
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
468
- switch (errorCode) {
469
- case "InternalServerException":
470
- case "com.amazonaws.ssmsap#InternalServerException":
471
- throw await de_InternalServerExceptionRes(parsedOutput, context);
472
- case "ValidationException":
473
- case "com.amazonaws.ssmsap#ValidationException":
474
- throw await de_ValidationExceptionRes(parsedOutput, context);
475
- default:
476
- const parsedBody = parsedOutput.body;
477
- return throwDefaultError({
478
- output,
479
- parsedBody,
480
- errorCode,
481
- });
482
- }
483
- };
484
- const de_GetOperationCommand = async (output, context) => {
485
- if (output.statusCode !== 200 && output.statusCode >= 300) {
486
- return de_GetOperationCommandError(output, context);
487
- }
488
- const contents = (0, smithy_client_1.map)({
489
- $metadata: deserializeMetadata(output),
490
- });
491
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
492
- const doc = (0, smithy_client_1.take)(data, {
493
- Operation: (_) => de_Operation(_, context),
494
- });
495
- Object.assign(contents, doc);
496
- return contents;
497
- };
498
- exports.de_GetOperationCommand = de_GetOperationCommand;
499
- const de_GetOperationCommandError = async (output, context) => {
500
- const parsedOutput = {
501
- ...output,
502
- body: await parseErrorBody(output.body, context),
503
- };
504
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
505
- switch (errorCode) {
506
- case "InternalServerException":
507
- case "com.amazonaws.ssmsap#InternalServerException":
508
- throw await de_InternalServerExceptionRes(parsedOutput, context);
509
- case "ValidationException":
510
- case "com.amazonaws.ssmsap#ValidationException":
511
- throw await de_ValidationExceptionRes(parsedOutput, context);
512
- default:
513
- const parsedBody = parsedOutput.body;
514
- return throwDefaultError({
515
- output,
516
- parsedBody,
517
- errorCode,
518
- });
519
- }
520
- };
521
- const de_GetResourcePermissionCommand = async (output, context) => {
522
- if (output.statusCode !== 200 && output.statusCode >= 300) {
523
- return de_GetResourcePermissionCommandError(output, context);
524
- }
525
- const contents = (0, smithy_client_1.map)({
526
- $metadata: deserializeMetadata(output),
527
- });
528
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
529
- const doc = (0, smithy_client_1.take)(data, {
530
- Policy: smithy_client_1.expectString,
531
- });
532
- Object.assign(contents, doc);
533
- return contents;
534
- };
535
- exports.de_GetResourcePermissionCommand = de_GetResourcePermissionCommand;
536
- const de_GetResourcePermissionCommandError = async (output, context) => {
537
- const parsedOutput = {
538
- ...output,
539
- body: await parseErrorBody(output.body, context),
540
- };
541
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
542
- switch (errorCode) {
543
- case "InternalServerException":
544
- case "com.amazonaws.ssmsap#InternalServerException":
545
- throw await de_InternalServerExceptionRes(parsedOutput, context);
546
- case "ResourceNotFoundException":
547
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
548
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
549
- case "ValidationException":
550
- case "com.amazonaws.ssmsap#ValidationException":
551
- throw await de_ValidationExceptionRes(parsedOutput, context);
552
- default:
553
- const parsedBody = parsedOutput.body;
554
- return throwDefaultError({
555
- output,
556
- parsedBody,
557
- errorCode,
558
- });
559
- }
560
- };
561
- const de_ListApplicationsCommand = async (output, context) => {
562
- if (output.statusCode !== 200 && output.statusCode >= 300) {
563
- return de_ListApplicationsCommandError(output, context);
564
- }
565
- const contents = (0, smithy_client_1.map)({
566
- $metadata: deserializeMetadata(output),
567
- });
568
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
569
- const doc = (0, smithy_client_1.take)(data, {
570
- Applications: smithy_client_1._json,
571
- NextToken: smithy_client_1.expectString,
572
- });
573
- Object.assign(contents, doc);
574
- return contents;
575
- };
576
- exports.de_ListApplicationsCommand = de_ListApplicationsCommand;
577
- const de_ListApplicationsCommandError = async (output, context) => {
578
- const parsedOutput = {
579
- ...output,
580
- body: await parseErrorBody(output.body, context),
581
- };
582
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
583
- switch (errorCode) {
584
- case "InternalServerException":
585
- case "com.amazonaws.ssmsap#InternalServerException":
586
- throw await de_InternalServerExceptionRes(parsedOutput, context);
587
- case "ResourceNotFoundException":
588
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
589
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
590
- case "ValidationException":
591
- case "com.amazonaws.ssmsap#ValidationException":
592
- throw await de_ValidationExceptionRes(parsedOutput, context);
593
- default:
594
- const parsedBody = parsedOutput.body;
595
- return throwDefaultError({
596
- output,
597
- parsedBody,
598
- errorCode,
599
- });
600
- }
601
- };
602
- const de_ListComponentsCommand = async (output, context) => {
603
- if (output.statusCode !== 200 && output.statusCode >= 300) {
604
- return de_ListComponentsCommandError(output, context);
605
- }
606
- const contents = (0, smithy_client_1.map)({
607
- $metadata: deserializeMetadata(output),
608
- });
609
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
610
- const doc = (0, smithy_client_1.take)(data, {
611
- Components: smithy_client_1._json,
612
- NextToken: smithy_client_1.expectString,
613
- });
614
- Object.assign(contents, doc);
615
- return contents;
616
- };
617
- exports.de_ListComponentsCommand = de_ListComponentsCommand;
618
- const de_ListComponentsCommandError = async (output, context) => {
619
- const parsedOutput = {
620
- ...output,
621
- body: await parseErrorBody(output.body, context),
622
- };
623
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
624
- switch (errorCode) {
625
- case "InternalServerException":
626
- case "com.amazonaws.ssmsap#InternalServerException":
627
- throw await de_InternalServerExceptionRes(parsedOutput, context);
628
- case "ResourceNotFoundException":
629
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
630
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
631
- case "UnauthorizedException":
632
- case "com.amazonaws.ssmsap#UnauthorizedException":
633
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
634
- case "ValidationException":
635
- case "com.amazonaws.ssmsap#ValidationException":
636
- throw await de_ValidationExceptionRes(parsedOutput, context);
637
- default:
638
- const parsedBody = parsedOutput.body;
639
- return throwDefaultError({
640
- output,
641
- parsedBody,
642
- errorCode,
643
- });
644
- }
645
- };
646
- const de_ListDatabasesCommand = async (output, context) => {
647
- if (output.statusCode !== 200 && output.statusCode >= 300) {
648
- return de_ListDatabasesCommandError(output, context);
649
- }
650
- const contents = (0, smithy_client_1.map)({
651
- $metadata: deserializeMetadata(output),
652
- });
653
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
654
- const doc = (0, smithy_client_1.take)(data, {
655
- Databases: smithy_client_1._json,
656
- NextToken: smithy_client_1.expectString,
657
- });
658
- Object.assign(contents, doc);
659
- return contents;
660
- };
661
- exports.de_ListDatabasesCommand = de_ListDatabasesCommand;
662
- const de_ListDatabasesCommandError = async (output, context) => {
663
- const parsedOutput = {
664
- ...output,
665
- body: await parseErrorBody(output.body, context),
666
- };
667
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
668
- switch (errorCode) {
669
- case "InternalServerException":
670
- case "com.amazonaws.ssmsap#InternalServerException":
671
- throw await de_InternalServerExceptionRes(parsedOutput, context);
672
- case "ResourceNotFoundException":
673
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
674
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
675
- case "ValidationException":
676
- case "com.amazonaws.ssmsap#ValidationException":
677
- throw await de_ValidationExceptionRes(parsedOutput, context);
678
- default:
679
- const parsedBody = parsedOutput.body;
680
- return throwDefaultError({
681
- output,
682
- parsedBody,
683
- errorCode,
684
- });
685
- }
686
- };
687
- const de_ListOperationsCommand = async (output, context) => {
688
- if (output.statusCode !== 200 && output.statusCode >= 300) {
689
- return de_ListOperationsCommandError(output, context);
690
- }
691
- const contents = (0, smithy_client_1.map)({
692
- $metadata: deserializeMetadata(output),
693
- });
694
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
695
- const doc = (0, smithy_client_1.take)(data, {
696
- NextToken: smithy_client_1.expectString,
697
- Operations: (_) => de_OperationList(_, context),
698
- });
699
- Object.assign(contents, doc);
700
- return contents;
701
- };
702
- exports.de_ListOperationsCommand = de_ListOperationsCommand;
703
- const de_ListOperationsCommandError = async (output, context) => {
704
- const parsedOutput = {
705
- ...output,
706
- body: await parseErrorBody(output.body, context),
707
- };
708
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
709
- switch (errorCode) {
710
- case "InternalServerException":
711
- case "com.amazonaws.ssmsap#InternalServerException":
712
- throw await de_InternalServerExceptionRes(parsedOutput, context);
713
- case "ValidationException":
714
- case "com.amazonaws.ssmsap#ValidationException":
715
- throw await de_ValidationExceptionRes(parsedOutput, context);
716
- default:
717
- const parsedBody = parsedOutput.body;
718
- return throwDefaultError({
719
- output,
720
- parsedBody,
721
- errorCode,
722
- });
723
- }
724
- };
725
- const de_ListTagsForResourceCommand = async (output, context) => {
726
- if (output.statusCode !== 200 && output.statusCode >= 300) {
727
- return de_ListTagsForResourceCommandError(output, context);
728
- }
729
- const contents = (0, smithy_client_1.map)({
730
- $metadata: deserializeMetadata(output),
731
- });
732
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
733
- const doc = (0, smithy_client_1.take)(data, {
734
- tags: smithy_client_1._json,
735
- });
736
- Object.assign(contents, doc);
737
- return contents;
738
- };
739
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
740
- const de_ListTagsForResourceCommandError = async (output, context) => {
741
- const parsedOutput = {
742
- ...output,
743
- body: await parseErrorBody(output.body, context),
744
- };
745
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
746
- switch (errorCode) {
747
- case "ConflictException":
748
- case "com.amazonaws.ssmsap#ConflictException":
749
- throw await de_ConflictExceptionRes(parsedOutput, context);
750
- case "ResourceNotFoundException":
751
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
752
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
753
- case "ValidationException":
754
- case "com.amazonaws.ssmsap#ValidationException":
755
- throw await de_ValidationExceptionRes(parsedOutput, context);
756
- default:
757
- const parsedBody = parsedOutput.body;
758
- return throwDefaultError({
759
- output,
760
- parsedBody,
761
- errorCode,
762
- });
763
- }
764
- };
765
- const de_PutResourcePermissionCommand = async (output, context) => {
766
- if (output.statusCode !== 200 && output.statusCode >= 300) {
767
- return de_PutResourcePermissionCommandError(output, context);
768
- }
769
- const contents = (0, smithy_client_1.map)({
770
- $metadata: deserializeMetadata(output),
771
- });
772
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
773
- const doc = (0, smithy_client_1.take)(data, {
774
- Policy: smithy_client_1.expectString,
775
- });
776
- Object.assign(contents, doc);
777
- return contents;
778
- };
779
- exports.de_PutResourcePermissionCommand = de_PutResourcePermissionCommand;
780
- const de_PutResourcePermissionCommandError = async (output, context) => {
781
- const parsedOutput = {
782
- ...output,
783
- body: await parseErrorBody(output.body, context),
784
- };
785
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
786
- switch (errorCode) {
787
- case "InternalServerException":
788
- case "com.amazonaws.ssmsap#InternalServerException":
789
- throw await de_InternalServerExceptionRes(parsedOutput, context);
790
- case "ResourceNotFoundException":
791
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
792
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
793
- case "ValidationException":
794
- case "com.amazonaws.ssmsap#ValidationException":
795
- throw await de_ValidationExceptionRes(parsedOutput, context);
796
- default:
797
- const parsedBody = parsedOutput.body;
798
- return throwDefaultError({
799
- output,
800
- parsedBody,
801
- errorCode,
802
- });
803
- }
804
- };
805
- const de_RegisterApplicationCommand = async (output, context) => {
806
- if (output.statusCode !== 200 && output.statusCode >= 300) {
807
- return de_RegisterApplicationCommandError(output, context);
808
- }
809
- const contents = (0, smithy_client_1.map)({
810
- $metadata: deserializeMetadata(output),
811
- });
812
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
813
- const doc = (0, smithy_client_1.take)(data, {
814
- Application: (_) => de_Application(_, context),
815
- OperationId: smithy_client_1.expectString,
816
- });
817
- Object.assign(contents, doc);
818
- return contents;
819
- };
820
- exports.de_RegisterApplicationCommand = de_RegisterApplicationCommand;
821
- const de_RegisterApplicationCommandError = async (output, context) => {
822
- const parsedOutput = {
823
- ...output,
824
- body: await parseErrorBody(output.body, context),
825
- };
826
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
827
- switch (errorCode) {
828
- case "ConflictException":
829
- case "com.amazonaws.ssmsap#ConflictException":
830
- throw await de_ConflictExceptionRes(parsedOutput, context);
831
- case "InternalServerException":
832
- case "com.amazonaws.ssmsap#InternalServerException":
833
- throw await de_InternalServerExceptionRes(parsedOutput, context);
834
- case "ResourceNotFoundException":
835
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
836
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
837
- case "ValidationException":
838
- case "com.amazonaws.ssmsap#ValidationException":
839
- throw await de_ValidationExceptionRes(parsedOutput, context);
840
- default:
841
- const parsedBody = parsedOutput.body;
842
- return throwDefaultError({
843
- output,
844
- parsedBody,
845
- errorCode,
846
- });
847
- }
848
- };
849
- const de_StartApplicationRefreshCommand = async (output, context) => {
850
- if (output.statusCode !== 200 && output.statusCode >= 300) {
851
- return de_StartApplicationRefreshCommandError(output, context);
852
- }
853
- const contents = (0, smithy_client_1.map)({
854
- $metadata: deserializeMetadata(output),
855
- });
856
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
857
- const doc = (0, smithy_client_1.take)(data, {
858
- OperationId: smithy_client_1.expectString,
859
- });
860
- Object.assign(contents, doc);
861
- return contents;
862
- };
863
- exports.de_StartApplicationRefreshCommand = de_StartApplicationRefreshCommand;
864
- const de_StartApplicationRefreshCommandError = async (output, context) => {
865
- const parsedOutput = {
866
- ...output,
867
- body: await parseErrorBody(output.body, context),
868
- };
869
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
870
- switch (errorCode) {
871
- case "ConflictException":
872
- case "com.amazonaws.ssmsap#ConflictException":
873
- throw await de_ConflictExceptionRes(parsedOutput, context);
874
- case "InternalServerException":
875
- case "com.amazonaws.ssmsap#InternalServerException":
876
- throw await de_InternalServerExceptionRes(parsedOutput, context);
877
- case "ResourceNotFoundException":
878
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
879
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
880
- case "UnauthorizedException":
881
- case "com.amazonaws.ssmsap#UnauthorizedException":
882
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
883
- case "ValidationException":
884
- case "com.amazonaws.ssmsap#ValidationException":
885
- throw await de_ValidationExceptionRes(parsedOutput, context);
886
- default:
887
- const parsedBody = parsedOutput.body;
888
- return throwDefaultError({
889
- output,
890
- parsedBody,
891
- errorCode,
892
- });
893
- }
894
- };
895
- const de_TagResourceCommand = async (output, context) => {
896
- if (output.statusCode !== 200 && output.statusCode >= 300) {
897
- return de_TagResourceCommandError(output, context);
898
- }
899
- const contents = (0, smithy_client_1.map)({
900
- $metadata: deserializeMetadata(output),
901
- });
902
- await (0, smithy_client_1.collectBody)(output.body, context);
903
- return contents;
904
- };
905
- exports.de_TagResourceCommand = de_TagResourceCommand;
906
- const de_TagResourceCommandError = async (output, context) => {
907
- const parsedOutput = {
908
- ...output,
909
- body: await parseErrorBody(output.body, context),
910
- };
911
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
912
- switch (errorCode) {
913
- case "ConflictException":
914
- case "com.amazonaws.ssmsap#ConflictException":
915
- throw await de_ConflictExceptionRes(parsedOutput, context);
916
- case "ResourceNotFoundException":
917
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
918
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
919
- case "ValidationException":
920
- case "com.amazonaws.ssmsap#ValidationException":
921
- throw await de_ValidationExceptionRes(parsedOutput, context);
922
- default:
923
- const parsedBody = parsedOutput.body;
924
- return throwDefaultError({
925
- output,
926
- parsedBody,
927
- errorCode,
928
- });
929
- }
930
- };
931
- const de_UntagResourceCommand = async (output, context) => {
932
- if (output.statusCode !== 200 && output.statusCode >= 300) {
933
- return de_UntagResourceCommandError(output, context);
934
- }
935
- const contents = (0, smithy_client_1.map)({
936
- $metadata: deserializeMetadata(output),
937
- });
938
- await (0, smithy_client_1.collectBody)(output.body, context);
939
- return contents;
940
- };
941
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
942
- const de_UntagResourceCommandError = async (output, context) => {
943
- const parsedOutput = {
944
- ...output,
945
- body: await parseErrorBody(output.body, context),
946
- };
947
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
948
- switch (errorCode) {
949
- case "ConflictException":
950
- case "com.amazonaws.ssmsap#ConflictException":
951
- throw await de_ConflictExceptionRes(parsedOutput, context);
952
- case "ResourceNotFoundException":
953
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
954
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
955
- case "ValidationException":
956
- case "com.amazonaws.ssmsap#ValidationException":
957
- throw await de_ValidationExceptionRes(parsedOutput, context);
958
- default:
959
- const parsedBody = parsedOutput.body;
960
- return throwDefaultError({
961
- output,
962
- parsedBody,
963
- errorCode,
964
- });
965
- }
966
- };
967
- const de_UpdateApplicationSettingsCommand = async (output, context) => {
968
- if (output.statusCode !== 200 && output.statusCode >= 300) {
969
- return de_UpdateApplicationSettingsCommandError(output, context);
970
- }
971
- const contents = (0, smithy_client_1.map)({
972
- $metadata: deserializeMetadata(output),
973
- });
974
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
975
- const doc = (0, smithy_client_1.take)(data, {
976
- Message: smithy_client_1.expectString,
977
- OperationIds: smithy_client_1._json,
978
- });
979
- Object.assign(contents, doc);
980
- return contents;
981
- };
982
- exports.de_UpdateApplicationSettingsCommand = de_UpdateApplicationSettingsCommand;
983
- const de_UpdateApplicationSettingsCommandError = async (output, context) => {
984
- const parsedOutput = {
985
- ...output,
986
- body: await parseErrorBody(output.body, context),
987
- };
988
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
989
- switch (errorCode) {
990
- case "ConflictException":
991
- case "com.amazonaws.ssmsap#ConflictException":
992
- throw await de_ConflictExceptionRes(parsedOutput, context);
993
- case "InternalServerException":
994
- case "com.amazonaws.ssmsap#InternalServerException":
995
- throw await de_InternalServerExceptionRes(parsedOutput, context);
996
- case "ResourceNotFoundException":
997
- case "com.amazonaws.ssmsap#ResourceNotFoundException":
998
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
999
- case "UnauthorizedException":
1000
- case "com.amazonaws.ssmsap#UnauthorizedException":
1001
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1002
- case "ValidationException":
1003
- case "com.amazonaws.ssmsap#ValidationException":
1004
- throw await de_ValidationExceptionRes(parsedOutput, context);
1005
- default:
1006
- const parsedBody = parsedOutput.body;
1007
- return throwDefaultError({
1008
- output,
1009
- parsedBody,
1010
- errorCode,
1011
- });
1012
- }
1013
- };
1014
- const throwDefaultError = (0, smithy_client_1.withBaseException)(SsmSapServiceException_1.SsmSapServiceException);
1015
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
1016
- const contents = (0, smithy_client_1.map)({});
1017
- const data = parsedOutput.body;
1018
- const doc = (0, smithy_client_1.take)(data, {
1019
- Message: smithy_client_1.expectString,
1020
- });
1021
- Object.assign(contents, doc);
1022
- const exception = new models_0_1.ConflictException({
1023
- $metadata: deserializeMetadata(parsedOutput),
1024
- ...contents,
1025
- });
1026
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1027
- };
1028
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1029
- const contents = (0, smithy_client_1.map)({});
1030
- const data = parsedOutput.body;
1031
- const doc = (0, smithy_client_1.take)(data, {
1032
- Message: smithy_client_1.expectString,
1033
- });
1034
- Object.assign(contents, doc);
1035
- const exception = new models_0_1.InternalServerException({
1036
- $metadata: deserializeMetadata(parsedOutput),
1037
- ...contents,
1038
- });
1039
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1040
- };
1041
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1042
- const contents = (0, smithy_client_1.map)({});
1043
- const data = parsedOutput.body;
1044
- const doc = (0, smithy_client_1.take)(data, {
1045
- Message: smithy_client_1.expectString,
1046
- });
1047
- Object.assign(contents, doc);
1048
- const exception = new models_0_1.ResourceNotFoundException({
1049
- $metadata: deserializeMetadata(parsedOutput),
1050
- ...contents,
1051
- });
1052
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1053
- };
1054
- const de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
1055
- const contents = (0, smithy_client_1.map)({});
1056
- const data = parsedOutput.body;
1057
- const doc = (0, smithy_client_1.take)(data, {
1058
- Message: smithy_client_1.expectString,
1059
- });
1060
- Object.assign(contents, doc);
1061
- const exception = new models_0_1.UnauthorizedException({
1062
- $metadata: deserializeMetadata(parsedOutput),
1063
- ...contents,
1064
- });
1065
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1066
- };
1067
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
1068
- const contents = (0, smithy_client_1.map)({});
1069
- const data = parsedOutput.body;
1070
- const doc = (0, smithy_client_1.take)(data, {
1071
- Message: smithy_client_1.expectString,
1072
- });
1073
- Object.assign(contents, doc);
1074
- const exception = new models_0_1.ValidationException({
1075
- $metadata: deserializeMetadata(parsedOutput),
1076
- ...contents,
1077
- });
1078
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1079
- };
1080
- const de_Application = (output, context) => {
1081
- return (0, smithy_client_1.take)(output, {
1082
- AppRegistryArn: smithy_client_1.expectString,
1083
- Arn: smithy_client_1.expectString,
1084
- Components: smithy_client_1._json,
1085
- DiscoveryStatus: smithy_client_1.expectString,
1086
- Id: smithy_client_1.expectString,
1087
- LastUpdated: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1088
- Status: smithy_client_1.expectString,
1089
- StatusMessage: smithy_client_1.expectString,
1090
- Type: smithy_client_1.expectString,
1091
- });
1092
- };
1093
- const de_Component = (output, context) => {
1094
- return (0, smithy_client_1.take)(output, {
1095
- ApplicationId: smithy_client_1.expectString,
1096
- Arn: smithy_client_1.expectString,
1097
- AssociatedHost: smithy_client_1._json,
1098
- ChildComponents: smithy_client_1._json,
1099
- ComponentId: smithy_client_1.expectString,
1100
- ComponentType: smithy_client_1.expectString,
1101
- DatabaseConnection: smithy_client_1._json,
1102
- Databases: smithy_client_1._json,
1103
- HdbVersion: smithy_client_1.expectString,
1104
- Hosts: smithy_client_1._json,
1105
- LastUpdated: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1106
- ParentComponent: smithy_client_1.expectString,
1107
- PrimaryHost: smithy_client_1.expectString,
1108
- Resilience: smithy_client_1._json,
1109
- SapFeature: smithy_client_1.expectString,
1110
- SapHostname: smithy_client_1.expectString,
1111
- SapKernelVersion: smithy_client_1.expectString,
1112
- Sid: smithy_client_1.expectString,
1113
- Status: smithy_client_1.expectString,
1114
- SystemNumber: smithy_client_1.expectString,
1115
- });
1116
- };
1117
- const de_Database = (output, context) => {
1118
- return (0, smithy_client_1.take)(output, {
1119
- ApplicationId: smithy_client_1.expectString,
1120
- Arn: smithy_client_1.expectString,
1121
- ComponentId: smithy_client_1.expectString,
1122
- Credentials: smithy_client_1._json,
1123
- DatabaseId: smithy_client_1.expectString,
1124
- DatabaseName: smithy_client_1.expectString,
1125
- DatabaseType: smithy_client_1.expectString,
1126
- LastUpdated: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1127
- PrimaryHost: smithy_client_1.expectString,
1128
- SQLPort: smithy_client_1.expectInt32,
1129
- Status: smithy_client_1.expectString,
1130
- });
1131
- };
1132
- const de_Operation = (output, context) => {
1133
- return (0, smithy_client_1.take)(output, {
1134
- EndTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1135
- Id: smithy_client_1.expectString,
1136
- LastUpdatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1137
- Properties: (_) => de_OperationProperties(_, context),
1138
- ResourceArn: smithy_client_1.expectString,
1139
- ResourceId: smithy_client_1.expectString,
1140
- ResourceType: smithy_client_1.expectString,
1141
- StartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1142
- Status: smithy_client_1.expectString,
1143
- StatusMessage: smithy_client_1.expectString,
1144
- Type: smithy_client_1.expectString,
1145
- });
1146
- };
1147
- const de_OperationList = (output, context) => {
1148
- const retVal = (output || [])
1149
- .filter((e) => e != null)
1150
- .map((entry) => {
1151
- return de_Operation(entry, context);
1152
- });
1153
- return retVal;
1154
- };
1155
- const de_OperationProperties = (output, context) => {
1156
- return Object.entries(output).reduce((acc, [key, value]) => {
1157
- if (value === null) {
1158
- acc[key] = null;
1159
- return acc;
1160
- }
1161
- acc[key] = (0, smithy_client_1.expectString)(value);
1162
- return acc;
1163
- }, {});
1164
- };
1165
- const deserializeMetadata = (output) => ({
1166
- httpStatusCode: output.statusCode,
1167
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1168
- extendedRequestId: output.headers["x-amz-id-2"],
1169
- cfId: output.headers["x-amz-cf-id"],
1170
- });
1171
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1172
- const isSerializableHeaderValue = (value) => value !== undefined &&
1173
- value !== null &&
1174
- value !== "" &&
1175
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1176
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1177
- const _tK = "tagKeys";
1178
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1179
- if (encoded.length) {
1180
- return JSON.parse(encoded);
1181
- }
1182
- return {};
1183
- });
1184
- const parseErrorBody = async (errorBody, context) => {
1185
- const value = await parseBody(errorBody, context);
1186
- value.message = value.message ?? value.Message;
1187
- return value;
1188
- };
1189
- const loadRestJsonErrorCode = (output, data) => {
1190
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1191
- const sanitizeErrorCode = (rawValue) => {
1192
- let cleanValue = rawValue;
1193
- if (typeof cleanValue === "number") {
1194
- cleanValue = cleanValue.toString();
1195
- }
1196
- if (cleanValue.indexOf(",") >= 0) {
1197
- cleanValue = cleanValue.split(",")[0];
1198
- }
1199
- if (cleanValue.indexOf(":") >= 0) {
1200
- cleanValue = cleanValue.split(":")[0];
1201
- }
1202
- if (cleanValue.indexOf("#") >= 0) {
1203
- cleanValue = cleanValue.split("#")[1];
1204
- }
1205
- return cleanValue;
1206
- };
1207
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1208
- if (headerKey !== undefined) {
1209
- return sanitizeErrorCode(output.headers[headerKey]);
1210
- }
1211
- if (data.code !== undefined) {
1212
- return sanitizeErrorCode(data.code);
1213
- }
1214
- if (data["__type"] !== undefined) {
1215
- return sanitizeErrorCode(data["__type"]);
1216
- }
1217
- };
1
+ module.exports = require("../index.js");