@aws-sdk/client-kendra 3.354.0 → 3.358.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.
package/README.md CHANGED
@@ -618,6 +618,14 @@ Query
618
618
 
619
619
  [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/classes/querycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/interfaces/querycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/interfaces/querycommandoutput.html)
620
620
 
621
+ </details>
622
+ <details>
623
+ <summary>
624
+ Retrieve
625
+ </summary>
626
+
627
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/classes/retrievecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/interfaces/retrievecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/interfaces/retrievecommandoutput.html)
628
+
621
629
  </details>
622
630
  <details>
623
631
  <summary>
@@ -54,6 +54,7 @@ const ListTagsForResourceCommand_1 = require("./commands/ListTagsForResourceComm
54
54
  const ListThesauriCommand_1 = require("./commands/ListThesauriCommand");
55
55
  const PutPrincipalMappingCommand_1 = require("./commands/PutPrincipalMappingCommand");
56
56
  const QueryCommand_1 = require("./commands/QueryCommand");
57
+ const RetrieveCommand_1 = require("./commands/RetrieveCommand");
57
58
  const StartDataSourceSyncJobCommand_1 = require("./commands/StartDataSourceSyncJobCommand");
58
59
  const StopDataSourceSyncJobCommand_1 = require("./commands/StopDataSourceSyncJobCommand");
59
60
  const SubmitFeedbackCommand_1 = require("./commands/SubmitFeedbackCommand");
@@ -121,6 +122,7 @@ const commands = {
121
122
  ListThesauriCommand: ListThesauriCommand_1.ListThesauriCommand,
122
123
  PutPrincipalMappingCommand: PutPrincipalMappingCommand_1.PutPrincipalMappingCommand,
123
124
  QueryCommand: QueryCommand_1.QueryCommand,
125
+ RetrieveCommand: RetrieveCommand_1.RetrieveCommand,
124
126
  StartDataSourceSyncJobCommand: StartDataSourceSyncJobCommand_1.StartDataSourceSyncJobCommand,
125
127
  StopDataSourceSyncJobCommand: StopDataSourceSyncJobCommand_1.StopDataSourceSyncJobCommand,
126
128
  SubmitFeedbackCommand: SubmitFeedbackCommand_1.SubmitFeedbackCommand,
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetrieveCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint");
5
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
6
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
9
+ class RetrieveCommand extends smithy_client_1.Command {
10
+ static getEndpointParameterInstructions() {
11
+ return {
12
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
13
+ Endpoint: { type: "builtInParams", name: "endpoint" },
14
+ Region: { type: "builtInParams", name: "region" },
15
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
16
+ };
17
+ }
18
+ constructor(input) {
19
+ super();
20
+ this.input = input;
21
+ }
22
+ resolveMiddleware(clientStack, configuration, options) {
23
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
24
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, RetrieveCommand.getEndpointParameterInstructions()));
25
+ const stack = clientStack.concat(this.middlewareStack);
26
+ const { logger } = configuration;
27
+ const clientName = "KendraClient";
28
+ const commandName = "RetrieveCommand";
29
+ const handlerExecutionContext = {
30
+ logger,
31
+ clientName,
32
+ commandName,
33
+ inputFilterSensitiveLog: (_) => _,
34
+ outputFilterSensitiveLog: (_) => _,
35
+ };
36
+ const { requestHandler } = configuration;
37
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
38
+ }
39
+ serialize(input, context) {
40
+ return (0, Aws_json1_1_1.se_RetrieveCommand)(input, context);
41
+ }
42
+ deserialize(output, context) {
43
+ return (0, Aws_json1_1_1.de_RetrieveCommand)(output, context);
44
+ }
45
+ }
46
+ exports.RetrieveCommand = RetrieveCommand;
@@ -53,6 +53,7 @@ tslib_1.__exportStar(require("./ListTagsForResourceCommand"), exports);
53
53
  tslib_1.__exportStar(require("./ListThesauriCommand"), exports);
54
54
  tslib_1.__exportStar(require("./PutPrincipalMappingCommand"), exports);
55
55
  tslib_1.__exportStar(require("./QueryCommand"), exports);
56
+ tslib_1.__exportStar(require("./RetrieveCommand"), exports);
56
57
  tslib_1.__exportStar(require("./StartDataSourceSyncJobCommand"), exports);
57
58
  tslib_1.__exportStar(require("./StopDataSourceSyncJobCommand"), exports);
