@aws-sdk/client-docdb-elastic 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 (29) hide show
  1. package/dist-cjs/DocDBElastic.js +1 -37
  2. package/dist-cjs/DocDBElasticClient.js +1 -43
  3. package/dist-cjs/commands/CreateClusterCommand.js +1 -29
  4. package/dist-cjs/commands/CreateClusterSnapshotCommand.js +1 -28
  5. package/dist-cjs/commands/DeleteClusterCommand.js +1 -28
  6. package/dist-cjs/commands/DeleteClusterSnapshotCommand.js +1 -28
  7. package/dist-cjs/commands/GetClusterCommand.js +1 -28
  8. package/dist-cjs/commands/GetClusterSnapshotCommand.js +1 -28
  9. package/dist-cjs/commands/ListClusterSnapshotsCommand.js +1 -28
  10. package/dist-cjs/commands/ListClustersCommand.js +1 -28
  11. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  12. package/dist-cjs/commands/RestoreClusterFromSnapshotCommand.js +1 -28
  13. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  14. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  15. package/dist-cjs/commands/UpdateClusterCommand.js +1 -29
  16. package/dist-cjs/commands/index.js +1 -16
  17. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  18. package/dist-cjs/extensionConfiguration.js +1 -2
  19. package/dist-cjs/index.js +1542 -11
  20. package/dist-cjs/models/DocDBElasticServiceException.js +1 -12
  21. package/dist-cjs/models/index.js +1 -4
  22. package/dist-cjs/models/models_0.js +1 -136
  23. package/dist-cjs/pagination/Interfaces.js +1 -2
  24. package/dist-cjs/pagination/ListClusterSnapshotsPaginator.js +1 -7
  25. package/dist-cjs/pagination/ListClustersPaginator.js +1 -7
  26. package/dist-cjs/pagination/index.js +1 -6
  27. package/dist-cjs/protocols/Aws_restJson1.js +1 -957
  28. package/dist-cjs/runtimeExtensions.js +1 -22
  29. package/package.json +40 -40
