@aws-sdk/client-kendra-ranking 3.310.0 → 3.315.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.
@@ -7,92 +7,65 @@ const uuid_1 = require("uuid");
7
7
  const KendraRankingServiceException_1 = require("../models/KendraRankingServiceException");
8
8
  const models_0_1 = require("../models/models_0");
9
9
  const se_CreateRescoreExecutionPlanCommand = async (input, context) => {
10
- const headers = {
11
- "content-type": "application/x-amz-json-1.0",
12
- "x-amz-target": "AWSKendraRerankingFrontendService.CreateRescoreExecutionPlan",
13
- };
10
+ const headers = sharedHeaders("CreateRescoreExecutionPlan");
14
11
  let body;
15
12
  body = JSON.stringify(se_CreateRescoreExecutionPlanRequest(input, context));
16
13
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
17
14
  };
18
15
  exports.se_CreateRescoreExecutionPlanCommand = se_CreateRescoreExecutionPlanCommand;
19
16
  const se_DeleteRescoreExecutionPlanCommand = async (input, context) => {
20
- const headers = {
21
- "content-type": "application/x-amz-json-1.0",
22
- "x-amz-target": "AWSKendraRerankingFrontendService.DeleteRescoreExecutionPlan",
23
- };
17
+ const headers = sharedHeaders("DeleteRescoreExecutionPlan");
24
18
  let body;
25
- body = JSON.stringify(se_DeleteRescoreExecutionPlanRequest(input, context));
19
+ body = JSON.stringify((0, smithy_client_1._json)(input));
26
20
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
21
  };
28
22
  exports.se_DeleteRescoreExecutionPlanCommand = se_DeleteRescoreExecutionPlanCommand;
29
23
  const se_DescribeRescoreExecutionPlanCommand = async (input, context) => {
30
- const headers = {
31
- "content-type": "application/x-amz-json-1.0",
32
- "x-amz-target": "AWSKendraRerankingFrontendService.DescribeRescoreExecutionPlan",
33
- };
24
+ const headers = sharedHeaders("DescribeRescoreExecutionPlan");
34
25
  let body;
35
- body = JSON.stringify(se_DescribeRescoreExecutionPlanRequest(input, context));
26
+ body = JSON.stringify((0, smithy_client_1._json)(input));
36
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
37
28
  };
38
29
  exports.se_DescribeRescoreExecutionPlanCommand = se_DescribeRescoreExecutionPlanCommand;
39
30
  const se_ListRescoreExecutionPlansCommand = async (input, context) => {
40
- const headers = {
41
- "content-type": "application/x-amz-json-1.0",
42
- "x-amz-target": "AWSKendraRerankingFrontendService.ListRescoreExecutionPlans",
43
- };
31
+ const headers = sharedHeaders("ListRescoreExecutionPlans");
44
32
  let body;
45
- body = JSON.stringify(se_ListRescoreExecutionPlansRequest(input, context));
33
+ body = JSON.stringify((0, smithy_client_1._json)(input));
46
34
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
47
35
  };
48
36
  exports.se_ListRescoreExecutionPlansCommand = se_ListRescoreExecutionPlansCommand;
49
37
  const se_ListTagsForResourceCommand = async (input, context) => {
50
- const headers = {
51
- "content-type": "application/x-amz-json-1.0",
52
- "x-amz-target": "AWSKendraRerankingFrontendService.ListTagsForResource",
53
- };
38
+ const headers = sharedHeaders("ListTagsForResource");
54
39
  let body;
55
- body = JSON.stringify(se_ListTagsForResourceRequest(input, context));
40
+ body = JSON.stringify((0, smithy_client_1._json)(input));
56
41
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
57
42
  };
58
43
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
59
44
  const se_RescoreCommand = async (input, context) => {
60
- const headers = {
61
- "content-type": "application/x-amz-json-1.0",
62
- "x-amz-target": "AWSKendraRerankingFrontendService.Rescore",
63
- };
45
+ const headers = sharedHeaders("Rescore");
64
46
  let body;
65
47
  body = JSON.stringify(se_RescoreRequest(input, context));
66
48
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
49
  };