58
59
  tslib_1.__exportStar(require("./SubmitFeedbackCommand"), exports);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.se_ListThesauriCommand = exports.se_ListTagsForResourceCommand = exports.se_ListQuerySuggestionsBlockListsCommand = exports.se_ListIndicesCommand = exports.se_ListGroupsOlderThanOrderingIdCommand = exports.se_ListFeaturedResultsSetsCommand = exports.se_ListFaqsCommand = exports.se_ListExperiencesCommand = exports.se_ListExperienceEntitiesCommand = exports.se_ListEntityPersonasCommand = exports.se_ListDataSourceSyncJobsCommand = exports.se_ListDataSourcesCommand = exports.se_ListAccessControlConfigurationsCommand = exports.se_GetSnapshotsCommand = exports.se_GetQuerySuggestionsCommand = exports.se_DisassociatePersonasFromEntitiesCommand = exports.se_DisassociateEntitiesFromExperienceCommand = exports.se_DescribeThesaurusCommand = exports.se_DescribeQuerySuggestionsConfigCommand = exports.se_DescribeQuerySuggestionsBlockListCommand = exports.se_DescribePrincipalMappingCommand = exports.se_DescribeIndexCommand = exports.se_DescribeFeaturedResultsSetCommand = exports.se_DescribeFaqCommand = exports.se_DescribeExperienceCommand = exports.se_DescribeDataSourceCommand = exports.se_DescribeAccessControlConfigurationCommand = exports.se_DeleteThesaurusCommand = exports.se_DeleteQuerySuggestionsBlockListCommand = exports.se_DeletePrincipalMappingCommand = exports.se_DeleteIndexCommand = exports.se_DeleteFaqCommand = exports.se_DeleteExperienceCommand = exports.se_DeleteDataSourceCommand = exports.se_DeleteAccessControlConfigurationCommand = exports.se_CreateThesaurusCommand = exports.se_CreateQuerySuggestionsBlockListCommand = exports.se_CreateIndexCommand = exports.se_CreateFeaturedResultsSetCommand = exports.se_CreateFaqCommand = exports.se_CreateExperienceCommand = exports.se_CreateDataSourceCommand = exports.se_CreateAccessControlConfigurationCommand = exports.se_ClearQuerySuggestionsCommand = exports.se_BatchPutDocumentCommand = exports.se_BatchGetDocumentStatusCommand = exports.se_BatchDeleteFeaturedResultsSetCommand = exports.se_BatchDeleteDocumentCommand = exports.se_AssociatePersonasToEntitiesCommand = exports.se_AssociateEntitiesToExperienceCommand = void 0;