@@ -1,957 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateClusterCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_RestoreClusterFromSnapshotCommand = exports.de_ListTagsForResourceCommand = exports.de_ListClusterSnapshotsCommand = exports.de_ListClustersCommand = exports.de_GetClusterSnapshotCommand = exports.de_GetClusterCommand = exports.de_DeleteClusterSnapshotCommand = exports.de_DeleteClusterCommand = exports.de_CreateClusterSnapshotCommand = exports.de_CreateClusterCommand = exports.se_UpdateClusterCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_RestoreClusterFromSnapshotCommand = exports.se_ListTagsForResourceCommand = exports.se_ListClusterSnapshotsCommand = exports.se_ListClustersCommand = exports.se_GetClusterSnapshotCommand = exports.se_GetClusterCommand = exports.se_DeleteClusterSnapshotCommand = exports.se_DeleteClusterCommand = exports.se_CreateClusterSnapshotCommand = exports.se_CreateClusterCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const DocDBElasticServiceException_1 = require("../models/DocDBElasticServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_CreateClusterCommand = async (input, context) => {
10
- const b = (0, core_1.requestBuilder)(input, context);
11
- const headers = {
12
- "content-type": "application/json",
13
- };
14
- b.bp("/cluster");
15
- let body;
16
- body = JSON.stringify((0, smithy_client_1.take)(input, {
17
- adminUserName: [],
18
- adminUserPassword: [],
19
- authType: [],
20
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
21
- clusterName: [],
22
- kmsKeyId: [],
23
- preferredMaintenanceWindow: [],
24
- shardCapacity: [],
25
- shardCount: [],
26
- subnetIds: (_) => (0, smithy_client_1._json)(_),
27
- tags: (_) => (0, smithy_client_1._json)(_),
28
- vpcSecurityGroupIds: (_) => (0, smithy_client_1._json)(_),
29
- }));
30
- b.m("POST").h(headers).b(body);
31
- return b.build();
32
- };
33
- exports.se_CreateClusterCommand = se_CreateClusterCommand;
34
- const se_CreateClusterSnapshotCommand = async (input, context) => {
35
- const b = (0, core_1.requestBuilder)(input, context);
36
- const headers = {
37
- "content-type": "application/json",
38
- };
39
- b.bp("/cluster-snapshot");
40
- let body;
41
- body = JSON.stringify((0, smithy_client_1.take)(input, {
42
- clusterArn: [],
43
- snapshotName: [],
44
- tags: (_) => (0, smithy_client_1._json)(_),
45
- }));
46
- b.m("POST").h(headers).b(body);
47
- return b.build();
48
- };
49
- exports.se_CreateClusterSnapshotCommand = se_CreateClusterSnapshotCommand;
50
- const se_DeleteClusterCommand = async (input, context) => {
51
- const b = (0, core_1.requestBuilder)(input, context);
52
- const headers = {};
53
- b.bp("/cluster/{clusterArn}");
54
- b.p("clusterArn", () => input.clusterArn, "{clusterArn}", false);
55
- let body;
56
- b.m("DELETE").h(headers).b(body);
57
- return b.build();
58
- };
59
- exports.se_DeleteClusterCommand = se_DeleteClusterCommand;
60
- const se_DeleteClusterSnapshotCommand = async (input, context) => {
61
- const b = (0, core_1.requestBuilder)(input, context);
62
- const headers = {};
63
- b.bp("/cluster-snapshot/{snapshotArn}");
64
- b.p("snapshotArn", () => input.snapshotArn, "{snapshotArn}", false);
65
- let body;
66
- b.m("DELETE").h(headers).b(body);
67
- return b.build();
68
- };
69
- exports.se_DeleteClusterSnapshotCommand = se_DeleteClusterSnapshotCommand;
70
- const se_GetClusterCommand = async (input, context) => {
71
- const b = (0, core_1.requestBuilder)(input, context);
72
- const headers = {};
73
- b.bp("/cluster/{clusterArn}");
74
- b.p("clusterArn", () => input.clusterArn, "{clusterArn}", false);
75
- let body;
76
- b.m("GET").h(headers).b(body);
77
- return b.build();
78
- };
79
- exports.se_GetClusterCommand = se_GetClusterCommand;
80
- const se_GetClusterSnapshotCommand = async (input, context) => {
81
- const b = (0, core_1.requestBuilder)(input, context);
82
- const headers = {};
83
- b.bp("/cluster-snapshot/{snapshotArn}");
84
- b.p("snapshotArn", () => input.snapshotArn, "{snapshotArn}", false);
85
- let body;
86
- b.m("GET").h(headers).b(body);
87
- return b.build();
88
- };
89
- exports.se_GetClusterSnapshotCommand = se_GetClusterSnapshotCommand;
90
- const se_ListClustersCommand = async (input, context) => {
91
- const b = (0, core_1.requestBuilder)(input, context);
92
- const headers = {};
93
- b.bp("/clusters");
94
- const query = (0, smithy_client_1.map)({
95
- [_nT]: [, input[_nT]],
96
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
97
- });
98
- let body;
99
- b.m("GET").h(headers).q(query).b(body);
100
- return b.build();
101
- };
102
- exports.se_ListClustersCommand = se_ListClustersCommand;
103
- const se_ListClusterSnapshotsCommand = async (input, context) => {
104
- const b = (0, core_1.requestBuilder)(input, context);
105
- const headers = {};
106
- b.bp("/cluster-snapshots");
107
- const query = (0, smithy_client_1.map)({
108
- [_cA]: [, input[_cA]],
109
- [_nT]: [, input[_nT]],
110
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
111
- });
112
- let body;
113
- b.m("GET").h(headers).q(query).b(body);
114
- return b.build();
115
- };
116
- exports.se_ListClusterSnapshotsCommand = se_ListClusterSnapshotsCommand;
117
- const se_ListTagsForResourceCommand = async (input, context) => {
118
- const b = (0, core_1.requestBuilder)(input, context);
119
- const headers = {};
120
- b.bp("/tags/{resourceArn}");
121
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
122
- let body;
123
- b.m("GET").h(headers).b(body);
124
- return b.build();
125
- };
126
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
127
- const se_RestoreClusterFromSnapshotCommand = async (input, context) => {
128
- const b = (0, core_1.requestBuilder)(input, context);
129
- const headers = {
130
- "content-type": "application/json",
131
- };
132
- b.bp("/cluster-snapshot/{snapshotArn}/restore");
133
- b.p("snapshotArn", () => input.snapshotArn, "{snapshotArn}", false);
134
- let body;
135
- body = JSON.stringify((0, smithy_client_1.take)(input, {
136
- clusterName: [],
137
- kmsKeyId: [],
138
- subnetIds: (_) => (0, smithy_client_1._json)(_),
139
- tags: (_) => (0, smithy_client_1._json)(_),
140
- vpcSecurityGroupIds: (_) => (0, smithy_client_1._json)(_),
141
- }));
142
- b.m("POST").h(headers).b(body);
143
- return b.build();
144
- };
145
- exports.se_RestoreClusterFromSnapshotCommand = se_RestoreClusterFromSnapshotCommand;
146
- const se_TagResourceCommand = async (input, context) => {
147
- const b = (0, core_1.requestBuilder)(input, context);
148
- const headers = {
149
- "content-type": "application/json",
150
- };
151
- b.bp("/tags/{resourceArn}");
152
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
153
- let body;
154
- body = JSON.stringify((0, smithy_client_1.take)(input, {
155
- tags: (_) => (0, smithy_client_1._json)(_),
156
- }));
157
- b.m("POST").h(headers).b(body);
158
- return b.build();
159
- };
160
- exports.se_TagResourceCommand = se_TagResourceCommand;
161
- const se_UntagResourceCommand = async (input, context) => {
162
- const b = (0, core_1.requestBuilder)(input, context);
163
- const headers = {};
164
- b.bp("/tags/{resourceArn}");
165
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
166
- const query = (0, smithy_client_1.map)({
167
- [_tK]: [
168
- (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
169
- () => (input[_tK] || []).map((_entry) => _entry),
170
- ],
171
- });
172
- let body;
173
- b.m("DELETE").h(headers).q(query).b(body);
174
- return b.build();
175
- };
176
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
177
- const se_UpdateClusterCommand = async (input, context) => {
178
- const b = (0, core_1.requestBuilder)(input, context);
179
- const headers = {
180
- "content-type": "application/json",
181
- };
182
- b.bp("/cluster/{clusterArn}");
183
- b.p("clusterArn", () => input.clusterArn, "{clusterArn}", false);
184
- let body;
185
- body = JSON.stringify((0, smithy_client_1.take)(input, {
186
- adminUserPassword: [],
187
- authType: [],
188
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
189
- preferredMaintenanceWindow: [],
190
- shardCapacity: [],
191
- shardCount: [],
192
- subnetIds: (_) => (0, smithy_client_1._json)(_),
193
- vpcSecurityGroupIds: (_) => (0, smithy_client_1._json)(_),
194
- }));
195
- b.m("PUT").h(headers).b(body);
196
- return b.build();
197
- };
198
- exports.se_UpdateClusterCommand = se_UpdateClusterCommand;
199
- const de_CreateClusterCommand = async (output, context) => {
200
- if (output.statusCode !== 200 && output.statusCode >= 300) {
201
- return de_CreateClusterCommandError(output, context);
202
- }
203
- const contents = (0, smithy_client_1.map)({
204
- $metadata: deserializeMetadata(output),
205
- });
206
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
207
- const doc = (0, smithy_client_1.take)(data, {
208
- cluster: smithy_client_1._json,
209
- });
210
- Object.assign(contents, doc);
211
- return contents;
212
- };
213
- exports.de_CreateClusterCommand = de_CreateClusterCommand;
214
- const de_CreateClusterCommandError = async (output, context) => {
215
- const parsedOutput = {
216
- ...output,
217
- body: await parseErrorBody(output.body, context),
218
- };
219
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
220
- switch (errorCode) {
221
- case "AccessDeniedException":
222
- case "com.amazonaws.docdbelastic#AccessDeniedException":
223
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
224
- case "ConflictException":
225
- case "com.amazonaws.docdbelastic#ConflictException":
226
- throw await de_ConflictExceptionRes(parsedOutput, context);
227
- case "InternalServerException":
228
- case "com.amazonaws.docdbelastic#InternalServerException":
229
- throw await de_InternalServerExceptionRes(parsedOutput, context);
230
- case "ServiceQuotaExceededException":
231
- case "com.amazonaws.docdbelastic#ServiceQuotaExceededException":
232
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
233
- case "ThrottlingException":
234
- case "com.amazonaws.docdbelastic#ThrottlingException":
235
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
236
- case "ValidationException":
237
- case "com.amazonaws.docdbelastic#ValidationException":
238
- throw await de_ValidationExceptionRes(parsedOutput, context);
239
- default:
240
- const parsedBody = parsedOutput.body;
241
- return throwDefaultError({
242
- output,
243
- parsedBody,
244
- errorCode,
245
- });
246
- }
247
- };
248
- const de_CreateClusterSnapshotCommand = async (output, context) => {
249
- if (output.statusCode !== 200 && output.statusCode >= 300) {
250
- return de_CreateClusterSnapshotCommandError(output, context);
251
- }
252
- const contents = (0, smithy_client_1.map)({
253
- $metadata: deserializeMetadata(output),
254
- });
255
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
256
- const doc = (0, smithy_client_1.take)(data, {
257
- snapshot: smithy_client_1._json,
258
- });
259
- Object.assign(contents, doc);
260
- return contents;
261
- };
262
- exports.de_CreateClusterSnapshotCommand = de_CreateClusterSnapshotCommand;
263
- const de_CreateClusterSnapshotCommandError = async (output, context) => {
264
- const parsedOutput = {
265
- ...output,
266
- body: await parseErrorBody(output.body, context),
267
- };
268
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
269
- switch (errorCode) {
270
- case "AccessDeniedException":
271
- case "com.amazonaws.docdbelastic#AccessDeniedException":
272
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
273
- case "ConflictException":
274
- case "com.amazonaws.docdbelastic#ConflictException":
275
- throw await de_ConflictExceptionRes(parsedOutput, context);
276
- case "InternalServerException":
277
- case "com.amazonaws.docdbelastic#InternalServerException":
278
- throw await de_InternalServerExceptionRes(parsedOutput, context);
279
- case "ResourceNotFoundException":
280
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
281
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
282
- case "ServiceQuotaExceededException":
283
- case "com.amazonaws.docdbelastic#ServiceQuotaExceededException":
284
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
285
- case "ThrottlingException":
286
- case "com.amazonaws.docdbelastic#ThrottlingException":
287
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
288
- case "ValidationException":
289
- case "com.amazonaws.docdbelastic#ValidationException":
290
- throw await de_ValidationExceptionRes(parsedOutput, context);
291
- default:
292
- const parsedBody = parsedOutput.body;
293
- return throwDefaultError({
294
- output,
295
- parsedBody,
296
- errorCode,
297
- });
298
- }
299
- };
300
- const de_DeleteClusterCommand = async (output, context) => {
301
- if (output.statusCode !== 200 && output.statusCode >= 300) {
302
- return de_DeleteClusterCommandError(output, context);
303
- }
304
- const contents = (0, smithy_client_1.map)({
305
- $metadata: deserializeMetadata(output),
306
- });
307
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
308
- const doc = (0, smithy_client_1.take)(data, {
309
- cluster: smithy_client_1._json,
310
- });
311
- Object.assign(contents, doc);
312
- return contents;
313
- };
314
- exports.de_DeleteClusterCommand = de_DeleteClusterCommand;
315
- const de_DeleteClusterCommandError = async (output, context) => {
316
- const parsedOutput = {
317
- ...output,
318
- body: await parseErrorBody(output.body, context),
319
- };
320
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
321
- switch (errorCode) {
322
- case "AccessDeniedException":
323
- case "com.amazonaws.docdbelastic#AccessDeniedException":
324
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
325
- case "ConflictException":
326
- case "com.amazonaws.docdbelastic#ConflictException":
327
- throw await de_ConflictExceptionRes(parsedOutput, context);
328
- case "InternalServerException":
329
- case "com.amazonaws.docdbelastic#InternalServerException":
330
- throw await de_InternalServerExceptionRes(parsedOutput, context);
331
- case "ResourceNotFoundException":
332
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
333
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
334
- case "ThrottlingException":
335
- case "com.amazonaws.docdbelastic#ThrottlingException":
336
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
337
- case "ValidationException":
338
- case "com.amazonaws.docdbelastic#ValidationException":
339
- throw await de_ValidationExceptionRes(parsedOutput, context);
340
- default:
341
- const parsedBody = parsedOutput.body;
342
- return throwDefaultError({
343
- output,
344
- parsedBody,
345
- errorCode,
346
- });
347
- }
348
- };
349
- const de_DeleteClusterSnapshotCommand = async (output, context) => {
350
- if (output.statusCode !== 200 && output.statusCode >= 300) {
351
- return de_DeleteClusterSnapshotCommandError(output, context);
352
- }
353
- const contents = (0, smithy_client_1.map)({
354
- $metadata: deserializeMetadata(output),
355
- });
356
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
357
- const doc = (0, smithy_client_1.take)(data, {
358
- snapshot: smithy_client_1._json,
359
- });
360
- Object.assign(contents, doc);
361
- return contents;
362
- };
363
- exports.de_DeleteClusterSnapshotCommand = de_DeleteClusterSnapshotCommand;
364
- const de_DeleteClusterSnapshotCommandError = async (output, context) => {
365
- const parsedOutput = {
366
- ...output,
367
- body: await parseErrorBody(output.body, context),
368
- };
369
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
370
- switch (errorCode) {
371
- case "AccessDeniedException":
372
- case "com.amazonaws.docdbelastic#AccessDeniedException":
373
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
374
- case "ConflictException":
375
- case "com.amazonaws.docdbelastic#ConflictException":
376
- throw await de_ConflictExceptionRes(parsedOutput, context);
377
- case "InternalServerException":
378
- case "com.amazonaws.docdbelastic#InternalServerException":
379
- throw await de_InternalServerExceptionRes(parsedOutput, context);
380
- case "ResourceNotFoundException":
381
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
382
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
383
- case "ThrottlingException":
384
- case "com.amazonaws.docdbelastic#ThrottlingException":
385
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
386
- case "ValidationException":
387
- case "com.amazonaws.docdbelastic#ValidationException":
388
- throw await de_ValidationExceptionRes(parsedOutput, context);
389
- default:
390
- const parsedBody = parsedOutput.body;
391
- return throwDefaultError({
392
- output,
393
- parsedBody,
394
- errorCode,
395
- });
396
- }
397
- };
398
- const de_GetClusterCommand = async (output, context) => {
399
- if (output.statusCode !== 200 && output.statusCode >= 300) {
400
- return de_GetClusterCommandError(output, context);
401
- }
402
- const contents = (0, smithy_client_1.map)({
403
- $metadata: deserializeMetadata(output),
404
- });
405
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
406
- const doc = (0, smithy_client_1.take)(data, {
407
- cluster: smithy_client_1._json,
408
- });
409
- Object.assign(contents, doc);
410
- return contents;
411
- };
412
- exports.de_GetClusterCommand = de_GetClusterCommand;
413
- const de_GetClusterCommandError = async (output, context) => {
414
- const parsedOutput = {
415
- ...output,
416
- body: await parseErrorBody(output.body, context),
417
- };
418
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
419
- switch (errorCode) {
420
- case "AccessDeniedException":
421
- case "com.amazonaws.docdbelastic#AccessDeniedException":
422
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
423
- case "InternalServerException":
424
- case "com.amazonaws.docdbelastic#InternalServerException":
425
- throw await de_InternalServerExceptionRes(parsedOutput, context);
426
- case "ResourceNotFoundException":
427
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
428
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
429
- case "ThrottlingException":
430
- case "com.amazonaws.docdbelastic#ThrottlingException":
431
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
432
- case "ValidationException":
433
- case "com.amazonaws.docdbelastic#ValidationException":
434
- throw await de_ValidationExceptionRes(parsedOutput, context);
435
- default:
436
- const parsedBody = parsedOutput.body;
437
- return throwDefaultError({
438
- output,
439
- parsedBody,
440
- errorCode,
441
- });
442
- }
443
- };
444
- const de_GetClusterSnapshotCommand = async (output, context) => {
445
- if (output.statusCode !== 200 && output.statusCode >= 300) {
446
- return de_GetClusterSnapshotCommandError(output, context);
447
- }
448
- const contents = (0, smithy_client_1.map)({
449
- $metadata: deserializeMetadata(output),
450
- });
451
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
452
- const doc = (0, smithy_client_1.take)(data, {
453
- snapshot: smithy_client_1._json,
454
- });
455
- Object.assign(contents, doc);
456
- return contents;
457
- };
458
- exports.de_GetClusterSnapshotCommand = de_GetClusterSnapshotCommand;
459
- const de_GetClusterSnapshotCommandError = async (output, context) => {
460
- const parsedOutput = {
461
- ...output,
462
- body: await parseErrorBody(output.body, context),
463
- };
464
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
465
- switch (errorCode) {
466
- case "AccessDeniedException":
467
- case "com.amazonaws.docdbelastic#AccessDeniedException":
468
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
469
- case "InternalServerException":
470
- case "com.amazonaws.docdbelastic#InternalServerException":
471
- throw await de_InternalServerExceptionRes(parsedOutput, context);
472
- case "ResourceNotFoundException":
473
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
474
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
475
- case "ThrottlingException":
476
- case "com.amazonaws.docdbelastic#ThrottlingException":
477
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
478
- case "ValidationException":
479
- case "com.amazonaws.docdbelastic#ValidationException":
480
- throw await de_ValidationExceptionRes(parsedOutput, context);
481
- default:
482
- const parsedBody = parsedOutput.body;
483
- return throwDefaultError({
484
- output,
485
- parsedBody,
486
- errorCode,
487
- });
488
- }
489
- };
490
- const de_ListClustersCommand = async (output, context) => {
491
- if (output.statusCode !== 200 && output.statusCode >= 300) {
492
- return de_ListClustersCommandError(output, context);
493
- }
494
- const contents = (0, smithy_client_1.map)({
495
- $metadata: deserializeMetadata(output),
496
- });
497
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
498
- const doc = (0, smithy_client_1.take)(data, {
499
- clusters: smithy_client_1._json,
500
- nextToken: smithy_client_1.expectString,
501
- });
502
- Object.assign(contents, doc);
503
- return contents;
504
- };
505
- exports.de_ListClustersCommand = de_ListClustersCommand;
506
- const de_ListClustersCommandError = async (output, context) => {
507
- const parsedOutput = {
508
- ...output,
509
- body: await parseErrorBody(output.body, context),
510
- };
511
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
512
- switch (errorCode) {
513
- case "AccessDeniedException":
514
- case "com.amazonaws.docdbelastic#AccessDeniedException":
515
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
516
- case "InternalServerException":
517
- case "com.amazonaws.docdbelastic#InternalServerException":
518
- throw await de_InternalServerExceptionRes(parsedOutput, context);
519
- case "ThrottlingException":
520
- case "com.amazonaws.docdbelastic#ThrottlingException":
521
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
522
- case "ValidationException":
523
- case "com.amazonaws.docdbelastic#ValidationException":
524
- throw await de_ValidationExceptionRes(parsedOutput, context);
525
- default:
526
- const parsedBody = parsedOutput.body;
527
- return throwDefaultError({
528
- output,
529
- parsedBody,
530
- errorCode,
531
- });
532
- }
533
- };
534
- const de_ListClusterSnapshotsCommand = async (output, context) => {
535
- if (output.statusCode !== 200 && output.statusCode >= 300) {
536
- return de_ListClusterSnapshotsCommandError(output, context);
537
- }
538
- const contents = (0, smithy_client_1.map)({
539
- $metadata: deserializeMetadata(output),
540
- });
541
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
542
- const doc = (0, smithy_client_1.take)(data, {
543
- nextToken: smithy_client_1.expectString,
544
- snapshots: smithy_client_1._json,
545
- });
546
- Object.assign(contents, doc);
547
- return contents;
548
- };
549
- exports.de_ListClusterSnapshotsCommand = de_ListClusterSnapshotsCommand;
550
- const de_ListClusterSnapshotsCommandError = async (output, context) => {
551
- const parsedOutput = {
552
- ...output,
553
- body: await parseErrorBody(output.body, context),
554
- };
555
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
556
- switch (errorCode) {
557
- case "AccessDeniedException":
558
- case "com.amazonaws.docdbelastic#AccessDeniedException":
559
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
560
- case "InternalServerException":
561
- case "com.amazonaws.docdbelastic#InternalServerException":
562
- throw await de_InternalServerExceptionRes(parsedOutput, context);
563
- case "ThrottlingException":
564
- case "com.amazonaws.docdbelastic#ThrottlingException":
565
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
566
- case "ValidationException":
567
- case "com.amazonaws.docdbelastic#ValidationException":
568
- throw await de_ValidationExceptionRes(parsedOutput, context);
569
- default:
570
- const parsedBody = parsedOutput.body;
571
- return throwDefaultError({
572
- output,
573
- parsedBody,
574
- errorCode,
575
- });
576
- }
577
- };
578
- const de_ListTagsForResourceCommand = async (output, context) => {
579
- if (output.statusCode !== 200 && output.statusCode >= 300) {
580
- return de_ListTagsForResourceCommandError(output, context);
581
- }
582
- const contents = (0, smithy_client_1.map)({
583
- $metadata: deserializeMetadata(output),
584
- });
585
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
586
- const doc = (0, smithy_client_1.take)(data, {
587
- tags: smithy_client_1._json,
588
- });
589
- Object.assign(contents, doc);
590
- return contents;
591
- };
592
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
593
- const de_ListTagsForResourceCommandError = async (output, context) => {
594
- const parsedOutput = {
595
- ...output,
596
- body: await parseErrorBody(output.body, context),
597
- };
598
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
599
- switch (errorCode) {
600
- case "InternalServerException":
601
- case "com.amazonaws.docdbelastic#InternalServerException":
602
- throw await de_InternalServerExceptionRes(parsedOutput, context);
603
- case "ResourceNotFoundException":
604
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
605
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
606
- case "ThrottlingException":
607
- case "com.amazonaws.docdbelastic#ThrottlingException":
608
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
609
- case "ValidationException":
610
- case "com.amazonaws.docdbelastic#ValidationException":
611
- throw await de_ValidationExceptionRes(parsedOutput, context);
612
- default:
613
- const parsedBody = parsedOutput.body;
614
- return throwDefaultError({
615
- output,
616
- parsedBody,
617
- errorCode,
618
- });
619
- }
620
- };
621
- const de_RestoreClusterFromSnapshotCommand = async (output, context) => {
622
- if (output.statusCode !== 200 && output.statusCode >= 300) {
623
- return de_RestoreClusterFromSnapshotCommandError(output, context);
624
- }
625
- const contents = (0, smithy_client_1.map)({
626
- $metadata: deserializeMetadata(output),
627
- });
628
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
629
- const doc = (0, smithy_client_1.take)(data, {
630
- cluster: smithy_client_1._json,
631
- });
632
- Object.assign(contents, doc);
633
- return contents;
634
- };
635
- exports.de_RestoreClusterFromSnapshotCommand = de_RestoreClusterFromSnapshotCommand;
636
- const de_RestoreClusterFromSnapshotCommandError = async (output, context) => {
637
- const parsedOutput = {
638
- ...output,
639
- body: await parseErrorBody(output.body, context),
640
- };
641
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
642
- switch (errorCode) {
643
- case "AccessDeniedException":
644
- case "com.amazonaws.docdbelastic#AccessDeniedException":
645
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
646
- case "ConflictException":
647
- case "com.amazonaws.docdbelastic#ConflictException":
648
- throw await de_ConflictExceptionRes(parsedOutput, context);
649
- case "InternalServerException":
650
- case "com.amazonaws.docdbelastic#InternalServerException":
651
- throw await de_InternalServerExceptionRes(parsedOutput, context);
652
- case "ResourceNotFoundException":
653
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
654
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
655
- case "ServiceQuotaExceededException":
656
- case "com.amazonaws.docdbelastic#ServiceQuotaExceededException":
657
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
658
- case "ThrottlingException":
659
- case "com.amazonaws.docdbelastic#ThrottlingException":
660
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
661
- case "ValidationException":
662
- case "com.amazonaws.docdbelastic#ValidationException":
663
- throw await de_ValidationExceptionRes(parsedOutput, context);
664
- default:
665
- const parsedBody = parsedOutput.body;
666
- return throwDefaultError({
667
- output,
668
- parsedBody,
669
- errorCode,
670
- });
671
- }
672
- };
673
- const de_TagResourceCommand = async (output, context) => {
674
- if (output.statusCode !== 200 && output.statusCode >= 300) {
675
- return de_TagResourceCommandError(output, context);
676
- }
677
- const contents = (0, smithy_client_1.map)({
678
- $metadata: deserializeMetadata(output),
679
- });
680
- await (0, smithy_client_1.collectBody)(output.body, context);
681
- return contents;
682
- };
683
- exports.de_TagResourceCommand = de_TagResourceCommand;
684
- const de_TagResourceCommandError = async (output, context) => {
685
- const parsedOutput = {
686
- ...output,
687
- body: await parseErrorBody(output.body, context),
688
- };
689
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
- switch (errorCode) {
691
- case "InternalServerException":
692
- case "com.amazonaws.docdbelastic#InternalServerException":
693
- throw await de_InternalServerExceptionRes(parsedOutput, context);
694
- case "ResourceNotFoundException":
695
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
696
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
697
- case "ThrottlingException":
698
- case "com.amazonaws.docdbelastic#ThrottlingException":
699
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
700
- case "ValidationException":
701
- case "com.amazonaws.docdbelastic#ValidationException":
702
- throw await de_ValidationExceptionRes(parsedOutput, context);
703
- default:
704
- const parsedBody = parsedOutput.body;
705
- return throwDefaultError({
706
- output,
707
- parsedBody,
708
- errorCode,
709
- });
710
- }
711
- };
712
- const de_UntagResourceCommand = async (output, context) => {
713
- if (output.statusCode !== 200 && output.statusCode >= 300) {
714
- return de_UntagResourceCommandError(output, context);
715
- }
716
- const contents = (0, smithy_client_1.map)({
717
- $metadata: deserializeMetadata(output),
718
- });
719
- await (0, smithy_client_1.collectBody)(output.body, context);
720
- return contents;
721
- };
722
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
723
- const de_UntagResourceCommandError = async (output, context) => {
724
- const parsedOutput = {
725
- ...output,
726
- body: await parseErrorBody(output.body, context),
727
- };
728
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
729
- switch (errorCode) {
730
- case "InternalServerException":
731
- case "com.amazonaws.docdbelastic#InternalServerException":
732
- throw await de_InternalServerExceptionRes(parsedOutput, context);
733
- case "ResourceNotFoundException":
734
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
735
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
736
- case "ThrottlingException":
737
- case "com.amazonaws.docdbelastic#ThrottlingException":
738
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
739
- case "ValidationException":
740
- case "com.amazonaws.docdbelastic#ValidationException":
741
- throw await de_ValidationExceptionRes(parsedOutput, context);
742
- default:
743
- const parsedBody = parsedOutput.body;
744
- return throwDefaultError({
745
- output,
746
- parsedBody,
747
- errorCode,
748
- });
749
- }
750
- };
751
- const de_UpdateClusterCommand = async (output, context) => {
752
- if (output.statusCode !== 200 && output.statusCode >= 300) {
753
- return de_UpdateClusterCommandError(output, context);
754
- }
755
- const contents = (0, smithy_client_1.map)({
756
- $metadata: deserializeMetadata(output),
757
- });
758
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
759
- const doc = (0, smithy_client_1.take)(data, {
760
- cluster: smithy_client_1._json,
761
- });
762
- Object.assign(contents, doc);
763
- return contents;
764
- };
765
- exports.de_UpdateClusterCommand = de_UpdateClusterCommand;
766
- const de_UpdateClusterCommandError = async (output, context) => {
767
- const parsedOutput = {
768
- ...output,
769
- body: await parseErrorBody(output.body, context),
770
- };
771
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
772
- switch (errorCode) {
773
- case "AccessDeniedException":
774
- case "com.amazonaws.docdbelastic#AccessDeniedException":
775
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
776
- case "ConflictException":
777
- case "com.amazonaws.docdbelastic#ConflictException":
778
- throw await de_ConflictExceptionRes(parsedOutput, context);
779
- case "InternalServerException":
780
- case "com.amazonaws.docdbelastic#InternalServerException":
781
- throw await de_InternalServerExceptionRes(parsedOutput, context);
782
- case "ResourceNotFoundException":
783
- case "com.amazonaws.docdbelastic#ResourceNotFoundException":
784
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
785
- case "ThrottlingException":
786
- case "com.amazonaws.docdbelastic#ThrottlingException":
787
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
788
- case "ValidationException":
789
- case "com.amazonaws.docdbelastic#ValidationException":
790
- throw await de_ValidationExceptionRes(parsedOutput, context);
791
- default:
792
- const parsedBody = parsedOutput.body;
793
- return throwDefaultError({
794
- output,
795
- parsedBody,
796
- errorCode,
797
- });
798
- }
799
- };
800
- const throwDefaultError = (0, smithy_client_1.withBaseException)(DocDBElasticServiceException_1.DocDBElasticServiceException);
801
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
802
- const contents = (0, smithy_client_1.map)({});
803
- const data = parsedOutput.body;
804
- const doc = (0, smithy_client_1.take)(data, {
805
- message: smithy_client_1.expectString,
806
- });
807
- Object.assign(contents, doc);
808
- const exception = new models_0_1.AccessDeniedException({
809
- $metadata: deserializeMetadata(parsedOutput),
810
- ...contents,
811
- });
812
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
813
- };
814
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
815
- const contents = (0, smithy_client_1.map)({});
816
- const data = parsedOutput.body;
817
- const doc = (0, smithy_client_1.take)(data, {
818
- message: smithy_client_1.expectString,
819
- resourceId: smithy_client_1.expectString,
820
- resourceType: smithy_client_1.expectString,
821
- });
822
- Object.assign(contents, doc);
823
- const exception = new models_0_1.ConflictException({
824
- $metadata: deserializeMetadata(parsedOutput),
825
- ...contents,
826
- });
827
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
828
- };
829
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
830
- const contents = (0, smithy_client_1.map)({});
831
- const data = parsedOutput.body;
832
- const doc = (0, smithy_client_1.take)(data, {
833
- message: smithy_client_1.expectString,
834
- });
835
- Object.assign(contents, doc);
836
- const exception = new models_0_1.InternalServerException({
837
- $metadata: deserializeMetadata(parsedOutput),
838
- ...contents,
839
- });
840
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
841
- };
842
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
843
- const contents = (0, smithy_client_1.map)({});
844
- const data = parsedOutput.body;
845
- const doc = (0, smithy_client_1.take)(data, {
846
- message: smithy_client_1.expectString,
847
- resourceId: smithy_client_1.expectString,
848
- resourceType: smithy_client_1.expectString,
849
- });
850
- Object.assign(contents, doc);
851
- const exception = new models_0_1.ResourceNotFoundException({
852
- $metadata: deserializeMetadata(parsedOutput),
853
- ...contents,
854
- });
855
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
856
- };
857
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
858
- const contents = (0, smithy_client_1.map)({});
859
- const data = parsedOutput.body;
860
- const doc = (0, smithy_client_1.take)(data, {
861
- message: smithy_client_1.expectString,
862
- });
863
- Object.assign(contents, doc);
864
- const exception = new models_0_1.ServiceQuotaExceededException({
865
- $metadata: deserializeMetadata(parsedOutput),
866
- ...contents,
867
- });
868
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
869
- };
870
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
871
- const contents = (0, smithy_client_1.map)({
872
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
873
- });
874
- const data = parsedOutput.body;
875
- const doc = (0, smithy_client_1.take)(data, {
876
- message: smithy_client_1.expectString,
877
- });
878
- Object.assign(contents, doc);
879
- const exception = new models_0_1.ThrottlingException({
880
- $metadata: deserializeMetadata(parsedOutput),
881
- ...contents,
882
- });
883
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
884
- };
885
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
886
- const contents = (0, smithy_client_1.map)({});
887
- const data = parsedOutput.body;
888
- const doc = (0, smithy_client_1.take)(data, {
889
- fieldList: smithy_client_1._json,
890
- message: smithy_client_1.expectString,
891
- reason: smithy_client_1.expectString,
892
- });
893
- Object.assign(contents, doc);
894
- const exception = new models_0_1.ValidationException({
895
- $metadata: deserializeMetadata(parsedOutput),
896
- ...contents,
897
- });
898
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
899
- };
900
- const deserializeMetadata = (output) => ({
901
- httpStatusCode: output.statusCode,
902
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
903
- extendedRequestId: output.headers["x-amz-id-2"],
904
- cfId: output.headers["x-amz-cf-id"],
905
- });
906
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
907
- const isSerializableHeaderValue = (value) => value !== undefined &&
908
- value !== null &&
909
- value !== "" &&
910
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
911
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
912
- const _cA = "clusterArn";
913
- const _mR = "maxResults";
914
- const _nT = "nextToken";
915
- const _rAS = "retryAfterSeconds";
916
- const _ra = "retry-after";
917
- const _tK = "tagKeys";
918
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
919
- if (encoded.length) {
920
- return JSON.parse(encoded);
921
- }
922
- return {};
923
- });
924
- const parseErrorBody = async (errorBody, context) => {
925
- const value = await parseBody(errorBody, context);
926
- value.message = value.message ?? value.Message;
927
- return value;
928
- };
929
- const loadRestJsonErrorCode = (output, data) => {
930
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
931
- const sanitizeErrorCode = (rawValue) => {
932
- let cleanValue = rawValue;
933
- if (typeof cleanValue === "number") {
934
- cleanValue = cleanValue.toString();
935
- }
936
- if (cleanValue.indexOf(",") >= 0) {
937
- cleanValue = cleanValue.split(",")[0];
938
- }
939
- if (cleanValue.indexOf(":") >= 0) {
940
- cleanValue = cleanValue.split(":")[0];
941
- }
942
- if (cleanValue.indexOf("#") >= 0) {
943
- cleanValue = cleanValue.split("#")[1];
944
- }
945
- return cleanValue;
946
- };
947
- const headerKey = findKey(output.headers, "x-amzn-errortype");
948
- if (headerKey !== undefined) {
949
- return sanitizeErrorCode(output.headers[headerKey]);
950
- }
951
- if (data.code !== undefined) {
952
- return sanitizeErrorCode(data.code);
953
- }
954
- if (data["__type"] !== undefined) {
955
- return sanitizeErrorCode(data["__type"]);
956
- }
957
- };
1
+ module.exports = require("../index.js");