68
50
  exports.se_RescoreCommand = se_RescoreCommand;
69
51
  const se_TagResourceCommand = async (input, context) => {
70
- const headers = {
71
- "content-type": "application/x-amz-json-1.0",
72
- "x-amz-target": "AWSKendraRerankingFrontendService.TagResource",
73
- };
52
+ const headers = sharedHeaders("TagResource");
74
53
  let body;
75
- body = JSON.stringify(se_TagResourceRequest(input, context));
54
+ body = JSON.stringify((0, smithy_client_1._json)(input));
76
55
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
56
  };
78
57
  exports.se_TagResourceCommand = se_TagResourceCommand;
79
58
  const se_UntagResourceCommand = async (input, context) => {
80
- const headers = {
81
- "content-type": "application/x-amz-json-1.0",
82
- "x-amz-target": "AWSKendraRerankingFrontendService.UntagResource",
83
- };
59
+ const headers = sharedHeaders("UntagResource");
84
60
  let body;
85
- body = JSON.stringify(se_UntagResourceRequest(input, context));
61
+ body = JSON.stringify((0, smithy_client_1._json)(input));
86
62
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
87
63
  };
88
64
  exports.se_UntagResourceCommand = se_UntagResourceCommand;
89
65
  const se_UpdateRescoreExecutionPlanCommand = async (input, context) => {
90
- const headers = {
91
- "content-type": "application/x-amz-json-1.0",
92
- "x-amz-target": "AWSKendraRerankingFrontendService.UpdateRescoreExecutionPlan",
93
- };
66
+ const headers = sharedHeaders("UpdateRescoreExecutionPlan");
94
67
  let body;
95
- body = JSON.stringify(se_UpdateRescoreExecutionPlanRequest(input, context));
68
+ body = JSON.stringify((0, smithy_client_1._json)(input));
96
69
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
97
70
  };
98
71
  exports.se_UpdateRescoreExecutionPlanCommand = se_UpdateRescoreExecutionPlanCommand;
@@ -102,12 +75,12 @@ const de_CreateRescoreExecutionPlanCommand = async (output, context) => {
102
75
  }
103
76
  const data = await parseBody(output.body, context);
104
77
  let contents = {};
105
- contents = de_CreateRescoreExecutionPlanResponse(data, context);
78
+ contents = (0, smithy_client_1._json)(data);
106
79
  const response = {
107
80
  $metadata: deserializeMetadata(output),
108
81
  ...contents,
109
82
  };
110
- return Promise.resolve(response);
83
+ return response;
111
84
  };
112
85
  exports.de_CreateRescoreExecutionPlanCommand = de_CreateRescoreExecutionPlanCommand;