4
- exports.de_DisassociatePersonasFromEntitiesCommand = exports.de_DisassociateEntitiesFromExperienceCommand = exports.de_DescribeThesaurusCommand = exports.de_DescribeQuerySuggestionsConfigCommand = exports.de_DescribeQuerySuggestionsBlockListCommand = exports.de_DescribePrincipalMappingCommand = exports.de_DescribeIndexCommand = exports.de_DescribeFeaturedResultsSetCommand = exports.de_DescribeFaqCommand = exports.de_DescribeExperienceCommand = exports.de_DescribeDataSourceCommand = exports.de_DescribeAccessControlConfigurationCommand = exports.de_DeleteThesaurusCommand = exports.de_DeleteQuerySuggestionsBlockListCommand = exports.de_DeletePrincipalMappingCommand = exports.de_DeleteIndexCommand = exports.de_DeleteFaqCommand = exports.de_DeleteExperienceCommand = exports.de_DeleteDataSourceCommand = exports.de_DeleteAccessControlConfigurationCommand = exports.de_CreateThesaurusCommand = exports.de_CreateQuerySuggestionsBlockListCommand = exports.de_CreateIndexCommand = exports.de_CreateFeaturedResultsSetCommand = exports.de_CreateFaqCommand = exports.de_CreateExperienceCommand = exports.de_CreateDataSourceCommand = exports.de_CreateAccessControlConfigurationCommand = exports.de_ClearQuerySuggestionsCommand = exports.de_BatchPutDocumentCommand = exports.de_BatchGetDocumentStatusCommand = exports.de_BatchDeleteFeaturedResultsSetCommand = exports.de_BatchDeleteDocumentCommand = exports.de_AssociatePersonasToEntitiesCommand = exports.de_AssociateEntitiesToExperienceCommand = exports.se_UpdateThesaurusCommand = exports.se_UpdateQuerySuggestionsConfigCommand = exports.se_UpdateQuerySuggestionsBlockListCommand = exports.se_UpdateIndexCommand = exports.se_UpdateFeaturedResultsSetCommand = exports.se_UpdateExperienceCommand = exports.se_UpdateDataSourceCommand = exports.se_UpdateAccessControlConfigurationCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_SubmitFeedbackCommand = exports.se_StopDataSourceSyncJobCommand = exports.se_StartDataSourceSyncJobCommand = exports.se_QueryCommand = exports.se_PutPrincipalMappingCommand = void 0;
5
- exports.de_UpdateThesaurusCommand = exports.de_UpdateQuerySuggestionsConfigCommand = exports.de_UpdateQuerySuggestionsBlockListCommand = exports.de_UpdateIndexCommand = exports.de_UpdateFeaturedResultsSetCommand = exports.de_UpdateExperienceCommand = exports.de_UpdateDataSourceCommand = exports.de_UpdateAccessControlConfigurationCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_SubmitFeedbackCommand = exports.de_StopDataSourceSyncJobCommand = exports.de_StartDataSourceSyncJobCommand = exports.de_QueryCommand = exports.de_PutPrincipalMappingCommand = exports.de_ListThesauriCommand = exports.de_ListTagsForResourceCommand = exports.de_ListQuerySuggestionsBlockListsCommand = exports.de_ListIndicesCommand = exports.de_ListGroupsOlderThanOrderingIdCommand = exports.de_ListFeaturedResultsSetsCommand = exports.de_ListFaqsCommand = exports.de_ListExperiencesCommand = exports.de_ListExperienceEntitiesCommand = exports.de_ListEntityPersonasCommand = exports.de_ListDataSourceSyncJobsCommand = exports.de_ListDataSourcesCommand = exports.de_ListAccessControlConfigurationsCommand = exports.de_GetSnapshotsCommand = exports.de_GetQuerySuggestionsCommand = void 0;
4
+ exports.de_DisassociateEntitiesFromExperienceCommand = exports.de_DescribeThesaurusCommand = exports.de_DescribeQuerySuggestionsConfigCommand = exports.de_DescribeQuerySuggestionsBlockListCommand = exports.de_DescribePrincipalMappingCommand = exports.de_DescribeIndexCommand = exports.de_DescribeFeaturedResultsSetCommand = exports.de_DescribeFaqCommand = exports.de_DescribeExperienceCommand = exports.de_DescribeDataSourceCommand = exports.de_DescribeAccessControlConfigurationCommand = exports.de_DeleteThesaurusCommand = exports.de_DeleteQuerySuggestionsBlockListCommand = exports.de_DeletePrincipalMappingCommand = exports.de_DeleteIndexCommand = exports.de_DeleteFaqCommand = exports.de_DeleteExperienceCommand = exports.de_DeleteDataSourceCommand = exports.de_DeleteAccessControlConfigurationCommand = exports.de_CreateThesaurusCommand = exports.de_CreateQuerySuggestionsBlockListCommand = exports.de_CreateIndexCommand = exports.de_CreateFeaturedResultsSetCommand = exports.de_CreateFaqCommand = exports.de_CreateExperienceCommand = exports.de_CreateDataSourceCommand = exports.de_CreateAccessControlConfigurationCommand = exports.de_ClearQuerySuggestionsCommand = exports.de_BatchPutDocumentCommand = exports.de_BatchGetDocumentStatusCommand = exports.de_BatchDeleteFeaturedResultsSetCommand = exports.de_BatchDeleteDocumentCommand = exports.de_AssociatePersonasToEntitiesCommand = exports.de_AssociateEntitiesToExperienceCommand = exports.se_UpdateThesaurusCommand = exports.se_UpdateQuerySuggestionsConfigCommand = exports.se_UpdateQuerySuggestionsBlockListCommand = exports.se_UpdateIndexCommand = exports.se_UpdateFeaturedResultsSetCommand = exports.se_UpdateExperienceCommand = exports.se_UpdateDataSourceCommand = exports.se_UpdateAccessControlConfigurationCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_SubmitFeedbackCommand = exports.se_StopDataSourceSyncJobCommand = exports.se_StartDataSourceSyncJobCommand = exports.se_RetrieveCommand = exports.se_QueryCommand = exports.se_PutPrincipalMappingCommand = void 0;
5
+ exports.de_UpdateThesaurusCommand = exports.de_UpdateQuerySuggestionsConfigCommand = exports.de_UpdateQuerySuggestionsBlockListCommand = exports.de_UpdateIndexCommand = exports.de_UpdateFeaturedResultsSetCommand = exports.de_UpdateExperienceCommand = exports.de_UpdateDataSourceCommand = exports.de_UpdateAccessControlConfigurationCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_SubmitFeedbackCommand = exports.de_StopDataSourceSyncJobCommand = exports.de_StartDataSourceSyncJobCommand = exports.de_RetrieveCommand = exports.de_QueryCommand = exports.de_PutPrincipalMappingCommand = exports.de_ListThesauriCommand = exports.de_ListTagsForResourceCommand = exports.de_ListQuerySuggestionsBlockListsCommand = exports.de_ListIndicesCommand = exports.de_ListGroupsOlderThanOrderingIdCommand = exports.de_ListFeaturedResultsSetsCommand = exports.de_ListFaqsCommand = exports.de_ListExperiencesCommand = exports.de_ListExperienceEntitiesCommand = exports.de_ListEntityPersonasCommand = exports.de_ListDataSourceSyncJobsCommand = exports.de_ListDataSourcesCommand = exports.de_ListAccessControlConfigurationsCommand = exports.de_GetSnapshotsCommand = exports.de_GetQuerySuggestionsCommand = exports.de_DisassociatePersonasFromEntitiesCommand = void 0;
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const protocol_http_1 = require("@smithy/protocol-http");
8
8
  const uuid_1 = require("uuid");
@@ -373,6 +373,13 @@ const se_QueryCommand = async (input, context) => {
373
373
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
374
374
  };
375
375
  exports.se_QueryCommand = se_QueryCommand;
