@aws-sdk/client-s3vectors 3.928.0 → 3.929.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 (37) hide show
  1. package/dist-cjs/index.js +640 -998
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/S3VectorsClient.js +2 -0
  4. package/dist-es/commands/CreateIndexCommand.js +3 -9
  5. package/dist-es/commands/CreateVectorBucketCommand.js +3 -9
  6. package/dist-es/commands/DeleteIndexCommand.js +3 -9
  7. package/dist-es/commands/DeleteVectorBucketCommand.js +3 -9
  8. package/dist-es/commands/DeleteVectorBucketPolicyCommand.js +3 -9
  9. package/dist-es/commands/DeleteVectorsCommand.js +3 -9
  10. package/dist-es/commands/GetIndexCommand.js +3 -9
  11. package/dist-es/commands/GetVectorBucketCommand.js +3 -9
  12. package/dist-es/commands/GetVectorBucketPolicyCommand.js +3 -9
  13. package/dist-es/commands/GetVectorsCommand.js +3 -9
  14. package/dist-es/commands/ListIndexesCommand.js +3 -9
  15. package/dist-es/commands/ListVectorBucketsCommand.js +3 -9
  16. package/dist-es/commands/ListVectorsCommand.js +3 -9
  17. package/dist-es/commands/PutVectorBucketPolicyCommand.js +3 -9
  18. package/dist-es/commands/PutVectorsCommand.js +3 -9
  19. package/dist-es/commands/QueryVectorsCommand.js +3 -9
  20. package/dist-es/runtimeConfig.shared.js +2 -0
  21. package/dist-es/schemas/schemas_0.js +572 -0
  22. package/dist-types/S3VectorsClient.d.ts +10 -1
  23. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  24. package/dist-types/runtimeConfig.d.ts +1 -0
  25. package/dist-types/runtimeConfig.native.d.ts +1 -0
  26. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  27. package/dist-types/schemas/schemas_0.d.ts +87 -0
  28. package/dist-types/ts3.4/S3VectorsClient.d.ts +4 -0
  29. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  30. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  31. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  32. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  33. package/dist-types/ts3.4/schemas/schemas_0.d.ts +92 -0
  34. package/package.json +5 -3
  35. package/dist-es/protocols/Aws_restJson1.js +0 -848
  36. package/dist-types/protocols/Aws_restJson1.d.ts +0 -146
  37. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -197