113
86
  const de_CreateRescoreExecutionPlanCommandError = async (output, context) => {
@@ -137,10 +110,9 @@ const de_CreateRescoreExecutionPlanCommandError = async (output, context) => {
137
110
  throw await de_ValidationExceptionRes(parsedOutput, context);
138
111
  default:
139
112
  const parsedBody = parsedOutput.body;
140
- (0, smithy_client_1.throwDefaultError)({
113
+ return throwDefaultError({
141
114
  output,
142
115
  parsedBody,
143
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
144
116
  errorCode,
145
117
  });
146
118
  }
@@ -153,7 +125,7 @@ const de_DeleteRescoreExecutionPlanCommand = async (output, context) => {
153
125
  const response = {
154
126
  $metadata: deserializeMetadata(output),
155
127
  };
156
- return Promise.resolve(response);
128
+ return response;
157
129
  };
158
130
  exports.de_DeleteRescoreExecutionPlanCommand = de_DeleteRescoreExecutionPlanCommand;
159
131
  const de_DeleteRescoreExecutionPlanCommandError = async (output, context) => {
@@ -183,10 +155,9 @@ const de_DeleteRescoreExecutionPlanCommandError = async (output, context) => {
183
155
  throw await de_ValidationExceptionRes(parsedOutput, context);
184
156
  default:
185
157
  const parsedBody = parsedOutput.body;
186
- (0, smithy_client_1.throwDefaultError)({
158
+ return throwDefaultError({
187
159
  output,
188
160
  parsedBody,
189
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
190
161
  errorCode,
191
162
  });
192
163
  }
@@ -202,7 +173,7 @@ const de_DescribeRescoreExecutionPlanCommand = async (output, context) => {
202
173
  $metadata: deserializeMetadata(output),
203
174
  ...contents,
204
175
  };
205
- return Promise.resolve(response);
176
+ return response;
206
177
  };
207
178
  exports.de_DescribeRescoreExecutionPlanCommand = de_DescribeRescoreExecutionPlanCommand;
208
179
  const de_DescribeRescoreExecutionPlanCommandError = async (output, context) => {
@@ -229,10 +200,9 @@ const de_DescribeRescoreExecutionPlanCommandError = async (output, context) => {
229
200
  throw await de_ValidationExceptionRes(parsedOutput, context);
230
201
  default:
231
202
  const parsedBody = parsedOutput.body;
232
- (0, smithy_client_1.throwDefaultError)({
203
+ return throwDefaultError({
233
204
  output,
234
205
  parsedBody,
235
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
236
206
  errorCode,
237
207
  });
238
208
  }
@@ -248,7 +218,7 @@ const de_ListRescoreExecutionPlansCommand = async (output, context) => {
248
218
  $metadata: deserializeMetadata(output),
249
219
  ...contents,
250
220
  };
251
- return Promise.resolve(response);
221
+ return response;
252
222
  };
253
223
  exports.de_ListRescoreExecutionPlansCommand = de_ListRescoreExecutionPlansCommand;
254
224
  const de_ListRescoreExecutionPlansCommandError = async (output, context) => {
@@ -272,10 +242,9 @@ const de_ListRescoreExecutionPlansCommandError = async (output, context) => {
272
242
  throw await de_ValidationExceptionRes(parsedOutput, context);
273
243
  default:
274
244
  const parsedBody = parsedOutput.body;
275
- (0, smithy_client_1.throwDefaultError)({
245
+ return throwDefaultError({
276
246
  output,
277
247
  parsedBody,
278
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
279
248
  errorCode,
280
249
  });
281
250
  }
@@ -286,12 +255,12 @@ const de_ListTagsForResourceCommand = async (output, context) => {
286
255
  }
287
256
  const data = await parseBody(output.body, context);
288
257
  let contents = {};
289
- contents = de_ListTagsForResourceResponse(data, context);
258
+ contents = (0, smithy_client_1._json)(data);
290
259
  const response = {
291
260
  $metadata: deserializeMetadata(output),
292
261
  ...contents,
293
262
  };
294
- return Promise.resolve(response);
263
+ return response;
295
264
  };
296
265
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
297
266
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -318,10 +287,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
318
287
  throw await de_ValidationExceptionRes(parsedOutput, context);
319
288
  default:
320
289
  const parsedBody = parsedOutput.body;
321
- (0, smithy_client_1.throwDefaultError)({
290
+ return throwDefaultError({
322
291
  output,
323
292
  parsedBody,
324
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
325
293
  errorCode,
326
294
  });
327
295
  }
@@ -337,7 +305,7 @@ const de_RescoreCommand = async (output, context) => {
337
305
  $metadata: deserializeMetadata(output),
338
306
  ...contents,
339
307
  };
340
- return Promise.resolve(response);
308
+ return response;
341
309
  };
342
310
  exports.de_RescoreCommand = de_RescoreCommand;
343
311
  const de_RescoreCommandError = async (output, context) => {
@@ -367,10 +335,9 @@ const de_RescoreCommandError = async (output, context) => {
367
335
  throw await de_ValidationExceptionRes(parsedOutput, context);
368
336
  default:
369
337
  const parsedBody = parsedOutput.body;
370
- (0, smithy_client_1.throwDefaultError)({
338
+ return throwDefaultError({
371
339
  output,
372
340
  parsedBody,
373
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
374
341
  errorCode,
375
342
  });
376
343
  }
@@ -381,12 +348,12 @@ const de_TagResourceCommand = async (output, context) => {
381
348
  }
382
349
  const data = await parseBody(output.body, context);
383
350
  let contents = {};
384
- contents = de_TagResourceResponse(data, context);
351
+ contents = (0, smithy_client_1._json)(data);
385
352
  const response = {
386
353
  $metadata: deserializeMetadata(output),
387
354
  ...contents,
388
355
  };
389
- return Promise.resolve(response);
356
+ return response;
390
357
  };
391
358
  exports.de_TagResourceCommand = de_TagResourceCommand;
392
359
  const de_TagResourceCommandError = async (output, context) => {
@@ -413,10 +380,9 @@ const de_TagResourceCommandError = async (output, context) => {
413
380
  throw await de_ValidationExceptionRes(parsedOutput, context);
414
381
  default:
415
382
  const parsedBody = parsedOutput.body;
416
- (0, smithy_client_1.throwDefaultError)({
383
+ return throwDefaultError({
417
384
  output,
418
385
  parsedBody,
419
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
420
386
  errorCode,
421
387
  });
422
388
  }
@@ -427,12 +393,12 @@ const de_UntagResourceCommand = async (output, context) => {
427
393
  }
428
394
  const data = await parseBody(output.body, context);
429
395
  let contents = {};
430
- contents = de_UntagResourceResponse(data, context);
396
+ contents = (0, smithy_client_1._json)(data);
431
397
  const response = {
432
398
  $metadata: deserializeMetadata(output),
433
399
  ...contents,
434
400
  };
435
- return Promise.resolve(response);
401
+ return response;
436
402
  };
437
403
  exports.de_UntagResourceCommand = de_UntagResourceCommand;
438
404
  const de_UntagResourceCommandError = async (output, context) => {
@@ -459,10 +425,9 @@ const de_UntagResourceCommandError = async (output, context) => {
459
425
  throw await de_ValidationExceptionRes(parsedOutput, context);
460
426
  default:
461
427
  const parsedBody = parsedOutput.body;
462
- (0, smithy_client_1.throwDefaultError)({
428
+ return throwDefaultError({
463
429
  output,
464
430
  parsedBody,
465
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
466
431
  errorCode,
467
432
  });
468
433
  }
@@ -475,7 +440,7 @@ const de_UpdateRescoreExecutionPlanCommand = async (output, context) => {
475
440
  const response = {
476
441
  $metadata: deserializeMetadata(output),
477
442
  };
478
- return Promise.resolve(response);
443
+ return response;
479
444
  };
480
445
  exports.de_UpdateRescoreExecutionPlanCommand = de_UpdateRescoreExecutionPlanCommand;
481
446
  const de_UpdateRescoreExecutionPlanCommandError = async (output, context) => {
@@ -508,17 +473,16 @@ const de_UpdateRescoreExecutionPlanCommandError = async (output, context) => {
508
473
  throw await de_ValidationExceptionRes(parsedOutput, context);
509
474
  default:
510
475
  const parsedBody = parsedOutput.body;
511
- (0, smithy_client_1.throwDefaultError)({
476
+ return throwDefaultError({
512
477
  output,
513
478
  parsedBody,
514
- exceptionCtor: KendraRankingServiceException_1.KendraRankingServiceException,
515
479
  errorCode,
516
480
  });
517
481
  }
518
482
  };
519
483
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
520
484
  const body = parsedOutput.body;
521
- const deserialized = de_AccessDeniedException(body, context);
485
+ const deserialized = (0, smithy_client_1._json)(body);
522
486
  const exception = new models_0_1.AccessDeniedException({
523
487
  $metadata: deserializeMetadata(parsedOutput),
524
488
  ...deserialized,
@@ -527,7 +491,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
527
491
  };
528
492
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
529
493
  const body = parsedOutput.body;
530
- const deserialized = de_ConflictException(body, context);
494
+ const deserialized = (0, smithy_client_1._json)(body);
531
495
  const exception = new models_0_1.ConflictException({
532
496
  $metadata: deserializeMetadata(parsedOutput),
533
497
  ...deserialized,
@@ -536,7 +500,7 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
536
500
  };
537
501
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
538
502
  const body = parsedOutput.body;
539
- const deserialized = de_InternalServerException(body, context);
503
+ const deserialized = (0, smithy_client_1._json)(body);
540
504
  const exception = new models_0_1.InternalServerException({
541
505
  $metadata: deserializeMetadata(parsedOutput),
542
506
  ...deserialized,
@@ -545,7 +509,7 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
545
509
  };
546
510
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
547
511
  const body = parsedOutput.body;
548
- const deserialized = de_ResourceNotFoundException(body, context);
512
+ const deserialized = (0, smithy_client_1._json)(body);
549
513
  const exception = new models_0_1.ResourceNotFoundException({
550
514
  $metadata: deserializeMetadata(parsedOutput),
551
515
  ...deserialized,
@@ -554,7 +518,7 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
554
518
  };
555
519
  const de_ResourceUnavailableExceptionRes = async (parsedOutput, context) => {
556
520
  const body = parsedOutput.body;
557
- const deserialized = de_ResourceUnavailableException(body, context);
521
+ const deserialized = (0, smithy_client_1._json)(body);
558
522
  const exception = new models_0_1.ResourceUnavailableException({
559
523
  $metadata: deserializeMetadata(parsedOutput),
560
524
  ...deserialized,
@@ -563,7 +527,7 @@ const de_ResourceUnavailableExceptionRes = async (parsedOutput, context) => {
563
527
  };
564
528
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
565
529
  const body = parsedOutput.body;
566
- const deserialized = de_ServiceQuotaExceededException(body, context);
530
+ const deserialized = (0, smithy_client_1._json)(body);
567
531
  const exception = new models_0_1.ServiceQuotaExceededException({
568
532
  $metadata: deserializeMetadata(parsedOutput),
569
533
  ...deserialized,
@@ -572,7 +536,7 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
572
536
  };
573
537
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
574
538
  const body = parsedOutput.body;
575
- const deserialized = de_ThrottlingException(body, context);
539
+ const deserialized = (0, smithy_client_1._json)(body);
576
540
  const exception = new models_0_1.ThrottlingException({
577
541
  $metadata: deserializeMetadata(parsedOutput),
578
542
  ...deserialized,
@@ -581,54 +545,32 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
581
545
  };
582
546
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
583
547
  const body = parsedOutput.body;
584
- const deserialized = de_ValidationException(body, context);
548
+ const deserialized = (0, smithy_client_1._json)(body);
585
549
  const exception = new models_0_1.ValidationException({
586
550
  $metadata: deserializeMetadata(parsedOutput),
587
551
  ...deserialized,
588
552
  });
589
553
  return (0, smithy_client_1.decorateServiceException)(exception, body);
590
554
  };
591
- const se_BodyTokensList = (input, context) => {
592
- return input
593
- .filter((e) => e != null)
594
- .map((entry) => {
595
- return entry;
596
- });
597
- };
598
- const se_CapacityUnitsConfiguration = (input, context) => {
599
- return {
600
- ...(input.RescoreCapacityUnits != null && { RescoreCapacityUnits: input.RescoreCapacityUnits }),
601
- };
602
- };
603
555
  const se_CreateRescoreExecutionPlanRequest = (input, context) => {
604
- return {
605
- ...(input.CapacityUnits != null && { CapacityUnits: se_CapacityUnitsConfiguration(input.CapacityUnits, context) }),
606
- ClientToken: input.ClientToken ?? (0, uuid_1.v4)(),
607
- ...(input.Description != null && { Description: input.Description }),
608
- ...(input.Name != null && { Name: input.Name }),
609
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
610
- };
611
- };
612
- const se_DeleteRescoreExecutionPlanRequest = (input, context) => {
613
- return {
614
- ...(input.Id != null && { Id: input.Id }),
615
- };
616
- };
617
- const se_DescribeRescoreExecutionPlanRequest = (input, context) => {
618
- return {
619
- ...(input.Id != null && { Id: input.Id }),
620
- };
556
+ return (0, smithy_client_1.take)(input, {
557
+ CapacityUnits: smithy_client_1._json,
558
+ ClientToken: (_) => _ ?? (0, uuid_1.v4)(),
559
+ Description: [],
560
+ Name: [],
561
+ Tags: smithy_client_1._json,
562
+ });
621
563
  };
622
564
  const se_Document = (input, context) => {
623
- return {
624
- ...(input.Body != null && { Body: input.Body }),
625
- ...(input.GroupId != null && { GroupId: input.GroupId }),
626
- ...(input.Id != null && { Id: input.Id }),
627
- ...(input.OriginalScore != null && { OriginalScore: (0, smithy_client_1.serializeFloat)(input.OriginalScore) }),
628
- ...(input.Title != null && { Title: input.Title }),
629
- ...(input.TokenizedBody != null && { TokenizedBody: se_BodyTokensList(input.TokenizedBody, context) }),
630
- ...(input.TokenizedTitle != null && { TokenizedTitle: se_TitleTokensList(input.TokenizedTitle, context) }),
631
- };
565
+ return (0, smithy_client_1.take)(input, {
566
+ Body: [],
567
+ GroupId: [],
568
+ Id: [],
569
+ OriginalScore: smithy_client_1.serializeFloat,
570
+ Title: [],
571
+ TokenizedBody: smithy_client_1._json,
572
+ TokenizedTitle: smithy_client_1._json,
573
+ });
632
574
  };
633
575
  const se_DocumentList = (input, context) => {
634
576
  return input
@@ -637,212 +579,69 @@ const se_DocumentList = (input, context) => {
637
579
  return se_Document(entry, context);
638
580
  });
639
581
  };
640
- const se_ListRescoreExecutionPlansRequest = (input, context) => {
641
- return {
642
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
643
- ...(input.NextToken != null && { NextToken: input.NextToken }),
644
- };
645
- };
646
- const se_ListTagsForResourceRequest = (input, context) => {
647
- return {
648
- ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
649
- };
650
- };
651
582
  const se_RescoreRequest = (input, context) => {
652
- return {
653
- ...(input.Documents != null && { Documents: se_DocumentList(input.Documents, context) }),
654
- ...(input.RescoreExecutionPlanId != null && { RescoreExecutionPlanId: input.RescoreExecutionPlanId }),
655
- ...(input.SearchQuery != null && { SearchQuery: input.SearchQuery }),
656
- };
657
- };
658
- const se_Tag = (input, context) => {
659
- return {
660
- ...(input.Key != null && { Key: input.Key }),
661
- ...(input.Value != null && { Value: input.Value }),
662
- };
663
- };
664
- const se_TagKeyList = (input, context) => {
665
- return input
666
- .filter((e) => e != null)
667
- .map((entry) => {
668
- return entry;
583
+ return (0, smithy_client_1.take)(input, {
584
+ Documents: (_) => se_DocumentList(_, context),
585
+ RescoreExecutionPlanId: [],
586
+ SearchQuery: [],
669
587
  });
670
588
  };
671
- const se_TagList = (input, context) => {
672
- return input
673
- .filter((e) => e != null)
674
- .map((entry) => {
675
- return se_Tag(entry, context);
676
- });
677
- };
678
- const se_TagResourceRequest = (input, context) => {
679
- return {
680
- ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
681
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
682
- };
683
- };
684
- const se_TitleTokensList = (input, context) => {
685
- return input
686
- .filter((e) => e != null)
687
- .map((entry) => {
688
- return entry;
689
- });
690
- };
691
- const se_UntagResourceRequest = (input, context) => {
692
- return {
693
- ...(input.ResourceARN != null && { ResourceARN: input.ResourceARN }),
694
- ...(input.TagKeys != null && { TagKeys: se_TagKeyList(input.TagKeys, context) }),
695
- };
696
- };
697
- const se_UpdateRescoreExecutionPlanRequest = (input, context) => {
698
- return {
699
- ...(input.CapacityUnits != null && { CapacityUnits: se_CapacityUnitsConfiguration(input.CapacityUnits, context) }),
700
- ...(input.Description != null && { Description: input.Description }),
701
- ...(input.Id != null && { Id: input.Id }),
702
- ...(input.Name != null && { Name: input.Name }),
703
- };
704
- };
705
- const de_AccessDeniedException = (output, context) => {
706
- return {
707
- Message: (0, smithy_client_1.expectString)(output.Message),
708
- };
709
- };
710
- const de_CapacityUnitsConfiguration = (output, context) => {
711
- return {
712
- RescoreCapacityUnits: (0, smithy_client_1.expectInt32)(output.RescoreCapacityUnits),
713
- };
714
- };
715
- const de_ConflictException = (output, context) => {
716
- return {
717
- Message: (0, smithy_client_1.expectString)(output.Message),
718
- };
719
- };
720
- const de_CreateRescoreExecutionPlanResponse = (output, context) => {
721
- return {
722
- Arn: (0, smithy_client_1.expectString)(output.Arn),
723
- Id: (0, smithy_client_1.expectString)(output.Id),
724
- };
725
- };
726
589
  const de_DescribeRescoreExecutionPlanResponse = (output, context) => {
727
- return {
728
- Arn: (0, smithy_client_1.expectString)(output.Arn),
729
- CapacityUnits: output.CapacityUnits != null ? de_CapacityUnitsConfiguration(output.CapacityUnits, context) : undefined,
730
- CreatedAt: output.CreatedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreatedAt))) : undefined,
731
- Description: (0, smithy_client_1.expectString)(output.Description),
732
- ErrorMessage: (0, smithy_client_1.expectString)(output.ErrorMessage),
733
- Id: (0, smithy_client_1.expectString)(output.Id),
734
- Name: (0, smithy_client_1.expectString)(output.Name),
735
- Status: (0, smithy_client_1.expectString)(output.Status),
736
- UpdatedAt: output.UpdatedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.UpdatedAt))) : undefined,
737
- };
738
- };
739
- const de_InternalServerException = (output, context) => {
740
- return {
741
- Message: (0, smithy_client_1.expectString)(output.Message),
742
- };
590
+ return (0, smithy_client_1.take)(output, {
591
+ Arn: smithy_client_1.expectString,
592
+ CapacityUnits: smithy_client_1._json,
593
+ CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
594
+ Description: smithy_client_1.expectString,
595
+ ErrorMessage: smithy_client_1.expectString,
596
+ Id: smithy_client_1.expectString,
597
+ Name: smithy_client_1.expectString,
598
+ Status: smithy_client_1.expectString,
599
+ UpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
600
+ });
743
601
  };
744
602
  const de_ListRescoreExecutionPlansResponse = (output, context) => {
745
- return {
746
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
747
- SummaryItems: output.SummaryItems != null ? de_RescoreExecutionPlanSummaryList(output.SummaryItems, context) : undefined,
748
- };
749
- };
750
- const de_ListTagsForResourceResponse = (output, context) => {
751
- return {
752
- Tags: output.Tags != null ? de_TagList(output.Tags, context) : undefined,
753
- };
603
+ return (0, smithy_client_1.take)(output, {
604
+ NextToken: smithy_client_1.expectString,
605
+ SummaryItems: (_) => de_RescoreExecutionPlanSummaryList(_, context),
606
+ });
754
607
  };
755
608
  const de_RescoreExecutionPlanSummary = (output, context) => {
756
- return {
757
- CreatedAt: output.CreatedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreatedAt))) : undefined,
758
- Id: (0, smithy_client_1.expectString)(output.Id),
759
- Name: (0, smithy_client_1.expectString)(output.Name),
760
- Status: (0, smithy_client_1.expectString)(output.Status),
761
- UpdatedAt: output.UpdatedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.UpdatedAt))) : undefined,
762
- };
609
+ return (0, smithy_client_1.take)(output, {
610
+ CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
611
+ Id: smithy_client_1.expectString,
612
+ Name: smithy_client_1.expectString,
613
+ Status: smithy_client_1.expectString,
614
+ UpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
615
+ });
763
616
  };
764
617
  const de_RescoreExecutionPlanSummaryList = (output, context) => {
765
618
  const retVal = (output || [])
766
619
  .filter((e) => e != null)
767
620
  .map((entry) => {
768
- if (entry === null) {
769
- return null;
770
- }
771
621
  return de_RescoreExecutionPlanSummary(entry, context);
772
622
  });
773
623
  return retVal;
774
624
  };
775
625
  const de_RescoreResult = (output, context) => {
776
- return {
777
- RescoreId: (0, smithy_client_1.expectString)(output.RescoreId),
778
- ResultItems: output.ResultItems != null ? de_RescoreResultItemList(output.ResultItems, context) : undefined,
779
- };
626
+ return (0, smithy_client_1.take)(output, {
627
+ RescoreId: smithy_client_1.expectString,
628
+ ResultItems: (_) => de_RescoreResultItemList(_, context),
629
+ });
780
630
  };
781
631
  const de_RescoreResultItem = (output, context) => {
782
- return {
783
- DocumentId: (0, smithy_client_1.expectString)(output.DocumentId),
784
- Score: (0, smithy_client_1.limitedParseFloat32)(output.Score),
785
- };
632
+ return (0, smithy_client_1.take)(output, {
633
+ DocumentId: smithy_client_1.expectString,
634
+ Score: smithy_client_1.limitedParseFloat32,
635
+ });
786
636
  };
787
637
  const de_RescoreResultItemList = (output, context) => {
788
638
  const retVal = (output || [])
789
639
  .filter((e) => e != null)
790
640
  .map((entry) => {
791
- if (entry === null) {
792
- return null;
793
- }
794
641
  return de_RescoreResultItem(entry, context);
795
642
  });
796
643
  return retVal;
797
644
  };
798
- const de_ResourceNotFoundException = (output, context) => {
799
- return {
800
- Message: (0, smithy_client_1.expectString)(output.Message),
801
- };
802
- };
803
- const de_ResourceUnavailableException = (output, context) => {
804
- return {
805
- Message: (0, smithy_client_1.expectString)(output.Message),
806
- };
807
- };
808
- const de_ServiceQuotaExceededException = (output, context) => {
809
- return {
810
- Message: (0, smithy_client_1.expectString)(output.Message),
811
- };
812
- };
813
- const de_Tag = (output, context) => {
814
- return {
815
- Key: (0, smithy_client_1.expectString)(output.Key),
816
- Value: (0, smithy_client_1.expectString)(output.Value),
817
- };
818
- };
819
- const de_TagList = (output, context) => {
820
- const retVal = (output || [])
821
- .filter((e) => e != null)
822
- .map((entry) => {
823
- if (entry === null) {
824
- return null;
825
- }
826
- return de_Tag(entry, context);
827
- });
828
- return retVal;
829
- };
830
- const de_TagResourceResponse = (output, context) => {
831
- return {};
832
- };
833
- const de_ThrottlingException = (output, context) => {
834
- return {
835
- Message: (0, smithy_client_1.expectString)(output.Message),
836
- };
837
- };
838
- const de_UntagResourceResponse = (output, context) => {
839
- return {};
840
- };
841
- const de_ValidationException = (output, context) => {
842
- return {
843
- Message: (0, smithy_client_1.expectString)(output.Message),
844
- };
845
- };
846
645
  const deserializeMetadata = (output) => ({
847
646
  httpStatusCode: output.statusCode,
848
647
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -856,6 +655,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
856
655
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
857
656
  };
858
657
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
658
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(KendraRankingServiceException_1.KendraRankingServiceException);
859
659
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
860
660
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
861
661
  const contents = {
@@ -874,6 +674,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
874
674
  }
875
675
  return new protocol_http_1.HttpRequest(contents);
876
676
  };
677
+ function sharedHeaders(operation) {
678
+ return {
679
+ "content-type": "application/x-amz-json-1.0",
680
+ "x-amz-target": `AWSKendraRerankingFrontendService.${operation}`,
681
+ };
682
+ }
877
683
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
878
684
  if (encoded.length) {
879
685
  return JSON.parse(encoded);