376
+ const se_RetrieveCommand = async (input, context) => {
377
+ const headers = sharedHeaders("Retrieve");
378
+ let body;
379
+ body = JSON.stringify(se_RetrieveRequest(input, context));
380
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
381
+ };
382
+ exports.se_RetrieveCommand = se_RetrieveCommand;
376
383
  const se_StartDataSourceSyncJobCommand = async (input, context) => {
377
384
  const headers = sharedHeaders("StartDataSourceSyncJob");
378
385
  let body;
@@ -756,7 +763,7 @@ const de_ClearQuerySuggestionsCommand = async (output, context) => {
756
763
  if (output.statusCode >= 300) {
757
764
  return de_ClearQuerySuggestionsCommandError(output, context);
758
765
  }
759
- await collectBody(output.body, context);
766
+ await (0, smithy_client_1.collectBody)(output.body, context);
760
767
  const response = {
761
768
  $metadata: deserializeMetadata(output),
762
769
  };
@@ -1260,7 +1267,7 @@ const de_DeleteDataSourceCommand = async (output, context) => {
1260
1267
  if (output.statusCode >= 300) {
1261
1268
  return de_DeleteDataSourceCommandError(output, context);
1262
1269
  }
1263
- await collectBody(output.body, context);
1270
+ await (0, smithy_client_1.collectBody)(output.body, context);
1264
1271
  const response = {
1265
1272
  $metadata: deserializeMetadata(output),
1266
1273
  };
@@ -1353,7 +1360,7 @@ const de_DeleteFaqCommand = async (output, context) => {
1353
1360
  if (output.statusCode >= 300) {
1354
1361
  return de_DeleteFaqCommandError(output, context);
1355
1362
  }
1356
- await collectBody(output.body, context);
1363
+ await (0, smithy_client_1.collectBody)(output.body, context);
1357
1364
  const response = {
1358
1365
  $metadata: deserializeMetadata(output),
1359
1366
  };
@@ -1398,7 +1405,7 @@ const de_DeleteIndexCommand = async (output, context) => {
1398
1405
  if (output.statusCode >= 300) {
1399
1406
  return de_DeleteIndexCommandError(output, context);
1400
1407
  }
1401
- await collectBody(output.body, context);
1408
+ await (0, smithy_client_1.collectBody)(output.body, context);
1402
1409
  const response = {
1403
1410
  $metadata: deserializeMetadata(output),
1404
1411
  };
@@ -1443,7 +1450,7 @@ const de_DeletePrincipalMappingCommand = async (output, context) => {
1443
1450
  if (output.statusCode >= 300) {
1444
1451
  return de_DeletePrincipalMappingCommandError(output, context);
1445
1452
  }
1446
- await collectBody(output.body, context);
1453
+ await (0, smithy_client_1.collectBody)(output.body, context);
1447
1454
  const response = {
1448
1455
  $metadata: deserializeMetadata(output),
1449
1456
  };
@@ -1488,7 +1495,7 @@ const de_DeleteQuerySuggestionsBlockListCommand = async (output, context) => {
1488
1495
  if (output.statusCode >= 300) {
1489
1496
  return de_DeleteQuerySuggestionsBlockListCommandError(output, context);
1490
1497
  }
1491
- await collectBody(output.body, context);
1498
+ await (0, smithy_client_1.collectBody)(output.body, context);
1492
1499
  const response = {
1493
1500
  $metadata: deserializeMetadata(output),
1494
1501
  };
@@ -1533,7 +1540,7 @@ const de_DeleteThesaurusCommand = async (output, context) => {
1533
1540
  if (output.statusCode >= 300) {
1534
1541
  return de_DeleteThesaurusCommandError(output, context);
1535
1542
  }
1536
- await collectBody(output.body, context);
1543
+ await (0, smithy_client_1.collectBody)(output.body, context);
1537
1544
  const response = {
1538
1545
  $metadata: deserializeMetadata(output),
1539
1546
  };
@@ -2799,7 +2806,7 @@ const de_PutPrincipalMappingCommand = async (output, context) => {
2799
2806
  if (output.statusCode >= 300) {
2800
2807
  return de_PutPrincipalMappingCommandError(output, context);
2801
2808
  }
2802
- await collectBody(output.body, context);
2809
+ await (0, smithy_client_1.collectBody)(output.body, context);
2803
2810
  const response = {
2804
2811
  $metadata: deserializeMetadata(output),
2805
2812
  };
@@ -2894,6 +2901,57 @@ const de_QueryCommandError = async (output, context) => {
2894
2901
  });
2895
2902
  }
2896
2903
  };
2904
+ const de_RetrieveCommand = async (output, context) => {
2905
+ if (output.statusCode >= 300) {
2906
+ return de_RetrieveCommandError(output, context);
2907
+ }
2908
+ const data = await parseBody(output.body, context);
2909
+ let contents = {};
2910
+ contents = de_RetrieveResult(data, context);
2911
+ const response = {
2912
+ $metadata: deserializeMetadata(output),
2913
+ ...contents,
2914
+ };
2915
+ return response;
2916
+ };
2917
+ exports.de_RetrieveCommand = de_RetrieveCommand;
2918
+ const de_RetrieveCommandError = async (output, context) => {
2919
+ const parsedOutput = {
2920
+ ...output,
2921
+ body: await parseErrorBody(output.body, context),
2922
+ };
2923
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2924
+ switch (errorCode) {
2925
+ case "AccessDeniedException":
2926
+ case "com.amazonaws.kendra#AccessDeniedException":
2927
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2928
+ case "ConflictException":
2929
+ case "com.amazonaws.kendra#ConflictException":
2930
+ throw await de_ConflictExceptionRes(parsedOutput, context);
2931
+ case "InternalServerException":
2932
+ case "com.amazonaws.kendra#InternalServerException":
2933
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
2934
+ case "ResourceNotFoundException":
2935
+ case "com.amazonaws.kendra#ResourceNotFoundException":
2936
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2937
+ case "ServiceQuotaExceededException":
2938
+ case "com.amazonaws.kendra#ServiceQuotaExceededException":
2939
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
2940
+ case "ThrottlingException":
2941
+ case "com.amazonaws.kendra#ThrottlingException":
2942
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
2943
+ case "ValidationException":
2944
+ case "com.amazonaws.kendra#ValidationException":
2945
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2946
+ default:
2947
+ const parsedBody = parsedOutput.body;
2948
+ return throwDefaultError({
2949
+ output,
2950
+ parsedBody,
2951
+ errorCode,
2952
+ });
2953
+ }
2954
+ };
2897
2955
  const de_StartDataSourceSyncJobCommand = async (output, context) => {
2898
2956
  if (output.statusCode >= 300) {
2899
2957
  return de_StartDataSourceSyncJobCommandError(output, context);
@@ -2949,7 +3007,7 @@ const de_StopDataSourceSyncJobCommand = async (output, context) => {
2949
3007
  if (output.statusCode >= 300) {
2950
3008
  return de_StopDataSourceSyncJobCommandError(output, context);
2951
3009
  }
2952
- await collectBody(output.body, context);
3010
+ await (0, smithy_client_1.collectBody)(output.body, context);
2953
3011
  const response = {
2954
3012
  $metadata: deserializeMetadata(output),
2955
3013
  };
@@ -2991,7 +3049,7 @@ const de_SubmitFeedbackCommand = async (output, context) => {
2991
3049
  if (output.statusCode >= 300) {
2992
3050
  return de_SubmitFeedbackCommandError(output, context);
2993
3051
  }
2994
- await collectBody(output.body, context);
3052
+ await (0, smithy_client_1.collectBody)(output.body, context);
2995
3053
  const response = {
2996
3054
  $metadata: deserializeMetadata(output),
2997
3055
  };
@@ -3177,7 +3235,7 @@ const de_UpdateDataSourceCommand = async (output, context) => {
3177
3235
  if (output.statusCode >= 300) {
3178
3236
  return de_UpdateDataSourceCommandError(output, context);
3179
3237
  }
3180
- await collectBody(output.body, context);
3238
+ await (0, smithy_client_1.collectBody)(output.body, context);
3181
3239
  const response = {
3182
3240
  $metadata: deserializeMetadata(output),
3183
3241
  };
@@ -3222,7 +3280,7 @@ const de_UpdateExperienceCommand = async (output, context) => {
3222
3280
  if (output.statusCode >= 300) {
3223
3281
  return de_UpdateExperienceCommandError(output, context);
3224
3282
  }
3225
- await collectBody(output.body, context);
3283
+ await (0, smithy_client_1.collectBody)(output.body, context);
3226
3284
  const response = {
3227
3285
  $metadata: deserializeMetadata(output),
3228
3286
  };
@@ -3315,7 +3373,7 @@ const de_UpdateIndexCommand = async (output, context) => {
3315
3373
  if (output.statusCode >= 300) {
3316
3374
  return de_UpdateIndexCommandError(output, context);
3317
3375
  }
3318
- await collectBody(output.body, context);
3376
+ await (0, smithy_client_1.collectBody)(output.body, context);
3319
3377
  const response = {
3320
3378
  $metadata: deserializeMetadata(output),
3321
3379
  };
@@ -3363,7 +3421,7 @@ const de_UpdateQuerySuggestionsBlockListCommand = async (output, context) => {
3363
3421
  if (output.statusCode >= 300) {
3364
3422
  return de_UpdateQuerySuggestionsBlockListCommandError(output, context);
3365
3423
  }
3366
- await collectBody(output.body, context);
3424
+ await (0, smithy_client_1.collectBody)(output.body, context);
3367
3425
  const response = {
3368
3426
  $metadata: deserializeMetadata(output),
3369
3427
  };
@@ -3408,7 +3466,7 @@ const de_UpdateQuerySuggestionsConfigCommand = async (output, context) => {
3408
3466
  if (output.statusCode >= 300) {
3409
3467
  return de_UpdateQuerySuggestionsConfigCommandError(output, context);
3410
3468
  }
3411
- await collectBody(output.body, context);
3469
+ await (0, smithy_client_1.collectBody)(output.body, context);
3412
3470
  const response = {
3413
3471
  $metadata: deserializeMetadata(output),
3414
3472
  };
@@ -3453,7 +3511,7 @@ const de_UpdateThesaurusCommand = async (output, context) => {
3453
3511
  if (output.statusCode >= 300) {
3454
3512
  return de_UpdateThesaurusCommandError(output, context);
3455
3513
  }
3456
- await collectBody(output.body, context);
3514
+ await (0, smithy_client_1.collectBody)(output.body, context);
3457
3515
  const response = {
3458
3516
  $metadata: deserializeMetadata(output),
3459
3517
  };
@@ -3912,6 +3970,18 @@ const se_QueryRequest = (input, context) => {
3912
3970
  VisitorId: [],
3913
3971
  });
3914
3972
  };
3973
+ const se_RetrieveRequest = (input, context) => {
3974
+ return (0, smithy_client_1.take)(input, {
3975
+ AttributeFilter: (_) => se_AttributeFilter(_, context),
3976
+ DocumentRelevanceOverrideConfigurations: smithy_client_1._json,
3977
+ IndexId: [],
3978
+ PageNumber: [],
3979
+ PageSize: [],
3980
+ QueryText: [],
3981
+ RequestedDocumentAttributes: smithy_client_1._json,
3982
+ UserContext: smithy_client_1._json,
3983
+ });
3984
+ };
3915
3985
  const se_SubmitFeedbackRequest = (input, context) => {
3916
3986
  return (0, smithy_client_1.take)(input, {
3917
3987
  ClickFeedbackItems: (_) => se_ClickFeedbackList(_, context),
@@ -4466,6 +4536,30 @@ const de_QuerySuggestionsBlockListSummaryItems = (output, context) => {
4466
4536
  });
4467
4537
  return retVal;
4468
4538
  };
4539
+ const de_RetrieveResult = (output, context) => {
4540
+ return (0, smithy_client_1.take)(output, {
4541
+ QueryId: smithy_client_1.expectString,
4542
+ ResultItems: (_) => de_RetrieveResultItemList(_, context),
4543
+ });
4544
+ };
4545
+ const de_RetrieveResultItem = (output, context) => {
4546
+ return (0, smithy_client_1.take)(output, {
4547
+ Content: smithy_client_1.expectString,
4548
+ DocumentAttributes: (_) => de_DocumentAttributeList(_, context),
4549
+ DocumentId: smithy_client_1.expectString,
4550
+ DocumentTitle: smithy_client_1.expectString,
4551
+ DocumentURI: smithy_client_1.expectString,
4552
+ Id: smithy_client_1.expectString,
4553
+ });
4554
+ };
4555
+ const de_RetrieveResultItemList = (output, context) => {
4556
+ const retVal = (output || [])
4557
+ .filter((e) => e != null)
4558
+ .map((entry) => {
4559
+ return de_RetrieveResultItem(entry, context);
4560
+ });
4561
+ return retVal;
4562
+ };
4469
4563
  const de_SourceDocument = (output, context) => {
4470
4564
  return (0, smithy_client_1.take)(output, {
4471
4565
  AdditionalAttributes: (_) => de_DocumentAttributeList(_, context),
@@ -4546,13 +4640,7 @@ const deserializeMetadata = (output) => ({
4546
4640
  extendedRequestId: output.headers["x-amz-id-2"],
4547
4641
  cfId: output.headers["x-amz-cf-id"],
4548
4642
  });
4549
- const collectBody = (streamBody = new Uint8Array(), context) => {
4550
- if (streamBody instanceof Uint8Array) {
4551
- return Promise.resolve(streamBody);
4552
- }
4553
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
4554
- };
4555
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
4643
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
4556
4644
  const throwDefaultError = (0, smithy_client_1.withBaseException)(KendraServiceException_1.KendraServiceException);
4557
4645
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
4558
4646
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
package/dist-es/Kendra.js CHANGED
@@ -51,6 +51,7 @@ import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceComma
51
51
  import { ListThesauriCommand, } from "./commands/ListThesauriCommand";
52
52
  import { PutPrincipalMappingCommand, } from "./commands/PutPrincipalMappingCommand";
53
53
  import { QueryCommand } from "./commands/QueryCommand";
54
+ import { RetrieveCommand } from "./commands/RetrieveCommand";
54
55
  import { StartDataSourceSyncJobCommand, } from "./commands/StartDataSourceSyncJobCommand";
55
56
  import { StopDataSourceSyncJobCommand, } from "./commands/StopDataSourceSyncJobCommand";
56
57
  import { SubmitFeedbackCommand, } from "./commands/SubmitFeedbackCommand";
@@ -118,6 +119,7 @@ const commands = {
118
119
  ListThesauriCommand,
119
120
  PutPrincipalMappingCommand,
120
121
  QueryCommand,
122
+ RetrieveCommand,
121
123
  StartDataSourceSyncJobCommand,
122
124
  StopDataSourceSyncJobCommand,
123
125
  SubmitFeedbackCommand,
@@ -0,0 +1,42 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { de_RetrieveCommand, se_RetrieveCommand } from "../protocols/Aws_json1_1";
5
+ export { $Command };
6
+ export class RetrieveCommand extends $Command {
7
+ static getEndpointParameterInstructions() {
8
+ return {
9
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
10
+ Endpoint: { type: "builtInParams", name: "endpoint" },
11
+ Region: { type: "builtInParams", name: "region" },
12
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
13
+ };
14
+ }
15
+ constructor(input) {
16
+ super();
17
+ this.input = input;
18
+ }
19
+ resolveMiddleware(clientStack, configuration, options) {
20
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, RetrieveCommand.getEndpointParameterInstructions()));
22
+ const stack = clientStack.concat(this.middlewareStack);
23
+ const { logger } = configuration;
24
+ const clientName = "KendraClient";
25
+ const commandName = "RetrieveCommand";
26
+ const handlerExecutionContext = {
27
+ logger,
28
+ clientName,
29
+ commandName,
30
+ inputFilterSensitiveLog: (_) => _,
31
+ outputFilterSensitiveLog: (_) => _,
32
+ };
33
+ const { requestHandler } = configuration;
34
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
35
+ }
36
+ serialize(input, context) {
37
+ return se_RetrieveCommand(input, context);
38
+ }
39
+ deserialize(output, context) {
40
+ return de_RetrieveCommand(output, context);
41
+ }
42
+ }
@@ -50,6 +50,7 @@ export * from "./ListTagsForResourceCommand";
50
50
  export * from "./ListThesauriCommand";
51
51
  export * from "./PutPrincipalMappingCommand";
52
52
  export * from "./QueryCommand";
53
+ export * from "./RetrieveCommand";
53
54
  export * from "./StartDataSourceSyncJobCommand";
54
55
  export * from "./StopDataSourceSyncJobCommand";
55
56
  export * from "./SubmitFeedbackCommand";
@@ -1,4 +1,4 @@
1
- import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, take, withBaseException, } from "@aws-sdk/smithy-client";
1
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, take, withBaseException, } from "@aws-sdk/smithy-client";
2
2
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { KendraServiceException as __BaseException } from "../models/KendraServiceException";
@@ -316,6 +316,12 @@ export const se_QueryCommand = async (input, context) => {
316
316
  body = JSON.stringify(se_QueryRequest(input, context));
317
317
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
318
318
  };
319
+ export const se_RetrieveCommand = async (input, context) => {
320
+ const headers = sharedHeaders("Retrieve");
321
+ let body;
322
+ body = JSON.stringify(se_RetrieveRequest(input, context));
323
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
324
+ };
319
325
  export const se_StartDataSourceSyncJobCommand = async (input, context) => {
320
326
  const headers = sharedHeaders("StartDataSourceSyncJob");
321
327
  let body;
@@ -2772,6 +2778,56 @@ const de_QueryCommandError = async (output, context) => {
2772
2778
  });
2773
2779
  }
2774
2780
  };
2781
+ export const de_RetrieveCommand = async (output, context) => {
2782
+ if (output.statusCode >= 300) {
2783
+ return de_RetrieveCommandError(output, context);
2784
+ }
2785
+ const data = await parseBody(output.body, context);
2786
+ let contents = {};
2787
+ contents = de_RetrieveResult(data, context);
2788
+ const response = {
2789
+ $metadata: deserializeMetadata(output),
2790
+ ...contents,
2791
+ };
2792
+ return response;
2793
+ };
2794
+ const de_RetrieveCommandError = async (output, context) => {
2795
+ const parsedOutput = {
2796
+ ...output,
2797
+ body: await parseErrorBody(output.body, context),
2798
+ };
2799
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2800
+ switch (errorCode) {
2801
+ case "AccessDeniedException":
2802
+ case "com.amazonaws.kendra#AccessDeniedException":
2803
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2804
+ case "ConflictException":
2805
+ case "com.amazonaws.kendra#ConflictException":
2806
+ throw await de_ConflictExceptionRes(parsedOutput, context);
2807
+ case "InternalServerException":
2808
+ case "com.amazonaws.kendra#InternalServerException":
2809
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
2810
+ case "ResourceNotFoundException":
2811
+ case "com.amazonaws.kendra#ResourceNotFoundException":
2812
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2813
+ case "ServiceQuotaExceededException":
2814
+ case "com.amazonaws.kendra#ServiceQuotaExceededException":
2815
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
2816
+ case "ThrottlingException":
2817
+ case "com.amazonaws.kendra#ThrottlingException":
2818
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
2819
+ case "ValidationException":
2820
+ case "com.amazonaws.kendra#ValidationException":
2821
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2822
+ default:
2823
+ const parsedBody = parsedOutput.body;
2824
+ return throwDefaultError({
2825
+ output,
2826
+ parsedBody,
2827
+ errorCode,
2828
+ });
2829
+ }
2830
+ };
2775
2831
  export const de_StartDataSourceSyncJobCommand = async (output, context) => {
2776
2832
  if (output.statusCode >= 300) {
2777
2833
  return de_StartDataSourceSyncJobCommandError(output, context);
@@ -3777,6 +3833,18 @@ const se_QueryRequest = (input, context) => {
3777
3833
  VisitorId: [],
3778
3834
  });
3779
3835
  };
3836
+ const se_RetrieveRequest = (input, context) => {
3837
+ return take(input, {
3838
+ AttributeFilter: (_) => se_AttributeFilter(_, context),
3839
+ DocumentRelevanceOverrideConfigurations: _json,
3840
+ IndexId: [],
3841
+ PageNumber: [],
3842
+ PageSize: [],
3843
+ QueryText: [],
3844
+ RequestedDocumentAttributes: _json,
3845
+ UserContext: _json,
3846
+ });
3847
+ };
3780
3848
  const se_SubmitFeedbackRequest = (input, context) => {
3781
3849
  return take(input, {
3782
3850
  ClickFeedbackItems: (_) => se_ClickFeedbackList(_, context),
@@ -4331,6 +4399,30 @@ const de_QuerySuggestionsBlockListSummaryItems = (output, context) => {
4331
4399
  });
4332
4400
  return retVal;
4333
4401
  };
4402
+ const de_RetrieveResult = (output, context) => {
4403
+ return take(output, {
4404
+ QueryId: __expectString,
4405
+ ResultItems: (_) => de_RetrieveResultItemList(_, context),
4406
+ });
4407
+ };
4408
+ const de_RetrieveResultItem = (output, context) => {
4409
+ return take(output, {
4410
+ Content: __expectString,
4411
+ DocumentAttributes: (_) => de_DocumentAttributeList(_, context),
4412
+ DocumentId: __expectString,
4413
+ DocumentTitle: __expectString,
4414
+ DocumentURI: __expectString,
4415
+ Id: __expectString,
4416
+ });
4417
+ };
4418
+ const de_RetrieveResultItemList = (output, context) => {
4419
+ const retVal = (output || [])
4420
+ .filter((e) => e != null)
4421
+ .map((entry) => {
4422
+ return de_RetrieveResultItem(entry, context);
4423
+ });
4424
+ return retVal;
4425
+ };
4334
4426
  const de_SourceDocument = (output, context) => {
4335
4427
  return take(output, {
4336
4428
  AdditionalAttributes: (_) => de_DocumentAttributeList(_, context),
@@ -4411,12 +4503,6 @@ const deserializeMetadata = (output) => ({
4411
4503
  extendedRequestId: output.headers["x-amz-id-2"],
4412
4504
  cfId: output.headers["x-amz-cf-id"],
4413
4505
  });
4414
- const collectBody = (streamBody = new Uint8Array(), context) => {
4415
- if (streamBody instanceof Uint8Array) {
4416
- return Promise.resolve(streamBody);
4417
- }
4418
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
4419
- };
4420
4506
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
4421
4507
  const throwDefaultError = withBaseException(__BaseException);
4422
4508
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
@@ -51,6 +51,7 @@ import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } fro
51
51
  import { ListThesauriCommandInput, ListThesauriCommandOutput } from "./commands/ListThesauriCommand";
52
52
  import { PutPrincipalMappingCommandInput, PutPrincipalMappingCommandOutput } from "./commands/PutPrincipalMappingCommand";
53
53
  import { QueryCommandInput, QueryCommandOutput } from "./commands/QueryCommand";
54
+ import { RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
54
55
  import { StartDataSourceSyncJobCommandInput, StartDataSourceSyncJobCommandOutput } from "./commands/StartDataSourceSyncJobCommand";
55
56
  import { StopDataSourceSyncJobCommandInput, StopDataSourceSyncJobCommandOutput } from "./commands/StopDataSourceSyncJobCommand";
56
57
  import { SubmitFeedbackCommandInput, SubmitFeedbackCommandOutput } from "./commands/SubmitFeedbackCommand";
@@ -378,6 +379,12 @@ export interface Kendra {
378
379
  query(args: QueryCommandInput, options?: __HttpHandlerOptions): Promise<QueryCommandOutput>;
379
380
  query(args: QueryCommandInput, cb: (err: any, data?: QueryCommandOutput) => void): void;
380
381
  query(args: QueryCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: QueryCommandOutput) => void): void;
382
+ /**
383
+ * @see {@link RetrieveCommand}
384
+ */
385
+ retrieve(args: RetrieveCommandInput, options?: __HttpHandlerOptions): Promise<RetrieveCommandOutput>;
386
+ retrieve(args: RetrieveCommandInput, cb: (err: any, data?: RetrieveCommandOutput) => void): void;
387
+ retrieve(args: RetrieveCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: RetrieveCommandOutput) => void): void;
381
388
  /**
382
389
  * @see {@link StartDataSourceSyncJobCommand}
383
390
  */