@@ -1,848 +0,0 @@
1
- import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, map, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
4
- import { AccessDeniedException, ConflictException, InternalServerException, KmsDisabledException, KmsInvalidKeyUsageException, KmsInvalidStateException, KmsNotFoundException, NotFoundException, RequestTimeoutException, ServiceQuotaExceededException, ServiceUnavailableException, TooManyRequestsException, ValidationException, VectorData, } from "../models/models_0";
5
- import { S3VectorsServiceException as __BaseException } from "../models/S3VectorsServiceException";
6
- export const se_CreateIndexCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = {
9
- "content-type": "application/json",
10
- };
11
- b.bp("/CreateIndex");
12
- let body;
13
- body = JSON.stringify(take(input, {
14
- dataType: [],
15
- dimension: [],
16
- distanceMetric: [],
17
- indexName: [],
18
- metadataConfiguration: (_) => _json(_),
19
- vectorBucketArn: [],
20
- vectorBucketName: [],
21
- }));
22
- b.m("POST").h(headers).b(body);
23
- return b.build();
24
- };
25
- export const se_CreateVectorBucketCommand = async (input, context) => {
26
- const b = rb(input, context);
27
- const headers = {
28
- "content-type": "application/json",
29
- };
30
- b.bp("/CreateVectorBucket");
31
- let body;
32
- body = JSON.stringify(take(input, {
33
- encryptionConfiguration: (_) => _json(_),
34
- vectorBucketName: [],
35
- }));
36
- b.m("POST").h(headers).b(body);
37
- return b.build();
38
- };
39
- export const se_DeleteIndexCommand = async (input, context) => {
40
- const b = rb(input, context);
41
- const headers = {
42
- "content-type": "application/json",
43
- };
44
- b.bp("/DeleteIndex");
45
- let body;
46
- body = JSON.stringify(take(input, {
47
- indexArn: [],
48
- indexName: [],
49
- vectorBucketName: [],
50
- }));
51
- b.m("POST").h(headers).b(body);
52
- return b.build();
53
- };
54
- export const se_DeleteVectorBucketCommand = async (input, context) => {
55
- const b = rb(input, context);
56
- const headers = {
57
- "content-type": "application/json",
58
- };
59
- b.bp("/DeleteVectorBucket");
60
- let body;
61
- body = JSON.stringify(take(input, {
62
- vectorBucketArn: [],
63
- vectorBucketName: [],
64
- }));
65
- b.m("POST").h(headers).b(body);
66
- return b.build();
67
- };
68
- export const se_DeleteVectorBucketPolicyCommand = async (input, context) => {
69
- const b = rb(input, context);
70
- const headers = {
71
- "content-type": "application/json",
72
- };
73
- b.bp("/DeleteVectorBucketPolicy");
74
- let body;
75
- body = JSON.stringify(take(input, {
76
- vectorBucketArn: [],
77
- vectorBucketName: [],
78
- }));
79
- b.m("POST").h(headers).b(body);
80
- return b.build();
81
- };
82
- export const se_DeleteVectorsCommand = async (input, context) => {
83
- const b = rb(input, context);
84
- const headers = {
85
- "content-type": "application/json",
86
- };
87
- b.bp("/DeleteVectors");
88
- let body;
89
- body = JSON.stringify(take(input, {
90
- indexArn: [],
91
- indexName: [],
92
- keys: (_) => _json(_),
93
- vectorBucketName: [],
94
- }));
95
- b.m("POST").h(headers).b(body);
96
- return b.build();
97
- };
98
- export const se_GetIndexCommand = async (input, context) => {
99
- const b = rb(input, context);
100
- const headers = {
101
- "content-type": "application/json",
102
- };
103
- b.bp("/GetIndex");
104
- let body;
105
- body = JSON.stringify(take(input, {
106
- indexArn: [],
107
- indexName: [],
108
- vectorBucketName: [],
109
- }));
110
- b.m("POST").h(headers).b(body);
111
- return b.build();
112
- };
113
- export const se_GetVectorBucketCommand = async (input, context) => {
114
- const b = rb(input, context);
115
- const headers = {
116
- "content-type": "application/json",
117
- };
118
- b.bp("/GetVectorBucket");
119
- let body;
120
- body = JSON.stringify(take(input, {
121
- vectorBucketArn: [],
122
- vectorBucketName: [],
123
- }));
124
- b.m("POST").h(headers).b(body);
125
- return b.build();
126
- };
127
- export const se_GetVectorBucketPolicyCommand = async (input, context) => {
128
- const b = rb(input, context);
129
- const headers = {
130
- "content-type": "application/json",
131
- };
132
- b.bp("/GetVectorBucketPolicy");
133
- let body;
134
- body = JSON.stringify(take(input, {
135
- vectorBucketArn: [],
136
- vectorBucketName: [],
137
- }));
138
- b.m("POST").h(headers).b(body);
139
- return b.build();
140
- };
141
- export const se_GetVectorsCommand = async (input, context) => {
142
- const b = rb(input, context);
143
- const headers = {
144
- "content-type": "application/json",
145
- };
146
- b.bp("/GetVectors");
147
- let body;
148
- body = JSON.stringify(take(input, {
149
- indexArn: [],
150
- indexName: [],
151
- keys: (_) => _json(_),
152
- returnData: [],
153
- returnMetadata: [],
154
- vectorBucketName: [],
155
- }));
156
- b.m("POST").h(headers).b(body);
157
- return b.build();
158
- };
159
- export const se_ListIndexesCommand = async (input, context) => {
160
- const b = rb(input, context);
161
- const headers = {
162
- "content-type": "application/json",
163
- };
164
- b.bp("/ListIndexes");
165
- let body;
166
- body = JSON.stringify(take(input, {
167
- maxResults: [],
168
- nextToken: [],
169
- prefix: [],
170
- vectorBucketArn: [],
171
- vectorBucketName: [],
172
- }));
173
- b.m("POST").h(headers).b(body);
174
- return b.build();
175
- };
176
- export const se_ListVectorBucketsCommand = async (input, context) => {
177
- const b = rb(input, context);
178
- const headers = {
179
- "content-type": "application/json",
180
- };
181
- b.bp("/ListVectorBuckets");
182
- let body;
183
- body = JSON.stringify(take(input, {
184
- maxResults: [],
185
- nextToken: [],
186
- prefix: [],
187
- }));
188
- b.m("POST").h(headers).b(body);
189
- return b.build();
190
- };
191
- export const se_ListVectorsCommand = async (input, context) => {
192
- const b = rb(input, context);
193
- const headers = {
194
- "content-type": "application/json",
195
- };
196
- b.bp("/ListVectors");
197
- let body;
198
- body = JSON.stringify(take(input, {
199
- indexArn: [],
200
- indexName: [],
201
- maxResults: [],
202
- nextToken: [],
203
- returnData: [],
204
- returnMetadata: [],
205
- segmentCount: [],
206
- segmentIndex: [],
207
- vectorBucketName: [],
208
- }));
209
- b.m("POST").h(headers).b(body);
210
- return b.build();
211
- };
212
- export const se_PutVectorBucketPolicyCommand = async (input, context) => {
213
- const b = rb(input, context);
214
- const headers = {
215
- "content-type": "application/json",
216
- };
217
- b.bp("/PutVectorBucketPolicy");
218
- let body;
219
- body = JSON.stringify(take(input, {
220
- policy: [],
221
- vectorBucketArn: [],
222
- vectorBucketName: [],
223
- }));
224
- b.m("POST").h(headers).b(body);
225
- return b.build();
226
- };
227
- export const se_PutVectorsCommand = async (input, context) => {
228
- const b = rb(input, context);
229
- const headers = {
230
- "content-type": "application/json",
231
- };
232
- b.bp("/PutVectors");
233
- let body;
234
- body = JSON.stringify(take(input, {
235
- indexArn: [],
236
- indexName: [],
237
- vectorBucketName: [],
238
- vectors: (_) => se_PutVectorsInputList(_, context),
239
- }));
240
- b.m("POST").h(headers).b(body);
241
- return b.build();
242
- };
243
- export const se_QueryVectorsCommand = async (input, context) => {
244
- const b = rb(input, context);
245
- const headers = {
246
- "content-type": "application/json",
247
- };
248
- b.bp("/QueryVectors");
249
- let body;
250
- body = JSON.stringify(take(input, {
251
- filter: (_) => se_Document(_, context),
252
- indexArn: [],
253
- indexName: [],
254
- queryVector: (_) => se_VectorData(_, context),
255
- returnDistance: [],
256
- returnMetadata: [],
257
- topK: [],
258
- vectorBucketName: [],
259
- }));
260
- b.m("POST").h(headers).b(body);
261
- return b.build();
262
- };
263
- export const de_CreateIndexCommand = async (output, context) => {
264
- if (output.statusCode !== 200 && output.statusCode >= 300) {
265
- return de_CommandError(output, context);
266
- }
267
- const contents = map({
268
- $metadata: deserializeMetadata(output),
269
- });
270
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
271
- const doc = take(data, {
272
- indexArn: __expectString,
273
- });
274
- Object.assign(contents, doc);
275
- return contents;
276
- };
277
- export const de_CreateVectorBucketCommand = async (output, context) => {
278
- if (output.statusCode !== 200 && output.statusCode >= 300) {
279
- return de_CommandError(output, context);
280
- }
281
- const contents = map({
282
- $metadata: deserializeMetadata(output),
283
- });
284
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
285
- const doc = take(data, {
286
- vectorBucketArn: __expectString,
287
- });
288
- Object.assign(contents, doc);
289
- return contents;
290
- };
291
- export const de_DeleteIndexCommand = async (output, context) => {
292
- if (output.statusCode !== 200 && output.statusCode >= 300) {
293
- return de_CommandError(output, context);
294
- }
295
- const contents = map({
296
- $metadata: deserializeMetadata(output),
297
- });
298
- await collectBody(output.body, context);
299
- return contents;
300
- };
301
- export const de_DeleteVectorBucketCommand = async (output, context) => {
302
- if (output.statusCode !== 200 && output.statusCode >= 300) {
303
- return de_CommandError(output, context);
304
- }
305
- const contents = map({
306
- $metadata: deserializeMetadata(output),
307
- });
308
- await collectBody(output.body, context);
309
- return contents;
310
- };
311
- export const de_DeleteVectorBucketPolicyCommand = async (output, context) => {
312
- if (output.statusCode !== 200 && output.statusCode >= 300) {
313
- return de_CommandError(output, context);
314
- }
315
- const contents = map({
316
- $metadata: deserializeMetadata(output),
317
- });
318
- await collectBody(output.body, context);
319
- return contents;
320
- };
321
- export const de_DeleteVectorsCommand = async (output, context) => {
322
- if (output.statusCode !== 200 && output.statusCode >= 300) {
323
- return de_CommandError(output, context);
324
- }
325
- const contents = map({
326
- $metadata: deserializeMetadata(output),
327
- });
328
- await collectBody(output.body, context);
329
- return contents;
330
- };
331
- export const de_GetIndexCommand = async (output, context) => {
332
- if (output.statusCode !== 200 && output.statusCode >= 300) {
333
- return de_CommandError(output, context);
334
- }
335
- const contents = map({
336
- $metadata: deserializeMetadata(output),
337
- });
338
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
339
- const doc = take(data, {
340
- index: (_) => de_Index(_, context),
341
- });
342
- Object.assign(contents, doc);
343
- return contents;
344
- };
345
- export const de_GetVectorBucketCommand = async (output, context) => {
346
- if (output.statusCode !== 200 && output.statusCode >= 300) {
347
- return de_CommandError(output, context);
348
- }
349
- const contents = map({
350
- $metadata: deserializeMetadata(output),
351
- });
352
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
353
- const doc = take(data, {
354
- vectorBucket: (_) => de_VectorBucket(_, context),
355
- });
356
- Object.assign(contents, doc);
357
- return contents;
358
- };
359
- export const de_GetVectorBucketPolicyCommand = async (output, context) => {
360
- if (output.statusCode !== 200 && output.statusCode >= 300) {
361
- return de_CommandError(output, context);
362
- }
363
- const contents = map({
364
- $metadata: deserializeMetadata(output),
365
- });
366
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
367
- const doc = take(data, {
368
- policy: __expectString,
369
- });
370
- Object.assign(contents, doc);
371
- return contents;
372
- };
373
- export const de_GetVectorsCommand = async (output, context) => {
374
- if (output.statusCode !== 200 && output.statusCode >= 300) {
375
- return de_CommandError(output, context);
376
- }
377
- const contents = map({
378
- $metadata: deserializeMetadata(output),
379
- });
380
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
381
- const doc = take(data, {
382
- vectors: (_) => de_GetVectorsOutputList(_, context),
383
- });
384
- Object.assign(contents, doc);
385
- return contents;
386
- };
387
- export const de_ListIndexesCommand = async (output, context) => {
388
- if (output.statusCode !== 200 && output.statusCode >= 300) {
389
- return de_CommandError(output, context);
390
- }
391
- const contents = map({
392
- $metadata: deserializeMetadata(output),
393
- });
394
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
395
- const doc = take(data, {
396
- indexes: (_) => de_ListIndexesOutputList(_, context),
397
- nextToken: __expectString,
398
- });
399
- Object.assign(contents, doc);
400
- return contents;
401
- };
402
- export const de_ListVectorBucketsCommand = async (output, context) => {
403
- if (output.statusCode !== 200 && output.statusCode >= 300) {
404
- return de_CommandError(output, context);
405
- }
406
- const contents = map({
407
- $metadata: deserializeMetadata(output),
408
- });
409
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
410
- const doc = take(data, {
411
- nextToken: __expectString,
412
- vectorBuckets: (_) => de_ListVectorBucketsOutputList(_, context),
413
- });
414
- Object.assign(contents, doc);
415
- return contents;
416
- };
417
- export const de_ListVectorsCommand = async (output, context) => {
418
- if (output.statusCode !== 200 && output.statusCode >= 300) {
419
- return de_CommandError(output, context);
420
- }
421
- const contents = map({
422
- $metadata: deserializeMetadata(output),
423
- });
424
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
425
- const doc = take(data, {
426
- nextToken: __expectString,
427
- vectors: (_) => de_ListVectorsOutputList(_, context),
428
- });
429
- Object.assign(contents, doc);
430
- return contents;
431
- };
432
- export const de_PutVectorBucketPolicyCommand = async (output, context) => {
433
- if (output.statusCode !== 200 && output.statusCode >= 300) {
434
- return de_CommandError(output, context);
435
- }
436
- const contents = map({
437
- $metadata: deserializeMetadata(output),
438
- });
439
- await collectBody(output.body, context);
440
- return contents;
441
- };
442
- export const de_PutVectorsCommand = async (output, context) => {
443
- if (output.statusCode !== 200 && output.statusCode >= 300) {
444
- return de_CommandError(output, context);
445
- }
446
- const contents = map({
447
- $metadata: deserializeMetadata(output),
448
- });
449
- await collectBody(output.body, context);
450
- return contents;
451
- };
452
- export const de_QueryVectorsCommand = async (output, context) => {
453
- if (output.statusCode !== 200 && output.statusCode >= 300) {
454
- return de_CommandError(output, context);
455
- }
456
- const contents = map({
457
- $metadata: deserializeMetadata(output),
458
- });
459
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
460
- const doc = take(data, {
461
- distanceMetric: __expectString,
462
- vectors: (_) => de_QueryVectorsOutputList(_, context),
463
- });
464
- Object.assign(contents, doc);
465
- return contents;
466
- };
467
- const de_CommandError = async (output, context) => {
468
- const parsedOutput = {
469
- ...output,
470
- body: await parseErrorBody(output.body, context),
471
- };
472
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
473
- switch (errorCode) {
474
- case "AccessDeniedException":
475
- case "com.amazonaws.s3vectors#AccessDeniedException":
476
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
477
- case "ConflictException":
478
- case "com.amazonaws.s3vectors#ConflictException":
479
- throw await de_ConflictExceptionRes(parsedOutput, context);
480
- case "InternalServerException":
481
- case "com.amazonaws.s3vectors#InternalServerException":
482
- throw await de_InternalServerExceptionRes(parsedOutput, context);
483
- case "NotFoundException":
484
- case "com.amazonaws.s3vectors#NotFoundException":
485
- throw await de_NotFoundExceptionRes(parsedOutput, context);
486
- case "RequestTimeoutException":
487
- case "com.amazonaws.s3vectors#RequestTimeoutException":
488
- throw await de_RequestTimeoutExceptionRes(parsedOutput, context);
489
- case "ServiceQuotaExceededException":
490
- case "com.amazonaws.s3vectors#ServiceQuotaExceededException":
491
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
492
- case "ServiceUnavailableException":
493
- case "com.amazonaws.s3vectors#ServiceUnavailableException":
494
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
495
- case "TooManyRequestsException":
496
- case "com.amazonaws.s3vectors#TooManyRequestsException":
497
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
498
- case "ValidationException":
499
- case "com.amazonaws.s3vectors#ValidationException":
500
- throw await de_ValidationExceptionRes(parsedOutput, context);
501
- case "KmsDisabledException":
502
- case "com.amazonaws.s3vectors#KmsDisabledException":
503
- throw await de_KmsDisabledExceptionRes(parsedOutput, context);
504
- case "KmsInvalidKeyUsageException":
505
- case "com.amazonaws.s3vectors#KmsInvalidKeyUsageException":
506
- throw await de_KmsInvalidKeyUsageExceptionRes(parsedOutput, context);
507
- case "KmsInvalidStateException":
508
- case "com.amazonaws.s3vectors#KmsInvalidStateException":
509
- throw await de_KmsInvalidStateExceptionRes(parsedOutput, context);
510
- case "KmsNotFoundException":
511
- case "com.amazonaws.s3vectors#KmsNotFoundException":
512
- throw await de_KmsNotFoundExceptionRes(parsedOutput, context);
513
- default:
514
- const parsedBody = parsedOutput.body;
515
- return throwDefaultError({
516
- output,
517
- parsedBody,
518
- errorCode,
519
- });
520
- }
521
- };
522
- const throwDefaultError = withBaseException(__BaseException);
523
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
524
- const contents = map({});
525
- const data = parsedOutput.body;
526
- const doc = take(data, {
527
- message: __expectString,
528
- });
529
- Object.assign(contents, doc);
530
- const exception = new AccessDeniedException({
531
- $metadata: deserializeMetadata(parsedOutput),
532
- ...contents,
533
- });
534
- return __decorateServiceException(exception, parsedOutput.body);
535
- };
536
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
537
- const contents = map({});
538
- const data = parsedOutput.body;
539
- const doc = take(data, {
540
- message: __expectString,
541
- });
542
- Object.assign(contents, doc);
543
- const exception = new ConflictException({
544
- $metadata: deserializeMetadata(parsedOutput),
545
- ...contents,
546
- });
547
- return __decorateServiceException(exception, parsedOutput.body);
548
- };
549
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
550
- const contents = map({});
551
- const data = parsedOutput.body;
552
- const doc = take(data, {
553
- message: __expectString,
554
- });
555
- Object.assign(contents, doc);
556
- const exception = new InternalServerException({
557
- $metadata: deserializeMetadata(parsedOutput),
558
- ...contents,
559
- });
560
- return __decorateServiceException(exception, parsedOutput.body);
561
- };
562
- const de_KmsDisabledExceptionRes = async (parsedOutput, context) => {
563
- const contents = map({});
564
- const data = parsedOutput.body;
565
- const doc = take(data, {
566
- message: __expectString,
567
- });
568
- Object.assign(contents, doc);
569
- const exception = new KmsDisabledException({
570
- $metadata: deserializeMetadata(parsedOutput),
571
- ...contents,
572
- });
573
- return __decorateServiceException(exception, parsedOutput.body);
574
- };
575
- const de_KmsInvalidKeyUsageExceptionRes = async (parsedOutput, context) => {
576
- const contents = map({});
577
- const data = parsedOutput.body;
578
- const doc = take(data, {
579
- message: __expectString,
580
- });
581
- Object.assign(contents, doc);
582
- const exception = new KmsInvalidKeyUsageException({
583
- $metadata: deserializeMetadata(parsedOutput),
584
- ...contents,
585
- });
586
- return __decorateServiceException(exception, parsedOutput.body);
587
- };
588
- const de_KmsInvalidStateExceptionRes = async (parsedOutput, context) => {
589
- const contents = map({});
590
- const data = parsedOutput.body;
591
- const doc = take(data, {
592
- message: __expectString,
593
- });
594
- Object.assign(contents, doc);
595
- const exception = new KmsInvalidStateException({
596
- $metadata: deserializeMetadata(parsedOutput),
597
- ...contents,
598
- });
599
- return __decorateServiceException(exception, parsedOutput.body);
600
- };
601
- const de_KmsNotFoundExceptionRes = async (parsedOutput, context) => {
602
- const contents = map({});
603
- const data = parsedOutput.body;
604
- const doc = take(data, {
605
- message: __expectString,
606
- });
607
- Object.assign(contents, doc);
608
- const exception = new KmsNotFoundException({
609
- $metadata: deserializeMetadata(parsedOutput),
610
- ...contents,
611
- });
612
- return __decorateServiceException(exception, parsedOutput.body);
613
- };
614
- const de_NotFoundExceptionRes = async (parsedOutput, context) => {
615
- const contents = map({});
616
- const data = parsedOutput.body;
617
- const doc = take(data, {
618
- message: __expectString,
619
- });
620
- Object.assign(contents, doc);
621
- const exception = new NotFoundException({
622
- $metadata: deserializeMetadata(parsedOutput),
623
- ...contents,
624
- });
625
- return __decorateServiceException(exception, parsedOutput.body);
626
- };
627
- const de_RequestTimeoutExceptionRes = async (parsedOutput, context) => {
628
- const contents = map({});
629
- const data = parsedOutput.body;
630
- const doc = take(data, {
631
- message: __expectString,
632
- });
633
- Object.assign(contents, doc);
634
- const exception = new RequestTimeoutException({
635
- $metadata: deserializeMetadata(parsedOutput),
636
- ...contents,
637
- });
638
- return __decorateServiceException(exception, parsedOutput.body);
639
- };
640
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
641
- const contents = map({});
642
- const data = parsedOutput.body;
643
- const doc = take(data, {
644
- message: __expectString,
645
- });
646
- Object.assign(contents, doc);
647
- const exception = new ServiceQuotaExceededException({
648
- $metadata: deserializeMetadata(parsedOutput),
649
- ...contents,
650
- });
651
- return __decorateServiceException(exception, parsedOutput.body);
652
- };
653
- const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
654
- const contents = map({});
655
- const data = parsedOutput.body;
656
- const doc = take(data, {
657
- message: __expectString,
658
- });
659
- Object.assign(contents, doc);
660
- const exception = new ServiceUnavailableException({
661
- $metadata: deserializeMetadata(parsedOutput),
662
- ...contents,
663
- });
664
- return __decorateServiceException(exception, parsedOutput.body);
665
- };
666
- const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
667
- const contents = map({});
668
- const data = parsedOutput.body;
669
- const doc = take(data, {
670
- message: __expectString,
671
- });
672
- Object.assign(contents, doc);
673
- const exception = new TooManyRequestsException({
674
- $metadata: deserializeMetadata(parsedOutput),
675
- ...contents,
676
- });
677
- return __decorateServiceException(exception, parsedOutput.body);
678
- };
679
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
680
- const contents = map({});
681
- const data = parsedOutput.body;
682
- const doc = take(data, {
683
- fieldList: _json,
684
- message: __expectString,
685
- });
686
- Object.assign(contents, doc);
687
- const exception = new ValidationException({
688
- $metadata: deserializeMetadata(parsedOutput),
689
- ...contents,
690
- });
691
- return __decorateServiceException(exception, parsedOutput.body);
692
- };
693
- const se_Float32VectorData = (input, context) => {
694
- return input
695
- .filter((e) => e != null)
696
- .map((entry) => {
697
- return __serializeFloat(entry);
698
- });
699
- };
700
- const se_PutInputVector = (input, context) => {
701
- return take(input, {
702
- data: (_) => se_VectorData(_, context),
703
- key: [],
704
- metadata: (_) => se_VectorMetadata(_, context),
705
- });
706
- };
707
- const se_PutVectorsInputList = (input, context) => {
708
- return input
709
- .filter((e) => e != null)
710
- .map((entry) => {
711
- return se_PutInputVector(entry, context);
712
- });
713
- };
714
- const se_VectorData = (input, context) => {
715
- return VectorData.visit(input, {
716
- float32: (value) => ({ float32: se_Float32VectorData(value, context) }),
717
- _: (name, value) => ({ [name]: value }),
718
- });
719
- };
720
- const se_VectorMetadata = (input, context) => {
721
- return input;
722
- };
723
- const se_Document = (input, context) => {
724
- return input;
725
- };
726
- const de_Float32VectorData = (output, context) => {
727
- const retVal = (output || [])
728
- .filter((e) => e != null)
729
- .map((entry) => {
730
- return __limitedParseFloat32(entry);
731
- });
732
- return retVal;
733
- };
734
- const de_GetOutputVector = (output, context) => {
735
- return take(output, {
736
- data: (_) => de_VectorData(__expectUnion(_), context),
737
- key: __expectString,
738
- metadata: (_) => de_VectorMetadata(_, context),
739
- });
740
- };
741
- const de_GetVectorsOutputList = (output, context) => {
742
- const retVal = (output || [])
743
- .filter((e) => e != null)
744
- .map((entry) => {
745
- return de_GetOutputVector(entry, context);
746
- });
747
- return retVal;
748
- };
749
- const de_Index = (output, context) => {
750
- return take(output, {
751
- creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
752
- dataType: __expectString,
753
- dimension: __expectInt32,
754
- distanceMetric: __expectString,
755
- indexArn: __expectString,
756
- indexName: __expectString,
757
- metadataConfiguration: _json,
758
- vectorBucketName: __expectString,
759
- });
760
- };
761
- const de_IndexSummary = (output, context) => {
762
- return take(output, {
763
- creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
764
- indexArn: __expectString,
765
- indexName: __expectString,
766
- vectorBucketName: __expectString,
767
- });
768
- };
769
- const de_ListIndexesOutputList = (output, context) => {
770
- const retVal = (output || [])
771
- .filter((e) => e != null)
772
- .map((entry) => {
773
- return de_IndexSummary(entry, context);
774
- });
775
- return retVal;
776
- };
777
- const de_ListOutputVector = (output, context) => {
778
- return take(output, {
779
- data: (_) => de_VectorData(__expectUnion(_), context),
780
- key: __expectString,
781
- metadata: (_) => de_VectorMetadata(_, context),
782
- });
783
- };
784
- const de_ListVectorBucketsOutputList = (output, context) => {
785
- const retVal = (output || [])
786
- .filter((e) => e != null)
787
- .map((entry) => {
788
- return de_VectorBucketSummary(entry, context);
789
- });
790
- return retVal;
791
- };
792
- const de_ListVectorsOutputList = (output, context) => {
793
- const retVal = (output || [])
794
- .filter((e) => e != null)
795
- .map((entry) => {
796
- return de_ListOutputVector(entry, context);
797
- });
798
- return retVal;
799
- };
800
- const de_QueryOutputVector = (output, context) => {
801
- return take(output, {
802
- data: (_) => de_VectorData(__expectUnion(_), context),
803
- distance: __limitedParseFloat32,
804
- key: __expectString,
805
- metadata: (_) => de_VectorMetadata(_, context),
806
- });
807
- };
808
- const de_QueryVectorsOutputList = (output, context) => {
809
- const retVal = (output || [])
810
- .filter((e) => e != null)
811
- .map((entry) => {
812
- return de_QueryOutputVector(entry, context);
813
- });
814
- return retVal;
815
- };
816
- const de_VectorBucket = (output, context) => {
817
- return take(output, {
818
- creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
819
- encryptionConfiguration: _json,
820
- vectorBucketArn: __expectString,
821
- vectorBucketName: __expectString,
822
- });
823
- };
824
- const de_VectorBucketSummary = (output, context) => {
825
- return take(output, {
826
- creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
827
- vectorBucketArn: __expectString,
828
- vectorBucketName: __expectString,
829
- });
830
- };
831
- const de_VectorData = (output, context) => {
832
- if (output.float32 != null) {
833
- return {
834
- float32: de_Float32VectorData(output.float32, context),
835
- };
836
- }
837
- return { $unknown: Object.entries(output)[0] };
838
- };
839
- const de_VectorMetadata = (output, context) => {
840
- return output;
841
- };
842
- const deserializeMetadata = (output) => ({
843
- httpStatusCode: output.statusCode,
844
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
845
- extendedRequestId: output.headers["x-amz-id-2"],
846
- cfId: output.headers["x-amz-cf-id"],
847
- });
848
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));