@aws-sdk/client-keyspaces 3.494.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 (31) hide show
  1. package/dist-cjs/Keyspaces.js +1 -39
  2. package/dist-cjs/KeyspacesClient.js +1 -43
  3. package/dist-cjs/commands/CreateKeyspaceCommand.js +1 -28
  4. package/dist-cjs/commands/CreateTableCommand.js +1 -28
  5. package/dist-cjs/commands/DeleteKeyspaceCommand.js +1 -28
  6. package/dist-cjs/commands/DeleteTableCommand.js +1 -28
  7. package/dist-cjs/commands/GetKeyspaceCommand.js +1 -28
  8. package/dist-cjs/commands/GetTableAutoScalingSettingsCommand.js +1 -28
  9. package/dist-cjs/commands/GetTableCommand.js +1 -28
  10. package/dist-cjs/commands/ListKeyspacesCommand.js +1 -28
  11. package/dist-cjs/commands/ListTablesCommand.js +1 -28
  12. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  13. package/dist-cjs/commands/RestoreTableCommand.js +1 -28
  14. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  15. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  16. package/dist-cjs/commands/UpdateTableCommand.js +1 -28
  17. package/dist-cjs/commands/index.js +1 -17
  18. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  19. package/dist-cjs/extensionConfiguration.js +1 -2
  20. package/dist-cjs/index.js +1647 -11
  21. package/dist-cjs/models/KeyspacesServiceException.js +1 -12
  22. package/dist-cjs/models/index.js +1 -4
  23. package/dist-cjs/models/models_0.js +1 -118
  24. package/dist-cjs/pagination/Interfaces.js +1 -2
  25. package/dist-cjs/pagination/ListKeyspacesPaginator.js +1 -7
  26. package/dist-cjs/pagination/ListTablesPaginator.js +1 -7
  27. package/dist-cjs/pagination/ListTagsForResourcePaginator.js +1 -7
  28. package/dist-cjs/pagination/index.js +1 -7
  29. package/dist-cjs/protocols/Aws_json1_0.js +1 -1064
  30. package/dist-cjs/runtimeExtensions.js +1 -22
  31. package/package.json +40 -40
@@ -1,1064 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateTableCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_RestoreTableCommand = exports.de_ListTagsForResourceCommand = exports.de_ListTablesCommand = exports.de_ListKeyspacesCommand = exports.de_GetTableAutoScalingSettingsCommand = exports.de_GetTableCommand = exports.de_GetKeyspaceCommand = exports.de_DeleteTableCommand = exports.de_DeleteKeyspaceCommand = exports.de_CreateTableCommand = exports.de_CreateKeyspaceCommand = exports.se_UpdateTableCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_RestoreTableCommand = exports.se_ListTagsForResourceCommand = exports.se_ListTablesCommand = exports.se_ListKeyspacesCommand = exports.se_GetTableAutoScalingSettingsCommand = exports.se_GetTableCommand = exports.se_GetKeyspaceCommand = exports.se_DeleteTableCommand = exports.se_DeleteKeyspaceCommand = exports.se_CreateTableCommand = exports.se_CreateKeyspaceCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const KeyspacesServiceException_1 = require("../models/KeyspacesServiceException");
7
- const models_0_1 = require("../models/models_0");
8
- const se_CreateKeyspaceCommand = async (input, context) => {
9
- const headers = sharedHeaders("CreateKeyspace");
10
- let body;
11
- body = JSON.stringify((0, smithy_client_1._json)(input));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- exports.se_CreateKeyspaceCommand = se_CreateKeyspaceCommand;
15
- const se_CreateTableCommand = async (input, context) => {
16
- const headers = sharedHeaders("CreateTable");
17
- let body;
18
- body = JSON.stringify(se_CreateTableRequest(input, context));
19
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
- };
21
- exports.se_CreateTableCommand = se_CreateTableCommand;
22
- const se_DeleteKeyspaceCommand = async (input, context) => {
23
- const headers = sharedHeaders("DeleteKeyspace");
24
- let body;
25
- body = JSON.stringify((0, smithy_client_1._json)(input));
26
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
- };
28
- exports.se_DeleteKeyspaceCommand = se_DeleteKeyspaceCommand;
29
- const se_DeleteTableCommand = async (input, context) => {
30
- const headers = sharedHeaders("DeleteTable");
31
- let body;
32
- body = JSON.stringify((0, smithy_client_1._json)(input));
33
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
- };
35
- exports.se_DeleteTableCommand = se_DeleteTableCommand;
36
- const se_GetKeyspaceCommand = async (input, context) => {
37
- const headers = sharedHeaders("GetKeyspace");
38
- let body;
39
- body = JSON.stringify((0, smithy_client_1._json)(input));
40
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
- };
42
- exports.se_GetKeyspaceCommand = se_GetKeyspaceCommand;
43
- const se_GetTableCommand = async (input, context) => {
44
- const headers = sharedHeaders("GetTable");
45
- let body;
46
- body = JSON.stringify((0, smithy_client_1._json)(input));
47
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
48
- };
49
- exports.se_GetTableCommand = se_GetTableCommand;
50
- const se_GetTableAutoScalingSettingsCommand = async (input, context) => {
51
- const headers = sharedHeaders("GetTableAutoScalingSettings");
52
- let body;
53
- body = JSON.stringify((0, smithy_client_1._json)(input));
54
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
55
- };
56
- exports.se_GetTableAutoScalingSettingsCommand = se_GetTableAutoScalingSettingsCommand;
57
- const se_ListKeyspacesCommand = async (input, context) => {
58
- const headers = sharedHeaders("ListKeyspaces");
59
- let body;
60
- body = JSON.stringify((0, smithy_client_1._json)(input));
61
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
62
- };
63
- exports.se_ListKeyspacesCommand = se_ListKeyspacesCommand;
64
- const se_ListTablesCommand = async (input, context) => {
65
- const headers = sharedHeaders("ListTables");
66
- let body;
67
- body = JSON.stringify((0, smithy_client_1._json)(input));
68
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
69
- };
70
- exports.se_ListTablesCommand = se_ListTablesCommand;
71
- const se_ListTagsForResourceCommand = async (input, context) => {
72
- const headers = sharedHeaders("ListTagsForResource");
73
- let body;
74
- body = JSON.stringify((0, smithy_client_1._json)(input));
75
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
- };
77
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
78
- const se_RestoreTableCommand = async (input, context) => {
79
- const headers = sharedHeaders("RestoreTable");
80
- let body;
81
- body = JSON.stringify(se_RestoreTableRequest(input, context));
82
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
83
- };
84
- exports.se_RestoreTableCommand = se_RestoreTableCommand;
85
- const se_TagResourceCommand = async (input, context) => {
86
- const headers = sharedHeaders("TagResource");
87
- let body;
88
- body = JSON.stringify((0, smithy_client_1._json)(input));
89
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
90
- };
91
- exports.se_TagResourceCommand = se_TagResourceCommand;
92
- const se_UntagResourceCommand = async (input, context) => {
93
- const headers = sharedHeaders("UntagResource");
94
- let body;
95
- body = JSON.stringify((0, smithy_client_1._json)(input));
96
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
97
- };
98
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
99
- const se_UpdateTableCommand = async (input, context) => {
100
- const headers = sharedHeaders("UpdateTable");
101
- let body;
102
- body = JSON.stringify(se_UpdateTableRequest(input, context));
103
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
104
- };
105
- exports.se_UpdateTableCommand = se_UpdateTableCommand;
106
- const de_CreateKeyspaceCommand = async (output, context) => {
107
- if (output.statusCode >= 300) {
108
- return de_CreateKeyspaceCommandError(output, context);
109
- }
110
- const data = await parseBody(output.body, context);
111
- let contents = {};
112
- contents = (0, smithy_client_1._json)(data);
113
- const response = {
114
- $metadata: deserializeMetadata(output),
115
- ...contents,
116
- };
117
- return response;
118
- };
119
- exports.de_CreateKeyspaceCommand = de_CreateKeyspaceCommand;
120
- const de_CreateKeyspaceCommandError = async (output, context) => {
121
- const parsedOutput = {
122
- ...output,
123
- body: await parseErrorBody(output.body, context),
124
- };
125
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
126
- switch (errorCode) {
127
- case "AccessDeniedException":
128
- case "com.amazonaws.keyspaces#AccessDeniedException":
129
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
130
- case "ConflictException":
131
- case "com.amazonaws.keyspaces#ConflictException":
132
- throw await de_ConflictExceptionRes(parsedOutput, context);
133
- case "InternalServerException":
134
- case "com.amazonaws.keyspaces#InternalServerException":
135
- throw await de_InternalServerExceptionRes(parsedOutput, context);
136
- case "ServiceQuotaExceededException":
137
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
138
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
139
- case "ValidationException":
140
- case "com.amazonaws.keyspaces#ValidationException":
141
- throw await de_ValidationExceptionRes(parsedOutput, context);
142
- default:
143
- const parsedBody = parsedOutput.body;
144
- return throwDefaultError({
145
- output,
146
- parsedBody,
147
- errorCode,
148
- });
149
- }
150
- };
151
- const de_CreateTableCommand = async (output, context) => {
152
- if (output.statusCode >= 300) {
153
- return de_CreateTableCommandError(output, context);
154
- }
155
- const data = await parseBody(output.body, context);
156
- let contents = {};
157
- contents = (0, smithy_client_1._json)(data);
158
- const response = {
159
- $metadata: deserializeMetadata(output),
160
- ...contents,
161
- };
162
- return response;
163
- };
164
- exports.de_CreateTableCommand = de_CreateTableCommand;
165
- const de_CreateTableCommandError = async (output, context) => {
166
- const parsedOutput = {
167
- ...output,
168
- body: await parseErrorBody(output.body, context),
169
- };
170
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
171
- switch (errorCode) {
172
- case "AccessDeniedException":
173
- case "com.amazonaws.keyspaces#AccessDeniedException":
174
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
175
- case "ConflictException":
176
- case "com.amazonaws.keyspaces#ConflictException":
177
- throw await de_ConflictExceptionRes(parsedOutput, context);
178
- case "InternalServerException":
179
- case "com.amazonaws.keyspaces#InternalServerException":
180
- throw await de_InternalServerExceptionRes(parsedOutput, context);
181
- case "ResourceNotFoundException":
182
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
183
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
184
- case "ServiceQuotaExceededException":
185
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
186
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
187
- case "ValidationException":
188
- case "com.amazonaws.keyspaces#ValidationException":
189
- throw await de_ValidationExceptionRes(parsedOutput, context);
190
- default:
191
- const parsedBody = parsedOutput.body;
192
- return throwDefaultError({
193
- output,
194
- parsedBody,
195
- errorCode,
196
- });
197
- }
198
- };
199
- const de_DeleteKeyspaceCommand = async (output, context) => {
200
- if (output.statusCode >= 300) {
201
- return de_DeleteKeyspaceCommandError(output, context);
202
- }
203
- const data = await parseBody(output.body, context);
204
- let contents = {};
205
- contents = (0, smithy_client_1._json)(data);
206
- const response = {
207
- $metadata: deserializeMetadata(output),
208
- ...contents,
209
- };
210
- return response;
211
- };
212
- exports.de_DeleteKeyspaceCommand = de_DeleteKeyspaceCommand;
213
- const de_DeleteKeyspaceCommandError = async (output, context) => {
214
- const parsedOutput = {
215
- ...output,
216
- body: await parseErrorBody(output.body, context),
217
- };
218
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
219
- switch (errorCode) {
220
- case "AccessDeniedException":
221
- case "com.amazonaws.keyspaces#AccessDeniedException":
222
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
223
- case "ConflictException":
224
- case "com.amazonaws.keyspaces#ConflictException":
225
- throw await de_ConflictExceptionRes(parsedOutput, context);
226
- case "InternalServerException":
227
- case "com.amazonaws.keyspaces#InternalServerException":
228
- throw await de_InternalServerExceptionRes(parsedOutput, context);
229
- case "ResourceNotFoundException":
230
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
231
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
232
- case "ServiceQuotaExceededException":
233
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
234
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
235
- case "ValidationException":
236
- case "com.amazonaws.keyspaces#ValidationException":
237
- throw await de_ValidationExceptionRes(parsedOutput, context);
238
- default:
239
- const parsedBody = parsedOutput.body;
240
- return throwDefaultError({
241
- output,
242
- parsedBody,
243
- errorCode,
244
- });
245
- }
246
- };
247
- const de_DeleteTableCommand = async (output, context) => {
248
- if (output.statusCode >= 300) {
249
- return de_DeleteTableCommandError(output, context);
250
- }
251
- const data = await parseBody(output.body, context);
252
- let contents = {};
253
- contents = (0, smithy_client_1._json)(data);
254
- const response = {
255
- $metadata: deserializeMetadata(output),
256
- ...contents,
257
- };
258
- return response;
259
- };
260
- exports.de_DeleteTableCommand = de_DeleteTableCommand;
261
- const de_DeleteTableCommandError = async (output, context) => {
262
- const parsedOutput = {
263
- ...output,
264
- body: await parseErrorBody(output.body, context),
265
- };
266
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
267
- switch (errorCode) {
268
- case "AccessDeniedException":
269
- case "com.amazonaws.keyspaces#AccessDeniedException":
270
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
271
- case "ConflictException":
272
- case "com.amazonaws.keyspaces#ConflictException":
273
- throw await de_ConflictExceptionRes(parsedOutput, context);
274
- case "InternalServerException":
275
- case "com.amazonaws.keyspaces#InternalServerException":
276
- throw await de_InternalServerExceptionRes(parsedOutput, context);
277
- case "ResourceNotFoundException":
278
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
279
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
280
- case "ServiceQuotaExceededException":
281
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
282
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
283
- case "ValidationException":
284
- case "com.amazonaws.keyspaces#ValidationException":
285
- throw await de_ValidationExceptionRes(parsedOutput, context);
286
- default:
287
- const parsedBody = parsedOutput.body;
288
- return throwDefaultError({
289
- output,
290
- parsedBody,
291
- errorCode,
292
- });
293
- }
294
- };
295
- const de_GetKeyspaceCommand = async (output, context) => {
296
- if (output.statusCode >= 300) {
297
- return de_GetKeyspaceCommandError(output, context);
298
- }
299
- const data = await parseBody(output.body, context);
300
- let contents = {};
301
- contents = (0, smithy_client_1._json)(data);
302
- const response = {
303
- $metadata: deserializeMetadata(output),
304
- ...contents,
305
- };
306
- return response;
307
- };
308
- exports.de_GetKeyspaceCommand = de_GetKeyspaceCommand;
309
- const de_GetKeyspaceCommandError = async (output, context) => {
310
- const parsedOutput = {
311
- ...output,
312
- body: await parseErrorBody(output.body, context),
313
- };
314
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
315
- switch (errorCode) {
316
- case "AccessDeniedException":
317
- case "com.amazonaws.keyspaces#AccessDeniedException":
318
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
319
- case "InternalServerException":
320
- case "com.amazonaws.keyspaces#InternalServerException":
321
- throw await de_InternalServerExceptionRes(parsedOutput, context);
322
- case "ResourceNotFoundException":
323
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
324
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
325
- case "ServiceQuotaExceededException":
326
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
327
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
328
- case "ValidationException":
329
- case "com.amazonaws.keyspaces#ValidationException":
330
- throw await de_ValidationExceptionRes(parsedOutput, context);
331
- default:
332
- const parsedBody = parsedOutput.body;
333
- return throwDefaultError({
334
- output,
335
- parsedBody,
336
- errorCode,
337
- });
338
- }
339
- };
340
- const de_GetTableCommand = async (output, context) => {
341
- if (output.statusCode >= 300) {
342
- return de_GetTableCommandError(output, context);
343
- }
344
- const data = await parseBody(output.body, context);
345
- let contents = {};
346
- contents = de_GetTableResponse(data, context);
347
- const response = {
348
- $metadata: deserializeMetadata(output),
349
- ...contents,
350
- };
351
- return response;
352
- };
353
- exports.de_GetTableCommand = de_GetTableCommand;
354
- const de_GetTableCommandError = async (output, context) => {
355
- const parsedOutput = {
356
- ...output,
357
- body: await parseErrorBody(output.body, context),
358
- };
359
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
360
- switch (errorCode) {
361
- case "AccessDeniedException":
362
- case "com.amazonaws.keyspaces#AccessDeniedException":
363
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
364
- case "InternalServerException":
365
- case "com.amazonaws.keyspaces#InternalServerException":
366
- throw await de_InternalServerExceptionRes(parsedOutput, context);
367
- case "ResourceNotFoundException":
368
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
369
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
370
- case "ServiceQuotaExceededException":
371
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
372
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
373
- case "ValidationException":
374
- case "com.amazonaws.keyspaces#ValidationException":
375
- throw await de_ValidationExceptionRes(parsedOutput, context);
376
- default:
377
- const parsedBody = parsedOutput.body;
378
- return throwDefaultError({
379
- output,
380
- parsedBody,
381
- errorCode,
382
- });
383
- }
384
- };
385
- const de_GetTableAutoScalingSettingsCommand = async (output, context) => {
386
- if (output.statusCode >= 300) {
387
- return de_GetTableAutoScalingSettingsCommandError(output, context);
388
- }
389
- const data = await parseBody(output.body, context);
390
- let contents = {};
391
- contents = de_GetTableAutoScalingSettingsResponse(data, context);
392
- const response = {
393
- $metadata: deserializeMetadata(output),
394
- ...contents,
395
- };
396
- return response;
397
- };
398
- exports.de_GetTableAutoScalingSettingsCommand = de_GetTableAutoScalingSettingsCommand;
399
- const de_GetTableAutoScalingSettingsCommandError = async (output, context) => {
400
- const parsedOutput = {
401
- ...output,
402
- body: await parseErrorBody(output.body, context),
403
- };
404
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
405
- switch (errorCode) {
406
- case "AccessDeniedException":
407
- case "com.amazonaws.keyspaces#AccessDeniedException":
408
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
409
- case "InternalServerException":
410
- case "com.amazonaws.keyspaces#InternalServerException":
411
- throw await de_InternalServerExceptionRes(parsedOutput, context);
412
- case "ResourceNotFoundException":
413
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
414
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
415
- case "ServiceQuotaExceededException":
416
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
417
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
418
- case "ValidationException":
419
- case "com.amazonaws.keyspaces#ValidationException":
420
- throw await de_ValidationExceptionRes(parsedOutput, context);
421
- default:
422
- const parsedBody = parsedOutput.body;
423
- return throwDefaultError({
424
- output,
425
- parsedBody,
426
- errorCode,
427
- });
428
- }
429
- };
430
- const de_ListKeyspacesCommand = async (output, context) => {
431
- if (output.statusCode >= 300) {
432
- return de_ListKeyspacesCommandError(output, context);
433
- }
434
- const data = await parseBody(output.body, context);
435
- let contents = {};
436
- contents = (0, smithy_client_1._json)(data);
437
- const response = {
438
- $metadata: deserializeMetadata(output),
439
- ...contents,
440
- };
441
- return response;
442
- };
443
- exports.de_ListKeyspacesCommand = de_ListKeyspacesCommand;
444
- const de_ListKeyspacesCommandError = async (output, context) => {
445
- const parsedOutput = {
446
- ...output,
447
- body: await parseErrorBody(output.body, context),
448
- };
449
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
450
- switch (errorCode) {
451
- case "AccessDeniedException":
452
- case "com.amazonaws.keyspaces#AccessDeniedException":
453
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
454
- case "InternalServerException":
455
- case "com.amazonaws.keyspaces#InternalServerException":
456
- throw await de_InternalServerExceptionRes(parsedOutput, context);
457
- case "ResourceNotFoundException":
458
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
459
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
460
- case "ServiceQuotaExceededException":
461
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
462
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
463
- case "ValidationException":
464
- case "com.amazonaws.keyspaces#ValidationException":
465
- throw await de_ValidationExceptionRes(parsedOutput, context);
466
- default:
467
- const parsedBody = parsedOutput.body;
468
- return throwDefaultError({
469
- output,
470
- parsedBody,
471
- errorCode,
472
- });
473
- }
474
- };
475
- const de_ListTablesCommand = async (output, context) => {
476
- if (output.statusCode >= 300) {
477
- return de_ListTablesCommandError(output, context);
478
- }
479
- const data = await parseBody(output.body, context);
480
- let contents = {};
481
- contents = (0, smithy_client_1._json)(data);
482
- const response = {
483
- $metadata: deserializeMetadata(output),
484
- ...contents,
485
- };
486
- return response;
487
- };
488
- exports.de_ListTablesCommand = de_ListTablesCommand;
489
- const de_ListTablesCommandError = async (output, context) => {
490
- const parsedOutput = {
491
- ...output,
492
- body: await parseErrorBody(output.body, context),
493
- };
494
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
495
- switch (errorCode) {
496
- case "AccessDeniedException":
497
- case "com.amazonaws.keyspaces#AccessDeniedException":
498
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
499
- case "InternalServerException":
500
- case "com.amazonaws.keyspaces#InternalServerException":
501
- throw await de_InternalServerExceptionRes(parsedOutput, context);
502
- case "ResourceNotFoundException":
503
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
504
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
505
- case "ServiceQuotaExceededException":
506
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
507
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
508
- case "ValidationException":
509
- case "com.amazonaws.keyspaces#ValidationException":
510
- throw await de_ValidationExceptionRes(parsedOutput, context);
511
- default:
512
- const parsedBody = parsedOutput.body;
513
- return throwDefaultError({
514
- output,
515
- parsedBody,
516
- errorCode,
517
- });
518
- }
519
- };
520
- const de_ListTagsForResourceCommand = async (output, context) => {
521
- if (output.statusCode >= 300) {
522
- return de_ListTagsForResourceCommandError(output, context);
523
- }
524
- const data = await parseBody(output.body, context);
525
- let contents = {};
526
- contents = (0, smithy_client_1._json)(data);
527
- const response = {
528
- $metadata: deserializeMetadata(output),
529
- ...contents,
530
- };
531
- return response;
532
- };
533
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
534
- const de_ListTagsForResourceCommandError = async (output, context) => {
535
- const parsedOutput = {
536
- ...output,
537
- body: await parseErrorBody(output.body, context),
538
- };
539
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
540
- switch (errorCode) {
541
- case "AccessDeniedException":
542
- case "com.amazonaws.keyspaces#AccessDeniedException":
543
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
544
- case "InternalServerException":
545
- case "com.amazonaws.keyspaces#InternalServerException":
546
- throw await de_InternalServerExceptionRes(parsedOutput, context);
547
- case "ResourceNotFoundException":
548
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
549
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
550
- case "ServiceQuotaExceededException":
551
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
552
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
553
- case "ValidationException":
554
- case "com.amazonaws.keyspaces#ValidationException":
555
- throw await de_ValidationExceptionRes(parsedOutput, context);
556
- default:
557
- const parsedBody = parsedOutput.body;
558
- return throwDefaultError({
559
- output,
560
- parsedBody,
561
- errorCode,
562
- });
563
- }
564
- };
565
- const de_RestoreTableCommand = async (output, context) => {
566
- if (output.statusCode >= 300) {
567
- return de_RestoreTableCommandError(output, context);
568
- }
569
- const data = await parseBody(output.body, context);
570
- let contents = {};
571
- contents = (0, smithy_client_1._json)(data);
572
- const response = {
573
- $metadata: deserializeMetadata(output),
574
- ...contents,
575
- };
576
- return response;
577
- };
578
- exports.de_RestoreTableCommand = de_RestoreTableCommand;
579
- const de_RestoreTableCommandError = async (output, context) => {
580
- const parsedOutput = {
581
- ...output,
582
- body: await parseErrorBody(output.body, context),
583
- };
584
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
585
- switch (errorCode) {
586
- case "AccessDeniedException":
587
- case "com.amazonaws.keyspaces#AccessDeniedException":
588
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
589
- case "ConflictException":
590
- case "com.amazonaws.keyspaces#ConflictException":
591
- throw await de_ConflictExceptionRes(parsedOutput, context);
592
- case "InternalServerException":
593
- case "com.amazonaws.keyspaces#InternalServerException":
594
- throw await de_InternalServerExceptionRes(parsedOutput, context);
595
- case "ResourceNotFoundException":
596
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
597
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
598
- case "ServiceQuotaExceededException":
599
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
600
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
601
- case "ValidationException":
602
- case "com.amazonaws.keyspaces#ValidationException":
603
- throw await de_ValidationExceptionRes(parsedOutput, context);
604
- default:
605
- const parsedBody = parsedOutput.body;
606
- return throwDefaultError({
607
- output,
608
- parsedBody,
609
- errorCode,
610
- });
611
- }
612
- };
613
- const de_TagResourceCommand = async (output, context) => {
614
- if (output.statusCode >= 300) {
615
- return de_TagResourceCommandError(output, context);
616
- }
617
- const data = await parseBody(output.body, context);
618
- let contents = {};
619
- contents = (0, smithy_client_1._json)(data);
620
- const response = {
621
- $metadata: deserializeMetadata(output),
622
- ...contents,
623
- };
624
- return response;
625
- };
626
- exports.de_TagResourceCommand = de_TagResourceCommand;
627
- const de_TagResourceCommandError = async (output, context) => {
628
- const parsedOutput = {
629
- ...output,
630
- body: await parseErrorBody(output.body, context),
631
- };
632
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
633
- switch (errorCode) {
634
- case "AccessDeniedException":
635
- case "com.amazonaws.keyspaces#AccessDeniedException":
636
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
637
- case "InternalServerException":
638
- case "com.amazonaws.keyspaces#InternalServerException":
639
- throw await de_InternalServerExceptionRes(parsedOutput, context);
640
- case "ResourceNotFoundException":
641
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
642
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
643
- case "ServiceQuotaExceededException":
644
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
645
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
646
- case "ValidationException":
647
- case "com.amazonaws.keyspaces#ValidationException":
648
- throw await de_ValidationExceptionRes(parsedOutput, context);
649
- default:
650
- const parsedBody = parsedOutput.body;
651
- return throwDefaultError({
652
- output,
653
- parsedBody,
654
- errorCode,
655
- });
656
- }
657
- };
658
- const de_UntagResourceCommand = async (output, context) => {
659
- if (output.statusCode >= 300) {
660
- return de_UntagResourceCommandError(output, context);
661
- }
662
- const data = await parseBody(output.body, context);
663
- let contents = {};
664
- contents = (0, smithy_client_1._json)(data);
665
- const response = {
666
- $metadata: deserializeMetadata(output),
667
- ...contents,
668
- };
669
- return response;
670
- };
671
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
672
- const de_UntagResourceCommandError = async (output, context) => {
673
- const parsedOutput = {
674
- ...output,
675
- body: await parseErrorBody(output.body, context),
676
- };
677
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
678
- switch (errorCode) {
679
- case "AccessDeniedException":
680
- case "com.amazonaws.keyspaces#AccessDeniedException":
681
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
682
- case "ConflictException":
683
- case "com.amazonaws.keyspaces#ConflictException":
684
- throw await de_ConflictExceptionRes(parsedOutput, context);
685
- case "InternalServerException":
686
- case "com.amazonaws.keyspaces#InternalServerException":
687
- throw await de_InternalServerExceptionRes(parsedOutput, context);
688
- case "ResourceNotFoundException":
689
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
690
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
691
- case "ServiceQuotaExceededException":
692
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
693
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
694
- case "ValidationException":
695
- case "com.amazonaws.keyspaces#ValidationException":
696
- throw await de_ValidationExceptionRes(parsedOutput, context);
697
- default:
698
- const parsedBody = parsedOutput.body;
699
- return throwDefaultError({
700
- output,
701
- parsedBody,
702
- errorCode,
703
- });
704
- }
705
- };
706
- const de_UpdateTableCommand = async (output, context) => {
707
- if (output.statusCode >= 300) {
708
- return de_UpdateTableCommandError(output, context);
709
- }
710
- const data = await parseBody(output.body, context);
711
- let contents = {};
712
- contents = (0, smithy_client_1._json)(data);
713
- const response = {
714
- $metadata: deserializeMetadata(output),
715
- ...contents,
716
- };
717
- return response;
718
- };
719
- exports.de_UpdateTableCommand = de_UpdateTableCommand;
720
- const de_UpdateTableCommandError = async (output, context) => {
721
- const parsedOutput = {
722
- ...output,
723
- body: await parseErrorBody(output.body, context),
724
- };
725
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
726
- switch (errorCode) {
727
- case "AccessDeniedException":
728
- case "com.amazonaws.keyspaces#AccessDeniedException":
729
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
730
- case "ConflictException":
731
- case "com.amazonaws.keyspaces#ConflictException":
732
- throw await de_ConflictExceptionRes(parsedOutput, context);
733
- case "InternalServerException":
734
- case "com.amazonaws.keyspaces#InternalServerException":
735
- throw await de_InternalServerExceptionRes(parsedOutput, context);
736
- case "ResourceNotFoundException":
737
- case "com.amazonaws.keyspaces#ResourceNotFoundException":
738
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
739
- case "ServiceQuotaExceededException":
740
- case "com.amazonaws.keyspaces#ServiceQuotaExceededException":
741
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
742
- case "ValidationException":
743
- case "com.amazonaws.keyspaces#ValidationException":
744
- throw await de_ValidationExceptionRes(parsedOutput, context);
745
- default:
746
- const parsedBody = parsedOutput.body;
747
- return throwDefaultError({
748
- output,
749
- parsedBody,
750
- errorCode,
751
- });
752
- }
753
- };
754
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
755
- const body = parsedOutput.body;
756
- const deserialized = (0, smithy_client_1._json)(body);
757
- const exception = new models_0_1.AccessDeniedException({
758
- $metadata: deserializeMetadata(parsedOutput),
759
- ...deserialized,
760
- });
761
- return (0, smithy_client_1.decorateServiceException)(exception, body);
762
- };
763
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
764
- const body = parsedOutput.body;
765
- const deserialized = (0, smithy_client_1._json)(body);
766
- const exception = new models_0_1.ConflictException({
767
- $metadata: deserializeMetadata(parsedOutput),
768
- ...deserialized,
769
- });
770
- return (0, smithy_client_1.decorateServiceException)(exception, body);
771
- };
772
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
773
- const body = parsedOutput.body;
774
- const deserialized = (0, smithy_client_1._json)(body);
775
- const exception = new models_0_1.InternalServerException({
776
- $metadata: deserializeMetadata(parsedOutput),
777
- ...deserialized,
778
- });
779
- return (0, smithy_client_1.decorateServiceException)(exception, body);
780
- };
781
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
782
- const body = parsedOutput.body;
783
- const deserialized = (0, smithy_client_1._json)(body);
784
- const exception = new models_0_1.ResourceNotFoundException({
785
- $metadata: deserializeMetadata(parsedOutput),
786
- ...deserialized,
787
- });
788
- return (0, smithy_client_1.decorateServiceException)(exception, body);
789
- };
790
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
791
- const body = parsedOutput.body;
792
- const deserialized = (0, smithy_client_1._json)(body);
793
- const exception = new models_0_1.ServiceQuotaExceededException({
794
- $metadata: deserializeMetadata(parsedOutput),
795
- ...deserialized,
796
- });
797
- return (0, smithy_client_1.decorateServiceException)(exception, body);
798
- };
799
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
800
- const body = parsedOutput.body;
801
- const deserialized = (0, smithy_client_1._json)(body);
802
- const exception = new models_0_1.ValidationException({
803
- $metadata: deserializeMetadata(parsedOutput),
804
- ...deserialized,
805
- });
806
- return (0, smithy_client_1.decorateServiceException)(exception, body);
807
- };
808
- const se_AutoScalingPolicy = (input, context) => {
809
- return (0, smithy_client_1.take)(input, {
810
- targetTrackingScalingPolicyConfiguration: (_) => se_TargetTrackingScalingPolicyConfiguration(_, context),
811
- });
812
- };
813
- const se_AutoScalingSettings = (input, context) => {
814
- return (0, smithy_client_1.take)(input, {
815
- autoScalingDisabled: [],
816
- maximumUnits: [],
817
- minimumUnits: [],
818
- scalingPolicy: (_) => se_AutoScalingPolicy(_, context),
819
- });
820
- };
821
- const se_AutoScalingSpecification = (input, context) => {
822
- return (0, smithy_client_1.take)(input, {
823
- readCapacityAutoScaling: (_) => se_AutoScalingSettings(_, context),
824
- writeCapacityAutoScaling: (_) => se_AutoScalingSettings(_, context),
825
- });
826
- };
827
- const se_CreateTableRequest = (input, context) => {
828
- return (0, smithy_client_1.take)(input, {
829
- autoScalingSpecification: (_) => se_AutoScalingSpecification(_, context),
830
- capacitySpecification: smithy_client_1._json,
831
- clientSideTimestamps: smithy_client_1._json,
832
- comment: smithy_client_1._json,
833
- defaultTimeToLive: [],
834
- encryptionSpecification: smithy_client_1._json,
835
- keyspaceName: [],
836
- pointInTimeRecovery: smithy_client_1._json,
837
- replicaSpecifications: (_) => se_ReplicaSpecificationList(_, context),
838
- schemaDefinition: smithy_client_1._json,
839
- tableName: [],
840
- tags: smithy_client_1._json,
841
- ttl: smithy_client_1._json,
842
- });
843
- };
844
- const se_ReplicaSpecification = (input, context) => {
845
- return (0, smithy_client_1.take)(input, {
846
- readCapacityAutoScaling: (_) => se_AutoScalingSettings(_, context),
847
- readCapacityUnits: [],
848
- region: [],
849
- });
850
- };
851
- const se_ReplicaSpecificationList = (input, context) => {
852
- return input
853
- .filter((e) => e != null)
854
- .map((entry) => {
855
- return se_ReplicaSpecification(entry, context);
856
- });
857
- };
858
- const se_RestoreTableRequest = (input, context) => {
859
- return (0, smithy_client_1.take)(input, {
860
- autoScalingSpecification: (_) => se_AutoScalingSpecification(_, context),
861
- capacitySpecificationOverride: smithy_client_1._json,
862
- encryptionSpecificationOverride: smithy_client_1._json,
863
- pointInTimeRecoveryOverride: smithy_client_1._json,
864
- replicaSpecifications: (_) => se_ReplicaSpecificationList(_, context),
865
- restoreTimestamp: (_) => Math.round(_.getTime() / 1000),
866
- sourceKeyspaceName: [],
867
- sourceTableName: [],
868
- tagsOverride: smithy_client_1._json,
869
- targetKeyspaceName: [],
870
- targetTableName: [],
871
- });
872
- };
873
- const se_TargetTrackingScalingPolicyConfiguration = (input, context) => {
874
- return (0, smithy_client_1.take)(input, {
875
- disableScaleIn: [],
876
- scaleInCooldown: [],
877
- scaleOutCooldown: [],
878
- targetValue: smithy_client_1.serializeFloat,
879
- });
880
- };
881
- const se_UpdateTableRequest = (input, context) => {
882
- return (0, smithy_client_1.take)(input, {
883
- addColumns: smithy_client_1._json,
884
- autoScalingSpecification: (_) => se_AutoScalingSpecification(_, context),
885
- capacitySpecification: smithy_client_1._json,
886
- clientSideTimestamps: smithy_client_1._json,
887
- defaultTimeToLive: [],
888
- encryptionSpecification: smithy_client_1._json,
889
- keyspaceName: [],
890
- pointInTimeRecovery: smithy_client_1._json,
891
- replicaSpecifications: (_) => se_ReplicaSpecificationList(_, context),
892
- tableName: [],
893
- ttl: smithy_client_1._json,
894
- });
895
- };
896
- const de_AutoScalingPolicy = (output, context) => {
897
- return (0, smithy_client_1.take)(output, {
898
- targetTrackingScalingPolicyConfiguration: (_) => de_TargetTrackingScalingPolicyConfiguration(_, context),
899
- });
900
- };
901
- const de_AutoScalingSettings = (output, context) => {
902
- return (0, smithy_client_1.take)(output, {
903
- autoScalingDisabled: smithy_client_1.expectBoolean,
904
- maximumUnits: smithy_client_1.expectLong,
905
- minimumUnits: smithy_client_1.expectLong,
906
- scalingPolicy: (_) => de_AutoScalingPolicy(_, context),
907
- });
908
- };
909
- const de_AutoScalingSpecification = (output, context) => {
910
- return (0, smithy_client_1.take)(output, {
911
- readCapacityAutoScaling: (_) => de_AutoScalingSettings(_, context),
912
- writeCapacityAutoScaling: (_) => de_AutoScalingSettings(_, context),
913
- });
914
- };
915
- const de_CapacitySpecificationSummary = (output, context) => {
916
- return (0, smithy_client_1.take)(output, {
917
- lastUpdateToPayPerRequestTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
918
- readCapacityUnits: smithy_client_1.expectLong,
919
- throughputMode: smithy_client_1.expectString,
920
- writeCapacityUnits: smithy_client_1.expectLong,
921
- });
922
- };
923
- const de_GetTableAutoScalingSettingsResponse = (output, context) => {
924
- return (0, smithy_client_1.take)(output, {
925
- autoScalingSpecification: (_) => de_AutoScalingSpecification(_, context),
926
- keyspaceName: smithy_client_1.expectString,
927
- replicaSpecifications: (_) => de_ReplicaAutoScalingSpecificationList(_, context),
928
- resourceArn: smithy_client_1.expectString,
929
- tableName: smithy_client_1.expectString,
930
- });
931
- };
932
- const de_GetTableResponse = (output, context) => {
933
- return (0, smithy_client_1.take)(output, {
934
- capacitySpecification: (_) => de_CapacitySpecificationSummary(_, context),
935
- clientSideTimestamps: smithy_client_1._json,
936
- comment: smithy_client_1._json,
937
- creationTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
938
- defaultTimeToLive: smithy_client_1.expectInt32,
939
- encryptionSpecification: smithy_client_1._json,
940
- keyspaceName: smithy_client_1.expectString,
941
- pointInTimeRecovery: (_) => de_PointInTimeRecoverySummary(_, context),
942
- replicaSpecifications: (_) => de_ReplicaSpecificationSummaryList(_, context),
943
- resourceArn: smithy_client_1.expectString,
944
- schemaDefinition: smithy_client_1._json,
945
- status: smithy_client_1.expectString,
946
- tableName: smithy_client_1.expectString,
947
- ttl: smithy_client_1._json,
948
- });
949
- };
950
- const de_PointInTimeRecoverySummary = (output, context) => {
951
- return (0, smithy_client_1.take)(output, {
952
- earliestRestorableTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
953
- status: smithy_client_1.expectString,
954
- });
955
- };
956
- const de_ReplicaAutoScalingSpecification = (output, context) => {
957
- return (0, smithy_client_1.take)(output, {
958
- autoScalingSpecification: (_) => de_AutoScalingSpecification(_, context),
959
- region: smithy_client_1.expectString,
960
- });
961
- };
962
- const de_ReplicaAutoScalingSpecificationList = (output, context) => {
963
- const retVal = (output || [])
964
- .filter((e) => e != null)
965
- .map((entry) => {
966
- return de_ReplicaAutoScalingSpecification(entry, context);
967
- });
968
- return retVal;
969
- };
970
- const de_ReplicaSpecificationSummary = (output, context) => {
971
- return (0, smithy_client_1.take)(output, {
972
- capacitySpecification: (_) => de_CapacitySpecificationSummary(_, context),
973
- region: smithy_client_1.expectString,
974
- status: smithy_client_1.expectString,
975
- });
976
- };
977
- const de_ReplicaSpecificationSummaryList = (output, context) => {
978
- const retVal = (output || [])
979
- .filter((e) => e != null)
980
- .map((entry) => {
981
- return de_ReplicaSpecificationSummary(entry, context);
982
- });
983
- return retVal;
984
- };
985
- const de_TargetTrackingScalingPolicyConfiguration = (output, context) => {
986
- return (0, smithy_client_1.take)(output, {
987
- disableScaleIn: smithy_client_1.expectBoolean,
988
- scaleInCooldown: smithy_client_1.expectInt32,
989
- scaleOutCooldown: smithy_client_1.expectInt32,
990
- targetValue: smithy_client_1.limitedParseDouble,
991
- });
992
- };
993
- const deserializeMetadata = (output) => ({
994
- httpStatusCode: output.statusCode,
995
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
996
- extendedRequestId: output.headers["x-amz-id-2"],
997
- cfId: output.headers["x-amz-cf-id"],
998
- });
999
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1000
- const throwDefaultError = (0, smithy_client_1.withBaseException)(KeyspacesServiceException_1.KeyspacesServiceException);
1001
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1002
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1003
- const contents = {
1004
- protocol,
1005
- hostname,
1006
- port,
1007
- method: "POST",
1008
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1009
- headers,
1010
- };
1011
- if (resolvedHostname !== undefined) {
1012
- contents.hostname = resolvedHostname;
1013
- }
1014
- if (body !== undefined) {
1015
- contents.body = body;
1016
- }
1017
- return new protocol_http_1.HttpRequest(contents);
1018
- };
1019
- function sharedHeaders(operation) {
1020
- return {
1021
- "content-type": "application/x-amz-json-1.0",
1022
- "x-amz-target": `KeyspacesService.${operation}`,
1023
- };
1024
- }
1025
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1026
- if (encoded.length) {
1027
- return JSON.parse(encoded);
1028
- }
1029
- return {};
1030
- });
1031
- const parseErrorBody = async (errorBody, context) => {
1032
- const value = await parseBody(errorBody, context);
1033
- value.message = value.message ?? value.Message;
1034
- return value;
1035
- };
1036
- const loadRestJsonErrorCode = (output, data) => {
1037
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1038
- const sanitizeErrorCode = (rawValue) => {
1039
- let cleanValue = rawValue;
1040
- if (typeof cleanValue === "number") {
1041
- cleanValue = cleanValue.toString();
1042
- }
1043
- if (cleanValue.indexOf(",") >= 0) {
1044
- cleanValue = cleanValue.split(",")[0];
1045
- }
1046
- if (cleanValue.indexOf(":") >= 0) {
1047
- cleanValue = cleanValue.split(":")[0];
1048
- }
1049
- if (cleanValue.indexOf("#") >= 0) {
1050
- cleanValue = cleanValue.split("#")[1];
1051
- }
1052
- return cleanValue;
1053
- };
1054
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1055
- if (headerKey !== undefined) {
1056
- return sanitizeErrorCode(output.headers[headerKey]);
1057
- }
1058
- if (data.code !== undefined) {
1059
- return sanitizeErrorCode(data.code);
1060
- }
1061
- if (data["__type"] !== undefined) {
1062
- return sanitizeErrorCode(data["__type"]);
1063
- }
1064
- };
1
+ module.exports = require("../index.js");