From 871dd41328f8d4d269a44158adb3828661dc302a Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 28 Nov 2023 19:07:19 +0000 Subject: [PATCH] feat(client-bedrock-agent): This release introduces Agents for Amazon Bedrock --- clients/client-bedrock-agent/.gitignore | 9 + clients/client-bedrock-agent/LICENSE | 201 + clients/client-bedrock-agent/README.md | 526 ++ .../client-bedrock-agent/api-extractor.json | 4 + clients/client-bedrock-agent/package.json | 104 + .../client-bedrock-agent/src/BedrockAgent.ts | 845 ++ .../src/BedrockAgentClient.ts | 451 ++ .../AssociateAgentKnowledgeBaseCommand.ts | 180 + .../commands/CreateAgentActionGroupCommand.ts | 202 + .../src/commands/CreateAgentAliasCommand.ts | 197 + .../src/commands/CreateAgentCommand.ts | 234 + .../src/commands/CreateDataSourceCommand.ts | 213 + .../commands/CreateKnowledgeBaseCommand.ts | 249 + .../commands/DeleteAgentActionGroupCommand.ts | 158 + .../src/commands/DeleteAgentAliasCommand.ts | 157 + .../src/commands/DeleteAgentCommand.ts | 157 + .../src/commands/DeleteAgentVersionCommand.ts | 161 + .../src/commands/DeleteDataSourceCommand.ts | 160 + .../commands/DeleteKnowledgeBaseCommand.ts | 158 + .../DisassociateAgentKnowledgeBaseCommand.ts | 168 + .../commands/GetAgentActionGroupCommand.ts | 181 + .../src/commands/GetAgentAliasCommand.ts | 179 + .../src/commands/GetAgentCommand.ts | 195 + .../commands/GetAgentKnowledgeBaseCommand.ts | 164 + .../src/commands/GetAgentVersionCommand.ts | 200 + .../src/commands/GetDataSourceCommand.ts | 182 + .../src/commands/GetIngestionJobCommand.ts | 174 + .../src/commands/GetKnowledgeBaseCommand.ts | 203 + .../commands/ListAgentActionGroupsCommand.ts | 166 + .../src/commands/ListAgentAliasesCommand.ts | 171 + .../ListAgentKnowledgeBasesCommand.ts | 165 + .../src/commands/ListAgentVersionsCommand.ts | 166 + .../src/commands/ListAgentsCommand.ts | 160 + .../src/commands/ListDataSourcesCommand.ts | 166 + .../src/commands/ListIngestionJobsCommand.ts | 188 + .../src/commands/ListKnowledgeBasesCommand.ts | 161 + .../commands/ListTagsForResourceCommand.ts | 156 + .../src/commands/PrepareAgentCommand.ts | 161 + .../src/commands/StartIngestionJobCommand.ts | 181 + .../src/commands/TagResourceCommand.ts | 156 + .../src/commands/UntagResourceCommand.ts | 153 + .../commands/UpdateAgentActionGroupCommand.ts | 202 + .../src/commands/UpdateAgentAliasCommand.ts | 194 + .../src/commands/UpdateAgentCommand.ts | 234 + .../UpdateAgentKnowledgeBaseCommand.ts | 169 + .../src/commands/UpdateDataSourceCommand.ts | 210 + .../commands/UpdateKnowledgeBaseCommand.ts | 246 + .../src/commands/index.ts | 41 + .../src/endpoint/EndpointParameters.ts | 34 + .../src/endpoint/endpointResolver.ts | 16 + .../src/endpoint/ruleset.ts | 32 + .../src/extensionConfiguration.ts | 12 + clients/client-bedrock-agent/src/index.ts | 20 + .../models/BedrockAgentServiceException.ts | 22 + .../client-bedrock-agent/src/models/index.ts | 2 + .../src/models/models_0.ts | 3864 +++++++++ .../src/pagination/Interfaces.ts | 11 + .../ListAgentActionGroupsPaginator.ts | 50 + .../pagination/ListAgentAliasesPaginator.ts | 50 + .../ListAgentKnowledgeBasesPaginator.ts | 50 + .../pagination/ListAgentVersionsPaginator.ts | 50 + .../src/pagination/ListAgentsPaginator.ts | 46 + .../pagination/ListDataSourcesPaginator.ts | 50 + .../pagination/ListIngestionJobsPaginator.ts | 50 + .../pagination/ListKnowledgeBasesPaginator.ts | 50 + .../src/pagination/index.ts | 10 + .../src/protocols/Aws_restJson1.ts | 4922 ++++++++++++ .../src/runtimeConfig.browser.ts | 44 + .../src/runtimeConfig.native.ts | 18 + .../src/runtimeConfig.shared.ts | 27 + .../client-bedrock-agent/src/runtimeConfig.ts | 61 + .../src/runtimeExtensions.ts | 45 + .../client-bedrock-agent/tsconfig.cjs.json | 6 + clients/client-bedrock-agent/tsconfig.es.json | 8 + clients/client-bedrock-agent/tsconfig.json | 13 + .../client-bedrock-agent/tsconfig.types.json | 10 + clients/client-bedrock-agent/typedoc.json | 6 + .../sdk-codegen/aws-models/bedrock-agent.json | 6958 +++++++++++++++++ 78 files changed, 25995 insertions(+) create mode 100644 clients/client-bedrock-agent/.gitignore create mode 100644 clients/client-bedrock-agent/LICENSE create mode 100644 clients/client-bedrock-agent/README.md create mode 100644 clients/client-bedrock-agent/api-extractor.json create mode 100644 clients/client-bedrock-agent/package.json create mode 100644 clients/client-bedrock-agent/src/BedrockAgent.ts create mode 100644 clients/client-bedrock-agent/src/BedrockAgentClient.ts create mode 100644 clients/client-bedrock-agent/src/commands/AssociateAgentKnowledgeBaseCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/CreateAgentActionGroupCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/CreateAgentAliasCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/CreateAgentCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/DeleteAgentActionGroupCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/DeleteAgentAliasCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/DeleteAgentCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/DeleteAgentVersionCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/DeleteDataSourceCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/DisassociateAgentKnowledgeBaseCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetAgentActionGroupCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetAgentAliasCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetAgentCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetAgentKnowledgeBaseCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetAgentVersionCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetIngestionJobCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListAgentActionGroupsCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListAgentAliasesCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListAgentKnowledgeBasesCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListAgentVersionsCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListAgentsCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListDataSourcesCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListIngestionJobsCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListKnowledgeBasesCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListTagsForResourceCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/PrepareAgentCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/StartIngestionJobCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/TagResourceCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/UntagResourceCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/UpdateAgentActionGroupCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/UpdateAgentAliasCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/UpdateAgentCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/UpdateAgentKnowledgeBaseCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/index.ts create mode 100644 clients/client-bedrock-agent/src/endpoint/EndpointParameters.ts create mode 100644 clients/client-bedrock-agent/src/endpoint/endpointResolver.ts create mode 100644 clients/client-bedrock-agent/src/endpoint/ruleset.ts create mode 100644 clients/client-bedrock-agent/src/extensionConfiguration.ts create mode 100644 clients/client-bedrock-agent/src/index.ts create mode 100644 clients/client-bedrock-agent/src/models/BedrockAgentServiceException.ts create mode 100644 clients/client-bedrock-agent/src/models/index.ts create mode 100644 clients/client-bedrock-agent/src/models/models_0.ts create mode 100644 clients/client-bedrock-agent/src/pagination/Interfaces.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListAgentActionGroupsPaginator.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListAgentAliasesPaginator.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListAgentKnowledgeBasesPaginator.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListAgentVersionsPaginator.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListAgentsPaginator.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListDataSourcesPaginator.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListIngestionJobsPaginator.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListKnowledgeBasesPaginator.ts create mode 100644 clients/client-bedrock-agent/src/pagination/index.ts create mode 100644 clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts create mode 100644 clients/client-bedrock-agent/src/runtimeConfig.browser.ts create mode 100644 clients/client-bedrock-agent/src/runtimeConfig.native.ts create mode 100644 clients/client-bedrock-agent/src/runtimeConfig.shared.ts create mode 100644 clients/client-bedrock-agent/src/runtimeConfig.ts create mode 100644 clients/client-bedrock-agent/src/runtimeExtensions.ts create mode 100644 clients/client-bedrock-agent/tsconfig.cjs.json create mode 100644 clients/client-bedrock-agent/tsconfig.es.json create mode 100644 clients/client-bedrock-agent/tsconfig.json create mode 100644 clients/client-bedrock-agent/tsconfig.types.json create mode 100644 clients/client-bedrock-agent/typedoc.json create mode 100644 codegen/sdk-codegen/aws-models/bedrock-agent.json diff --git a/clients/client-bedrock-agent/.gitignore b/clients/client-bedrock-agent/.gitignore new file mode 100644 index 000000000000..54f14c9aef25 --- /dev/null +++ b/clients/client-bedrock-agent/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/clients/client-bedrock-agent/LICENSE b/clients/client-bedrock-agent/LICENSE new file mode 100644 index 000000000000..5001cd317c44 --- /dev/null +++ b/clients/client-bedrock-agent/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/clients/client-bedrock-agent/README.md b/clients/client-bedrock-agent/README.md new file mode 100644 index 000000000000..b36713cf1573 --- /dev/null +++ b/clients/client-bedrock-agent/README.md @@ -0,0 +1,526 @@ + + +# @aws-sdk/client-bedrock-agent + +## Description + +AWS SDK for JavaScript BedrockAgent Client for Node.js, Browser and React Native. + +An example service, deployed with the Octane Service creator, +which will echo the string + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-bedrock-agent +using your favorite package manager: + +- `npm install @aws-sdk/client-bedrock-agent` +- `yarn add @aws-sdk/client-bedrock-agent` +- `pnpm add @aws-sdk/client-bedrock-agent` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `BedrockAgentClient` and +the commands you need, for example `ListAgentsCommand`: + +```js +// ES5 example +const { BedrockAgentClient, ListAgentsCommand } = require("@aws-sdk/client-bedrock-agent"); +``` + +```ts +// ES6+ example +import { BedrockAgentClient, ListAgentsCommand } from "@aws-sdk/client-bedrock-agent"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new BedrockAgentClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ListAgentsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-bedrock-agent"; +const client = new AWS.BedrockAgent({ region: "REGION" }); + +// async/await. +try { + const data = await client.listAgents(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .listAgents(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.listAgents(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-bedrock-agent` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +AssociateAgentKnowledgeBase + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/AssociateAgentKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/AssociateAgentKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/AssociateAgentKnowledgeBaseCommandOutput/) + +
+
+ +CreateAgent + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/CreateAgentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateAgentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateAgentCommandOutput/) + +
+
+ +CreateAgentActionGroup + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/CreateAgentActionGroupCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateAgentActionGroupCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateAgentActionGroupCommandOutput/) + +
+
+ +CreateAgentAlias + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/CreateAgentAliasCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateAgentAliasCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateAgentAliasCommandOutput/) + +
+
+ +CreateDataSource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/CreateDataSourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateDataSourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateDataSourceCommandOutput/) + +
+
+ +CreateKnowledgeBase + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/CreateKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/CreateKnowledgeBaseCommandOutput/) + +
+
+ +DeleteAgent + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DeleteAgentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteAgentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteAgentCommandOutput/) + +
+
+ +DeleteAgentActionGroup + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DeleteAgentActionGroupCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteAgentActionGroupCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteAgentActionGroupCommandOutput/) + +
+
+ +DeleteAgentAlias + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DeleteAgentAliasCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteAgentAliasCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteAgentAliasCommandOutput/) + +
+
+ +DeleteAgentVersion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DeleteAgentVersionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteAgentVersionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteAgentVersionCommandOutput/) + +
+
+ +DeleteDataSource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DeleteDataSourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteDataSourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteDataSourceCommandOutput/) + +
+
+ +DeleteKnowledgeBase + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DeleteKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteKnowledgeBaseCommandOutput/) + +
+
+ +DisassociateAgentKnowledgeBase + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DisassociateAgentKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DisassociateAgentKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DisassociateAgentKnowledgeBaseCommandOutput/) + +
+
+ +GetAgent + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetAgentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentCommandOutput/) + +
+
+ +GetAgentActionGroup + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetAgentActionGroupCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentActionGroupCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentActionGroupCommandOutput/) + +
+
+ +GetAgentAlias + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetAgentAliasCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentAliasCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentAliasCommandOutput/) + +
+
+ +GetAgentKnowledgeBase + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetAgentKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentKnowledgeBaseCommandOutput/) + +
+
+ +GetAgentVersion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetAgentVersionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentVersionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetAgentVersionCommandOutput/) + +
+
+ +GetDataSource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetDataSourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetDataSourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetDataSourceCommandOutput/) + +
+
+ +GetIngestionJob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetIngestionJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetIngestionJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetIngestionJobCommandOutput/) + +
+
+ +GetKnowledgeBase + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetKnowledgeBaseCommandOutput/) + +
+
+ +ListAgentActionGroups + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListAgentActionGroupsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentActionGroupsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentActionGroupsCommandOutput/) + +
+
+ +ListAgentAliases + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListAgentAliasesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentAliasesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentAliasesCommandOutput/) + +
+
+ +ListAgentKnowledgeBases + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListAgentKnowledgeBasesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentKnowledgeBasesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentKnowledgeBasesCommandOutput/) + +
+
+ +ListAgents + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListAgentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentsCommandOutput/) + +
+
+ +ListAgentVersions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListAgentVersionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentVersionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListAgentVersionsCommandOutput/) + +
+
+ +ListDataSources + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListDataSourcesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListDataSourcesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListDataSourcesCommandOutput/) + +
+
+ +ListIngestionJobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListIngestionJobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListIngestionJobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListIngestionJobsCommandOutput/) + +
+
+ +ListKnowledgeBases + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListKnowledgeBasesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListKnowledgeBasesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListKnowledgeBasesCommandOutput/) + +
+
+ +ListTagsForResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListTagsForResourceCommandOutput/) + +
+
+ +PrepareAgent + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/PrepareAgentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/PrepareAgentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/PrepareAgentCommandOutput/) + +
+
+ +StartIngestionJob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/StartIngestionJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/StartIngestionJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/StartIngestionJobCommandOutput/) + +
+
+ +TagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/TagResourceCommandOutput/) + +
+
+ +UntagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UntagResourceCommandOutput/) + +
+
+ +UpdateAgent + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/UpdateAgentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateAgentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateAgentCommandOutput/) + +
+
+ +UpdateAgentActionGroup + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/UpdateAgentActionGroupCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateAgentActionGroupCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateAgentActionGroupCommandOutput/) + +
+
+ +UpdateAgentAlias + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/UpdateAgentAliasCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateAgentAliasCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateAgentAliasCommandOutput/) + +
+
+ +UpdateAgentKnowledgeBase + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/UpdateAgentKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateAgentKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateAgentKnowledgeBaseCommandOutput/) + +
+
+ +UpdateDataSource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/UpdateDataSourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateDataSourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateDataSourceCommandOutput/) + +
+
+ +UpdateKnowledgeBase + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/UpdateKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/UpdateKnowledgeBaseCommandOutput/) + +
diff --git a/clients/client-bedrock-agent/api-extractor.json b/clients/client-bedrock-agent/api-extractor.json new file mode 100644 index 000000000000..d5bf5ffeee85 --- /dev/null +++ b/clients/client-bedrock-agent/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/clients/client-bedrock-agent/package.json b/clients/client-bedrock-agent/package.json new file mode 100644 index 000000000000..0399253a57a1 --- /dev/null +++ b/clients/client-bedrock-agent/package.json @@ -0,0 +1,104 @@ +{ + "name": "@aws-sdk/client-bedrock-agent", + "description": "AWS SDK for JavaScript Bedrock Agent Client for Node.js, Browser and React Native", + "version": "3.0.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:docs": "typedoc", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo bedrock-agent" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "*", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-signing": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^2.0.18", + "@smithy/fetch-http-handler": "^2.2.6", + "@smithy/hash-node": "^2.0.15", + "@smithy/invalid-dependency": "^2.0.13", + "@smithy/middleware-content-length": "^2.0.15", + "@smithy/middleware-endpoint": "^2.2.0", + "@smithy/middleware-retry": "^2.0.20", + "@smithy/middleware-serde": "^2.0.13", + "@smithy/middleware-stack": "^2.0.7", + "@smithy/node-config-provider": "^2.1.5", + "@smithy/node-http-handler": "^2.1.9", + "@smithy/protocol-http": "^3.0.9", + "@smithy/smithy-client": "^2.1.15", + "@smithy/types": "^2.5.0", + "@smithy/url-parser": "^2.0.13", + "@smithy/util-base64": "^2.0.1", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.19", + "@smithy/util-defaults-mode-node": "^2.0.25", + "@smithy/util-endpoints": "^1.0.4", + "@smithy/util-retry": "^2.0.6", + "@smithy/util-utf8": "^2.0.2", + "tslib": "^2.5.0", + "uuid": "^8.3.2" + }, + "devDependencies": { + "@smithy/service-client-documentation-generator": "^2.0.0", + "@tsconfig/node14": "1.0.3", + "@types/node": "^14.14.31", + "@types/uuid": "^8.3.0", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.23.23", + "typescript": "~4.9.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-bedrock-agent", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-bedrock-agent" + } +} diff --git a/clients/client-bedrock-agent/src/BedrockAgent.ts b/clients/client-bedrock-agent/src/BedrockAgent.ts new file mode 100644 index 000000000000..c63ecff56156 --- /dev/null +++ b/clients/client-bedrock-agent/src/BedrockAgent.ts @@ -0,0 +1,845 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { BedrockAgentClient, BedrockAgentClientConfig } from "./BedrockAgentClient"; +import { + AssociateAgentKnowledgeBaseCommand, + AssociateAgentKnowledgeBaseCommandInput, + AssociateAgentKnowledgeBaseCommandOutput, +} from "./commands/AssociateAgentKnowledgeBaseCommand"; +import { + CreateAgentActionGroupCommand, + CreateAgentActionGroupCommandInput, + CreateAgentActionGroupCommandOutput, +} from "./commands/CreateAgentActionGroupCommand"; +import { + CreateAgentAliasCommand, + CreateAgentAliasCommandInput, + CreateAgentAliasCommandOutput, +} from "./commands/CreateAgentAliasCommand"; +import { CreateAgentCommand, CreateAgentCommandInput, CreateAgentCommandOutput } from "./commands/CreateAgentCommand"; +import { + CreateDataSourceCommand, + CreateDataSourceCommandInput, + CreateDataSourceCommandOutput, +} from "./commands/CreateDataSourceCommand"; +import { + CreateKnowledgeBaseCommand, + CreateKnowledgeBaseCommandInput, + CreateKnowledgeBaseCommandOutput, +} from "./commands/CreateKnowledgeBaseCommand"; +import { + DeleteAgentActionGroupCommand, + DeleteAgentActionGroupCommandInput, + DeleteAgentActionGroupCommandOutput, +} from "./commands/DeleteAgentActionGroupCommand"; +import { + DeleteAgentAliasCommand, + DeleteAgentAliasCommandInput, + DeleteAgentAliasCommandOutput, +} from "./commands/DeleteAgentAliasCommand"; +import { DeleteAgentCommand, DeleteAgentCommandInput, DeleteAgentCommandOutput } from "./commands/DeleteAgentCommand"; +import { + DeleteAgentVersionCommand, + DeleteAgentVersionCommandInput, + DeleteAgentVersionCommandOutput, +} from "./commands/DeleteAgentVersionCommand"; +import { + DeleteDataSourceCommand, + DeleteDataSourceCommandInput, + DeleteDataSourceCommandOutput, +} from "./commands/DeleteDataSourceCommand"; +import { + DeleteKnowledgeBaseCommand, + DeleteKnowledgeBaseCommandInput, + DeleteKnowledgeBaseCommandOutput, +} from "./commands/DeleteKnowledgeBaseCommand"; +import { + DisassociateAgentKnowledgeBaseCommand, + DisassociateAgentKnowledgeBaseCommandInput, + DisassociateAgentKnowledgeBaseCommandOutput, +} from "./commands/DisassociateAgentKnowledgeBaseCommand"; +import { + GetAgentActionGroupCommand, + GetAgentActionGroupCommandInput, + GetAgentActionGroupCommandOutput, +} from "./commands/GetAgentActionGroupCommand"; +import { + GetAgentAliasCommand, + GetAgentAliasCommandInput, + GetAgentAliasCommandOutput, +} from "./commands/GetAgentAliasCommand"; +import { GetAgentCommand, GetAgentCommandInput, GetAgentCommandOutput } from "./commands/GetAgentCommand"; +import { + GetAgentKnowledgeBaseCommand, + GetAgentKnowledgeBaseCommandInput, + GetAgentKnowledgeBaseCommandOutput, +} from "./commands/GetAgentKnowledgeBaseCommand"; +import { + GetAgentVersionCommand, + GetAgentVersionCommandInput, + GetAgentVersionCommandOutput, +} from "./commands/GetAgentVersionCommand"; +import { + GetDataSourceCommand, + GetDataSourceCommandInput, + GetDataSourceCommandOutput, +} from "./commands/GetDataSourceCommand"; +import { + GetIngestionJobCommand, + GetIngestionJobCommandInput, + GetIngestionJobCommandOutput, +} from "./commands/GetIngestionJobCommand"; +import { + GetKnowledgeBaseCommand, + GetKnowledgeBaseCommandInput, + GetKnowledgeBaseCommandOutput, +} from "./commands/GetKnowledgeBaseCommand"; +import { + ListAgentActionGroupsCommand, + ListAgentActionGroupsCommandInput, + ListAgentActionGroupsCommandOutput, +} from "./commands/ListAgentActionGroupsCommand"; +import { + ListAgentAliasesCommand, + ListAgentAliasesCommandInput, + ListAgentAliasesCommandOutput, +} from "./commands/ListAgentAliasesCommand"; +import { + ListAgentKnowledgeBasesCommand, + ListAgentKnowledgeBasesCommandInput, + ListAgentKnowledgeBasesCommandOutput, +} from "./commands/ListAgentKnowledgeBasesCommand"; +import { ListAgentsCommand, ListAgentsCommandInput, ListAgentsCommandOutput } from "./commands/ListAgentsCommand"; +import { + ListAgentVersionsCommand, + ListAgentVersionsCommandInput, + ListAgentVersionsCommandOutput, +} from "./commands/ListAgentVersionsCommand"; +import { + ListDataSourcesCommand, + ListDataSourcesCommandInput, + ListDataSourcesCommandOutput, +} from "./commands/ListDataSourcesCommand"; +import { + ListIngestionJobsCommand, + ListIngestionJobsCommandInput, + ListIngestionJobsCommandOutput, +} from "./commands/ListIngestionJobsCommand"; +import { + ListKnowledgeBasesCommand, + ListKnowledgeBasesCommandInput, + ListKnowledgeBasesCommandOutput, +} from "./commands/ListKnowledgeBasesCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { + PrepareAgentCommand, + PrepareAgentCommandInput, + PrepareAgentCommandOutput, +} from "./commands/PrepareAgentCommand"; +import { + StartIngestionJobCommand, + StartIngestionJobCommandInput, + StartIngestionJobCommandOutput, +} from "./commands/StartIngestionJobCommand"; +import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { + UpdateAgentActionGroupCommand, + UpdateAgentActionGroupCommandInput, + UpdateAgentActionGroupCommandOutput, +} from "./commands/UpdateAgentActionGroupCommand"; +import { + UpdateAgentAliasCommand, + UpdateAgentAliasCommandInput, + UpdateAgentAliasCommandOutput, +} from "./commands/UpdateAgentAliasCommand"; +import { UpdateAgentCommand, UpdateAgentCommandInput, UpdateAgentCommandOutput } from "./commands/UpdateAgentCommand"; +import { + UpdateAgentKnowledgeBaseCommand, + UpdateAgentKnowledgeBaseCommandInput, + UpdateAgentKnowledgeBaseCommandOutput, +} from "./commands/UpdateAgentKnowledgeBaseCommand"; +import { + UpdateDataSourceCommand, + UpdateDataSourceCommandInput, + UpdateDataSourceCommandOutput, +} from "./commands/UpdateDataSourceCommand"; +import { + UpdateKnowledgeBaseCommand, + UpdateKnowledgeBaseCommandInput, + UpdateKnowledgeBaseCommandOutput, +} from "./commands/UpdateKnowledgeBaseCommand"; + +const commands = { + AssociateAgentKnowledgeBaseCommand, + CreateAgentCommand, + CreateAgentActionGroupCommand, + CreateAgentAliasCommand, + CreateDataSourceCommand, + CreateKnowledgeBaseCommand, + DeleteAgentCommand, + DeleteAgentActionGroupCommand, + DeleteAgentAliasCommand, + DeleteAgentVersionCommand, + DeleteDataSourceCommand, + DeleteKnowledgeBaseCommand, + DisassociateAgentKnowledgeBaseCommand, + GetAgentCommand, + GetAgentActionGroupCommand, + GetAgentAliasCommand, + GetAgentKnowledgeBaseCommand, + GetAgentVersionCommand, + GetDataSourceCommand, + GetIngestionJobCommand, + GetKnowledgeBaseCommand, + ListAgentActionGroupsCommand, + ListAgentAliasesCommand, + ListAgentKnowledgeBasesCommand, + ListAgentsCommand, + ListAgentVersionsCommand, + ListDataSourcesCommand, + ListIngestionJobsCommand, + ListKnowledgeBasesCommand, + ListTagsForResourceCommand, + PrepareAgentCommand, + StartIngestionJobCommand, + TagResourceCommand, + UntagResourceCommand, + UpdateAgentCommand, + UpdateAgentActionGroupCommand, + UpdateAgentAliasCommand, + UpdateAgentKnowledgeBaseCommand, + UpdateDataSourceCommand, + UpdateKnowledgeBaseCommand, +}; + +export interface BedrockAgent { + /** + * @see {@link AssociateAgentKnowledgeBaseCommand} + */ + associateAgentKnowledgeBase( + args: AssociateAgentKnowledgeBaseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + associateAgentKnowledgeBase( + args: AssociateAgentKnowledgeBaseCommandInput, + cb: (err: any, data?: AssociateAgentKnowledgeBaseCommandOutput) => void + ): void; + associateAgentKnowledgeBase( + args: AssociateAgentKnowledgeBaseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AssociateAgentKnowledgeBaseCommandOutput) => void + ): void; + + /** + * @see {@link CreateAgentCommand} + */ + createAgent(args: CreateAgentCommandInput, options?: __HttpHandlerOptions): Promise; + createAgent(args: CreateAgentCommandInput, cb: (err: any, data?: CreateAgentCommandOutput) => void): void; + createAgent( + args: CreateAgentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateAgentCommandOutput) => void + ): void; + + /** + * @see {@link CreateAgentActionGroupCommand} + */ + createAgentActionGroup( + args: CreateAgentActionGroupCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createAgentActionGroup( + args: CreateAgentActionGroupCommandInput, + cb: (err: any, data?: CreateAgentActionGroupCommandOutput) => void + ): void; + createAgentActionGroup( + args: CreateAgentActionGroupCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateAgentActionGroupCommandOutput) => void + ): void; + + /** + * @see {@link CreateAgentAliasCommand} + */ + createAgentAlias( + args: CreateAgentAliasCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createAgentAlias( + args: CreateAgentAliasCommandInput, + cb: (err: any, data?: CreateAgentAliasCommandOutput) => void + ): void; + createAgentAlias( + args: CreateAgentAliasCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateAgentAliasCommandOutput) => void + ): void; + + /** + * @see {@link CreateDataSourceCommand} + */ + createDataSource( + args: CreateDataSourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createDataSource( + args: CreateDataSourceCommandInput, + cb: (err: any, data?: CreateDataSourceCommandOutput) => void + ): void; + createDataSource( + args: CreateDataSourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateDataSourceCommandOutput) => void + ): void; + + /** + * @see {@link CreateKnowledgeBaseCommand} + */ + createKnowledgeBase( + args: CreateKnowledgeBaseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createKnowledgeBase( + args: CreateKnowledgeBaseCommandInput, + cb: (err: any, data?: CreateKnowledgeBaseCommandOutput) => void + ): void; + createKnowledgeBase( + args: CreateKnowledgeBaseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateKnowledgeBaseCommandOutput) => void + ): void; + + /** + * @see {@link DeleteAgentCommand} + */ + deleteAgent(args: DeleteAgentCommandInput, options?: __HttpHandlerOptions): Promise; + deleteAgent(args: DeleteAgentCommandInput, cb: (err: any, data?: DeleteAgentCommandOutput) => void): void; + deleteAgent( + args: DeleteAgentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteAgentCommandOutput) => void + ): void; + + /** + * @see {@link DeleteAgentActionGroupCommand} + */ + deleteAgentActionGroup( + args: DeleteAgentActionGroupCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteAgentActionGroup( + args: DeleteAgentActionGroupCommandInput, + cb: (err: any, data?: DeleteAgentActionGroupCommandOutput) => void + ): void; + deleteAgentActionGroup( + args: DeleteAgentActionGroupCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteAgentActionGroupCommandOutput) => void + ): void; + + /** + * @see {@link DeleteAgentAliasCommand} + */ + deleteAgentAlias( + args: DeleteAgentAliasCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteAgentAlias( + args: DeleteAgentAliasCommandInput, + cb: (err: any, data?: DeleteAgentAliasCommandOutput) => void + ): void; + deleteAgentAlias( + args: DeleteAgentAliasCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteAgentAliasCommandOutput) => void + ): void; + + /** + * @see {@link DeleteAgentVersionCommand} + */ + deleteAgentVersion( + args: DeleteAgentVersionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteAgentVersion( + args: DeleteAgentVersionCommandInput, + cb: (err: any, data?: DeleteAgentVersionCommandOutput) => void + ): void; + deleteAgentVersion( + args: DeleteAgentVersionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteAgentVersionCommandOutput) => void + ): void; + + /** + * @see {@link DeleteDataSourceCommand} + */ + deleteDataSource( + args: DeleteDataSourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteDataSource( + args: DeleteDataSourceCommandInput, + cb: (err: any, data?: DeleteDataSourceCommandOutput) => void + ): void; + deleteDataSource( + args: DeleteDataSourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteDataSourceCommandOutput) => void + ): void; + + /** + * @see {@link DeleteKnowledgeBaseCommand} + */ + deleteKnowledgeBase( + args: DeleteKnowledgeBaseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteKnowledgeBase( + args: DeleteKnowledgeBaseCommandInput, + cb: (err: any, data?: DeleteKnowledgeBaseCommandOutput) => void + ): void; + deleteKnowledgeBase( + args: DeleteKnowledgeBaseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteKnowledgeBaseCommandOutput) => void + ): void; + + /** + * @see {@link DisassociateAgentKnowledgeBaseCommand} + */ + disassociateAgentKnowledgeBase( + args: DisassociateAgentKnowledgeBaseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + disassociateAgentKnowledgeBase( + args: DisassociateAgentKnowledgeBaseCommandInput, + cb: (err: any, data?: DisassociateAgentKnowledgeBaseCommandOutput) => void + ): void; + disassociateAgentKnowledgeBase( + args: DisassociateAgentKnowledgeBaseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DisassociateAgentKnowledgeBaseCommandOutput) => void + ): void; + + /** + * @see {@link GetAgentCommand} + */ + getAgent(args: GetAgentCommandInput, options?: __HttpHandlerOptions): Promise; + getAgent(args: GetAgentCommandInput, cb: (err: any, data?: GetAgentCommandOutput) => void): void; + getAgent( + args: GetAgentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAgentCommandOutput) => void + ): void; + + /** + * @see {@link GetAgentActionGroupCommand} + */ + getAgentActionGroup( + args: GetAgentActionGroupCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getAgentActionGroup( + args: GetAgentActionGroupCommandInput, + cb: (err: any, data?: GetAgentActionGroupCommandOutput) => void + ): void; + getAgentActionGroup( + args: GetAgentActionGroupCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAgentActionGroupCommandOutput) => void + ): void; + + /** + * @see {@link GetAgentAliasCommand} + */ + getAgentAlias(args: GetAgentAliasCommandInput, options?: __HttpHandlerOptions): Promise; + getAgentAlias(args: GetAgentAliasCommandInput, cb: (err: any, data?: GetAgentAliasCommandOutput) => void): void; + getAgentAlias( + args: GetAgentAliasCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAgentAliasCommandOutput) => void + ): void; + + /** + * @see {@link GetAgentKnowledgeBaseCommand} + */ + getAgentKnowledgeBase( + args: GetAgentKnowledgeBaseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getAgentKnowledgeBase( + args: GetAgentKnowledgeBaseCommandInput, + cb: (err: any, data?: GetAgentKnowledgeBaseCommandOutput) => void + ): void; + getAgentKnowledgeBase( + args: GetAgentKnowledgeBaseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAgentKnowledgeBaseCommandOutput) => void + ): void; + + /** + * @see {@link GetAgentVersionCommand} + */ + getAgentVersion( + args: GetAgentVersionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getAgentVersion(args: GetAgentVersionCommandInput, cb: (err: any, data?: GetAgentVersionCommandOutput) => void): void; + getAgentVersion( + args: GetAgentVersionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAgentVersionCommandOutput) => void + ): void; + + /** + * @see {@link GetDataSourceCommand} + */ + getDataSource(args: GetDataSourceCommandInput, options?: __HttpHandlerOptions): Promise; + getDataSource(args: GetDataSourceCommandInput, cb: (err: any, data?: GetDataSourceCommandOutput) => void): void; + getDataSource( + args: GetDataSourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetDataSourceCommandOutput) => void + ): void; + + /** + * @see {@link GetIngestionJobCommand} + */ + getIngestionJob( + args: GetIngestionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getIngestionJob(args: GetIngestionJobCommandInput, cb: (err: any, data?: GetIngestionJobCommandOutput) => void): void; + getIngestionJob( + args: GetIngestionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetIngestionJobCommandOutput) => void + ): void; + + /** + * @see {@link GetKnowledgeBaseCommand} + */ + getKnowledgeBase( + args: GetKnowledgeBaseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getKnowledgeBase( + args: GetKnowledgeBaseCommandInput, + cb: (err: any, data?: GetKnowledgeBaseCommandOutput) => void + ): void; + getKnowledgeBase( + args: GetKnowledgeBaseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetKnowledgeBaseCommandOutput) => void + ): void; + + /** + * @see {@link ListAgentActionGroupsCommand} + */ + listAgentActionGroups( + args: ListAgentActionGroupsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listAgentActionGroups( + args: ListAgentActionGroupsCommandInput, + cb: (err: any, data?: ListAgentActionGroupsCommandOutput) => void + ): void; + listAgentActionGroups( + args: ListAgentActionGroupsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAgentActionGroupsCommandOutput) => void + ): void; + + /** + * @see {@link ListAgentAliasesCommand} + */ + listAgentAliases( + args: ListAgentAliasesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listAgentAliases( + args: ListAgentAliasesCommandInput, + cb: (err: any, data?: ListAgentAliasesCommandOutput) => void + ): void; + listAgentAliases( + args: ListAgentAliasesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAgentAliasesCommandOutput) => void + ): void; + + /** + * @see {@link ListAgentKnowledgeBasesCommand} + */ + listAgentKnowledgeBases( + args: ListAgentKnowledgeBasesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listAgentKnowledgeBases( + args: ListAgentKnowledgeBasesCommandInput, + cb: (err: any, data?: ListAgentKnowledgeBasesCommandOutput) => void + ): void; + listAgentKnowledgeBases( + args: ListAgentKnowledgeBasesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAgentKnowledgeBasesCommandOutput) => void + ): void; + + /** + * @see {@link ListAgentsCommand} + */ + listAgents(args: ListAgentsCommandInput, options?: __HttpHandlerOptions): Promise; + listAgents(args: ListAgentsCommandInput, cb: (err: any, data?: ListAgentsCommandOutput) => void): void; + listAgents( + args: ListAgentsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAgentsCommandOutput) => void + ): void; + + /** + * @see {@link ListAgentVersionsCommand} + */ + listAgentVersions( + args: ListAgentVersionsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listAgentVersions( + args: ListAgentVersionsCommandInput, + cb: (err: any, data?: ListAgentVersionsCommandOutput) => void + ): void; + listAgentVersions( + args: ListAgentVersionsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAgentVersionsCommandOutput) => void + ): void; + + /** + * @see {@link ListDataSourcesCommand} + */ + listDataSources( + args: ListDataSourcesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listDataSources(args: ListDataSourcesCommandInput, cb: (err: any, data?: ListDataSourcesCommandOutput) => void): void; + listDataSources( + args: ListDataSourcesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListDataSourcesCommandOutput) => void + ): void; + + /** + * @see {@link ListIngestionJobsCommand} + */ + listIngestionJobs( + args: ListIngestionJobsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listIngestionJobs( + args: ListIngestionJobsCommandInput, + cb: (err: any, data?: ListIngestionJobsCommandOutput) => void + ): void; + listIngestionJobs( + args: ListIngestionJobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListIngestionJobsCommandOutput) => void + ): void; + + /** + * @see {@link ListKnowledgeBasesCommand} + */ + listKnowledgeBases( + args: ListKnowledgeBasesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listKnowledgeBases( + args: ListKnowledgeBasesCommandInput, + cb: (err: any, data?: ListKnowledgeBasesCommandOutput) => void + ): void; + listKnowledgeBases( + args: ListKnowledgeBasesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListKnowledgeBasesCommandOutput) => void + ): void; + + /** + * @see {@link ListTagsForResourceCommand} + */ + listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + + /** + * @see {@link PrepareAgentCommand} + */ + prepareAgent(args: PrepareAgentCommandInput, options?: __HttpHandlerOptions): Promise; + prepareAgent(args: PrepareAgentCommandInput, cb: (err: any, data?: PrepareAgentCommandOutput) => void): void; + prepareAgent( + args: PrepareAgentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PrepareAgentCommandOutput) => void + ): void; + + /** + * @see {@link StartIngestionJobCommand} + */ + startIngestionJob( + args: StartIngestionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + startIngestionJob( + args: StartIngestionJobCommandInput, + cb: (err: any, data?: StartIngestionJobCommandOutput) => void + ): void; + startIngestionJob( + args: StartIngestionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartIngestionJobCommandOutput) => void + ): void; + + /** + * @see {@link TagResourceCommand} + */ + tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UntagResourceCommand} + */ + untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void; + untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UpdateAgentCommand} + */ + updateAgent(args: UpdateAgentCommandInput, options?: __HttpHandlerOptions): Promise; + updateAgent(args: UpdateAgentCommandInput, cb: (err: any, data?: UpdateAgentCommandOutput) => void): void; + updateAgent( + args: UpdateAgentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateAgentCommandOutput) => void + ): void; + + /** + * @see {@link UpdateAgentActionGroupCommand} + */ + updateAgentActionGroup( + args: UpdateAgentActionGroupCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateAgentActionGroup( + args: UpdateAgentActionGroupCommandInput, + cb: (err: any, data?: UpdateAgentActionGroupCommandOutput) => void + ): void; + updateAgentActionGroup( + args: UpdateAgentActionGroupCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateAgentActionGroupCommandOutput) => void + ): void; + + /** + * @see {@link UpdateAgentAliasCommand} + */ + updateAgentAlias( + args: UpdateAgentAliasCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateAgentAlias( + args: UpdateAgentAliasCommandInput, + cb: (err: any, data?: UpdateAgentAliasCommandOutput) => void + ): void; + updateAgentAlias( + args: UpdateAgentAliasCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateAgentAliasCommandOutput) => void + ): void; + + /** + * @see {@link UpdateAgentKnowledgeBaseCommand} + */ + updateAgentKnowledgeBase( + args: UpdateAgentKnowledgeBaseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateAgentKnowledgeBase( + args: UpdateAgentKnowledgeBaseCommandInput, + cb: (err: any, data?: UpdateAgentKnowledgeBaseCommandOutput) => void + ): void; + updateAgentKnowledgeBase( + args: UpdateAgentKnowledgeBaseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateAgentKnowledgeBaseCommandOutput) => void + ): void; + + /** + * @see {@link UpdateDataSourceCommand} + */ + updateDataSource( + args: UpdateDataSourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateDataSource( + args: UpdateDataSourceCommandInput, + cb: (err: any, data?: UpdateDataSourceCommandOutput) => void + ): void; + updateDataSource( + args: UpdateDataSourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateDataSourceCommandOutput) => void + ): void; + + /** + * @see {@link UpdateKnowledgeBaseCommand} + */ + updateKnowledgeBase( + args: UpdateKnowledgeBaseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateKnowledgeBase( + args: UpdateKnowledgeBaseCommandInput, + cb: (err: any, data?: UpdateKnowledgeBaseCommandOutput) => void + ): void; + updateKnowledgeBase( + args: UpdateKnowledgeBaseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateKnowledgeBaseCommandOutput) => void + ): void; +} + +/** + * @public + * An example service, deployed with the Octane Service creator, + * which will echo the string + */ +export class BedrockAgent extends BedrockAgentClient implements BedrockAgent {} +createAggregatedClient(commands, BedrockAgent); diff --git a/clients/client-bedrock-agent/src/BedrockAgentClient.ts b/clients/client-bedrock-agent/src/BedrockAgentClient.ts new file mode 100644 index 000000000000..c552ef4af548 --- /dev/null +++ b/clients/client-bedrock-agent/src/BedrockAgentClient.ts @@ -0,0 +1,451 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, + getAwsAuthPlugin, + resolveAwsAuthConfig, +} from "@aws-sdk/middleware-signing"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { Credentials as __Credentials } from "@aws-sdk/types"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + Checksum as __Checksum, + ChecksumConstructor as __ChecksumConstructor, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + Hash as __Hash, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + AssociateAgentKnowledgeBaseCommandInput, + AssociateAgentKnowledgeBaseCommandOutput, +} from "./commands/AssociateAgentKnowledgeBaseCommand"; +import { + CreateAgentActionGroupCommandInput, + CreateAgentActionGroupCommandOutput, +} from "./commands/CreateAgentActionGroupCommand"; +import { CreateAgentAliasCommandInput, CreateAgentAliasCommandOutput } from "./commands/CreateAgentAliasCommand"; +import { CreateAgentCommandInput, CreateAgentCommandOutput } from "./commands/CreateAgentCommand"; +import { CreateDataSourceCommandInput, CreateDataSourceCommandOutput } from "./commands/CreateDataSourceCommand"; +import { + CreateKnowledgeBaseCommandInput, + CreateKnowledgeBaseCommandOutput, +} from "./commands/CreateKnowledgeBaseCommand"; +import { + DeleteAgentActionGroupCommandInput, + DeleteAgentActionGroupCommandOutput, +} from "./commands/DeleteAgentActionGroupCommand"; +import { DeleteAgentAliasCommandInput, DeleteAgentAliasCommandOutput } from "./commands/DeleteAgentAliasCommand"; +import { DeleteAgentCommandInput, DeleteAgentCommandOutput } from "./commands/DeleteAgentCommand"; +import { DeleteAgentVersionCommandInput, DeleteAgentVersionCommandOutput } from "./commands/DeleteAgentVersionCommand"; +import { DeleteDataSourceCommandInput, DeleteDataSourceCommandOutput } from "./commands/DeleteDataSourceCommand"; +import { + DeleteKnowledgeBaseCommandInput, + DeleteKnowledgeBaseCommandOutput, +} from "./commands/DeleteKnowledgeBaseCommand"; +import { + DisassociateAgentKnowledgeBaseCommandInput, + DisassociateAgentKnowledgeBaseCommandOutput, +} from "./commands/DisassociateAgentKnowledgeBaseCommand"; +import { + GetAgentActionGroupCommandInput, + GetAgentActionGroupCommandOutput, +} from "./commands/GetAgentActionGroupCommand"; +import { GetAgentAliasCommandInput, GetAgentAliasCommandOutput } from "./commands/GetAgentAliasCommand"; +import { GetAgentCommandInput, GetAgentCommandOutput } from "./commands/GetAgentCommand"; +import { + GetAgentKnowledgeBaseCommandInput, + GetAgentKnowledgeBaseCommandOutput, +} from "./commands/GetAgentKnowledgeBaseCommand"; +import { GetAgentVersionCommandInput, GetAgentVersionCommandOutput } from "./commands/GetAgentVersionCommand"; +import { GetDataSourceCommandInput, GetDataSourceCommandOutput } from "./commands/GetDataSourceCommand"; +import { GetIngestionJobCommandInput, GetIngestionJobCommandOutput } from "./commands/GetIngestionJobCommand"; +import { GetKnowledgeBaseCommandInput, GetKnowledgeBaseCommandOutput } from "./commands/GetKnowledgeBaseCommand"; +import { + ListAgentActionGroupsCommandInput, + ListAgentActionGroupsCommandOutput, +} from "./commands/ListAgentActionGroupsCommand"; +import { ListAgentAliasesCommandInput, ListAgentAliasesCommandOutput } from "./commands/ListAgentAliasesCommand"; +import { + ListAgentKnowledgeBasesCommandInput, + ListAgentKnowledgeBasesCommandOutput, +} from "./commands/ListAgentKnowledgeBasesCommand"; +import { ListAgentsCommandInput, ListAgentsCommandOutput } from "./commands/ListAgentsCommand"; +import { ListAgentVersionsCommandInput, ListAgentVersionsCommandOutput } from "./commands/ListAgentVersionsCommand"; +import { ListDataSourcesCommandInput, ListDataSourcesCommandOutput } from "./commands/ListDataSourcesCommand"; +import { ListIngestionJobsCommandInput, ListIngestionJobsCommandOutput } from "./commands/ListIngestionJobsCommand"; +import { ListKnowledgeBasesCommandInput, ListKnowledgeBasesCommandOutput } from "./commands/ListKnowledgeBasesCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { PrepareAgentCommandInput, PrepareAgentCommandOutput } from "./commands/PrepareAgentCommand"; +import { StartIngestionJobCommandInput, StartIngestionJobCommandOutput } from "./commands/StartIngestionJobCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { + UpdateAgentActionGroupCommandInput, + UpdateAgentActionGroupCommandOutput, +} from "./commands/UpdateAgentActionGroupCommand"; +import { UpdateAgentAliasCommandInput, UpdateAgentAliasCommandOutput } from "./commands/UpdateAgentAliasCommand"; +import { UpdateAgentCommandInput, UpdateAgentCommandOutput } from "./commands/UpdateAgentCommand"; +import { + UpdateAgentKnowledgeBaseCommandInput, + UpdateAgentKnowledgeBaseCommandOutput, +} from "./commands/UpdateAgentKnowledgeBaseCommand"; +import { UpdateDataSourceCommandInput, UpdateDataSourceCommandOutput } from "./commands/UpdateDataSourceCommand"; +import { + UpdateKnowledgeBaseCommandInput, + UpdateKnowledgeBaseCommandOutput, +} from "./commands/UpdateKnowledgeBaseCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | AssociateAgentKnowledgeBaseCommandInput + | CreateAgentActionGroupCommandInput + | CreateAgentAliasCommandInput + | CreateAgentCommandInput + | CreateDataSourceCommandInput + | CreateKnowledgeBaseCommandInput + | DeleteAgentActionGroupCommandInput + | DeleteAgentAliasCommandInput + | DeleteAgentCommandInput + | DeleteAgentVersionCommandInput + | DeleteDataSourceCommandInput + | DeleteKnowledgeBaseCommandInput + | DisassociateAgentKnowledgeBaseCommandInput + | GetAgentActionGroupCommandInput + | GetAgentAliasCommandInput + | GetAgentCommandInput + | GetAgentKnowledgeBaseCommandInput + | GetAgentVersionCommandInput + | GetDataSourceCommandInput + | GetIngestionJobCommandInput + | GetKnowledgeBaseCommandInput + | ListAgentActionGroupsCommandInput + | ListAgentAliasesCommandInput + | ListAgentKnowledgeBasesCommandInput + | ListAgentVersionsCommandInput + | ListAgentsCommandInput + | ListDataSourcesCommandInput + | ListIngestionJobsCommandInput + | ListKnowledgeBasesCommandInput + | ListTagsForResourceCommandInput + | PrepareAgentCommandInput + | StartIngestionJobCommandInput + | TagResourceCommandInput + | UntagResourceCommandInput + | UpdateAgentActionGroupCommandInput + | UpdateAgentAliasCommandInput + | UpdateAgentCommandInput + | UpdateAgentKnowledgeBaseCommandInput + | UpdateDataSourceCommandInput + | UpdateKnowledgeBaseCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | AssociateAgentKnowledgeBaseCommandOutput + | CreateAgentActionGroupCommandOutput + | CreateAgentAliasCommandOutput + | CreateAgentCommandOutput + | CreateDataSourceCommandOutput + | CreateKnowledgeBaseCommandOutput + | DeleteAgentActionGroupCommandOutput + | DeleteAgentAliasCommandOutput + | DeleteAgentCommandOutput + | DeleteAgentVersionCommandOutput + | DeleteDataSourceCommandOutput + | DeleteKnowledgeBaseCommandOutput + | DisassociateAgentKnowledgeBaseCommandOutput + | GetAgentActionGroupCommandOutput + | GetAgentAliasCommandOutput + | GetAgentCommandOutput + | GetAgentKnowledgeBaseCommandOutput + | GetAgentVersionCommandOutput + | GetDataSourceCommandOutput + | GetIngestionJobCommandOutput + | GetKnowledgeBaseCommandOutput + | ListAgentActionGroupsCommandOutput + | ListAgentAliasesCommandOutput + | ListAgentKnowledgeBasesCommandOutput + | ListAgentVersionsCommandOutput + | ListAgentsCommandOutput + | ListDataSourcesCommandOutput + | ListIngestionJobsCommandOutput + | ListKnowledgeBasesCommandOutput + | ListTagsForResourceCommandOutput + | PrepareAgentCommandOutput + | StartIngestionJobCommandOutput + | TagResourceCommandOutput + | UntagResourceCommandOutput + | UpdateAgentActionGroupCommandOutput + | UpdateAgentAliasCommandOutput + | UpdateAgentCommandOutput + | UpdateAgentKnowledgeBaseCommandOutput + | UpdateDataSourceCommandOutput + | UpdateKnowledgeBaseCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Default credentials provider; Not available in browser runtime. + * @internal + */ + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type BedrockAgentClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + AwsAuthInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of BedrockAgentClient class constructor that set the region, credentials and other options. + */ +export interface BedrockAgentClientConfig extends BedrockAgentClientConfigType {} + +/** + * @public + */ +export type BedrockAgentClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + AwsAuthResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of BedrockAgentClient class. This is resolved and normalized from the {@link BedrockAgentClientConfig | constructor configuration interface}. + */ +export interface BedrockAgentClientResolvedConfig extends BedrockAgentClientResolvedConfigType {} + +/** + * @public + * An example service, deployed with the Octane Service creator, + * which will echo the string + */ +export class BedrockAgentClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + BedrockAgentClientResolvedConfig +> { + /** + * The resolved configuration of BedrockAgentClient class. This is resolved and normalized from the {@link BedrockAgentClientConfig | constructor configuration interface}. + */ + readonly config: BedrockAgentClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveAwsAuthConfig(_config_5); + const _config_7 = resolveUserAgentConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(getAwsAuthPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/clients/client-bedrock-agent/src/commands/AssociateAgentKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/AssociateAgentKnowledgeBaseCommand.ts new file mode 100644 index 000000000000..34a2f7e48518 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/AssociateAgentKnowledgeBaseCommand.ts @@ -0,0 +1,180 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { AssociateAgentKnowledgeBaseRequest, AssociateAgentKnowledgeBaseResponse } from "../models/models_0"; +import { + de_AssociateAgentKnowledgeBaseCommand, + se_AssociateAgentKnowledgeBaseCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link AssociateAgentKnowledgeBaseCommand}. + */ +export interface AssociateAgentKnowledgeBaseCommandInput extends AssociateAgentKnowledgeBaseRequest {} +/** + * @public + * + * The output of {@link AssociateAgentKnowledgeBaseCommand}. + */ +export interface AssociateAgentKnowledgeBaseCommandOutput + extends AssociateAgentKnowledgeBaseResponse, + __MetadataBearer {} + +/** + * @public + * Associate a Knowledge Base to an existing Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, AssociateAgentKnowledgeBaseCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, AssociateAgentKnowledgeBaseCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // AssociateAgentKnowledgeBaseRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * knowledgeBaseId: "STRING_VALUE", // required + * description: "STRING_VALUE", // required + * knowledgeBaseState: "ENABLED" || "DISABLED", + * }; + * const command = new AssociateAgentKnowledgeBaseCommand(input); + * const response = await client.send(command); + * // { // AssociateAgentKnowledgeBaseResponse + * // agentKnowledgeBase: { // AgentKnowledgeBase + * // agentId: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // knowledgeBaseId: "STRING_VALUE", // required + * // description: "STRING_VALUE", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // knowledgeBaseState: "ENABLED" || "DISABLED", // required + * // }, + * // }; + * + * ``` + * + * @param AssociateAgentKnowledgeBaseCommandInput - {@link AssociateAgentKnowledgeBaseCommandInput} + * @returns {@link AssociateAgentKnowledgeBaseCommandOutput} + * @see {@link AssociateAgentKnowledgeBaseCommandInput} for command's `input` shape. + * @see {@link AssociateAgentKnowledgeBaseCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class AssociateAgentKnowledgeBaseCommand extends $Command< + AssociateAgentKnowledgeBaseCommandInput, + AssociateAgentKnowledgeBaseCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: AssociateAgentKnowledgeBaseCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, AssociateAgentKnowledgeBaseCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "AssociateAgentKnowledgeBaseCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "AssociateAgentKnowledgeBase", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: AssociateAgentKnowledgeBaseCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_AssociateAgentKnowledgeBaseCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_AssociateAgentKnowledgeBaseCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/CreateAgentActionGroupCommand.ts b/clients/client-bedrock-agent/src/commands/CreateAgentActionGroupCommand.ts new file mode 100644 index 000000000000..9153b7df242a --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/CreateAgentActionGroupCommand.ts @@ -0,0 +1,202 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { + CreateAgentActionGroupRequest, + CreateAgentActionGroupRequestFilterSensitiveLog, + CreateAgentActionGroupResponse, + CreateAgentActionGroupResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_CreateAgentActionGroupCommand, se_CreateAgentActionGroupCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateAgentActionGroupCommand}. + */ +export interface CreateAgentActionGroupCommandInput extends CreateAgentActionGroupRequest {} +/** + * @public + * + * The output of {@link CreateAgentActionGroupCommand}. + */ +export interface CreateAgentActionGroupCommandOutput extends CreateAgentActionGroupResponse, __MetadataBearer {} + +/** + * @public + * Creates an Action Group for existing Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, CreateAgentActionGroupCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, CreateAgentActionGroupCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // CreateAgentActionGroupRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * actionGroupName: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * description: "STRING_VALUE", + * parentActionGroupSignature: "AMAZON.UserInput", + * actionGroupExecutor: { // ActionGroupExecutor Union: only one key present + * lambda: "STRING_VALUE", + * }, + * apiSchema: { // APISchema Union: only one key present + * s3: { // S3Identifier + * s3BucketName: "STRING_VALUE", + * s3ObjectKey: "STRING_VALUE", + * }, + * payload: "STRING_VALUE", + * }, + * actionGroupState: "ENABLED" || "DISABLED", + * }; + * const command = new CreateAgentActionGroupCommand(input); + * const response = await client.send(command); + * // { // CreateAgentActionGroupResponse + * // agentActionGroup: { // AgentActionGroup + * // agentId: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // actionGroupId: "STRING_VALUE", // required + * // actionGroupName: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // description: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // parentActionSignature: "AMAZON.UserInput", + * // actionGroupExecutor: { // ActionGroupExecutor Union: only one key present + * // lambda: "STRING_VALUE", + * // }, + * // apiSchema: { // APISchema Union: only one key present + * // s3: { // S3Identifier + * // s3BucketName: "STRING_VALUE", + * // s3ObjectKey: "STRING_VALUE", + * // }, + * // payload: "STRING_VALUE", + * // }, + * // actionGroupState: "ENABLED" || "DISABLED", // required + * // }, + * // }; + * + * ``` + * + * @param CreateAgentActionGroupCommandInput - {@link CreateAgentActionGroupCommandInput} + * @returns {@link CreateAgentActionGroupCommandOutput} + * @see {@link CreateAgentActionGroupCommandInput} for command's `input` shape. + * @see {@link CreateAgentActionGroupCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class CreateAgentActionGroupCommand extends $Command< + CreateAgentActionGroupCommandInput, + CreateAgentActionGroupCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateAgentActionGroupCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, CreateAgentActionGroupCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "CreateAgentActionGroupCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: CreateAgentActionGroupRequestFilterSensitiveLog, + outputFilterSensitiveLog: CreateAgentActionGroupResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "CreateAgentActionGroup", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateAgentActionGroupCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateAgentActionGroupCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateAgentActionGroupCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/CreateAgentAliasCommand.ts b/clients/client-bedrock-agent/src/commands/CreateAgentAliasCommand.ts new file mode 100644 index 000000000000..4a82e4013f5f --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/CreateAgentAliasCommand.ts @@ -0,0 +1,197 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { CreateAgentAliasRequest, CreateAgentAliasResponse } from "../models/models_0"; +import { de_CreateAgentAliasCommand, se_CreateAgentAliasCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateAgentAliasCommand}. + */ +export interface CreateAgentAliasCommandInput extends CreateAgentAliasRequest {} +/** + * @public + * + * The output of {@link CreateAgentAliasCommand}. + */ +export interface CreateAgentAliasCommandOutput extends CreateAgentAliasResponse, __MetadataBearer {} + +/** + * @public + * Creates an Alias for an existing Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, CreateAgentAliasCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, CreateAgentAliasCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // CreateAgentAliasRequest + * agentId: "STRING_VALUE", // required + * agentAliasName: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * description: "STRING_VALUE", + * routingConfiguration: [ // AgentAliasRoutingConfiguration + * { // AgentAliasRoutingConfigurationListItem + * agentVersion: "STRING_VALUE", // required + * }, + * ], + * tags: { // TagsMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new CreateAgentAliasCommand(input); + * const response = await client.send(command); + * // { // CreateAgentAliasResponse + * // agentAlias: { // AgentAlias + * // agentId: "STRING_VALUE", // required + * // agentAliasId: "STRING_VALUE", // required + * // agentAliasName: "STRING_VALUE", // required + * // agentAliasArn: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // description: "STRING_VALUE", + * // routingConfiguration: [ // AgentAliasRoutingConfiguration // required + * // { // AgentAliasRoutingConfigurationListItem + * // agentVersion: "STRING_VALUE", // required + * // }, + * // ], + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // agentAliasHistoryEvents: [ // AgentAliasHistoryEvents + * // { // AgentAliasHistoryEvent + * // routingConfiguration: [ + * // { + * // agentVersion: "STRING_VALUE", // required + * // }, + * // ], + * // endDate: new Date("TIMESTAMP"), + * // startDate: new Date("TIMESTAMP"), + * // }, + * // ], + * // agentAliasStatus: "CREATING" || "PREPARED" || "FAILED" || "UPDATING" || "DELETING", // required + * // }, + * // }; + * + * ``` + * + * @param CreateAgentAliasCommandInput - {@link CreateAgentAliasCommandInput} + * @returns {@link CreateAgentAliasCommandOutput} + * @see {@link CreateAgentAliasCommandInput} for command's `input` shape. + * @see {@link CreateAgentAliasCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class CreateAgentAliasCommand extends $Command< + CreateAgentAliasCommandInput, + CreateAgentAliasCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateAgentAliasCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, CreateAgentAliasCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "CreateAgentAliasCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "CreateAgentAlias", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateAgentAliasCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateAgentAliasCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateAgentAliasCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/CreateAgentCommand.ts b/clients/client-bedrock-agent/src/commands/CreateAgentCommand.ts new file mode 100644 index 000000000000..8fbd69e4e4eb --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/CreateAgentCommand.ts @@ -0,0 +1,234 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { + CreateAgentRequest, + CreateAgentRequestFilterSensitiveLog, + CreateAgentResponse, + CreateAgentResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_CreateAgentCommand, se_CreateAgentCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateAgentCommand}. + */ +export interface CreateAgentCommandInput extends CreateAgentRequest {} +/** + * @public + * + * The output of {@link CreateAgentCommand}. + */ +export interface CreateAgentCommandOutput extends CreateAgentResponse, __MetadataBearer {} + +/** + * @public + * Creates an Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, CreateAgentCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, CreateAgentCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // CreateAgentRequest + * agentName: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * instruction: "STRING_VALUE", + * foundationModel: "STRING_VALUE", + * description: "STRING_VALUE", + * idleSessionTTLInSeconds: Number("int"), + * agentResourceRoleArn: "STRING_VALUE", // required + * customerEncryptionKeyArn: "STRING_VALUE", + * tags: { // TagsMap + * "": "STRING_VALUE", + * }, + * promptOverrideConfiguration: { // PromptOverrideConfiguration + * promptConfigurations: [ // PromptConfigurations // required + * { // PromptConfiguration + * promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION", + * promptCreationMode: "DEFAULT" || "OVERRIDDEN", + * promptState: "ENABLED" || "DISABLED", + * basePromptTemplate: "STRING_VALUE", + * inferenceConfiguration: { // InferenceConfiguration + * temperature: Number("float"), + * topP: Number("float"), + * topK: Number("int"), + * maximumLength: Number("int"), + * stopSequences: [ // StopSequences + * "STRING_VALUE", + * ], + * }, + * parserMode: "DEFAULT" || "OVERRIDDEN", + * }, + * ], + * overrideLambda: "STRING_VALUE", + * }, + * }; + * const command = new CreateAgentCommand(input); + * const response = await client.send(command); + * // { // CreateAgentResponse + * // agent: { // Agent + * // agentId: "STRING_VALUE", // required + * // agentName: "STRING_VALUE", // required + * // agentArn: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // instruction: "STRING_VALUE", + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // foundationModel: "STRING_VALUE", + * // description: "STRING_VALUE", + * // idleSessionTTLInSeconds: Number("int"), // required + * // agentResourceRoleArn: "STRING_VALUE", // required + * // customerEncryptionKeyArn: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // preparedAt: new Date("TIMESTAMP"), + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // recommendedActions: [ // RecommendedActions + * // "STRING_VALUE", + * // ], + * // promptOverrideConfiguration: { // PromptOverrideConfiguration + * // promptConfigurations: [ // PromptConfigurations // required + * // { // PromptConfiguration + * // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION", + * // promptCreationMode: "DEFAULT" || "OVERRIDDEN", + * // promptState: "ENABLED" || "DISABLED", + * // basePromptTemplate: "STRING_VALUE", + * // inferenceConfiguration: { // InferenceConfiguration + * // temperature: Number("float"), + * // topP: Number("float"), + * // topK: Number("int"), + * // maximumLength: Number("int"), + * // stopSequences: [ // StopSequences + * // "STRING_VALUE", + * // ], + * // }, + * // parserMode: "DEFAULT" || "OVERRIDDEN", + * // }, + * // ], + * // overrideLambda: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param CreateAgentCommandInput - {@link CreateAgentCommandInput} + * @returns {@link CreateAgentCommandOutput} + * @see {@link CreateAgentCommandInput} for command's `input` shape. + * @see {@link CreateAgentCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class CreateAgentCommand extends $Command< + CreateAgentCommandInput, + CreateAgentCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateAgentCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, CreateAgentCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "CreateAgentCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: CreateAgentRequestFilterSensitiveLog, + outputFilterSensitiveLog: CreateAgentResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "CreateAgent", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateAgentCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateAgentCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateAgentCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts b/clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts new file mode 100644 index 000000000000..48025382daed --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts @@ -0,0 +1,213 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { CreateDataSourceRequest, CreateDataSourceResponse } from "../models/models_0"; +import { de_CreateDataSourceCommand, se_CreateDataSourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateDataSourceCommand}. + */ +export interface CreateDataSourceCommandInput extends CreateDataSourceRequest {} +/** + * @public + * + * The output of {@link CreateDataSourceCommand}. + */ +export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse, __MetadataBearer {} + +/** + * @public + * Create a new data source + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, CreateDataSourceCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, CreateDataSourceCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // CreateDataSourceRequest + * knowledgeBaseId: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * name: "STRING_VALUE", // required + * description: "STRING_VALUE", + * dataSourceConfiguration: { // DataSourceConfiguration + * type: "S3", // required + * s3Configuration: { // S3DataSourceConfiguration + * bucketArn: "STRING_VALUE", // required + * inclusionPrefixes: [ // S3Prefixes + * "STRING_VALUE", + * ], + * }, + * }, + * serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration + * kmsKeyArn: "STRING_VALUE", + * }, + * vectorIngestionConfiguration: { // VectorIngestionConfiguration + * chunkingConfiguration: { // ChunkingConfiguration + * chunkingStrategy: "FIXED_SIZE" || "NONE", // required + * fixedSizeChunkingConfiguration: { // FixedSizeChunkingConfiguration + * maxTokens: Number("int"), // required + * overlapPercentage: Number("int"), // required + * }, + * }, + * }, + * }; + * const command = new CreateDataSourceCommand(input); + * const response = await client.send(command); + * // { // CreateDataSourceResponse + * // dataSource: { // DataSource + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // status: "AVAILABLE" || "DELETING", // required + * // description: "STRING_VALUE", + * // dataSourceConfiguration: { // DataSourceConfiguration + * // type: "S3", // required + * // s3Configuration: { // S3DataSourceConfiguration + * // bucketArn: "STRING_VALUE", // required + * // inclusionPrefixes: [ // S3Prefixes + * // "STRING_VALUE", + * // ], + * // }, + * // }, + * // serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration + * // kmsKeyArn: "STRING_VALUE", + * // }, + * // vectorIngestionConfiguration: { // VectorIngestionConfiguration + * // chunkingConfiguration: { // ChunkingConfiguration + * // chunkingStrategy: "FIXED_SIZE" || "NONE", // required + * // fixedSizeChunkingConfiguration: { // FixedSizeChunkingConfiguration + * // maxTokens: Number("int"), // required + * // overlapPercentage: Number("int"), // required + * // }, + * // }, + * // }, + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // }; + * + * ``` + * + * @param CreateDataSourceCommandInput - {@link CreateDataSourceCommandInput} + * @returns {@link CreateDataSourceCommandOutput} + * @see {@link CreateDataSourceCommandInput} for command's `input` shape. + * @see {@link CreateDataSourceCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class CreateDataSourceCommand extends $Command< + CreateDataSourceCommandInput, + CreateDataSourceCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateDataSourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, CreateDataSourceCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "CreateDataSourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "CreateDataSource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateDataSourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateDataSourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateDataSourceCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts new file mode 100644 index 000000000000..8fbe43e43590 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts @@ -0,0 +1,249 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { CreateKnowledgeBaseRequest, CreateKnowledgeBaseResponse } from "../models/models_0"; +import { de_CreateKnowledgeBaseCommand, se_CreateKnowledgeBaseCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateKnowledgeBaseCommand}. + */ +export interface CreateKnowledgeBaseCommandInput extends CreateKnowledgeBaseRequest {} +/** + * @public + * + * The output of {@link CreateKnowledgeBaseCommand}. + */ +export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseResponse, __MetadataBearer {} + +/** + * @public + * Create a new knowledge base + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, CreateKnowledgeBaseCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, CreateKnowledgeBaseCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // CreateKnowledgeBaseRequest + * clientToken: "STRING_VALUE", + * name: "STRING_VALUE", // required + * description: "STRING_VALUE", + * roleArn: "STRING_VALUE", // required + * knowledgeBaseConfiguration: { // KnowledgeBaseConfiguration + * type: "VECTOR", // required + * vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration + * embeddingModelArn: "STRING_VALUE", // required + * }, + * }, + * storageConfiguration: { // StorageConfiguration + * type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD", // required + * opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration + * collectionArn: "STRING_VALUE", // required + * vectorIndexName: "STRING_VALUE", // required + * fieldMapping: { // OpenSearchServerlessFieldMapping + * vectorField: "STRING_VALUE", // required + * textField: "STRING_VALUE", // required + * metadataField: "STRING_VALUE", // required + * }, + * }, + * pineconeConfiguration: { // PineconeConfiguration + * connectionString: "STRING_VALUE", // required + * credentialsSecretArn: "STRING_VALUE", // required + * namespace: "STRING_VALUE", + * fieldMapping: { // PineconeFieldMapping + * textField: "STRING_VALUE", // required + * metadataField: "STRING_VALUE", // required + * }, + * }, + * redisEnterpriseCloudConfiguration: { // RedisEnterpriseCloudConfiguration + * endpoint: "STRING_VALUE", // required + * vectorIndexName: "STRING_VALUE", // required + * credentialsSecretArn: "STRING_VALUE", // required + * fieldMapping: { // RedisEnterpriseCloudFieldMapping + * vectorField: "STRING_VALUE", // required + * textField: "STRING_VALUE", // required + * metadataField: "STRING_VALUE", // required + * }, + * }, + * }, + * tags: { // TagsMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new CreateKnowledgeBaseCommand(input); + * const response = await client.send(command); + * // { // CreateKnowledgeBaseResponse + * // knowledgeBase: { // KnowledgeBase + * // knowledgeBaseId: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // knowledgeBaseArn: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // roleArn: "STRING_VALUE", // required + * // knowledgeBaseConfiguration: { // KnowledgeBaseConfiguration + * // type: "VECTOR", // required + * // vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration + * // embeddingModelArn: "STRING_VALUE", // required + * // }, + * // }, + * // storageConfiguration: { // StorageConfiguration + * // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD", // required + * // opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration + * // collectionArn: "STRING_VALUE", // required + * // vectorIndexName: "STRING_VALUE", // required + * // fieldMapping: { // OpenSearchServerlessFieldMapping + * // vectorField: "STRING_VALUE", // required + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // pineconeConfiguration: { // PineconeConfiguration + * // connectionString: "STRING_VALUE", // required + * // credentialsSecretArn: "STRING_VALUE", // required + * // namespace: "STRING_VALUE", + * // fieldMapping: { // PineconeFieldMapping + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // redisEnterpriseCloudConfiguration: { // RedisEnterpriseCloudConfiguration + * // endpoint: "STRING_VALUE", // required + * // vectorIndexName: "STRING_VALUE", // required + * // credentialsSecretArn: "STRING_VALUE", // required + * // fieldMapping: { // RedisEnterpriseCloudFieldMapping + * // vectorField: "STRING_VALUE", // required + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // }, + * // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param CreateKnowledgeBaseCommandInput - {@link CreateKnowledgeBaseCommandInput} + * @returns {@link CreateKnowledgeBaseCommandOutput} + * @see {@link CreateKnowledgeBaseCommandInput} for command's `input` shape. + * @see {@link CreateKnowledgeBaseCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class CreateKnowledgeBaseCommand extends $Command< + CreateKnowledgeBaseCommandInput, + CreateKnowledgeBaseCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateKnowledgeBaseCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, CreateKnowledgeBaseCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "CreateKnowledgeBaseCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "CreateKnowledgeBase", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateKnowledgeBaseCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateKnowledgeBaseCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateKnowledgeBaseCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/DeleteAgentActionGroupCommand.ts b/clients/client-bedrock-agent/src/commands/DeleteAgentActionGroupCommand.ts new file mode 100644 index 000000000000..f298698b6a61 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/DeleteAgentActionGroupCommand.ts @@ -0,0 +1,158 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { DeleteAgentActionGroupRequest, DeleteAgentActionGroupResponse } from "../models/models_0"; +import { de_DeleteAgentActionGroupCommand, se_DeleteAgentActionGroupCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteAgentActionGroupCommand}. + */ +export interface DeleteAgentActionGroupCommandInput extends DeleteAgentActionGroupRequest {} +/** + * @public + * + * The output of {@link DeleteAgentActionGroupCommand}. + */ +export interface DeleteAgentActionGroupCommandOutput extends DeleteAgentActionGroupResponse, __MetadataBearer {} + +/** + * @public + * Deletes an Action Group for existing Amazon Bedrock Agent. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, DeleteAgentActionGroupCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, DeleteAgentActionGroupCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // DeleteAgentActionGroupRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * actionGroupId: "STRING_VALUE", // required + * skipResourceInUseCheck: true || false, + * }; + * const command = new DeleteAgentActionGroupCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteAgentActionGroupCommandInput - {@link DeleteAgentActionGroupCommandInput} + * @returns {@link DeleteAgentActionGroupCommandOutput} + * @see {@link DeleteAgentActionGroupCommandInput} for command's `input` shape. + * @see {@link DeleteAgentActionGroupCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class DeleteAgentActionGroupCommand extends $Command< + DeleteAgentActionGroupCommandInput, + DeleteAgentActionGroupCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteAgentActionGroupCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DeleteAgentActionGroupCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "DeleteAgentActionGroupCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "DeleteAgentActionGroup", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteAgentActionGroupCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteAgentActionGroupCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteAgentActionGroupCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/DeleteAgentAliasCommand.ts b/clients/client-bedrock-agent/src/commands/DeleteAgentAliasCommand.ts new file mode 100644 index 000000000000..38893b4340ff --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/DeleteAgentAliasCommand.ts @@ -0,0 +1,157 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { DeleteAgentAliasRequest, DeleteAgentAliasResponse } from "../models/models_0"; +import { de_DeleteAgentAliasCommand, se_DeleteAgentAliasCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteAgentAliasCommand}. + */ +export interface DeleteAgentAliasCommandInput extends DeleteAgentAliasRequest {} +/** + * @public + * + * The output of {@link DeleteAgentAliasCommand}. + */ +export interface DeleteAgentAliasCommandOutput extends DeleteAgentAliasResponse, __MetadataBearer {} + +/** + * @public + * Deletes an Alias for a Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, DeleteAgentAliasCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, DeleteAgentAliasCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // DeleteAgentAliasRequest + * agentId: "STRING_VALUE", // required + * agentAliasId: "STRING_VALUE", // required + * }; + * const command = new DeleteAgentAliasCommand(input); + * const response = await client.send(command); + * // { // DeleteAgentAliasResponse + * // agentId: "STRING_VALUE", // required + * // agentAliasId: "STRING_VALUE", // required + * // agentAliasStatus: "CREATING" || "PREPARED" || "FAILED" || "UPDATING" || "DELETING", // required + * // }; + * + * ``` + * + * @param DeleteAgentAliasCommandInput - {@link DeleteAgentAliasCommandInput} + * @returns {@link DeleteAgentAliasCommandOutput} + * @see {@link DeleteAgentAliasCommandInput} for command's `input` shape. + * @see {@link DeleteAgentAliasCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class DeleteAgentAliasCommand extends $Command< + DeleteAgentAliasCommandInput, + DeleteAgentAliasCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteAgentAliasCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DeleteAgentAliasCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "DeleteAgentAliasCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "DeleteAgentAlias", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteAgentAliasCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteAgentAliasCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteAgentAliasCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/DeleteAgentCommand.ts b/clients/client-bedrock-agent/src/commands/DeleteAgentCommand.ts new file mode 100644 index 000000000000..ac7312ad8ef4 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/DeleteAgentCommand.ts @@ -0,0 +1,157 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { DeleteAgentRequest, DeleteAgentResponse } from "../models/models_0"; +import { de_DeleteAgentCommand, se_DeleteAgentCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteAgentCommand}. + */ +export interface DeleteAgentCommandInput extends DeleteAgentRequest {} +/** + * @public + * + * The output of {@link DeleteAgentCommand}. + */ +export interface DeleteAgentCommandOutput extends DeleteAgentResponse, __MetadataBearer {} + +/** + * @public + * Deletes an Agent for existing Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, DeleteAgentCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, DeleteAgentCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // DeleteAgentRequest + * agentId: "STRING_VALUE", // required + * skipResourceInUseCheck: true || false, + * }; + * const command = new DeleteAgentCommand(input); + * const response = await client.send(command); + * // { // DeleteAgentResponse + * // agentId: "STRING_VALUE", // required + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // }; + * + * ``` + * + * @param DeleteAgentCommandInput - {@link DeleteAgentCommandInput} + * @returns {@link DeleteAgentCommandOutput} + * @see {@link DeleteAgentCommandInput} for command's `input` shape. + * @see {@link DeleteAgentCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class DeleteAgentCommand extends $Command< + DeleteAgentCommandInput, + DeleteAgentCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteAgentCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DeleteAgentCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "DeleteAgentCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "DeleteAgent", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteAgentCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteAgentCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteAgentCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/DeleteAgentVersionCommand.ts b/clients/client-bedrock-agent/src/commands/DeleteAgentVersionCommand.ts new file mode 100644 index 000000000000..df7890814a73 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/DeleteAgentVersionCommand.ts @@ -0,0 +1,161 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { DeleteAgentVersionRequest, DeleteAgentVersionResponse } from "../models/models_0"; +import { de_DeleteAgentVersionCommand, se_DeleteAgentVersionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteAgentVersionCommand}. + */ +export interface DeleteAgentVersionCommandInput extends DeleteAgentVersionRequest {} +/** + * @public + * + * The output of {@link DeleteAgentVersionCommand}. + */ +export interface DeleteAgentVersionCommandOutput extends DeleteAgentVersionResponse, __MetadataBearer {} + +/** + * @public + * Deletes an Agent version for existing Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, DeleteAgentVersionCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, DeleteAgentVersionCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // DeleteAgentVersionRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * skipResourceInUseCheck: true || false, + * }; + * const command = new DeleteAgentVersionCommand(input); + * const response = await client.send(command); + * // { // DeleteAgentVersionResponse + * // agentId: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // }; + * + * ``` + * + * @param DeleteAgentVersionCommandInput - {@link DeleteAgentVersionCommandInput} + * @returns {@link DeleteAgentVersionCommandOutput} + * @see {@link DeleteAgentVersionCommandInput} for command's `input` shape. + * @see {@link DeleteAgentVersionCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class DeleteAgentVersionCommand extends $Command< + DeleteAgentVersionCommandInput, + DeleteAgentVersionCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteAgentVersionCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DeleteAgentVersionCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "DeleteAgentVersionCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "DeleteAgentVersion", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteAgentVersionCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteAgentVersionCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteAgentVersionCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/DeleteDataSourceCommand.ts b/clients/client-bedrock-agent/src/commands/DeleteDataSourceCommand.ts new file mode 100644 index 000000000000..d65eaf86d726 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/DeleteDataSourceCommand.ts @@ -0,0 +1,160 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { DeleteDataSourceRequest, DeleteDataSourceResponse } from "../models/models_0"; +import { de_DeleteDataSourceCommand, se_DeleteDataSourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteDataSourceCommand}. + */ +export interface DeleteDataSourceCommandInput extends DeleteDataSourceRequest {} +/** + * @public + * + * The output of {@link DeleteDataSourceCommand}. + */ +export interface DeleteDataSourceCommandOutput extends DeleteDataSourceResponse, __MetadataBearer {} + +/** + * @public + * Delete an existing data source + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, DeleteDataSourceCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, DeleteDataSourceCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // DeleteDataSourceRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * }; + * const command = new DeleteDataSourceCommand(input); + * const response = await client.send(command); + * // { // DeleteDataSourceResponse + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // status: "AVAILABLE" || "DELETING", // required + * // }; + * + * ``` + * + * @param DeleteDataSourceCommandInput - {@link DeleteDataSourceCommandInput} + * @returns {@link DeleteDataSourceCommandOutput} + * @see {@link DeleteDataSourceCommandInput} for command's `input` shape. + * @see {@link DeleteDataSourceCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class DeleteDataSourceCommand extends $Command< + DeleteDataSourceCommandInput, + DeleteDataSourceCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteDataSourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DeleteDataSourceCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "DeleteDataSourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "DeleteDataSource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteDataSourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteDataSourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteDataSourceCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts new file mode 100644 index 000000000000..a9d3bde02232 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts @@ -0,0 +1,158 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { DeleteKnowledgeBaseRequest, DeleteKnowledgeBaseResponse } from "../models/models_0"; +import { de_DeleteKnowledgeBaseCommand, se_DeleteKnowledgeBaseCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteKnowledgeBaseCommand}. + */ +export interface DeleteKnowledgeBaseCommandInput extends DeleteKnowledgeBaseRequest {} +/** + * @public + * + * The output of {@link DeleteKnowledgeBaseCommand}. + */ +export interface DeleteKnowledgeBaseCommandOutput extends DeleteKnowledgeBaseResponse, __MetadataBearer {} + +/** + * @public + * Delete an existing knowledge base + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, DeleteKnowledgeBaseCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, DeleteKnowledgeBaseCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // DeleteKnowledgeBaseRequest + * knowledgeBaseId: "STRING_VALUE", // required + * }; + * const command = new DeleteKnowledgeBaseCommand(input); + * const response = await client.send(command); + * // { // DeleteKnowledgeBaseResponse + * // knowledgeBaseId: "STRING_VALUE", // required + * // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required + * // }; + * + * ``` + * + * @param DeleteKnowledgeBaseCommandInput - {@link DeleteKnowledgeBaseCommandInput} + * @returns {@link DeleteKnowledgeBaseCommandOutput} + * @see {@link DeleteKnowledgeBaseCommandInput} for command's `input` shape. + * @see {@link DeleteKnowledgeBaseCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class DeleteKnowledgeBaseCommand extends $Command< + DeleteKnowledgeBaseCommandInput, + DeleteKnowledgeBaseCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteKnowledgeBaseCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DeleteKnowledgeBaseCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "DeleteKnowledgeBaseCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "DeleteKnowledgeBase", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteKnowledgeBaseCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteKnowledgeBaseCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteKnowledgeBaseCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/DisassociateAgentKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/DisassociateAgentKnowledgeBaseCommand.ts new file mode 100644 index 000000000000..828b433fc22a --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/DisassociateAgentKnowledgeBaseCommand.ts @@ -0,0 +1,168 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { DisassociateAgentKnowledgeBaseRequest, DisassociateAgentKnowledgeBaseResponse } from "../models/models_0"; +import { + de_DisassociateAgentKnowledgeBaseCommand, + se_DisassociateAgentKnowledgeBaseCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DisassociateAgentKnowledgeBaseCommand}. + */ +export interface DisassociateAgentKnowledgeBaseCommandInput extends DisassociateAgentKnowledgeBaseRequest {} +/** + * @public + * + * The output of {@link DisassociateAgentKnowledgeBaseCommand}. + */ +export interface DisassociateAgentKnowledgeBaseCommandOutput + extends DisassociateAgentKnowledgeBaseResponse, + __MetadataBearer {} + +/** + * @public + * Disassociate an existing Knowledge Base from an Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, DisassociateAgentKnowledgeBaseCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, DisassociateAgentKnowledgeBaseCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // DisassociateAgentKnowledgeBaseRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * knowledgeBaseId: "STRING_VALUE", // required + * }; + * const command = new DisassociateAgentKnowledgeBaseCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DisassociateAgentKnowledgeBaseCommandInput - {@link DisassociateAgentKnowledgeBaseCommandInput} + * @returns {@link DisassociateAgentKnowledgeBaseCommandOutput} + * @see {@link DisassociateAgentKnowledgeBaseCommandInput} for command's `input` shape. + * @see {@link DisassociateAgentKnowledgeBaseCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class DisassociateAgentKnowledgeBaseCommand extends $Command< + DisassociateAgentKnowledgeBaseCommandInput, + DisassociateAgentKnowledgeBaseCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DisassociateAgentKnowledgeBaseCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DisassociateAgentKnowledgeBaseCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "DisassociateAgentKnowledgeBaseCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "DisassociateAgentKnowledgeBase", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: DisassociateAgentKnowledgeBaseCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_DisassociateAgentKnowledgeBaseCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_DisassociateAgentKnowledgeBaseCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/GetAgentActionGroupCommand.ts b/clients/client-bedrock-agent/src/commands/GetAgentActionGroupCommand.ts new file mode 100644 index 000000000000..e642924a7dfa --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetAgentActionGroupCommand.ts @@ -0,0 +1,181 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { + GetAgentActionGroupRequest, + GetAgentActionGroupResponse, + GetAgentActionGroupResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_GetAgentActionGroupCommand, se_GetAgentActionGroupCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetAgentActionGroupCommand}. + */ +export interface GetAgentActionGroupCommandInput extends GetAgentActionGroupRequest {} +/** + * @public + * + * The output of {@link GetAgentActionGroupCommand}. + */ +export interface GetAgentActionGroupCommandOutput extends GetAgentActionGroupResponse, __MetadataBearer {} + +/** + * @public + * Gets an Action Group for existing Amazon Bedrock Agent Version + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetAgentActionGroupCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetAgentActionGroupCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetAgentActionGroupRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * actionGroupId: "STRING_VALUE", // required + * }; + * const command = new GetAgentActionGroupCommand(input); + * const response = await client.send(command); + * // { // GetAgentActionGroupResponse + * // agentActionGroup: { // AgentActionGroup + * // agentId: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // actionGroupId: "STRING_VALUE", // required + * // actionGroupName: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // description: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // parentActionSignature: "AMAZON.UserInput", + * // actionGroupExecutor: { // ActionGroupExecutor Union: only one key present + * // lambda: "STRING_VALUE", + * // }, + * // apiSchema: { // APISchema Union: only one key present + * // s3: { // S3Identifier + * // s3BucketName: "STRING_VALUE", + * // s3ObjectKey: "STRING_VALUE", + * // }, + * // payload: "STRING_VALUE", + * // }, + * // actionGroupState: "ENABLED" || "DISABLED", // required + * // }, + * // }; + * + * ``` + * + * @param GetAgentActionGroupCommandInput - {@link GetAgentActionGroupCommandInput} + * @returns {@link GetAgentActionGroupCommandOutput} + * @see {@link GetAgentActionGroupCommandInput} for command's `input` shape. + * @see {@link GetAgentActionGroupCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class GetAgentActionGroupCommand extends $Command< + GetAgentActionGroupCommandInput, + GetAgentActionGroupCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetAgentActionGroupCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetAgentActionGroupCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "GetAgentActionGroupCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: GetAgentActionGroupResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "GetAgentActionGroup", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetAgentActionGroupCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetAgentActionGroupCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetAgentActionGroupCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/GetAgentAliasCommand.ts b/clients/client-bedrock-agent/src/commands/GetAgentAliasCommand.ts new file mode 100644 index 000000000000..3f9caee94394 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetAgentAliasCommand.ts @@ -0,0 +1,179 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { GetAgentAliasRequest, GetAgentAliasResponse } from "../models/models_0"; +import { de_GetAgentAliasCommand, se_GetAgentAliasCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetAgentAliasCommand}. + */ +export interface GetAgentAliasCommandInput extends GetAgentAliasRequest {} +/** + * @public + * + * The output of {@link GetAgentAliasCommand}. + */ +export interface GetAgentAliasCommandOutput extends GetAgentAliasResponse, __MetadataBearer {} + +/** + * @public + * Describes an Alias for a Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetAgentAliasCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetAgentAliasCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetAgentAliasRequest + * agentId: "STRING_VALUE", // required + * agentAliasId: "STRING_VALUE", // required + * }; + * const command = new GetAgentAliasCommand(input); + * const response = await client.send(command); + * // { // GetAgentAliasResponse + * // agentAlias: { // AgentAlias + * // agentId: "STRING_VALUE", // required + * // agentAliasId: "STRING_VALUE", // required + * // agentAliasName: "STRING_VALUE", // required + * // agentAliasArn: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // description: "STRING_VALUE", + * // routingConfiguration: [ // AgentAliasRoutingConfiguration // required + * // { // AgentAliasRoutingConfigurationListItem + * // agentVersion: "STRING_VALUE", // required + * // }, + * // ], + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // agentAliasHistoryEvents: [ // AgentAliasHistoryEvents + * // { // AgentAliasHistoryEvent + * // routingConfiguration: [ + * // { + * // agentVersion: "STRING_VALUE", // required + * // }, + * // ], + * // endDate: new Date("TIMESTAMP"), + * // startDate: new Date("TIMESTAMP"), + * // }, + * // ], + * // agentAliasStatus: "CREATING" || "PREPARED" || "FAILED" || "UPDATING" || "DELETING", // required + * // }, + * // }; + * + * ``` + * + * @param GetAgentAliasCommandInput - {@link GetAgentAliasCommandInput} + * @returns {@link GetAgentAliasCommandOutput} + * @see {@link GetAgentAliasCommandInput} for command's `input` shape. + * @see {@link GetAgentAliasCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class GetAgentAliasCommand extends $Command< + GetAgentAliasCommandInput, + GetAgentAliasCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetAgentAliasCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetAgentAliasCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "GetAgentAliasCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "GetAgentAlias", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetAgentAliasCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetAgentAliasCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetAgentAliasCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/GetAgentCommand.ts b/clients/client-bedrock-agent/src/commands/GetAgentCommand.ts new file mode 100644 index 000000000000..ca2cb5c63ca2 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetAgentCommand.ts @@ -0,0 +1,195 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { GetAgentRequest, GetAgentResponse, GetAgentResponseFilterSensitiveLog } from "../models/models_0"; +import { de_GetAgentCommand, se_GetAgentCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetAgentCommand}. + */ +export interface GetAgentCommandInput extends GetAgentRequest {} +/** + * @public + * + * The output of {@link GetAgentCommand}. + */ +export interface GetAgentCommandOutput extends GetAgentResponse, __MetadataBearer {} + +/** + * @public + * Gets an Agent for existing Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetAgentCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetAgentCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetAgentRequest + * agentId: "STRING_VALUE", // required + * }; + * const command = new GetAgentCommand(input); + * const response = await client.send(command); + * // { // GetAgentResponse + * // agent: { // Agent + * // agentId: "STRING_VALUE", // required + * // agentName: "STRING_VALUE", // required + * // agentArn: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // instruction: "STRING_VALUE", + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // foundationModel: "STRING_VALUE", + * // description: "STRING_VALUE", + * // idleSessionTTLInSeconds: Number("int"), // required + * // agentResourceRoleArn: "STRING_VALUE", // required + * // customerEncryptionKeyArn: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // preparedAt: new Date("TIMESTAMP"), + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // recommendedActions: [ // RecommendedActions + * // "STRING_VALUE", + * // ], + * // promptOverrideConfiguration: { // PromptOverrideConfiguration + * // promptConfigurations: [ // PromptConfigurations // required + * // { // PromptConfiguration + * // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION", + * // promptCreationMode: "DEFAULT" || "OVERRIDDEN", + * // promptState: "ENABLED" || "DISABLED", + * // basePromptTemplate: "STRING_VALUE", + * // inferenceConfiguration: { // InferenceConfiguration + * // temperature: Number("float"), + * // topP: Number("float"), + * // topK: Number("int"), + * // maximumLength: Number("int"), + * // stopSequences: [ // StopSequences + * // "STRING_VALUE", + * // ], + * // }, + * // parserMode: "DEFAULT" || "OVERRIDDEN", + * // }, + * // ], + * // overrideLambda: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param GetAgentCommandInput - {@link GetAgentCommandInput} + * @returns {@link GetAgentCommandOutput} + * @see {@link GetAgentCommandInput} for command's `input` shape. + * @see {@link GetAgentCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class GetAgentCommand extends $Command< + GetAgentCommandInput, + GetAgentCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetAgentCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetAgentCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "GetAgentCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: GetAgentResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "GetAgent", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetAgentCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetAgentCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetAgentCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/GetAgentKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/GetAgentKnowledgeBaseCommand.ts new file mode 100644 index 000000000000..763c81bfcf9b --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetAgentKnowledgeBaseCommand.ts @@ -0,0 +1,164 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { GetAgentKnowledgeBaseRequest, GetAgentKnowledgeBaseResponse } from "../models/models_0"; +import { de_GetAgentKnowledgeBaseCommand, se_GetAgentKnowledgeBaseCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetAgentKnowledgeBaseCommand}. + */ +export interface GetAgentKnowledgeBaseCommandInput extends GetAgentKnowledgeBaseRequest {} +/** + * @public + * + * The output of {@link GetAgentKnowledgeBaseCommand}. + */ +export interface GetAgentKnowledgeBaseCommandOutput extends GetAgentKnowledgeBaseResponse, __MetadataBearer {} + +/** + * @public + * Gets a knowledge base associated to an existing Amazon Bedrock Agent Version + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetAgentKnowledgeBaseCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetAgentKnowledgeBaseCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetAgentKnowledgeBaseRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * knowledgeBaseId: "STRING_VALUE", // required + * }; + * const command = new GetAgentKnowledgeBaseCommand(input); + * const response = await client.send(command); + * // { // GetAgentKnowledgeBaseResponse + * // agentKnowledgeBase: { // AgentKnowledgeBase + * // agentId: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // knowledgeBaseId: "STRING_VALUE", // required + * // description: "STRING_VALUE", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // knowledgeBaseState: "ENABLED" || "DISABLED", // required + * // }, + * // }; + * + * ``` + * + * @param GetAgentKnowledgeBaseCommandInput - {@link GetAgentKnowledgeBaseCommandInput} + * @returns {@link GetAgentKnowledgeBaseCommandOutput} + * @see {@link GetAgentKnowledgeBaseCommandInput} for command's `input` shape. + * @see {@link GetAgentKnowledgeBaseCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class GetAgentKnowledgeBaseCommand extends $Command< + GetAgentKnowledgeBaseCommandInput, + GetAgentKnowledgeBaseCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetAgentKnowledgeBaseCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetAgentKnowledgeBaseCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "GetAgentKnowledgeBaseCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "GetAgentKnowledgeBase", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetAgentKnowledgeBaseCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetAgentKnowledgeBaseCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetAgentKnowledgeBaseCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/GetAgentVersionCommand.ts b/clients/client-bedrock-agent/src/commands/GetAgentVersionCommand.ts new file mode 100644 index 000000000000..ab828c2f4131 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetAgentVersionCommand.ts @@ -0,0 +1,200 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { + GetAgentVersionRequest, + GetAgentVersionResponse, + GetAgentVersionResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_GetAgentVersionCommand, se_GetAgentVersionCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetAgentVersionCommand}. + */ +export interface GetAgentVersionCommandInput extends GetAgentVersionRequest {} +/** + * @public + * + * The output of {@link GetAgentVersionCommand}. + */ +export interface GetAgentVersionCommandOutput extends GetAgentVersionResponse, __MetadataBearer {} + +/** + * @public + * Gets an Agent version for existing Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetAgentVersionCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetAgentVersionCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetAgentVersionRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * }; + * const command = new GetAgentVersionCommand(input); + * const response = await client.send(command); + * // { // GetAgentVersionResponse + * // agentVersion: { // AgentVersion + * // agentId: "STRING_VALUE", // required + * // agentName: "STRING_VALUE", // required + * // agentArn: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // instruction: "STRING_VALUE", + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // foundationModel: "STRING_VALUE", + * // description: "STRING_VALUE", + * // idleSessionTTLInSeconds: Number("int"), // required + * // agentResourceRoleArn: "STRING_VALUE", // required + * // customerEncryptionKeyArn: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // recommendedActions: [ // RecommendedActions + * // "STRING_VALUE", + * // ], + * // promptOverrideConfiguration: { // PromptOverrideConfiguration + * // promptConfigurations: [ // PromptConfigurations // required + * // { // PromptConfiguration + * // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION", + * // promptCreationMode: "DEFAULT" || "OVERRIDDEN", + * // promptState: "ENABLED" || "DISABLED", + * // basePromptTemplate: "STRING_VALUE", + * // inferenceConfiguration: { // InferenceConfiguration + * // temperature: Number("float"), + * // topP: Number("float"), + * // topK: Number("int"), + * // maximumLength: Number("int"), + * // stopSequences: [ // StopSequences + * // "STRING_VALUE", + * // ], + * // }, + * // parserMode: "DEFAULT" || "OVERRIDDEN", + * // }, + * // ], + * // overrideLambda: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param GetAgentVersionCommandInput - {@link GetAgentVersionCommandInput} + * @returns {@link GetAgentVersionCommandOutput} + * @see {@link GetAgentVersionCommandInput} for command's `input` shape. + * @see {@link GetAgentVersionCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class GetAgentVersionCommand extends $Command< + GetAgentVersionCommandInput, + GetAgentVersionCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetAgentVersionCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetAgentVersionCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "GetAgentVersionCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: GetAgentVersionResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "GetAgentVersion", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetAgentVersionCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetAgentVersionCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetAgentVersionCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts b/clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts new file mode 100644 index 000000000000..fdd9ec9c389c --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts @@ -0,0 +1,182 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { GetDataSourceRequest, GetDataSourceResponse } from "../models/models_0"; +import { de_GetDataSourceCommand, se_GetDataSourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetDataSourceCommand}. + */ +export interface GetDataSourceCommandInput extends GetDataSourceRequest {} +/** + * @public + * + * The output of {@link GetDataSourceCommand}. + */ +export interface GetDataSourceCommandOutput extends GetDataSourceResponse, __MetadataBearer {} + +/** + * @public + * Get an existing data source + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetDataSourceCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetDataSourceCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetDataSourceRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * }; + * const command = new GetDataSourceCommand(input); + * const response = await client.send(command); + * // { // GetDataSourceResponse + * // dataSource: { // DataSource + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // status: "AVAILABLE" || "DELETING", // required + * // description: "STRING_VALUE", + * // dataSourceConfiguration: { // DataSourceConfiguration + * // type: "S3", // required + * // s3Configuration: { // S3DataSourceConfiguration + * // bucketArn: "STRING_VALUE", // required + * // inclusionPrefixes: [ // S3Prefixes + * // "STRING_VALUE", + * // ], + * // }, + * // }, + * // serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration + * // kmsKeyArn: "STRING_VALUE", + * // }, + * // vectorIngestionConfiguration: { // VectorIngestionConfiguration + * // chunkingConfiguration: { // ChunkingConfiguration + * // chunkingStrategy: "FIXED_SIZE" || "NONE", // required + * // fixedSizeChunkingConfiguration: { // FixedSizeChunkingConfiguration + * // maxTokens: Number("int"), // required + * // overlapPercentage: Number("int"), // required + * // }, + * // }, + * // }, + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // }; + * + * ``` + * + * @param GetDataSourceCommandInput - {@link GetDataSourceCommandInput} + * @returns {@link GetDataSourceCommandOutput} + * @see {@link GetDataSourceCommandInput} for command's `input` shape. + * @see {@link GetDataSourceCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class GetDataSourceCommand extends $Command< + GetDataSourceCommandInput, + GetDataSourceCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetDataSourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetDataSourceCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "GetDataSourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "GetDataSource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetDataSourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetDataSourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetDataSourceCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/GetIngestionJobCommand.ts b/clients/client-bedrock-agent/src/commands/GetIngestionJobCommand.ts new file mode 100644 index 000000000000..23442d15683d --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetIngestionJobCommand.ts @@ -0,0 +1,174 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { GetIngestionJobRequest, GetIngestionJobResponse } from "../models/models_0"; +import { de_GetIngestionJobCommand, se_GetIngestionJobCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetIngestionJobCommand}. + */ +export interface GetIngestionJobCommandInput extends GetIngestionJobRequest {} +/** + * @public + * + * The output of {@link GetIngestionJobCommand}. + */ +export interface GetIngestionJobCommandOutput extends GetIngestionJobResponse, __MetadataBearer {} + +/** + * @public + * Get an ingestion job + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetIngestionJobCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetIngestionJobCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetIngestionJobRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * ingestionJobId: "STRING_VALUE", // required + * }; + * const command = new GetIngestionJobCommand(input); + * const response = await client.send(command); + * // { // GetIngestionJobResponse + * // ingestionJob: { // IngestionJob + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // ingestionJobId: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED", // required + * // statistics: { // IngestionJobStatistics + * // numberOfDocumentsScanned: Number("long"), + * // numberOfNewDocumentsIndexed: Number("long"), + * // numberOfModifiedDocumentsIndexed: Number("long"), + * // numberOfDocumentsDeleted: Number("long"), + * // numberOfDocumentsFailed: Number("long"), + * // }, + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // startedAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // }; + * + * ``` + * + * @param GetIngestionJobCommandInput - {@link GetIngestionJobCommandInput} + * @returns {@link GetIngestionJobCommandOutput} + * @see {@link GetIngestionJobCommandInput} for command's `input` shape. + * @see {@link GetIngestionJobCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class GetIngestionJobCommand extends $Command< + GetIngestionJobCommandInput, + GetIngestionJobCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetIngestionJobCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetIngestionJobCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "GetIngestionJobCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "GetIngestionJob", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetIngestionJobCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetIngestionJobCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetIngestionJobCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts new file mode 100644 index 000000000000..9d9116423306 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts @@ -0,0 +1,203 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { GetKnowledgeBaseRequest, GetKnowledgeBaseResponse } from "../models/models_0"; +import { de_GetKnowledgeBaseCommand, se_GetKnowledgeBaseCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetKnowledgeBaseCommand}. + */ +export interface GetKnowledgeBaseCommandInput extends GetKnowledgeBaseRequest {} +/** + * @public + * + * The output of {@link GetKnowledgeBaseCommand}. + */ +export interface GetKnowledgeBaseCommandOutput extends GetKnowledgeBaseResponse, __MetadataBearer {} + +/** + * @public + * Get an existing knowledge base + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetKnowledgeBaseCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetKnowledgeBaseCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetKnowledgeBaseRequest + * knowledgeBaseId: "STRING_VALUE", // required + * }; + * const command = new GetKnowledgeBaseCommand(input); + * const response = await client.send(command); + * // { // GetKnowledgeBaseResponse + * // knowledgeBase: { // KnowledgeBase + * // knowledgeBaseId: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // knowledgeBaseArn: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // roleArn: "STRING_VALUE", // required + * // knowledgeBaseConfiguration: { // KnowledgeBaseConfiguration + * // type: "VECTOR", // required + * // vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration + * // embeddingModelArn: "STRING_VALUE", // required + * // }, + * // }, + * // storageConfiguration: { // StorageConfiguration + * // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD", // required + * // opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration + * // collectionArn: "STRING_VALUE", // required + * // vectorIndexName: "STRING_VALUE", // required + * // fieldMapping: { // OpenSearchServerlessFieldMapping + * // vectorField: "STRING_VALUE", // required + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // pineconeConfiguration: { // PineconeConfiguration + * // connectionString: "STRING_VALUE", // required + * // credentialsSecretArn: "STRING_VALUE", // required + * // namespace: "STRING_VALUE", + * // fieldMapping: { // PineconeFieldMapping + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // redisEnterpriseCloudConfiguration: { // RedisEnterpriseCloudConfiguration + * // endpoint: "STRING_VALUE", // required + * // vectorIndexName: "STRING_VALUE", // required + * // credentialsSecretArn: "STRING_VALUE", // required + * // fieldMapping: { // RedisEnterpriseCloudFieldMapping + * // vectorField: "STRING_VALUE", // required + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // }, + * // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param GetKnowledgeBaseCommandInput - {@link GetKnowledgeBaseCommandInput} + * @returns {@link GetKnowledgeBaseCommandOutput} + * @see {@link GetKnowledgeBaseCommandInput} for command's `input` shape. + * @see {@link GetKnowledgeBaseCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class GetKnowledgeBaseCommand extends $Command< + GetKnowledgeBaseCommandInput, + GetKnowledgeBaseCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetKnowledgeBaseCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetKnowledgeBaseCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "GetKnowledgeBaseCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "GetKnowledgeBase", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetKnowledgeBaseCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetKnowledgeBaseCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetKnowledgeBaseCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListAgentActionGroupsCommand.ts b/clients/client-bedrock-agent/src/commands/ListAgentActionGroupsCommand.ts new file mode 100644 index 000000000000..ef8d006169dd --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListAgentActionGroupsCommand.ts @@ -0,0 +1,166 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListAgentActionGroupsRequest, ListAgentActionGroupsResponse } from "../models/models_0"; +import { de_ListAgentActionGroupsCommand, se_ListAgentActionGroupsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListAgentActionGroupsCommand}. + */ +export interface ListAgentActionGroupsCommandInput extends ListAgentActionGroupsRequest {} +/** + * @public + * + * The output of {@link ListAgentActionGroupsCommand}. + */ +export interface ListAgentActionGroupsCommandOutput extends ListAgentActionGroupsResponse, __MetadataBearer {} + +/** + * @public + * Lists an Action Group for existing Amazon Bedrock Agent Version + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListAgentActionGroupsCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListAgentActionGroupsCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListAgentActionGroupsRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListAgentActionGroupsCommand(input); + * const response = await client.send(command); + * // { // ListAgentActionGroupsResponse + * // actionGroupSummaries: [ // ActionGroupSummaries // required + * // { // ActionGroupSummary + * // actionGroupId: "STRING_VALUE", // required + * // actionGroupName: "STRING_VALUE", // required + * // actionGroupState: "ENABLED" || "DISABLED", // required + * // description: "STRING_VALUE", + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListAgentActionGroupsCommandInput - {@link ListAgentActionGroupsCommandInput} + * @returns {@link ListAgentActionGroupsCommandOutput} + * @see {@link ListAgentActionGroupsCommandInput} for command's `input` shape. + * @see {@link ListAgentActionGroupsCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListAgentActionGroupsCommand extends $Command< + ListAgentActionGroupsCommandInput, + ListAgentActionGroupsCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListAgentActionGroupsCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListAgentActionGroupsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListAgentActionGroupsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListAgentActionGroups", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListAgentActionGroupsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListAgentActionGroupsCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListAgentActionGroupsCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListAgentAliasesCommand.ts b/clients/client-bedrock-agent/src/commands/ListAgentAliasesCommand.ts new file mode 100644 index 000000000000..eca49fdecc16 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListAgentAliasesCommand.ts @@ -0,0 +1,171 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListAgentAliasesRequest, ListAgentAliasesResponse } from "../models/models_0"; +import { de_ListAgentAliasesCommand, se_ListAgentAliasesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListAgentAliasesCommand}. + */ +export interface ListAgentAliasesCommandInput extends ListAgentAliasesRequest {} +/** + * @public + * + * The output of {@link ListAgentAliasesCommand}. + */ +export interface ListAgentAliasesCommandOutput extends ListAgentAliasesResponse, __MetadataBearer {} + +/** + * @public + * Lists all the Aliases for an Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListAgentAliasesCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListAgentAliasesCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListAgentAliasesRequest + * agentId: "STRING_VALUE", // required + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListAgentAliasesCommand(input); + * const response = await client.send(command); + * // { // ListAgentAliasesResponse + * // agentAliasSummaries: [ // AgentAliasSummaries // required + * // { // AgentAliasSummary + * // agentAliasId: "STRING_VALUE", // required + * // agentAliasName: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // routingConfiguration: [ // AgentAliasRoutingConfiguration + * // { // AgentAliasRoutingConfigurationListItem + * // agentVersion: "STRING_VALUE", // required + * // }, + * // ], + * // agentAliasStatus: "CREATING" || "PREPARED" || "FAILED" || "UPDATING" || "DELETING", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListAgentAliasesCommandInput - {@link ListAgentAliasesCommandInput} + * @returns {@link ListAgentAliasesCommandOutput} + * @see {@link ListAgentAliasesCommandInput} for command's `input` shape. + * @see {@link ListAgentAliasesCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListAgentAliasesCommand extends $Command< + ListAgentAliasesCommandInput, + ListAgentAliasesCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListAgentAliasesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListAgentAliasesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListAgentAliasesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListAgentAliases", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListAgentAliasesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListAgentAliasesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListAgentAliasesCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListAgentKnowledgeBasesCommand.ts b/clients/client-bedrock-agent/src/commands/ListAgentKnowledgeBasesCommand.ts new file mode 100644 index 000000000000..2c8c4b4d4511 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListAgentKnowledgeBasesCommand.ts @@ -0,0 +1,165 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListAgentKnowledgeBasesRequest, ListAgentKnowledgeBasesResponse } from "../models/models_0"; +import { de_ListAgentKnowledgeBasesCommand, se_ListAgentKnowledgeBasesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListAgentKnowledgeBasesCommand}. + */ +export interface ListAgentKnowledgeBasesCommandInput extends ListAgentKnowledgeBasesRequest {} +/** + * @public + * + * The output of {@link ListAgentKnowledgeBasesCommand}. + */ +export interface ListAgentKnowledgeBasesCommandOutput extends ListAgentKnowledgeBasesResponse, __MetadataBearer {} + +/** + * @public + * List of Knowledge Bases associated to an existing Amazon Bedrock Agent Version + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListAgentKnowledgeBasesCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListAgentKnowledgeBasesCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListAgentKnowledgeBasesRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListAgentKnowledgeBasesCommand(input); + * const response = await client.send(command); + * // { // ListAgentKnowledgeBasesResponse + * // agentKnowledgeBaseSummaries: [ // AgentKnowledgeBaseSummaries // required + * // { // AgentKnowledgeBaseSummary + * // knowledgeBaseId: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // knowledgeBaseState: "ENABLED" || "DISABLED", // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListAgentKnowledgeBasesCommandInput - {@link ListAgentKnowledgeBasesCommandInput} + * @returns {@link ListAgentKnowledgeBasesCommandOutput} + * @see {@link ListAgentKnowledgeBasesCommandInput} for command's `input` shape. + * @see {@link ListAgentKnowledgeBasesCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListAgentKnowledgeBasesCommand extends $Command< + ListAgentKnowledgeBasesCommandInput, + ListAgentKnowledgeBasesCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListAgentKnowledgeBasesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListAgentKnowledgeBasesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListAgentKnowledgeBasesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListAgentKnowledgeBases", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListAgentKnowledgeBasesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListAgentKnowledgeBasesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListAgentKnowledgeBasesCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListAgentVersionsCommand.ts b/clients/client-bedrock-agent/src/commands/ListAgentVersionsCommand.ts new file mode 100644 index 000000000000..1f6954c36c02 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListAgentVersionsCommand.ts @@ -0,0 +1,166 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListAgentVersionsRequest, ListAgentVersionsResponse } from "../models/models_0"; +import { de_ListAgentVersionsCommand, se_ListAgentVersionsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListAgentVersionsCommand}. + */ +export interface ListAgentVersionsCommandInput extends ListAgentVersionsRequest {} +/** + * @public + * + * The output of {@link ListAgentVersionsCommand}. + */ +export interface ListAgentVersionsCommandOutput extends ListAgentVersionsResponse, __MetadataBearer {} + +/** + * @public + * Lists Agent Versions + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListAgentVersionsCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListAgentVersionsCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListAgentVersionsRequest + * agentId: "STRING_VALUE", // required + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListAgentVersionsCommand(input); + * const response = await client.send(command); + * // { // ListAgentVersionsResponse + * // agentVersionSummaries: [ // AgentVersionSummaries // required + * // { // AgentVersionSummary + * // agentName: "STRING_VALUE", // required + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // agentVersion: "STRING_VALUE", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // description: "STRING_VALUE", + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListAgentVersionsCommandInput - {@link ListAgentVersionsCommandInput} + * @returns {@link ListAgentVersionsCommandOutput} + * @see {@link ListAgentVersionsCommandInput} for command's `input` shape. + * @see {@link ListAgentVersionsCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListAgentVersionsCommand extends $Command< + ListAgentVersionsCommandInput, + ListAgentVersionsCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListAgentVersionsCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListAgentVersionsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListAgentVersionsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListAgentVersions", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListAgentVersionsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListAgentVersionsCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListAgentVersionsCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListAgentsCommand.ts b/clients/client-bedrock-agent/src/commands/ListAgentsCommand.ts new file mode 100644 index 000000000000..24363af3b386 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListAgentsCommand.ts @@ -0,0 +1,160 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListAgentsRequest, ListAgentsResponse } from "../models/models_0"; +import { de_ListAgentsCommand, se_ListAgentsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListAgentsCommand}. + */ +export interface ListAgentsCommandInput extends ListAgentsRequest {} +/** + * @public + * + * The output of {@link ListAgentsCommand}. + */ +export interface ListAgentsCommandOutput extends ListAgentsResponse, __MetadataBearer {} + +/** + * @public + * Lists Agents + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListAgentsCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListAgentsCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListAgentsRequest + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListAgentsCommand(input); + * const response = await client.send(command); + * // { // ListAgentsResponse + * // agentSummaries: [ // AgentSummaries // required + * // { // AgentSummary + * // agentId: "STRING_VALUE", // required + * // agentName: "STRING_VALUE", // required + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // description: "STRING_VALUE", + * // updatedAt: new Date("TIMESTAMP"), // required + * // latestAgentVersion: "STRING_VALUE", + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListAgentsCommandInput - {@link ListAgentsCommandInput} + * @returns {@link ListAgentsCommandOutput} + * @see {@link ListAgentsCommandInput} for command's `input` shape. + * @see {@link ListAgentsCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListAgentsCommand extends $Command< + ListAgentsCommandInput, + ListAgentsCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListAgentsCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListAgentsCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListAgentsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListAgents", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListAgentsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListAgentsCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListAgentsCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListDataSourcesCommand.ts b/clients/client-bedrock-agent/src/commands/ListDataSourcesCommand.ts new file mode 100644 index 000000000000..2af28b98cc39 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListDataSourcesCommand.ts @@ -0,0 +1,166 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListDataSourcesRequest, ListDataSourcesResponse } from "../models/models_0"; +import { de_ListDataSourcesCommand, se_ListDataSourcesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListDataSourcesCommand}. + */ +export interface ListDataSourcesCommandInput extends ListDataSourcesRequest {} +/** + * @public + * + * The output of {@link ListDataSourcesCommand}. + */ +export interface ListDataSourcesCommandOutput extends ListDataSourcesResponse, __MetadataBearer {} + +/** + * @public + * List data sources + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListDataSourcesCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListDataSourcesCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListDataSourcesRequest + * knowledgeBaseId: "STRING_VALUE", // required + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListDataSourcesCommand(input); + * const response = await client.send(command); + * // { // ListDataSourcesResponse + * // dataSourceSummaries: [ // DataSourceSummaries // required + * // { // DataSourceSummary + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // status: "AVAILABLE" || "DELETING", // required + * // description: "STRING_VALUE", + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListDataSourcesCommandInput - {@link ListDataSourcesCommandInput} + * @returns {@link ListDataSourcesCommandOutput} + * @see {@link ListDataSourcesCommandInput} for command's `input` shape. + * @see {@link ListDataSourcesCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListDataSourcesCommand extends $Command< + ListDataSourcesCommandInput, + ListDataSourcesCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListDataSourcesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListDataSourcesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListDataSourcesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListDataSources", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListDataSourcesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListDataSourcesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListDataSourcesCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListIngestionJobsCommand.ts b/clients/client-bedrock-agent/src/commands/ListIngestionJobsCommand.ts new file mode 100644 index 000000000000..a9da9b50bba1 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListIngestionJobsCommand.ts @@ -0,0 +1,188 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListIngestionJobsRequest, ListIngestionJobsResponse } from "../models/models_0"; +import { de_ListIngestionJobsCommand, se_ListIngestionJobsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListIngestionJobsCommand}. + */ +export interface ListIngestionJobsCommandInput extends ListIngestionJobsRequest {} +/** + * @public + * + * The output of {@link ListIngestionJobsCommand}. + */ +export interface ListIngestionJobsCommandOutput extends ListIngestionJobsResponse, __MetadataBearer {} + +/** + * @public + * List ingestion jobs + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListIngestionJobsCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListIngestionJobsCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListIngestionJobsRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * filters: [ // IngestionJobFilters + * { // IngestionJobFilter + * attribute: "STATUS", // required + * operator: "EQ", // required + * values: [ // IngestionJobFilterValues // required + * "STRING_VALUE", + * ], + * }, + * ], + * sortBy: { // IngestionJobSortBy + * attribute: "STATUS" || "STARTED_AT", // required + * order: "ASCENDING" || "DESCENDING", // required + * }, + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListIngestionJobsCommand(input); + * const response = await client.send(command); + * // { // ListIngestionJobsResponse + * // ingestionJobSummaries: [ // IngestionJobSummaries // required + * // { // IngestionJobSummary + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // ingestionJobId: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED", // required + * // startedAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // statistics: { // IngestionJobStatistics + * // numberOfDocumentsScanned: Number("long"), + * // numberOfNewDocumentsIndexed: Number("long"), + * // numberOfModifiedDocumentsIndexed: Number("long"), + * // numberOfDocumentsDeleted: Number("long"), + * // numberOfDocumentsFailed: Number("long"), + * // }, + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListIngestionJobsCommandInput - {@link ListIngestionJobsCommandInput} + * @returns {@link ListIngestionJobsCommandOutput} + * @see {@link ListIngestionJobsCommandInput} for command's `input` shape. + * @see {@link ListIngestionJobsCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListIngestionJobsCommand extends $Command< + ListIngestionJobsCommandInput, + ListIngestionJobsCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListIngestionJobsCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListIngestionJobsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListIngestionJobsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListIngestionJobs", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListIngestionJobsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListIngestionJobsCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListIngestionJobsCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListKnowledgeBasesCommand.ts b/clients/client-bedrock-agent/src/commands/ListKnowledgeBasesCommand.ts new file mode 100644 index 000000000000..1ad8e9bebb3d --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListKnowledgeBasesCommand.ts @@ -0,0 +1,161 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListKnowledgeBasesRequest, ListKnowledgeBasesResponse } from "../models/models_0"; +import { de_ListKnowledgeBasesCommand, se_ListKnowledgeBasesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListKnowledgeBasesCommand}. + */ +export interface ListKnowledgeBasesCommandInput extends ListKnowledgeBasesRequest {} +/** + * @public + * + * The output of {@link ListKnowledgeBasesCommand}. + */ +export interface ListKnowledgeBasesCommandOutput extends ListKnowledgeBasesResponse, __MetadataBearer {} + +/** + * @public + * List Knowledge Bases + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListKnowledgeBasesCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListKnowledgeBasesCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListKnowledgeBasesRequest + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListKnowledgeBasesCommand(input); + * const response = await client.send(command); + * // { // ListKnowledgeBasesResponse + * // knowledgeBaseSummaries: [ // KnowledgeBaseSummaries // required + * // { // KnowledgeBaseSummary + * // knowledgeBaseId: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListKnowledgeBasesCommandInput - {@link ListKnowledgeBasesCommandInput} + * @returns {@link ListKnowledgeBasesCommandOutput} + * @see {@link ListKnowledgeBasesCommandInput} for command's `input` shape. + * @see {@link ListKnowledgeBasesCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListKnowledgeBasesCommand extends $Command< + ListKnowledgeBasesCommandInput, + ListKnowledgeBasesCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListKnowledgeBasesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListKnowledgeBasesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListKnowledgeBasesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListKnowledgeBases", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListKnowledgeBasesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListKnowledgeBasesCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListKnowledgeBasesCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/ListTagsForResourceCommand.ts b/clients/client-bedrock-agent/src/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..a149a6201cb8 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,156 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { ListTagsForResourceRequest, ListTagsForResourceResponse } from "../models/models_0"; +import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandInput extends ListTagsForResourceRequest {} +/** + * @public + * + * The output of {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceResponse, __MetadataBearer {} + +/** + * @public + * List tags for a resource + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListTagsForResourceCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListTagsForResourceCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListTagsForResourceRequest + * resourceArn: "STRING_VALUE", // required + * }; + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * // { // ListTagsForResourceResponse + * // tags: { // TagsMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param ListTagsForResourceCommandInput - {@link ListTagsForResourceCommandInput} + * @returns {@link ListTagsForResourceCommandOutput} + * @see {@link ListTagsForResourceCommandInput} for command's `input` shape. + * @see {@link ListTagsForResourceCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class ListTagsForResourceCommand extends $Command< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListTagsForResourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "ListTagsForResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "ListTagsForResource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListTagsForResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListTagsForResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListTagsForResourceCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/PrepareAgentCommand.ts b/clients/client-bedrock-agent/src/commands/PrepareAgentCommand.ts new file mode 100644 index 000000000000..4ef7e76c13bd --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/PrepareAgentCommand.ts @@ -0,0 +1,161 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { PrepareAgentRequest, PrepareAgentResponse } from "../models/models_0"; +import { de_PrepareAgentCommand, se_PrepareAgentCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link PrepareAgentCommand}. + */ +export interface PrepareAgentCommandInput extends PrepareAgentRequest {} +/** + * @public + * + * The output of {@link PrepareAgentCommand}. + */ +export interface PrepareAgentCommandOutput extends PrepareAgentResponse, __MetadataBearer {} + +/** + * @public + * Prepares an existing Amazon Bedrock Agent to receive runtime requests + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, PrepareAgentCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, PrepareAgentCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // PrepareAgentRequest + * agentId: "STRING_VALUE", // required + * }; + * const command = new PrepareAgentCommand(input); + * const response = await client.send(command); + * // { // PrepareAgentResponse + * // agentId: "STRING_VALUE", // required + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // agentVersion: "STRING_VALUE", // required + * // preparedAt: new Date("TIMESTAMP"), // required + * // }; + * + * ``` + * + * @param PrepareAgentCommandInput - {@link PrepareAgentCommandInput} + * @returns {@link PrepareAgentCommandOutput} + * @see {@link PrepareAgentCommandInput} for command's `input` shape. + * @see {@link PrepareAgentCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class PrepareAgentCommand extends $Command< + PrepareAgentCommandInput, + PrepareAgentCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: PrepareAgentCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, PrepareAgentCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "PrepareAgentCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "PrepareAgent", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: PrepareAgentCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_PrepareAgentCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_PrepareAgentCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/StartIngestionJobCommand.ts b/clients/client-bedrock-agent/src/commands/StartIngestionJobCommand.ts new file mode 100644 index 000000000000..f6cbf0afe6ef --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/StartIngestionJobCommand.ts @@ -0,0 +1,181 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { StartIngestionJobRequest, StartIngestionJobResponse } from "../models/models_0"; +import { de_StartIngestionJobCommand, se_StartIngestionJobCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link StartIngestionJobCommand}. + */ +export interface StartIngestionJobCommandInput extends StartIngestionJobRequest {} +/** + * @public + * + * The output of {@link StartIngestionJobCommand}. + */ +export interface StartIngestionJobCommandOutput extends StartIngestionJobResponse, __MetadataBearer {} + +/** + * @public + * Start a new ingestion job + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, StartIngestionJobCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, StartIngestionJobCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // StartIngestionJobRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * description: "STRING_VALUE", + * }; + * const command = new StartIngestionJobCommand(input); + * const response = await client.send(command); + * // { // StartIngestionJobResponse + * // ingestionJob: { // IngestionJob + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // ingestionJobId: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // status: "STARTING" || "IN_PROGRESS" || "COMPLETE" || "FAILED", // required + * // statistics: { // IngestionJobStatistics + * // numberOfDocumentsScanned: Number("long"), + * // numberOfNewDocumentsIndexed: Number("long"), + * // numberOfModifiedDocumentsIndexed: Number("long"), + * // numberOfDocumentsDeleted: Number("long"), + * // numberOfDocumentsFailed: Number("long"), + * // }, + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // startedAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // }; + * + * ``` + * + * @param StartIngestionJobCommandInput - {@link StartIngestionJobCommandInput} + * @returns {@link StartIngestionJobCommandOutput} + * @see {@link StartIngestionJobCommandInput} for command's `input` shape. + * @see {@link StartIngestionJobCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class StartIngestionJobCommand extends $Command< + StartIngestionJobCommandInput, + StartIngestionJobCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: StartIngestionJobCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, StartIngestionJobCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "StartIngestionJobCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "StartIngestionJob", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: StartIngestionJobCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_StartIngestionJobCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_StartIngestionJobCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/TagResourceCommand.ts b/clients/client-bedrock-agent/src/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..15cfde690f27 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/TagResourceCommand.ts @@ -0,0 +1,156 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { TagResourceRequest, TagResourceResponse } from "../models/models_0"; +import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link TagResourceCommand}. + */ +export interface TagResourceCommandInput extends TagResourceRequest {} +/** + * @public + * + * The output of {@link TagResourceCommand}. + */ +export interface TagResourceCommandOutput extends TagResourceResponse, __MetadataBearer {} + +/** + * @public + * Tag a resource + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, TagResourceCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, TagResourceCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // TagResourceRequest + * resourceArn: "STRING_VALUE", // required + * tags: { // TagsMap // required + * "": "STRING_VALUE", + * }, + * }; + * const command = new TagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param TagResourceCommandInput - {@link TagResourceCommandInput} + * @returns {@link TagResourceCommandOutput} + * @see {@link TagResourceCommandInput} for command's `input` shape. + * @see {@link TagResourceCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class TagResourceCommand extends $Command< + TagResourceCommandInput, + TagResourceCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: TagResourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, TagResourceCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "TagResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "TagResource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: TagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_TagResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_TagResourceCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/UntagResourceCommand.ts b/clients/client-bedrock-agent/src/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..1ced8faf7f1c --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/UntagResourceCommand.ts @@ -0,0 +1,153 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { UntagResourceRequest, UntagResourceResponse } from "../models/models_0"; +import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandInput extends UntagResourceRequest {} +/** + * @public + * + * The output of {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandOutput extends UntagResourceResponse, __MetadataBearer {} + +/** + * @public + * Untag a resource + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, UntagResourceCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, UntagResourceCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // UntagResourceRequest + * resourceArn: "STRING_VALUE", // required + * tagKeys: [ // TagKeyList // required + * "STRING_VALUE", + * ], + * }; + * const command = new UntagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UntagResourceCommandInput - {@link UntagResourceCommandInput} + * @returns {@link UntagResourceCommandOutput} + * @see {@link UntagResourceCommandInput} for command's `input` shape. + * @see {@link UntagResourceCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class UntagResourceCommand extends $Command< + UntagResourceCommandInput, + UntagResourceCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UntagResourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UntagResourceCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "UntagResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "UntagResource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UntagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UntagResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UntagResourceCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/UpdateAgentActionGroupCommand.ts b/clients/client-bedrock-agent/src/commands/UpdateAgentActionGroupCommand.ts new file mode 100644 index 000000000000..8d6be0e81afa --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/UpdateAgentActionGroupCommand.ts @@ -0,0 +1,202 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { + UpdateAgentActionGroupRequest, + UpdateAgentActionGroupRequestFilterSensitiveLog, + UpdateAgentActionGroupResponse, + UpdateAgentActionGroupResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_UpdateAgentActionGroupCommand, se_UpdateAgentActionGroupCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateAgentActionGroupCommand}. + */ +export interface UpdateAgentActionGroupCommandInput extends UpdateAgentActionGroupRequest {} +/** + * @public + * + * The output of {@link UpdateAgentActionGroupCommand}. + */ +export interface UpdateAgentActionGroupCommandOutput extends UpdateAgentActionGroupResponse, __MetadataBearer {} + +/** + * @public + * Updates an existing Action Group for Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, UpdateAgentActionGroupCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, UpdateAgentActionGroupCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // UpdateAgentActionGroupRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * actionGroupId: "STRING_VALUE", // required + * actionGroupName: "STRING_VALUE", // required + * description: "STRING_VALUE", + * parentActionGroupSignature: "AMAZON.UserInput", + * actionGroupExecutor: { // ActionGroupExecutor Union: only one key present + * lambda: "STRING_VALUE", + * }, + * actionGroupState: "ENABLED" || "DISABLED", + * apiSchema: { // APISchema Union: only one key present + * s3: { // S3Identifier + * s3BucketName: "STRING_VALUE", + * s3ObjectKey: "STRING_VALUE", + * }, + * payload: "STRING_VALUE", + * }, + * }; + * const command = new UpdateAgentActionGroupCommand(input); + * const response = await client.send(command); + * // { // UpdateAgentActionGroupResponse + * // agentActionGroup: { // AgentActionGroup + * // agentId: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // actionGroupId: "STRING_VALUE", // required + * // actionGroupName: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // description: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // parentActionSignature: "AMAZON.UserInput", + * // actionGroupExecutor: { // ActionGroupExecutor Union: only one key present + * // lambda: "STRING_VALUE", + * // }, + * // apiSchema: { // APISchema Union: only one key present + * // s3: { // S3Identifier + * // s3BucketName: "STRING_VALUE", + * // s3ObjectKey: "STRING_VALUE", + * // }, + * // payload: "STRING_VALUE", + * // }, + * // actionGroupState: "ENABLED" || "DISABLED", // required + * // }, + * // }; + * + * ``` + * + * @param UpdateAgentActionGroupCommandInput - {@link UpdateAgentActionGroupCommandInput} + * @returns {@link UpdateAgentActionGroupCommandOutput} + * @see {@link UpdateAgentActionGroupCommandInput} for command's `input` shape. + * @see {@link UpdateAgentActionGroupCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class UpdateAgentActionGroupCommand extends $Command< + UpdateAgentActionGroupCommandInput, + UpdateAgentActionGroupCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateAgentActionGroupCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateAgentActionGroupCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "UpdateAgentActionGroupCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UpdateAgentActionGroupRequestFilterSensitiveLog, + outputFilterSensitiveLog: UpdateAgentActionGroupResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "UpdateAgentActionGroup", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateAgentActionGroupCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateAgentActionGroupCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateAgentActionGroupCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/UpdateAgentAliasCommand.ts b/clients/client-bedrock-agent/src/commands/UpdateAgentAliasCommand.ts new file mode 100644 index 000000000000..49e289b1b11f --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/UpdateAgentAliasCommand.ts @@ -0,0 +1,194 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { UpdateAgentAliasRequest, UpdateAgentAliasResponse } from "../models/models_0"; +import { de_UpdateAgentAliasCommand, se_UpdateAgentAliasCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateAgentAliasCommand}. + */ +export interface UpdateAgentAliasCommandInput extends UpdateAgentAliasRequest {} +/** + * @public + * + * The output of {@link UpdateAgentAliasCommand}. + */ +export interface UpdateAgentAliasCommandOutput extends UpdateAgentAliasResponse, __MetadataBearer {} + +/** + * @public + * Updates an existing Alias for an Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, UpdateAgentAliasCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, UpdateAgentAliasCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // UpdateAgentAliasRequest + * agentId: "STRING_VALUE", // required + * agentAliasId: "STRING_VALUE", // required + * agentAliasName: "STRING_VALUE", // required + * description: "STRING_VALUE", + * routingConfiguration: [ // AgentAliasRoutingConfiguration + * { // AgentAliasRoutingConfigurationListItem + * agentVersion: "STRING_VALUE", // required + * }, + * ], + * }; + * const command = new UpdateAgentAliasCommand(input); + * const response = await client.send(command); + * // { // UpdateAgentAliasResponse + * // agentAlias: { // AgentAlias + * // agentId: "STRING_VALUE", // required + * // agentAliasId: "STRING_VALUE", // required + * // agentAliasName: "STRING_VALUE", // required + * // agentAliasArn: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // description: "STRING_VALUE", + * // routingConfiguration: [ // AgentAliasRoutingConfiguration // required + * // { // AgentAliasRoutingConfigurationListItem + * // agentVersion: "STRING_VALUE", // required + * // }, + * // ], + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // agentAliasHistoryEvents: [ // AgentAliasHistoryEvents + * // { // AgentAliasHistoryEvent + * // routingConfiguration: [ + * // { + * // agentVersion: "STRING_VALUE", // required + * // }, + * // ], + * // endDate: new Date("TIMESTAMP"), + * // startDate: new Date("TIMESTAMP"), + * // }, + * // ], + * // agentAliasStatus: "CREATING" || "PREPARED" || "FAILED" || "UPDATING" || "DELETING", // required + * // }, + * // }; + * + * ``` + * + * @param UpdateAgentAliasCommandInput - {@link UpdateAgentAliasCommandInput} + * @returns {@link UpdateAgentAliasCommandOutput} + * @see {@link UpdateAgentAliasCommandInput} for command's `input` shape. + * @see {@link UpdateAgentAliasCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class UpdateAgentAliasCommand extends $Command< + UpdateAgentAliasCommandInput, + UpdateAgentAliasCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateAgentAliasCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateAgentAliasCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "UpdateAgentAliasCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "UpdateAgentAlias", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateAgentAliasCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateAgentAliasCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateAgentAliasCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/UpdateAgentCommand.ts b/clients/client-bedrock-agent/src/commands/UpdateAgentCommand.ts new file mode 100644 index 000000000000..f24ff01679f6 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/UpdateAgentCommand.ts @@ -0,0 +1,234 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { + UpdateAgentRequest, + UpdateAgentRequestFilterSensitiveLog, + UpdateAgentResponse, + UpdateAgentResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_UpdateAgentCommand, se_UpdateAgentCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateAgentCommand}. + */ +export interface UpdateAgentCommandInput extends UpdateAgentRequest {} +/** + * @public + * + * The output of {@link UpdateAgentCommand}. + */ +export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __MetadataBearer {} + +/** + * @public + * Updates an existing Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, UpdateAgentCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, UpdateAgentCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // UpdateAgentRequest + * agentId: "STRING_VALUE", // required + * agentName: "STRING_VALUE", // required + * instruction: "STRING_VALUE", + * foundationModel: "STRING_VALUE", + * description: "STRING_VALUE", + * idleSessionTTLInSeconds: Number("int"), + * agentResourceRoleArn: "STRING_VALUE", // required + * customerEncryptionKeyArn: "STRING_VALUE", + * promptOverrideConfiguration: { // PromptOverrideConfiguration + * promptConfigurations: [ // PromptConfigurations // required + * { // PromptConfiguration + * promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION", + * promptCreationMode: "DEFAULT" || "OVERRIDDEN", + * promptState: "ENABLED" || "DISABLED", + * basePromptTemplate: "STRING_VALUE", + * inferenceConfiguration: { // InferenceConfiguration + * temperature: Number("float"), + * topP: Number("float"), + * topK: Number("int"), + * maximumLength: Number("int"), + * stopSequences: [ // StopSequences + * "STRING_VALUE", + * ], + * }, + * parserMode: "DEFAULT" || "OVERRIDDEN", + * }, + * ], + * overrideLambda: "STRING_VALUE", + * }, + * }; + * const command = new UpdateAgentCommand(input); + * const response = await client.send(command); + * // { // UpdateAgentResponse + * // agent: { // Agent + * // agentId: "STRING_VALUE", // required + * // agentName: "STRING_VALUE", // required + * // agentArn: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // clientToken: "STRING_VALUE", + * // instruction: "STRING_VALUE", + * // agentStatus: "CREATING" || "PREPARING" || "PREPARED" || "NOT_PREPARED" || "DELETING" || "FAILED" || "VERSIONING" || "UPDATING", // required + * // foundationModel: "STRING_VALUE", + * // description: "STRING_VALUE", + * // idleSessionTTLInSeconds: Number("int"), // required + * // agentResourceRoleArn: "STRING_VALUE", // required + * // customerEncryptionKeyArn: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // preparedAt: new Date("TIMESTAMP"), + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // recommendedActions: [ // RecommendedActions + * // "STRING_VALUE", + * // ], + * // promptOverrideConfiguration: { // PromptOverrideConfiguration + * // promptConfigurations: [ // PromptConfigurations // required + * // { // PromptConfiguration + * // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION", + * // promptCreationMode: "DEFAULT" || "OVERRIDDEN", + * // promptState: "ENABLED" || "DISABLED", + * // basePromptTemplate: "STRING_VALUE", + * // inferenceConfiguration: { // InferenceConfiguration + * // temperature: Number("float"), + * // topP: Number("float"), + * // topK: Number("int"), + * // maximumLength: Number("int"), + * // stopSequences: [ // StopSequences + * // "STRING_VALUE", + * // ], + * // }, + * // parserMode: "DEFAULT" || "OVERRIDDEN", + * // }, + * // ], + * // overrideLambda: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param UpdateAgentCommandInput - {@link UpdateAgentCommandInput} + * @returns {@link UpdateAgentCommandOutput} + * @see {@link UpdateAgentCommandInput} for command's `input` shape. + * @see {@link UpdateAgentCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception is thrown when a request is made beyond the service quota + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class UpdateAgentCommand extends $Command< + UpdateAgentCommandInput, + UpdateAgentCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateAgentCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UpdateAgentCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "UpdateAgentCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UpdateAgentRequestFilterSensitiveLog, + outputFilterSensitiveLog: UpdateAgentResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "UpdateAgent", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateAgentCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateAgentCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateAgentCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/UpdateAgentKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/UpdateAgentKnowledgeBaseCommand.ts new file mode 100644 index 000000000000..619983dd09a4 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/UpdateAgentKnowledgeBaseCommand.ts @@ -0,0 +1,169 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { UpdateAgentKnowledgeBaseRequest, UpdateAgentKnowledgeBaseResponse } from "../models/models_0"; +import { de_UpdateAgentKnowledgeBaseCommand, se_UpdateAgentKnowledgeBaseCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateAgentKnowledgeBaseCommand}. + */ +export interface UpdateAgentKnowledgeBaseCommandInput extends UpdateAgentKnowledgeBaseRequest {} +/** + * @public + * + * The output of {@link UpdateAgentKnowledgeBaseCommand}. + */ +export interface UpdateAgentKnowledgeBaseCommandOutput extends UpdateAgentKnowledgeBaseResponse, __MetadataBearer {} + +/** + * @public + * Updates an existing Knowledge Base associated to an Amazon Bedrock Agent + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, UpdateAgentKnowledgeBaseCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, UpdateAgentKnowledgeBaseCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // UpdateAgentKnowledgeBaseRequest + * agentId: "STRING_VALUE", // required + * agentVersion: "STRING_VALUE", // required + * knowledgeBaseId: "STRING_VALUE", // required + * description: "STRING_VALUE", + * knowledgeBaseState: "ENABLED" || "DISABLED", + * }; + * const command = new UpdateAgentKnowledgeBaseCommand(input); + * const response = await client.send(command); + * // { // UpdateAgentKnowledgeBaseResponse + * // agentKnowledgeBase: { // AgentKnowledgeBase + * // agentId: "STRING_VALUE", // required + * // agentVersion: "STRING_VALUE", // required + * // knowledgeBaseId: "STRING_VALUE", // required + * // description: "STRING_VALUE", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // knowledgeBaseState: "ENABLED" || "DISABLED", // required + * // }, + * // }; + * + * ``` + * + * @param UpdateAgentKnowledgeBaseCommandInput - {@link UpdateAgentKnowledgeBaseCommandInput} + * @returns {@link UpdateAgentKnowledgeBaseCommandOutput} + * @see {@link UpdateAgentKnowledgeBaseCommandInput} for command's `input` shape. + * @see {@link UpdateAgentKnowledgeBaseCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class UpdateAgentKnowledgeBaseCommand extends $Command< + UpdateAgentKnowledgeBaseCommandInput, + UpdateAgentKnowledgeBaseCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateAgentKnowledgeBaseCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateAgentKnowledgeBaseCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "UpdateAgentKnowledgeBaseCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "UpdateAgentKnowledgeBase", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateAgentKnowledgeBaseCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateAgentKnowledgeBaseCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateAgentKnowledgeBaseCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts b/clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts new file mode 100644 index 000000000000..3282a58fb7dc --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts @@ -0,0 +1,210 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { UpdateDataSourceRequest, UpdateDataSourceResponse } from "../models/models_0"; +import { de_UpdateDataSourceCommand, se_UpdateDataSourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateDataSourceCommand}. + */ +export interface UpdateDataSourceCommandInput extends UpdateDataSourceRequest {} +/** + * @public + * + * The output of {@link UpdateDataSourceCommand}. + */ +export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse, __MetadataBearer {} + +/** + * @public + * Update an existing data source + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, UpdateDataSourceCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, UpdateDataSourceCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // UpdateDataSourceRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * description: "STRING_VALUE", + * dataSourceConfiguration: { // DataSourceConfiguration + * type: "S3", // required + * s3Configuration: { // S3DataSourceConfiguration + * bucketArn: "STRING_VALUE", // required + * inclusionPrefixes: [ // S3Prefixes + * "STRING_VALUE", + * ], + * }, + * }, + * serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration + * kmsKeyArn: "STRING_VALUE", + * }, + * vectorIngestionConfiguration: { // VectorIngestionConfiguration + * chunkingConfiguration: { // ChunkingConfiguration + * chunkingStrategy: "FIXED_SIZE" || "NONE", // required + * fixedSizeChunkingConfiguration: { // FixedSizeChunkingConfiguration + * maxTokens: Number("int"), // required + * overlapPercentage: Number("int"), // required + * }, + * }, + * }, + * }; + * const command = new UpdateDataSourceCommand(input); + * const response = await client.send(command); + * // { // UpdateDataSourceResponse + * // dataSource: { // DataSource + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // status: "AVAILABLE" || "DELETING", // required + * // description: "STRING_VALUE", + * // dataSourceConfiguration: { // DataSourceConfiguration + * // type: "S3", // required + * // s3Configuration: { // S3DataSourceConfiguration + * // bucketArn: "STRING_VALUE", // required + * // inclusionPrefixes: [ // S3Prefixes + * // "STRING_VALUE", + * // ], + * // }, + * // }, + * // serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration + * // kmsKeyArn: "STRING_VALUE", + * // }, + * // vectorIngestionConfiguration: { // VectorIngestionConfiguration + * // chunkingConfiguration: { // ChunkingConfiguration + * // chunkingStrategy: "FIXED_SIZE" || "NONE", // required + * // fixedSizeChunkingConfiguration: { // FixedSizeChunkingConfiguration + * // maxTokens: Number("int"), // required + * // overlapPercentage: Number("int"), // required + * // }, + * // }, + * // }, + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // }, + * // }; + * + * ``` + * + * @param UpdateDataSourceCommandInput - {@link UpdateDataSourceCommandInput} + * @returns {@link UpdateDataSourceCommandOutput} + * @see {@link UpdateDataSourceCommandInput} for command's `input` shape. + * @see {@link UpdateDataSourceCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class UpdateDataSourceCommand extends $Command< + UpdateDataSourceCommandInput, + UpdateDataSourceCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateDataSourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateDataSourceCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "UpdateDataSourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "UpdateDataSource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateDataSourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateDataSourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateDataSourceCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts new file mode 100644 index 000000000000..1990d6b569a9 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts @@ -0,0 +1,246 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { UpdateKnowledgeBaseRequest, UpdateKnowledgeBaseResponse } from "../models/models_0"; +import { de_UpdateKnowledgeBaseCommand, se_UpdateKnowledgeBaseCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateKnowledgeBaseCommand}. + */ +export interface UpdateKnowledgeBaseCommandInput extends UpdateKnowledgeBaseRequest {} +/** + * @public + * + * The output of {@link UpdateKnowledgeBaseCommand}. + */ +export interface UpdateKnowledgeBaseCommandOutput extends UpdateKnowledgeBaseResponse, __MetadataBearer {} + +/** + * @public + * Update an existing knowledge base + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, UpdateKnowledgeBaseCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, UpdateKnowledgeBaseCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // UpdateKnowledgeBaseRequest + * knowledgeBaseId: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * description: "STRING_VALUE", + * roleArn: "STRING_VALUE", // required + * knowledgeBaseConfiguration: { // KnowledgeBaseConfiguration + * type: "VECTOR", // required + * vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration + * embeddingModelArn: "STRING_VALUE", // required + * }, + * }, + * storageConfiguration: { // StorageConfiguration + * type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD", // required + * opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration + * collectionArn: "STRING_VALUE", // required + * vectorIndexName: "STRING_VALUE", // required + * fieldMapping: { // OpenSearchServerlessFieldMapping + * vectorField: "STRING_VALUE", // required + * textField: "STRING_VALUE", // required + * metadataField: "STRING_VALUE", // required + * }, + * }, + * pineconeConfiguration: { // PineconeConfiguration + * connectionString: "STRING_VALUE", // required + * credentialsSecretArn: "STRING_VALUE", // required + * namespace: "STRING_VALUE", + * fieldMapping: { // PineconeFieldMapping + * textField: "STRING_VALUE", // required + * metadataField: "STRING_VALUE", // required + * }, + * }, + * redisEnterpriseCloudConfiguration: { // RedisEnterpriseCloudConfiguration + * endpoint: "STRING_VALUE", // required + * vectorIndexName: "STRING_VALUE", // required + * credentialsSecretArn: "STRING_VALUE", // required + * fieldMapping: { // RedisEnterpriseCloudFieldMapping + * vectorField: "STRING_VALUE", // required + * textField: "STRING_VALUE", // required + * metadataField: "STRING_VALUE", // required + * }, + * }, + * }, + * }; + * const command = new UpdateKnowledgeBaseCommand(input); + * const response = await client.send(command); + * // { // UpdateKnowledgeBaseResponse + * // knowledgeBase: { // KnowledgeBase + * // knowledgeBaseId: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // knowledgeBaseArn: "STRING_VALUE", // required + * // description: "STRING_VALUE", + * // roleArn: "STRING_VALUE", // required + * // knowledgeBaseConfiguration: { // KnowledgeBaseConfiguration + * // type: "VECTOR", // required + * // vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration + * // embeddingModelArn: "STRING_VALUE", // required + * // }, + * // }, + * // storageConfiguration: { // StorageConfiguration + * // type: "OPENSEARCH_SERVERLESS" || "PINECONE" || "REDIS_ENTERPRISE_CLOUD", // required + * // opensearchServerlessConfiguration: { // OpenSearchServerlessConfiguration + * // collectionArn: "STRING_VALUE", // required + * // vectorIndexName: "STRING_VALUE", // required + * // fieldMapping: { // OpenSearchServerlessFieldMapping + * // vectorField: "STRING_VALUE", // required + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // pineconeConfiguration: { // PineconeConfiguration + * // connectionString: "STRING_VALUE", // required + * // credentialsSecretArn: "STRING_VALUE", // required + * // namespace: "STRING_VALUE", + * // fieldMapping: { // PineconeFieldMapping + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // redisEnterpriseCloudConfiguration: { // RedisEnterpriseCloudConfiguration + * // endpoint: "STRING_VALUE", // required + * // vectorIndexName: "STRING_VALUE", // required + * // credentialsSecretArn: "STRING_VALUE", // required + * // fieldMapping: { // RedisEnterpriseCloudFieldMapping + * // vectorField: "STRING_VALUE", // required + * // textField: "STRING_VALUE", // required + * // metadataField: "STRING_VALUE", // required + * // }, + * // }, + * // }, + * // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required + * // createdAt: new Date("TIMESTAMP"), // required + * // updatedAt: new Date("TIMESTAMP"), // required + * // failureReasons: [ // FailureReasons + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param UpdateKnowledgeBaseCommandInput - {@link UpdateKnowledgeBaseCommandInput} + * @returns {@link UpdateKnowledgeBaseCommandOutput} + * @see {@link UpdateKnowledgeBaseCommandInput} for command's `input` shape. + * @see {@link UpdateKnowledgeBaseCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception is thrown when a request is denied per access permissions + * + * @throws {@link ConflictException} (client fault) + * This exception is thrown when there is a conflict performing an operation + * + * @throws {@link InternalServerException} (server fault) + * This exception is thrown if there was an unexpected error during processing of request + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception is thrown when a resource referenced by the operation does not exist + * + * @throws {@link ThrottlingException} (client fault) + * This exception is thrown when the number of requests exceeds the limit + * + * @throws {@link ValidationException} (client fault) + * This exception is thrown when the request's input validation fails + * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + */ +export class UpdateKnowledgeBaseCommand extends $Command< + UpdateKnowledgeBaseCommandInput, + UpdateKnowledgeBaseCommandOutput, + BedrockAgentClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateKnowledgeBaseCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: BedrockAgentClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateKnowledgeBaseCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "BedrockAgentClient"; + const commandName = "UpdateKnowledgeBaseCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AmazonBedrockAgentBuildTimeLambda", + operation: "UpdateKnowledgeBase", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateKnowledgeBaseCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateKnowledgeBaseCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateKnowledgeBaseCommand(output, context); + } +} diff --git a/clients/client-bedrock-agent/src/commands/index.ts b/clients/client-bedrock-agent/src/commands/index.ts new file mode 100644 index 000000000000..be253941de52 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/index.ts @@ -0,0 +1,41 @@ +// smithy-typescript generated code +export * from "./AssociateAgentKnowledgeBaseCommand"; +export * from "./CreateAgentActionGroupCommand"; +export * from "./CreateAgentAliasCommand"; +export * from "./CreateAgentCommand"; +export * from "./CreateDataSourceCommand"; +export * from "./CreateKnowledgeBaseCommand"; +export * from "./DeleteAgentActionGroupCommand"; +export * from "./DeleteAgentAliasCommand"; +export * from "./DeleteAgentCommand"; +export * from "./DeleteAgentVersionCommand"; +export * from "./DeleteDataSourceCommand"; +export * from "./DeleteKnowledgeBaseCommand"; +export * from "./DisassociateAgentKnowledgeBaseCommand"; +export * from "./GetAgentActionGroupCommand"; +export * from "./GetAgentAliasCommand"; +export * from "./GetAgentCommand"; +export * from "./GetAgentKnowledgeBaseCommand"; +export * from "./GetAgentVersionCommand"; +export * from "./GetDataSourceCommand"; +export * from "./GetIngestionJobCommand"; +export * from "./GetKnowledgeBaseCommand"; +export * from "./ListAgentActionGroupsCommand"; +export * from "./ListAgentAliasesCommand"; +export * from "./ListAgentKnowledgeBasesCommand"; +export * from "./ListAgentVersionsCommand"; +export * from "./ListAgentsCommand"; +export * from "./ListDataSourcesCommand"; +export * from "./ListIngestionJobsCommand"; +export * from "./ListKnowledgeBasesCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./PrepareAgentCommand"; +export * from "./StartIngestionJobCommand"; +export * from "./TagResourceCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateAgentActionGroupCommand"; +export * from "./UpdateAgentAliasCommand"; +export * from "./UpdateAgentCommand"; +export * from "./UpdateAgentKnowledgeBaseCommand"; +export * from "./UpdateDataSourceCommand"; +export * from "./UpdateKnowledgeBaseCommand"; diff --git a/clients/client-bedrock-agent/src/endpoint/EndpointParameters.ts b/clients/client-bedrock-agent/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..5f8d2e564e42 --- /dev/null +++ b/clients/client-bedrock-agent/src/endpoint/EndpointParameters.ts @@ -0,0 +1,34 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "bedrock", + }; +}; + +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/clients/client-bedrock-agent/src/endpoint/endpointResolver.ts b/clients/client-bedrock-agent/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..5a2f95973187 --- /dev/null +++ b/clients/client-bedrock-agent/src/endpoint/endpointResolver.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +import { EndpointV2, Logger } from "@smithy/types"; +import { EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }); +}; diff --git a/clients/client-bedrock-agent/src/endpoint/ruleset.ts b/clients/client-bedrock-agent/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..3890ad917445 --- /dev/null +++ b/clients/client-bedrock-agent/src/endpoint/ruleset.ts @@ -0,0 +1,32 @@ +// @ts-nocheck +// generated code, do not edit +import { RuleSetObject } from "@smithy/types"; + +/* This file is compressed. Log this object + or see "smithy.rules#endpointRuleSet" + in codegen/sdk-codegen/aws-models/bedrock-agent.json */ + +const s="required", +t="fn", +u="argv", +v="ref"; +const a=true, +b="isSet", +c="booleanEquals", +d="error", +e="endpoint", +f="tree", +g="PartitionResult", +h={[s]:false,"type":"String"}, +i={[s]:true,"default":false,"type":"Boolean"}, +j={[v]:"Endpoint"}, +k={[t]:c,[u]:[{[v]:"UseFIPS"},true]}, +l={[t]:c,[u]:[{[v]:"UseDualStack"},true]}, +m={}, +n={[t]:"getAttr",[u]:[{[v]:g},"supportsFIPS"]}, +o={[t]:c,[u]:[true,{[t]:"getAttr",[u]:[{[v]:g},"supportsDualStack"]}]}, +p=[k], +q=[l], +r=[{[v]:"Region"}]; +const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[t]:b,[u]:[j]}],rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:j,properties:m,headers:m},type:e}],type:f}],type:f},{rules:[{conditions:[{[t]:b,[u]:r}],rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:g}],rules:[{conditions:[k,l],rules:[{conditions:[{[t]:c,[u]:[a,n]},o],rules:[{rules:[{endpoint:{url:"https://bedrock-agent-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:p,rules:[{conditions:[{[t]:c,[u]:[n,a]}],rules:[{rules:[{endpoint:{url:"https://bedrock-agent-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:q,rules:[{conditions:[o],rules:[{rules:[{endpoint:{url:"https://bedrock-agent.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{rules:[{endpoint:{url:"https://bedrock-agent.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}],type:f}]}; +export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-bedrock-agent/src/extensionConfiguration.ts b/clients/client-bedrock-agent/src/extensionConfiguration.ts new file mode 100644 index 000000000000..4a70934aef05 --- /dev/null +++ b/clients/client-bedrock-agent/src/extensionConfiguration.ts @@ -0,0 +1,12 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +/** + * @internal + */ +export interface BedrockAgentExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration {} diff --git a/clients/client-bedrock-agent/src/index.ts b/clients/client-bedrock-agent/src/index.ts new file mode 100644 index 000000000000..c715f81fdd21 --- /dev/null +++ b/clients/client-bedrock-agent/src/index.ts @@ -0,0 +1,20 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + * An example service, deployed with the Octane Service creator, + * which will echo the string + * + * @packageDocumentation + */ +export * from "./BedrockAgentClient"; +export * from "./BedrockAgent"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export { RuntimeExtension } from "./runtimeExtensions"; +export { BedrockAgentExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./pagination"; +export * from "./models"; + +import "@aws-sdk/util-endpoints"; + +export { BedrockAgentServiceException } from "./models/BedrockAgentServiceException"; diff --git a/clients/client-bedrock-agent/src/models/BedrockAgentServiceException.ts b/clients/client-bedrock-agent/src/models/BedrockAgentServiceException.ts new file mode 100644 index 000000000000..05538e3a7207 --- /dev/null +++ b/clients/client-bedrock-agent/src/models/BedrockAgentServiceException.ts @@ -0,0 +1,22 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export { __ServiceException, __ServiceExceptionOptions }; + +/** + * @public + * + * Base exception class for all service exceptions from BedrockAgent service. + */ +export class BedrockAgentServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, BedrockAgentServiceException.prototype); + } +} diff --git a/clients/client-bedrock-agent/src/models/index.ts b/clients/client-bedrock-agent/src/models/index.ts new file mode 100644 index 000000000000..9eaceb12865f --- /dev/null +++ b/clients/client-bedrock-agent/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/clients/client-bedrock-agent/src/models/models_0.ts b/clients/client-bedrock-agent/src/models/models_0.ts new file mode 100644 index 000000000000..afc889937d10 --- /dev/null +++ b/clients/client-bedrock-agent/src/models/models_0.ts @@ -0,0 +1,3864 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client"; + +import { BedrockAgentServiceException as __BaseException } from "./BedrockAgentServiceException"; + +/** + * @public + * This exception is thrown when a request is denied per access permissions + */ +export class AccessDeniedException extends __BaseException { + readonly name: "AccessDeniedException" = "AccessDeniedException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, AccessDeniedException.prototype); + } +} + +/** + * @public + * Type of Executors for an Action Group + */ +export type ActionGroupExecutor = ActionGroupExecutor.LambdaMember | ActionGroupExecutor.$UnknownMember; + +/** + * @public + */ +export namespace ActionGroupExecutor { + /** + * @public + * ARN of a Lambda. + */ + export interface LambdaMember { + lambda: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + lambda?: never; + $unknown: [string, any]; + } + + export interface Visitor { + lambda: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: ActionGroupExecutor, visitor: Visitor): T => { + if (value.lambda !== undefined) return visitor.lambda(value.lambda); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + * This exception is thrown when there is a conflict performing an operation + */ +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ConflictException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ConflictException.prototype); + } +} + +/** + * @public + * @enum + */ +export const ActionGroupState = { + DISABLED: "DISABLED", + ENABLED: "ENABLED", +} as const; + +/** + * @public + */ +export type ActionGroupState = (typeof ActionGroupState)[keyof typeof ActionGroupState]; + +/** + * @public + * The identifier for the S3 resource. + */ +export interface S3Identifier { + /** + * @public + * A bucket in S3. + */ + s3BucketName?: string; + + /** + * @public + * A object key in S3. + */ + s3ObjectKey?: string; +} + +/** + * @public + * Contains information about the API Schema for the Action Group + */ +export type APISchema = APISchema.PayloadMember | APISchema.S3Member | APISchema.$UnknownMember; + +/** + * @public + */ +export namespace APISchema { + /** + * @public + * The identifier for the S3 resource. + */ + export interface S3Member { + s3: S3Identifier; + payload?: never; + $unknown?: never; + } + + /** + * @public + * String OpenAPI Payload + */ + export interface PayloadMember { + s3?: never; + payload: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + s3?: never; + payload?: never; + $unknown: [string, any]; + } + + export interface Visitor { + s3: (value: S3Identifier) => T; + payload: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: APISchema, visitor: Visitor): T => { + if (value.s3 !== undefined) return visitor.s3(value.s3); + if (value.payload !== undefined) return visitor.payload(value.payload); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + * @enum + */ +export const ActionGroupSignature = { + AMAZON_USERINPUT: "AMAZON.UserInput", +} as const; + +/** + * @public + */ +export type ActionGroupSignature = (typeof ActionGroupSignature)[keyof typeof ActionGroupSignature]; + +/** + * @public + * Create Action Group Request + */ +export interface CreateAgentActionGroupRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Draft Version of the Agent. + */ + agentVersion: string | undefined; + + /** + * @public + * Name for a resource. + */ + actionGroupName: string | undefined; + + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Action Group Signature for a BuiltIn Action + */ + parentActionGroupSignature?: ActionGroupSignature; + + /** + * @public + * Type of Executors for an Action Group + */ + actionGroupExecutor?: ActionGroupExecutor; + + /** + * @public + * Contains information about the API Schema for the Action Group + */ + apiSchema?: APISchema; + + /** + * @public + * State of the action group + */ + actionGroupState?: ActionGroupState; +} + +/** + * @public + * Contains the information of an Agent Action Group + */ +export interface AgentActionGroup { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Agent Version. + */ + agentVersion: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + actionGroupId: string | undefined; + + /** + * @public + * Name for a resource. + */ + actionGroupName: string | undefined; + + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * Action Group Signature for a BuiltIn Action + */ + parentActionSignature?: ActionGroupSignature; + + /** + * @public + * Type of Executors for an Action Group + */ + actionGroupExecutor?: ActionGroupExecutor; + + /** + * @public + * Contains information about the API Schema for the Action Group + */ + apiSchema?: APISchema; + + /** + * @public + * State of the action group + */ + actionGroupState: ActionGroupState | undefined; +} + +/** + * @public + * Create Action Group Response + */ +export interface CreateAgentActionGroupResponse { + /** + * @public + * Contains the information of an Agent Action Group + */ + agentActionGroup: AgentActionGroup | undefined; +} + +/** + * @public + * This exception is thrown if there was an unexpected error during processing of request + */ +export class InternalServerException extends __BaseException { + readonly name: "InternalServerException" = "InternalServerException"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServerException.prototype); + } +} + +/** + * @public + * This exception is thrown when a resource referenced by the operation does not exist + */ +export class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + } +} + +/** + * @public + * This exception is thrown when a request is made beyond the service quota + */ +export class ServiceQuotaExceededException extends __BaseException { + readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceQuotaExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); + } +} + +/** + * @public + * This exception is thrown when the number of requests exceeds the limit + */ +export class ThrottlingException extends __BaseException { + readonly name: "ThrottlingException" = "ThrottlingException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ThrottlingException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ThrottlingException.prototype); + } +} + +/** + * @public + * Stores information about a field passed inside a request that resulted in an exception + */ +export interface ValidationExceptionField { + /** + * @public + * Non Blank String + */ + name: string | undefined; + + /** + * @public + * Non Blank String + */ + message: string | undefined; +} + +/** + * @public + * This exception is thrown when the request's input validation fails + */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + /** + * @public + * list of ValidationExceptionField + */ + fieldList?: ValidationExceptionField[]; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + this.fieldList = opts.fieldList; + } +} + +/** + * @public + * Delete Action Group Request + */ +export interface DeleteAgentActionGroupRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Draft Version of the Agent. + */ + agentVersion: string | undefined; + + /** + * @public + * Id generated at the server side when an Agent ActionGroup is created + */ + actionGroupId: string | undefined; + + /** + * @public + * Skips checking if resource is in use when set to true. Defaults to false + */ + skipResourceInUseCheck?: boolean; +} + +/** + * @public + * Delete Action Group Response + */ +export interface DeleteAgentActionGroupResponse {} + +/** + * @public + * Get Action Group Request + */ +export interface GetAgentActionGroupRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Version number generated when a version is created + */ + agentVersion: string | undefined; + + /** + * @public + * Id generated at the server side when an Agent Action Group is created + */ + actionGroupId: string | undefined; +} + +/** + * @public + * Get Action Group Response + */ +export interface GetAgentActionGroupResponse { + /** + * @public + * Contains the information of an Agent Action Group + */ + agentActionGroup: AgentActionGroup | undefined; +} + +/** + * @public + * List Action Groups Request + */ +export interface ListAgentActionGroupsRequest { + /** + * @public + * Id generated at the server side when an Agent is Listed + */ + agentId: string | undefined; + + /** + * @public + * Id generated at the server side when an Agent is Listed + */ + agentVersion: string | undefined; + + /** + * @public + * Max Results. + */ + maxResults?: number; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * ActionGroup Summary + */ +export interface ActionGroupSummary { + /** + * @public + * Identifier for a resource. + */ + actionGroupId: string | undefined; + + /** + * @public + * Name for a resource. + */ + actionGroupName: string | undefined; + + /** + * @public + * State of the action group + */ + actionGroupState: ActionGroupState | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; +} + +/** + * @public + * List Action Groups Response + */ +export interface ListAgentActionGroupsResponse { + /** + * @public + * List of ActionGroup Summaries + */ + actionGroupSummaries: ActionGroupSummary[] | undefined; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * Update Action Group Request + */ +export interface UpdateAgentActionGroupRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Draft Version of the Agent. + */ + agentVersion: string | undefined; + + /** + * @public + * Id generated at the server side when an Action Group is created under Agent + */ + actionGroupId: string | undefined; + + /** + * @public + * Name for a resource. + */ + actionGroupName: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Action Group Signature for a BuiltIn Action + */ + parentActionGroupSignature?: ActionGroupSignature; + + /** + * @public + * Type of Executors for an Action Group + */ + actionGroupExecutor?: ActionGroupExecutor; + + /** + * @public + * State of the action group + */ + actionGroupState?: ActionGroupState; + + /** + * @public + * Contains information about the API Schema for the Action Group + */ + apiSchema?: APISchema; +} + +/** + * @public + * Update Action Group Response + */ +export interface UpdateAgentActionGroupResponse { + /** + * @public + * Contains the information of an Agent Action Group + */ + agentActionGroup: AgentActionGroup | undefined; +} + +/** + * @public + * @enum + */ +export const AgentStatus = { + CREATING: "CREATING", + DELETING: "DELETING", + FAILED: "FAILED", + NOT_PREPARED: "NOT_PREPARED", + PREPARED: "PREPARED", + PREPARING: "PREPARING", + UPDATING: "UPDATING", + VERSIONING: "VERSIONING", +} as const; + +/** + * @public + */ +export type AgentStatus = (typeof AgentStatus)[keyof typeof AgentStatus]; + +/** + * @public + * Configuration for inference in prompt configuration + */ +export interface InferenceConfiguration { + /** + * @public + * Controls randomness, higher values increase diversity + */ + temperature?: number; + + /** + * @public + * Cumulative probability cutoff for token selection + */ + topP?: number; + + /** + * @public + * Sample from the k most likely next tokens + */ + topK?: number; + + /** + * @public + * Maximum length of output + */ + maximumLength?: number; + + /** + * @public + * List of stop sequences + */ + stopSequences?: string[]; +} + +/** + * @public + * @enum + */ +export const CreationMode = { + DEFAULT: "DEFAULT", + OVERRIDDEN: "OVERRIDDEN", +} as const; + +/** + * @public + */ +export type CreationMode = (typeof CreationMode)[keyof typeof CreationMode]; + +/** + * @public + * @enum + */ +export const PromptState = { + DISABLED: "DISABLED", + ENABLED: "ENABLED", +} as const; + +/** + * @public + */ +export type PromptState = (typeof PromptState)[keyof typeof PromptState]; + +/** + * @public + * @enum + */ +export const PromptType = { + KNOWLEDGE_BASE_RESPONSE_GENERATION: "KNOWLEDGE_BASE_RESPONSE_GENERATION", + ORCHESTRATION: "ORCHESTRATION", + POST_PROCESSING: "POST_PROCESSING", + PRE_PROCESSING: "PRE_PROCESSING", +} as const; + +/** + * @public + */ +export type PromptType = (typeof PromptType)[keyof typeof PromptType]; + +/** + * @public + * BasePromptConfiguration per Prompt Type. + */ +export interface PromptConfiguration { + /** + * @public + * Prompt Type. + */ + promptType?: PromptType; + + /** + * @public + * Creation Mode for Prompt Configuration. + */ + promptCreationMode?: CreationMode; + + /** + * @public + * Prompt State. + */ + promptState?: PromptState; + + /** + * @public + * Base Prompt Template. + */ + basePromptTemplate?: string; + + /** + * @public + * Configuration for inference in prompt configuration + */ + inferenceConfiguration?: InferenceConfiguration; + + /** + * @public + * Creation Mode for Prompt Configuration. + */ + parserMode?: CreationMode; +} + +/** + * @public + * Configuration for prompt override. + */ +export interface PromptOverrideConfiguration { + /** + * @public + * List of BasePromptConfiguration + */ + promptConfigurations: PromptConfiguration[] | undefined; + + /** + * @public + * ARN of a Lambda. + */ + overrideLambda?: string; +} + +/** + * @public + * Contains the information of an agent + */ +export interface Agent { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Name for a resource. + */ + agentName: string | undefined; + + /** + * @public + * Arn representation of the Agent. + */ + agentArn: string | undefined; + + /** + * @public + * Draft Agent Version. + */ + agentVersion: string | undefined; + + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Instruction for the agent. + */ + instruction?: string; + + /** + * @public + * Schema Type for Action APIs. + */ + agentStatus: AgentStatus | undefined; + + /** + * @public + * ARN or name of a Bedrock model. + */ + foundationModel?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Max Session Time. + */ + idleSessionTTLInSeconds: number | undefined; + + /** + * @public + * ARN of a IAM role. + */ + agentResourceRoleArn: string | undefined; + + /** + * @public + * A KMS key ARN + */ + customerEncryptionKeyArn?: string; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + preparedAt?: Date; + + /** + * @public + * Failure Reasons for Error. + */ + failureReasons?: string[]; + + /** + * @public + * The recommended actions users can take to resolve an error in failureReasons. + */ + recommendedActions?: string[]; + + /** + * @public + * Configuration for prompt override. + */ + promptOverrideConfiguration?: PromptOverrideConfiguration; +} + +/** + * @public + * Details about the routing configuration for an Agent alias. + */ +export interface AgentAliasRoutingConfigurationListItem { + /** + * @public + * Agent Version. + */ + agentVersion: string | undefined; +} + +/** + * @public + * History event for an alias for an Agent. + */ +export interface AgentAliasHistoryEvent { + /** + * @public + * Routing configuration for an Agent alias. + */ + routingConfiguration?: AgentAliasRoutingConfigurationListItem[]; + + /** + * @public + * Time Stamp. + */ + endDate?: Date; + + /** + * @public + * Time Stamp. + */ + startDate?: Date; +} + +/** + * @public + * @enum + */ +export const AgentAliasStatus = { + CREATING: "CREATING", + DELETING: "DELETING", + FAILED: "FAILED", + PREPARED: "PREPARED", + UPDATING: "UPDATING", +} as const; + +/** + * @public + */ +export type AgentAliasStatus = (typeof AgentAliasStatus)[keyof typeof AgentAliasStatus]; + +/** + * @public + * Contains the information of an agent alias + */ +export interface AgentAlias { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Id for an Agent Alias generated at the server side. + */ + agentAliasId: string | undefined; + + /** + * @public + * Name for a resource. + */ + agentAliasName: string | undefined; + + /** + * @public + * Arn representation of the Agent Alias. + */ + agentAliasArn: string | undefined; + + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Routing configuration for an Agent alias. + */ + routingConfiguration: AgentAliasRoutingConfigurationListItem[] | undefined; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * The list of history events for an alias for an Agent. + */ + agentAliasHistoryEvents?: AgentAliasHistoryEvent[]; + + /** + * @public + * The statuses an Agent Alias can be in. + */ + agentAliasStatus: AgentAliasStatus | undefined; +} + +/** + * @public + * Summary of an alias for an Agent. + */ +export interface AgentAliasSummary { + /** + * @public + * Id for an Agent Alias generated at the server side. + */ + agentAliasId: string | undefined; + + /** + * @public + * Name for a resource. + */ + agentAliasName: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Routing configuration for an Agent alias. + */ + routingConfiguration?: AgentAliasRoutingConfigurationListItem[]; + + /** + * @public + * The statuses an Agent Alias can be in. + */ + agentAliasStatus: AgentAliasStatus | undefined; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; +} + +/** + * @public + * @enum + */ +export const KnowledgeBaseState = { + DISABLED: "DISABLED", + ENABLED: "ENABLED", +} as const; + +/** + * @public + */ +export type KnowledgeBaseState = (typeof KnowledgeBaseState)[keyof typeof KnowledgeBaseState]; + +/** + * @public + * Contains the information of an Agent Knowledge Base. + */ +export interface AgentKnowledgeBase { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Agent Version. + */ + agentVersion: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description: string | undefined; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * State of the knowledge base; whether it is enabled or disabled + */ + knowledgeBaseState: KnowledgeBaseState | undefined; +} + +/** + * @public + * Agent Knowledge Base Summary + */ +export interface AgentKnowledgeBaseSummary { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * State of the knowledge base; whether it is enabled or disabled + */ + knowledgeBaseState: KnowledgeBaseState | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; +} + +/** + * @public + * Create Agent Request + */ +export interface CreateAgentRequest { + /** + * @public + * Name for a resource. + */ + agentName: string | undefined; + + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Instruction for the agent. + */ + instruction?: string; + + /** + * @public + * ARN or name of a Bedrock model. + */ + foundationModel?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Max Session Time. + */ + idleSessionTTLInSeconds?: number; + + /** + * @public + * ARN of a IAM role. + */ + agentResourceRoleArn: string | undefined; + + /** + * @public + * A KMS key ARN + */ + customerEncryptionKeyArn?: string; + + /** + * @public + * A map of tag keys and values + */ + tags?: Record; + + /** + * @public + * Configuration for prompt override. + */ + promptOverrideConfiguration?: PromptOverrideConfiguration; +} + +/** + * @public + * Create Agent Response + */ +export interface CreateAgentResponse { + /** + * @public + * Contains the information of an agent + */ + agent: Agent | undefined; +} + +/** + * @public + * Delete Agent Request + */ +export interface DeleteAgentRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Skips checking if resource is in use when set to true. Defaults to false + */ + skipResourceInUseCheck?: boolean; +} + +/** + * @public + * Delete Agent Response + */ +export interface DeleteAgentResponse { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Schema Type for Action APIs. + */ + agentStatus: AgentStatus | undefined; +} + +/** + * @public + * Get Agent Request + */ +export interface GetAgentRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; +} + +/** + * @public + * Get Agent Response + */ +export interface GetAgentResponse { + /** + * @public + * Contains the information of an agent + */ + agent: Agent | undefined; +} + +/** + * @public + * List Agent Request + */ +export interface ListAgentsRequest { + /** + * @public + * Max Results. + */ + maxResults?: number; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * Summary of Agent. + */ +export interface AgentSummary { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Name for a resource. + */ + agentName: string | undefined; + + /** + * @public + * Schema Type for Action APIs. + */ + agentStatus: AgentStatus | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * Agent Version. + */ + latestAgentVersion?: string; +} + +/** + * @public + * List Agent Response + */ +export interface ListAgentsResponse { + /** + * @public + * List of AgentSummary. + */ + agentSummaries: AgentSummary[] | undefined; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * PrepareAgent Request + */ +export interface PrepareAgentRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; +} + +/** + * @public + * PrepareAgent Response + */ +export interface PrepareAgentResponse { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Schema Type for Action APIs. + */ + agentStatus: AgentStatus | undefined; + + /** + * @public + * Agent Version. + */ + agentVersion: string | undefined; + + /** + * @public + * Time Stamp. + */ + preparedAt: Date | undefined; +} + +/** + * @public + * Update Agent Request + */ +export interface UpdateAgentRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Name for a resource. + */ + agentName: string | undefined; + + /** + * @public + * Instruction for the agent. + */ + instruction?: string; + + /** + * @public + * ARN or name of a Bedrock model. + */ + foundationModel?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Max Session Time. + */ + idleSessionTTLInSeconds?: number; + + /** + * @public + * ARN of a IAM role. + */ + agentResourceRoleArn: string | undefined; + + /** + * @public + * A KMS key ARN + */ + customerEncryptionKeyArn?: string; + + /** + * @public + * Configuration for prompt override. + */ + promptOverrideConfiguration?: PromptOverrideConfiguration; +} + +/** + * @public + * Update Agent Response + */ +export interface UpdateAgentResponse { + /** + * @public + * Contains the information of an agent + */ + agent: Agent | undefined; +} + +/** + * @public + * Contains the information of an agent version. + */ +export interface AgentVersion { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Name for a resource. + */ + agentName: string | undefined; + + /** + * @public + * Arn representation of the Agent. + */ + agentArn: string | undefined; + + /** + * @public + * Numerical Agent Version. + */ + version: string | undefined; + + /** + * @public + * Instruction for the agent. + */ + instruction?: string; + + /** + * @public + * Schema Type for Action APIs. + */ + agentStatus: AgentStatus | undefined; + + /** + * @public + * ARN or name of a Bedrock model. + */ + foundationModel?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Max Session Time. + */ + idleSessionTTLInSeconds: number | undefined; + + /** + * @public + * ARN of a IAM role. + */ + agentResourceRoleArn: string | undefined; + + /** + * @public + * A KMS key ARN + */ + customerEncryptionKeyArn?: string; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * Failure Reasons for Error. + */ + failureReasons?: string[]; + + /** + * @public + * The recommended actions users can take to resolve an error in failureReasons. + */ + recommendedActions?: string[]; + + /** + * @public + * Configuration for prompt override. + */ + promptOverrideConfiguration?: PromptOverrideConfiguration; +} + +/** + * @public + * Summary of agent version. + */ +export interface AgentVersionSummary { + /** + * @public + * Name for a resource. + */ + agentName: string | undefined; + + /** + * @public + * Schema Type for Action APIs. + */ + agentStatus: AgentStatus | undefined; + + /** + * @public + * Agent Version. + */ + agentVersion: string | undefined; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; +} + +/** + * @public + * Create Agent Alias Request + */ +export interface CreateAgentAliasRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Name for a resource. + */ + agentAliasName: string | undefined; + + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Routing configuration for an Agent alias. + */ + routingConfiguration?: AgentAliasRoutingConfigurationListItem[]; + + /** + * @public + * A map of tag keys and values + */ + tags?: Record; +} + +/** + * @public + * Create Agent Alias Response + */ +export interface CreateAgentAliasResponse { + /** + * @public + * Contains the information of an agent alias + */ + agentAlias: AgentAlias | undefined; +} + +/** + * @public + * Delete Agent Alias Request + */ +export interface DeleteAgentAliasRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Id generated at the server side when an Agent Alias is created + */ + agentAliasId: string | undefined; +} + +/** + * @public + * Delete Agent Alias Response + */ +export interface DeleteAgentAliasResponse { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Id for an Agent Alias generated at the server side. + */ + agentAliasId: string | undefined; + + /** + * @public + * The statuses an Agent Alias can be in. + */ + agentAliasStatus: AgentAliasStatus | undefined; +} + +/** + * @public + * Get Agent Alias Request + */ +export interface GetAgentAliasRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Id generated at the server side when an Agent Alias is created + */ + agentAliasId: string | undefined; +} + +/** + * @public + * Get Agent Alias Response + */ +export interface GetAgentAliasResponse { + /** + * @public + * Contains the information of an agent alias + */ + agentAlias: AgentAlias | undefined; +} + +/** + * @public + * List Agent Aliases Request + */ +export interface ListAgentAliasesRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Max Results. + */ + maxResults?: number; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * List Agent Aliases Response + */ +export interface ListAgentAliasesResponse { + /** + * @public + * The list of summaries of all the aliases for an Agent. + */ + agentAliasSummaries: AgentAliasSummary[] | undefined; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * Update Agent Alias Request + */ +export interface UpdateAgentAliasRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Id generated at the server side when an Agent Alias is created + */ + agentAliasId: string | undefined; + + /** + * @public + * Name for a resource. + */ + agentAliasName: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Routing configuration for an Agent alias. + */ + routingConfiguration?: AgentAliasRoutingConfigurationListItem[]; +} + +/** + * @public + * Update Agent Alias Response + */ +export interface UpdateAgentAliasResponse { + /** + * @public + * Contains the information of an agent alias + */ + agentAlias: AgentAlias | undefined; +} + +/** + * @public + * Configures an S3 data source location. + */ +export interface S3DataSourceConfiguration { + /** + * @public + * A S3 bucket ARN + */ + bucketArn: string | undefined; + + /** + * @public + * A list of S3 prefixes. + */ + inclusionPrefixes?: string[]; +} + +/** + * @public + * @enum + */ +export const DataSourceType = { + S3: "S3", +} as const; + +/** + * @public + */ +export type DataSourceType = (typeof DataSourceType)[keyof typeof DataSourceType]; + +/** + * @public + * Specifies a raw data source location to ingest. + */ +export interface DataSourceConfiguration { + /** + * @public + * The type of the data source location. + */ + type: DataSourceType | undefined; + + /** + * @public + * Configures an S3 data source location. + */ + s3Configuration?: S3DataSourceConfiguration; +} + +/** + * @public + * Server-side encryption configuration. + */ +export interface ServerSideEncryptionConfiguration { + /** + * @public + * A KMS key ARN + */ + kmsKeyArn?: string; +} + +/** + * @public + * @enum + */ +export const ChunkingStrategy = { + FIXED_SIZE: "FIXED_SIZE", + NONE: "NONE", +} as const; + +/** + * @public + */ +export type ChunkingStrategy = (typeof ChunkingStrategy)[keyof typeof ChunkingStrategy]; + +/** + * @public + * Configures fixed size chunking strategy + */ +export interface FixedSizeChunkingConfiguration { + /** + * @public + * The maximum number of tokens per chunk. + */ + maxTokens: number | undefined; + + /** + * @public + * The overlap percentage between adjacent chunks. + */ + overlapPercentage: number | undefined; +} + +/** + * @public + * Configures chunking strategy + */ +export interface ChunkingConfiguration { + /** + * @public + * The type of chunking strategy + */ + chunkingStrategy: ChunkingStrategy | undefined; + + /** + * @public + * Configures fixed size chunking strategy + */ + fixedSizeChunkingConfiguration?: FixedSizeChunkingConfiguration; +} + +/** + * @public + * Configures ingestion for a vector knowledge base + */ +export interface VectorIngestionConfiguration { + /** + * @public + * Configures chunking strategy + */ + chunkingConfiguration?: ChunkingConfiguration; +} + +/** + * @public + */ +export interface CreateDataSourceRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Name for a resource. + */ + name: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Specifies a raw data source location to ingest. + */ + dataSourceConfiguration: DataSourceConfiguration | undefined; + + /** + * @public + * Server-side encryption configuration. + */ + serverSideEncryptionConfiguration?: ServerSideEncryptionConfiguration; + + /** + * @public + * Configures ingestion for a vector knowledge base + */ + vectorIngestionConfiguration?: VectorIngestionConfiguration; +} + +/** + * @public + * @enum + */ +export const DataSourceStatus = { + AVAILABLE: "AVAILABLE", + DELETING: "DELETING", +} as const; + +/** + * @public + */ +export type DataSourceStatus = (typeof DataSourceStatus)[keyof typeof DataSourceStatus]; + +/** + * @public + * Contains the information of a data source. + */ +export interface DataSource { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * Name for a resource. + */ + name: string | undefined; + + /** + * @public + * The status of a data source. + */ + status: DataSourceStatus | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Specifies a raw data source location to ingest. + */ + dataSourceConfiguration: DataSourceConfiguration | undefined; + + /** + * @public + * Server-side encryption configuration. + */ + serverSideEncryptionConfiguration?: ServerSideEncryptionConfiguration; + + /** + * @public + * Configures ingestion for a vector knowledge base + */ + vectorIngestionConfiguration?: VectorIngestionConfiguration; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; +} + +/** + * @public + */ +export interface CreateDataSourceResponse { + /** + * @public + * Contains the information of a data source. + */ + dataSource: DataSource | undefined; +} + +/** + * @public + */ +export interface DeleteDataSourceRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; +} + +/** + * @public + */ +export interface DeleteDataSourceResponse { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * The status of a data source. + */ + status: DataSourceStatus | undefined; +} + +/** + * @public + */ +export interface GetDataSourceRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; +} + +/** + * @public + */ +export interface GetDataSourceResponse { + /** + * @public + * Contains the information of a data source. + */ + dataSource: DataSource | undefined; +} + +/** + * @public + */ +export interface ListDataSourcesRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Max Results. + */ + maxResults?: number; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * Summary information of a data source. + */ +export interface DataSourceSummary { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * Name for a resource. + */ + name: string | undefined; + + /** + * @public + * The status of a data source. + */ + status: DataSourceStatus | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; +} + +/** + * @public + */ +export interface ListDataSourcesResponse { + /** + * @public + * list of data source summaries + */ + dataSourceSummaries: DataSourceSummary[] | undefined; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + */ +export interface UpdateDataSourceRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * Name for a resource. + */ + name: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * Specifies a raw data source location to ingest. + */ + dataSourceConfiguration: DataSourceConfiguration | undefined; + + /** + * @public + * Server-side encryption configuration. + */ + serverSideEncryptionConfiguration?: ServerSideEncryptionConfiguration; + + /** + * @public + * Configures ingestion for a vector knowledge base + */ + vectorIngestionConfiguration?: VectorIngestionConfiguration; +} + +/** + * @public + */ +export interface UpdateDataSourceResponse { + /** + * @public + * Contains the information of a data source. + */ + dataSource: DataSource | undefined; +} + +/** + * @public + */ +export interface GetIngestionJobRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + ingestionJobId: string | undefined; +} + +/** + * @public + * The document level statistics of an ingestion job + */ +export interface IngestionJobStatistics { + /** + * @public + * Number of scanned documents + */ + numberOfDocumentsScanned?: number; + + /** + * @public + * Number of indexed documents + */ + numberOfNewDocumentsIndexed?: number; + + /** + * @public + * Number of modified documents indexed + */ + numberOfModifiedDocumentsIndexed?: number; + + /** + * @public + * Number of deleted documents + */ + numberOfDocumentsDeleted?: number; + + /** + * @public + * Number of failed documents + */ + numberOfDocumentsFailed?: number; +} + +/** + * @public + * @enum + */ +export const IngestionJobStatus = { + COMPLETE: "COMPLETE", + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", + STARTING: "STARTING", +} as const; + +/** + * @public + */ +export type IngestionJobStatus = (typeof IngestionJobStatus)[keyof typeof IngestionJobStatus]; + +/** + * @public + * Contains the information of an ingestion job. + */ +export interface IngestionJob { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + ingestionJobId: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * The status of an ingestion job. + */ + status: IngestionJobStatus | undefined; + + /** + * @public + * The document level statistics of an ingestion job + */ + statistics?: IngestionJobStatistics; + + /** + * @public + * Failure Reasons for Error. + */ + failureReasons?: string[]; + + /** + * @public + * Time Stamp. + */ + startedAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; +} + +/** + * @public + */ +export interface GetIngestionJobResponse { + /** + * @public + * Contains the information of an ingestion job. + */ + ingestionJob: IngestionJob | undefined; +} + +/** + * @public + * @enum + */ +export const IngestionJobFilterAttribute = { + STATUS: "STATUS", +} as const; + +/** + * @public + */ +export type IngestionJobFilterAttribute = + (typeof IngestionJobFilterAttribute)[keyof typeof IngestionJobFilterAttribute]; + +/** + * @public + * @enum + */ +export const IngestionJobFilterOperator = { + EQ: "EQ", +} as const; + +/** + * @public + */ +export type IngestionJobFilterOperator = (typeof IngestionJobFilterOperator)[keyof typeof IngestionJobFilterOperator]; + +/** + * @public + * Filters the response returned by ListIngestionJobs operation. + */ +export interface IngestionJobFilter { + /** + * @public + * The name of the field to filter ingestion jobs. + */ + attribute: IngestionJobFilterAttribute | undefined; + + /** + * @public + * The operator used to filter ingestion jobs. + */ + operator: IngestionJobFilterOperator | undefined; + + /** + * @public + * The list of values used to filter ingestion jobs. + */ + values: string[] | undefined; +} + +/** + * @public + * @enum + */ +export const IngestionJobSortByAttribute = { + STARTED_AT: "STARTED_AT", + STATUS: "STATUS", +} as const; + +/** + * @public + */ +export type IngestionJobSortByAttribute = + (typeof IngestionJobSortByAttribute)[keyof typeof IngestionJobSortByAttribute]; + +/** + * @public + * @enum + */ +export const SortOrder = { + ASCENDING: "ASCENDING", + DESCENDING: "DESCENDING", +} as const; + +/** + * @public + */ +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]; + +/** + * @public + * Sorts the response returned by ListIngestionJobs operation. + */ +export interface IngestionJobSortBy { + /** + * @public + * The name of the field to sort ingestion jobs. + */ + attribute: IngestionJobSortByAttribute | undefined; + + /** + * @public + * Order to sort results by. + */ + order: SortOrder | undefined; +} + +/** + * @public + */ +export interface ListIngestionJobsRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * List of IngestionJobFilters + */ + filters?: IngestionJobFilter[]; + + /** + * @public + * Sorts the response returned by ListIngestionJobs operation. + */ + sortBy?: IngestionJobSortBy; + + /** + * @public + * Max Results. + */ + maxResults?: number; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * Summary information of an ingestion job. + */ +export interface IngestionJobSummary { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + ingestionJobId: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * The status of an ingestion job. + */ + status: IngestionJobStatus | undefined; + + /** + * @public + * Time Stamp. + */ + startedAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * The document level statistics of an ingestion job + */ + statistics?: IngestionJobStatistics; +} + +/** + * @public + */ +export interface ListIngestionJobsResponse { + /** + * @public + * List of IngestionJobSummaries + */ + ingestionJobSummaries: IngestionJobSummary[] | undefined; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + */ +export interface StartIngestionJobRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + dataSourceId: string | undefined; + + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Description of the Resource. + */ + description?: string; +} + +/** + * @public + */ +export interface StartIngestionJobResponse { + /** + * @public + * Contains the information of an ingestion job. + */ + ingestionJob: IngestionJob | undefined; +} + +/** + * @public + * Associate Agent Knowledge Base Request + */ +export interface AssociateAgentKnowledgeBaseRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Draft Version of the Agent. + */ + agentVersion: string | undefined; + + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description: string | undefined; + + /** + * @public + * State of the knowledge base; whether it is enabled or disabled + */ + knowledgeBaseState?: KnowledgeBaseState; +} + +/** + * @public + * Associate Agent Knowledge Base Response + */ +export interface AssociateAgentKnowledgeBaseResponse { + /** + * @public + * Contains the information of an Agent Knowledge Base. + */ + agentKnowledgeBase: AgentKnowledgeBase | undefined; +} + +/** + * @public + * @enum + */ +export const KnowledgeBaseType = { + VECTOR: "VECTOR", +} as const; + +/** + * @public + */ +export type KnowledgeBaseType = (typeof KnowledgeBaseType)[keyof typeof KnowledgeBaseType]; + +/** + * @public + * Configurations for a vector knowledge base. + */ +export interface VectorKnowledgeBaseConfiguration { + /** + * @public + * Arn of a Bedrock model. + */ + embeddingModelArn: string | undefined; +} + +/** + * @public + * Configures a bedrock knowledge base. + */ +export interface KnowledgeBaseConfiguration { + /** + * @public + * The type of a knowledge base. + */ + type: KnowledgeBaseType | undefined; + + /** + * @public + * Configurations for a vector knowledge base. + */ + vectorKnowledgeBaseConfiguration?: VectorKnowledgeBaseConfiguration; +} + +/** + * @public + * A mapping of Bedrock Knowledge Base fields to OpenSearch Serverless field names + */ +export interface OpenSearchServerlessFieldMapping { + /** + * @public + * Name of the field + */ + vectorField: string | undefined; + + /** + * @public + * Name of the field + */ + textField: string | undefined; + + /** + * @public + * Name of the field + */ + metadataField: string | undefined; +} + +/** + * @public + * Contains the configurations to use OpenSearch Serverless to store knowledge base data. + */ +export interface OpenSearchServerlessConfiguration { + /** + * @public + * Arn of an OpenSearch Serverless collection. + */ + collectionArn: string | undefined; + + /** + * @public + * Arn of an OpenSearch Serverless index. + */ + vectorIndexName: string | undefined; + + /** + * @public + * A mapping of Bedrock Knowledge Base fields to OpenSearch Serverless field names + */ + fieldMapping: OpenSearchServerlessFieldMapping | undefined; +} + +/** + * @public + * A mapping of Bedrock Knowledge Base fields to Pinecone field names + */ +export interface PineconeFieldMapping { + /** + * @public + * Name of the field + */ + textField: string | undefined; + + /** + * @public + * Name of the field + */ + metadataField: string | undefined; +} + +/** + * @public + * Contains the configurations to use Pinecone to store knowledge base data. + */ +export interface PineconeConfiguration { + /** + * @public + * Pinecone connection string + */ + connectionString: string | undefined; + + /** + * @public + * Arn of a SecretsManager Secret. + */ + credentialsSecretArn: string | undefined; + + /** + * @public + * Pinecone namespace + */ + namespace?: string; + + /** + * @public + * A mapping of Bedrock Knowledge Base fields to Pinecone field names + */ + fieldMapping: PineconeFieldMapping | undefined; +} + +/** + * @public + * A mapping of Bedrock Knowledge Base fields to Redis Cloud field names + */ +export interface RedisEnterpriseCloudFieldMapping { + /** + * @public + * Name of the field + */ + vectorField: string | undefined; + + /** + * @public + * Name of the field + */ + textField: string | undefined; + + /** + * @public + * Name of the field + */ + metadataField: string | undefined; +} + +/** + * @public + * Contains the configurations to use Redis Enterprise Cloud to store knowledge base data. + */ +export interface RedisEnterpriseCloudConfiguration { + /** + * @public + * Redis enterprise cloud endpoint + */ + endpoint: string | undefined; + + /** + * @public + * Name of a redis enterprise cloud index + */ + vectorIndexName: string | undefined; + + /** + * @public + * Arn of a SecretsManager Secret. + */ + credentialsSecretArn: string | undefined; + + /** + * @public + * A mapping of Bedrock Knowledge Base fields to Redis Cloud field names + */ + fieldMapping: RedisEnterpriseCloudFieldMapping | undefined; +} + +/** + * @public + * @enum + */ +export const KnowledgeBaseStorageType = { + OPENSEARCH_SERVERLESS: "OPENSEARCH_SERVERLESS", + PINECONE: "PINECONE", + REDIS_ENTERPRISE_CLOUD: "REDIS_ENTERPRISE_CLOUD", +} as const; + +/** + * @public + */ +export type KnowledgeBaseStorageType = (typeof KnowledgeBaseStorageType)[keyof typeof KnowledgeBaseStorageType]; + +/** + * @public + * Configures the physical storage of ingested data in a knowledge base. + */ +export interface StorageConfiguration { + /** + * @public + * The storage type of a knowledge base. + */ + type: KnowledgeBaseStorageType | undefined; + + /** + * @public + * Contains the configurations to use OpenSearch Serverless to store knowledge base data. + */ + opensearchServerlessConfiguration?: OpenSearchServerlessConfiguration; + + /** + * @public + * Contains the configurations to use Pinecone to store knowledge base data. + */ + pineconeConfiguration?: PineconeConfiguration; + + /** + * @public + * Contains the configurations to use Redis Enterprise Cloud to store knowledge base data. + */ + redisEnterpriseCloudConfiguration?: RedisEnterpriseCloudConfiguration; +} + +/** + * @public + */ +export interface CreateKnowledgeBaseRequest { + /** + * @public + * Client specified token used for idempotency checks + */ + clientToken?: string; + + /** + * @public + * Name for a resource. + */ + name: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * ARN of a IAM role. + */ + roleArn: string | undefined; + + /** + * @public + * Configures a bedrock knowledge base. + */ + knowledgeBaseConfiguration: KnowledgeBaseConfiguration | undefined; + + /** + * @public + * Configures the physical storage of ingested data in a knowledge base. + */ + storageConfiguration: StorageConfiguration | undefined; + + /** + * @public + * A map of tag keys and values + */ + tags?: Record; +} + +/** + * @public + * @enum + */ +export const KnowledgeBaseStatus = { + ACTIVE: "ACTIVE", + CREATING: "CREATING", + DELETING: "DELETING", + FAILED: "FAILED", + UPDATING: "UPDATING", +} as const; + +/** + * @public + */ +export type KnowledgeBaseStatus = (typeof KnowledgeBaseStatus)[keyof typeof KnowledgeBaseStatus]; + +/** + * @public + * Contains the information of a knowledge base. + */ +export interface KnowledgeBase { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Name for a resource. + */ + name: string | undefined; + + /** + * @public + * ARN of a KnowledgeBase + */ + knowledgeBaseArn: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * ARN of a IAM role. + */ + roleArn: string | undefined; + + /** + * @public + * Configures a bedrock knowledge base. + */ + knowledgeBaseConfiguration: KnowledgeBaseConfiguration | undefined; + + /** + * @public + * Configures the physical storage of ingested data in a knowledge base. + */ + storageConfiguration: StorageConfiguration | undefined; + + /** + * @public + * The status of a knowledge base. + */ + status: KnowledgeBaseStatus | undefined; + + /** + * @public + * Time Stamp. + */ + createdAt: Date | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; + + /** + * @public + * Failure Reasons for Error. + */ + failureReasons?: string[]; +} + +/** + * @public + */ +export interface CreateKnowledgeBaseResponse { + /** + * @public + * Contains the information of a knowledge base. + */ + knowledgeBase: KnowledgeBase | undefined; +} + +/** + * @public + */ +export interface DeleteKnowledgeBaseRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; +} + +/** + * @public + */ +export interface DeleteKnowledgeBaseResponse { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * The status of a knowledge base. + */ + status: KnowledgeBaseStatus | undefined; +} + +/** + * @public + * Disassociate Agent Knowledge Base Request + */ +export interface DisassociateAgentKnowledgeBaseRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Draft Version of the Agent. + */ + agentVersion: string | undefined; + + /** + * @public + * Id generated at the server side when a Knowledge Base is associated to an Agent + */ + knowledgeBaseId: string | undefined; +} + +/** + * @public + * Disassociate Agent Knowledge Base Response + */ +export interface DisassociateAgentKnowledgeBaseResponse {} + +/** + * @public + * Get Agent Knowledge Base Request + */ +export interface GetAgentKnowledgeBaseRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Version number generated when a version is created + */ + agentVersion: string | undefined; + + /** + * @public + * Id generated at the server side when a Knowledge Base is associated + */ + knowledgeBaseId: string | undefined; +} + +/** + * @public + * Get Agent Knowledge Base Response + */ +export interface GetAgentKnowledgeBaseResponse { + /** + * @public + * Contains the information of an Agent Knowledge Base. + */ + agentKnowledgeBase: AgentKnowledgeBase | undefined; +} + +/** + * @public + */ +export interface GetKnowledgeBaseRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; +} + +/** + * @public + */ +export interface GetKnowledgeBaseResponse { + /** + * @public + * Contains the information of a knowledge base. + */ + knowledgeBase: KnowledgeBase | undefined; +} + +/** + * @public + * List Agent Knowledge Bases Request + */ +export interface ListAgentKnowledgeBasesRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Version number generated when a version is created + */ + agentVersion: string | undefined; + + /** + * @public + * Max Results. + */ + maxResults?: number; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * List Agent Knowledge Bases Response + */ +export interface ListAgentKnowledgeBasesResponse { + /** + * @public + * List of Agent Knowledge Base Summaries + */ + agentKnowledgeBaseSummaries: AgentKnowledgeBaseSummary[] | undefined; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + */ +export interface ListKnowledgeBasesRequest { + /** + * @public + * Max Results. + */ + maxResults?: number; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * Summary information of a knowledge base. + */ +export interface KnowledgeBaseSummary { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Name for a resource. + */ + name: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * The status of a knowledge base. + */ + status: KnowledgeBaseStatus | undefined; + + /** + * @public + * Time Stamp. + */ + updatedAt: Date | undefined; +} + +/** + * @public + */ +export interface ListKnowledgeBasesResponse { + /** + * @public + * List of KnowledgeBaseSummaries + */ + knowledgeBaseSummaries: KnowledgeBaseSummary[] | undefined; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * Update Agent Knowledge Base Request + */ +export interface UpdateAgentKnowledgeBaseRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Draft Version of the Agent. + */ + agentVersion: string | undefined; + + /** + * @public + * Id generated at the server side when a Knowledge Base is associated to an Agent + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * State of the knowledge base; whether it is enabled or disabled + */ + knowledgeBaseState?: KnowledgeBaseState; +} + +/** + * @public + * Update Agent Knowledge Base Response + */ +export interface UpdateAgentKnowledgeBaseResponse { + /** + * @public + * Contains the information of an Agent Knowledge Base. + */ + agentKnowledgeBase: AgentKnowledgeBase | undefined; +} + +/** + * @public + */ +export interface UpdateKnowledgeBaseRequest { + /** + * @public + * Identifier for a resource. + */ + knowledgeBaseId: string | undefined; + + /** + * @public + * Name for a resource. + */ + name: string | undefined; + + /** + * @public + * Description of the Resource. + */ + description?: string; + + /** + * @public + * ARN of a IAM role. + */ + roleArn: string | undefined; + + /** + * @public + * Configures a bedrock knowledge base. + */ + knowledgeBaseConfiguration: KnowledgeBaseConfiguration | undefined; + + /** + * @public + * Configures the physical storage of ingested data in a knowledge base. + */ + storageConfiguration: StorageConfiguration | undefined; +} + +/** + * @public + */ +export interface UpdateKnowledgeBaseResponse { + /** + * @public + * Contains the information of a knowledge base. + */ + knowledgeBase: KnowledgeBase | undefined; +} + +/** + * @public + */ +export interface ListTagsForResourceRequest { + /** + * @public + * ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base] + */ + resourceArn: string | undefined; +} + +/** + * @public + */ +export interface ListTagsForResourceResponse { + /** + * @public + * A map of tag keys and values + */ + tags?: Record; +} + +/** + * @public + */ +export interface TagResourceRequest { + /** + * @public + * ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base] + */ + resourceArn: string | undefined; + + /** + * @public + * A map of tag keys and values + */ + tags: Record | undefined; +} + +/** + * @public + */ +export interface TagResourceResponse {} + +/** + * @public + */ +export interface UntagResourceRequest { + /** + * @public + * ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base] + */ + resourceArn: string | undefined; + + /** + * @public + * List of Tag Keys + */ + tagKeys: string[] | undefined; +} + +/** + * @public + */ +export interface UntagResourceResponse {} + +/** + * @public + * Delete Agent Version Request + */ +export interface DeleteAgentVersionRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Numerical Agent Version. + */ + agentVersion: string | undefined; + + /** + * @public + * Skips checking if resource is in use when set to true. Defaults to false + */ + skipResourceInUseCheck?: boolean; +} + +/** + * @public + * Delete Agent Version Response + */ +export interface DeleteAgentVersionResponse { + /** + * @public + * Identifier for a resource. + */ + agentId: string | undefined; + + /** + * @public + * Numerical Agent Version. + */ + agentVersion: string | undefined; + + /** + * @public + * Schema Type for Action APIs. + */ + agentStatus: AgentStatus | undefined; +} + +/** + * @public + * Get Agent Version Request + */ +export interface GetAgentVersionRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Numerical Agent Version. + */ + agentVersion: string | undefined; +} + +/** + * @public + * Get Agent Version Response + */ +export interface GetAgentVersionResponse { + /** + * @public + * Contains the information of an agent version. + */ + agentVersion: AgentVersion | undefined; +} + +/** + * @public + * List Agent Versions Request + */ +export interface ListAgentVersionsRequest { + /** + * @public + * Id generated at the server side when an Agent is created + */ + agentId: string | undefined; + + /** + * @public + * Max Results. + */ + maxResults?: number; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @public + * List Agent Versions Response + */ +export interface ListAgentVersionsResponse { + /** + * @public + * List of AgentVersionSummary. + */ + agentVersionSummaries: AgentVersionSummary[] | undefined; + + /** + * @public + * Opaque continuation token of previous paginated response. + */ + nextToken?: string; +} + +/** + * @internal + */ +export const APISchemaFilterSensitiveLog = (obj: APISchema): any => { + if (obj.s3 !== undefined) return { s3: obj.s3 }; + if (obj.payload !== undefined) return { payload: SENSITIVE_STRING }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @internal + */ +export const CreateAgentActionGroupRequestFilterSensitiveLog = (obj: CreateAgentActionGroupRequest): any => ({ + ...obj, + ...(obj.actionGroupExecutor && { actionGroupExecutor: obj.actionGroupExecutor }), + ...(obj.apiSchema && { apiSchema: APISchemaFilterSensitiveLog(obj.apiSchema) }), +}); + +/** + * @internal + */ +export const AgentActionGroupFilterSensitiveLog = (obj: AgentActionGroup): any => ({ + ...obj, + ...(obj.actionGroupExecutor && { actionGroupExecutor: obj.actionGroupExecutor }), + ...(obj.apiSchema && { apiSchema: APISchemaFilterSensitiveLog(obj.apiSchema) }), +}); + +/** + * @internal + */ +export const CreateAgentActionGroupResponseFilterSensitiveLog = (obj: CreateAgentActionGroupResponse): any => ({ + ...obj, + ...(obj.agentActionGroup && { agentActionGroup: AgentActionGroupFilterSensitiveLog(obj.agentActionGroup) }), +}); + +/** + * @internal + */ +export const GetAgentActionGroupResponseFilterSensitiveLog = (obj: GetAgentActionGroupResponse): any => ({ + ...obj, + ...(obj.agentActionGroup && { agentActionGroup: AgentActionGroupFilterSensitiveLog(obj.agentActionGroup) }), +}); + +/** + * @internal + */ +export const UpdateAgentActionGroupRequestFilterSensitiveLog = (obj: UpdateAgentActionGroupRequest): any => ({ + ...obj, + ...(obj.actionGroupExecutor && { actionGroupExecutor: obj.actionGroupExecutor }), + ...(obj.apiSchema && { apiSchema: APISchemaFilterSensitiveLog(obj.apiSchema) }), +}); + +/** + * @internal + */ +export const UpdateAgentActionGroupResponseFilterSensitiveLog = (obj: UpdateAgentActionGroupResponse): any => ({ + ...obj, + ...(obj.agentActionGroup && { agentActionGroup: AgentActionGroupFilterSensitiveLog(obj.agentActionGroup) }), +}); + +/** + * @internal + */ +export const PromptOverrideConfigurationFilterSensitiveLog = (obj: PromptOverrideConfiguration): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const AgentFilterSensitiveLog = (obj: Agent): any => ({ + ...obj, + ...(obj.instruction && { instruction: SENSITIVE_STRING }), + ...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const CreateAgentRequestFilterSensitiveLog = (obj: CreateAgentRequest): any => ({ + ...obj, + ...(obj.instruction && { instruction: SENSITIVE_STRING }), + ...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const CreateAgentResponseFilterSensitiveLog = (obj: CreateAgentResponse): any => ({ + ...obj, + ...(obj.agent && { agent: AgentFilterSensitiveLog(obj.agent) }), +}); + +/** + * @internal + */ +export const GetAgentResponseFilterSensitiveLog = (obj: GetAgentResponse): any => ({ + ...obj, + ...(obj.agent && { agent: AgentFilterSensitiveLog(obj.agent) }), +}); + +/** + * @internal + */ +export const UpdateAgentRequestFilterSensitiveLog = (obj: UpdateAgentRequest): any => ({ + ...obj, + ...(obj.instruction && { instruction: SENSITIVE_STRING }), + ...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const UpdateAgentResponseFilterSensitiveLog = (obj: UpdateAgentResponse): any => ({ + ...obj, + ...(obj.agent && { agent: AgentFilterSensitiveLog(obj.agent) }), +}); + +/** + * @internal + */ +export const AgentVersionFilterSensitiveLog = (obj: AgentVersion): any => ({ + ...obj, + ...(obj.instruction && { instruction: SENSITIVE_STRING }), + ...(obj.promptOverrideConfiguration && { promptOverrideConfiguration: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const GetAgentVersionResponseFilterSensitiveLog = (obj: GetAgentVersionResponse): any => ({ + ...obj, + ...(obj.agentVersion && { agentVersion: AgentVersionFilterSensitiveLog(obj.agentVersion) }), +}); diff --git a/clients/client-bedrock-agent/src/pagination/Interfaces.ts b/clients/client-bedrock-agent/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..a50990820bbf --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/Interfaces.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; + +/** + * @public + */ +export interface BedrockAgentPaginationConfiguration extends PaginationConfiguration { + client: BedrockAgentClient; +} diff --git a/clients/client-bedrock-agent/src/pagination/ListAgentActionGroupsPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListAgentActionGroupsPaginator.ts new file mode 100644 index 000000000000..56f9c6afee61 --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListAgentActionGroupsPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { + ListAgentActionGroupsCommand, + ListAgentActionGroupsCommandInput, + ListAgentActionGroupsCommandOutput, +} from "../commands/ListAgentActionGroupsCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BedrockAgentClient, + input: ListAgentActionGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAgentActionGroupsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListAgentActionGroups( + config: BedrockAgentPaginationConfiguration, + input: ListAgentActionGroupsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListAgentActionGroupsCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof BedrockAgentClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected BedrockAgent | BedrockAgentClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-bedrock-agent/src/pagination/ListAgentAliasesPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListAgentAliasesPaginator.ts new file mode 100644 index 000000000000..9b6093caf33d --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListAgentAliasesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { + ListAgentAliasesCommand, + ListAgentAliasesCommandInput, + ListAgentAliasesCommandOutput, +} from "../commands/ListAgentAliasesCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BedrockAgentClient, + input: ListAgentAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAgentAliasesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListAgentAliases( + config: BedrockAgentPaginationConfiguration, + input: ListAgentAliasesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListAgentAliasesCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof BedrockAgentClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected BedrockAgent | BedrockAgentClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-bedrock-agent/src/pagination/ListAgentKnowledgeBasesPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListAgentKnowledgeBasesPaginator.ts new file mode 100644 index 000000000000..cda5c35d8337 --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListAgentKnowledgeBasesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { + ListAgentKnowledgeBasesCommand, + ListAgentKnowledgeBasesCommandInput, + ListAgentKnowledgeBasesCommandOutput, +} from "../commands/ListAgentKnowledgeBasesCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BedrockAgentClient, + input: ListAgentKnowledgeBasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAgentKnowledgeBasesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListAgentKnowledgeBases( + config: BedrockAgentPaginationConfiguration, + input: ListAgentKnowledgeBasesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListAgentKnowledgeBasesCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof BedrockAgentClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected BedrockAgent | BedrockAgentClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-bedrock-agent/src/pagination/ListAgentVersionsPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListAgentVersionsPaginator.ts new file mode 100644 index 000000000000..fe13112b91a2 --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListAgentVersionsPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { + ListAgentVersionsCommand, + ListAgentVersionsCommandInput, + ListAgentVersionsCommandOutput, +} from "../commands/ListAgentVersionsCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BedrockAgentClient, + input: ListAgentVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAgentVersionsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListAgentVersions( + config: BedrockAgentPaginationConfiguration, + input: ListAgentVersionsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListAgentVersionsCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof BedrockAgentClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected BedrockAgent | BedrockAgentClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-bedrock-agent/src/pagination/ListAgentsPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListAgentsPaginator.ts new file mode 100644 index 000000000000..f08a2e07f698 --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListAgentsPaginator.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { ListAgentsCommand, ListAgentsCommandInput, ListAgentsCommandOutput } from "../commands/ListAgentsCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BedrockAgentClient, + input: ListAgentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAgentsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListAgents( + config: BedrockAgentPaginationConfiguration, + input: ListAgentsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListAgentsCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof BedrockAgentClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected BedrockAgent | BedrockAgentClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-bedrock-agent/src/pagination/ListDataSourcesPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListDataSourcesPaginator.ts new file mode 100644 index 000000000000..28b121a5554f --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListDataSourcesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { + ListDataSourcesCommand, + ListDataSourcesCommandInput, + ListDataSourcesCommandOutput, +} from "../commands/ListDataSourcesCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BedrockAgentClient, + input: ListDataSourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDataSourcesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListDataSources( + config: BedrockAgentPaginationConfiguration, + input: ListDataSourcesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListDataSourcesCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof BedrockAgentClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected BedrockAgent | BedrockAgentClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-bedrock-agent/src/pagination/ListIngestionJobsPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListIngestionJobsPaginator.ts new file mode 100644 index 000000000000..72ed06d64b60 --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListIngestionJobsPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { + ListIngestionJobsCommand, + ListIngestionJobsCommandInput, + ListIngestionJobsCommandOutput, +} from "../commands/ListIngestionJobsCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BedrockAgentClient, + input: ListIngestionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListIngestionJobsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListIngestionJobs( + config: BedrockAgentPaginationConfiguration, + input: ListIngestionJobsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListIngestionJobsCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof BedrockAgentClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected BedrockAgent | BedrockAgentClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-bedrock-agent/src/pagination/ListKnowledgeBasesPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListKnowledgeBasesPaginator.ts new file mode 100644 index 000000000000..6a4900cab037 --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListKnowledgeBasesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { + ListKnowledgeBasesCommand, + ListKnowledgeBasesCommandInput, + ListKnowledgeBasesCommandOutput, +} from "../commands/ListKnowledgeBasesCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: BedrockAgentClient, + input: ListKnowledgeBasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListKnowledgeBasesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListKnowledgeBases( + config: BedrockAgentPaginationConfiguration, + input: ListKnowledgeBasesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListKnowledgeBasesCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof BedrockAgentClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected BedrockAgent | BedrockAgentClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-bedrock-agent/src/pagination/index.ts b/clients/client-bedrock-agent/src/pagination/index.ts new file mode 100644 index 000000000000..49a20f0da691 --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/index.ts @@ -0,0 +1,10 @@ +// smithy-typescript generated code +export * from "./Interfaces"; +export * from "./ListAgentActionGroupsPaginator"; +export * from "./ListAgentAliasesPaginator"; +export * from "./ListAgentKnowledgeBasesPaginator"; +export * from "./ListAgentVersionsPaginator"; +export * from "./ListAgentsPaginator"; +export * from "./ListDataSourcesPaginator"; +export * from "./ListIngestionJobsPaginator"; +export * from "./ListKnowledgeBasesPaginator"; diff --git a/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts new file mode 100644 index 000000000000..18546727e7f6 --- /dev/null +++ b/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts @@ -0,0 +1,4922 @@ +// smithy-typescript generated code +import { awsExpectUnion as __expectUnion } from "@aws-sdk/core"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { + _json, + collectBody, + decorateServiceException as __decorateServiceException, + expectInt32 as __expectInt32, + expectNonNull as __expectNonNull, + expectObject as __expectObject, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + limitedParseFloat32 as __limitedParseFloat32, + map, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + resolvedPath as __resolvedPath, + serializeFloat as __serializeFloat, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { + AssociateAgentKnowledgeBaseCommandInput, + AssociateAgentKnowledgeBaseCommandOutput, +} from "../commands/AssociateAgentKnowledgeBaseCommand"; +import { + CreateAgentActionGroupCommandInput, + CreateAgentActionGroupCommandOutput, +} from "../commands/CreateAgentActionGroupCommand"; +import { CreateAgentAliasCommandInput, CreateAgentAliasCommandOutput } from "../commands/CreateAgentAliasCommand"; +import { CreateAgentCommandInput, CreateAgentCommandOutput } from "../commands/CreateAgentCommand"; +import { CreateDataSourceCommandInput, CreateDataSourceCommandOutput } from "../commands/CreateDataSourceCommand"; +import { + CreateKnowledgeBaseCommandInput, + CreateKnowledgeBaseCommandOutput, +} from "../commands/CreateKnowledgeBaseCommand"; +import { + DeleteAgentActionGroupCommandInput, + DeleteAgentActionGroupCommandOutput, +} from "../commands/DeleteAgentActionGroupCommand"; +import { DeleteAgentAliasCommandInput, DeleteAgentAliasCommandOutput } from "../commands/DeleteAgentAliasCommand"; +import { DeleteAgentCommandInput, DeleteAgentCommandOutput } from "../commands/DeleteAgentCommand"; +import { DeleteAgentVersionCommandInput, DeleteAgentVersionCommandOutput } from "../commands/DeleteAgentVersionCommand"; +import { DeleteDataSourceCommandInput, DeleteDataSourceCommandOutput } from "../commands/DeleteDataSourceCommand"; +import { + DeleteKnowledgeBaseCommandInput, + DeleteKnowledgeBaseCommandOutput, +} from "../commands/DeleteKnowledgeBaseCommand"; +import { + DisassociateAgentKnowledgeBaseCommandInput, + DisassociateAgentKnowledgeBaseCommandOutput, +} from "../commands/DisassociateAgentKnowledgeBaseCommand"; +import { + GetAgentActionGroupCommandInput, + GetAgentActionGroupCommandOutput, +} from "../commands/GetAgentActionGroupCommand"; +import { GetAgentAliasCommandInput, GetAgentAliasCommandOutput } from "../commands/GetAgentAliasCommand"; +import { GetAgentCommandInput, GetAgentCommandOutput } from "../commands/GetAgentCommand"; +import { + GetAgentKnowledgeBaseCommandInput, + GetAgentKnowledgeBaseCommandOutput, +} from "../commands/GetAgentKnowledgeBaseCommand"; +import { GetAgentVersionCommandInput, GetAgentVersionCommandOutput } from "../commands/GetAgentVersionCommand"; +import { GetDataSourceCommandInput, GetDataSourceCommandOutput } from "../commands/GetDataSourceCommand"; +import { GetIngestionJobCommandInput, GetIngestionJobCommandOutput } from "../commands/GetIngestionJobCommand"; +import { GetKnowledgeBaseCommandInput, GetKnowledgeBaseCommandOutput } from "../commands/GetKnowledgeBaseCommand"; +import { + ListAgentActionGroupsCommandInput, + ListAgentActionGroupsCommandOutput, +} from "../commands/ListAgentActionGroupsCommand"; +import { ListAgentAliasesCommandInput, ListAgentAliasesCommandOutput } from "../commands/ListAgentAliasesCommand"; +import { + ListAgentKnowledgeBasesCommandInput, + ListAgentKnowledgeBasesCommandOutput, +} from "../commands/ListAgentKnowledgeBasesCommand"; +import { ListAgentsCommandInput, ListAgentsCommandOutput } from "../commands/ListAgentsCommand"; +import { ListAgentVersionsCommandInput, ListAgentVersionsCommandOutput } from "../commands/ListAgentVersionsCommand"; +import { ListDataSourcesCommandInput, ListDataSourcesCommandOutput } from "../commands/ListDataSourcesCommand"; +import { ListIngestionJobsCommandInput, ListIngestionJobsCommandOutput } from "../commands/ListIngestionJobsCommand"; +import { ListKnowledgeBasesCommandInput, ListKnowledgeBasesCommandOutput } from "../commands/ListKnowledgeBasesCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { PrepareAgentCommandInput, PrepareAgentCommandOutput } from "../commands/PrepareAgentCommand"; +import { StartIngestionJobCommandInput, StartIngestionJobCommandOutput } from "../commands/StartIngestionJobCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { + UpdateAgentActionGroupCommandInput, + UpdateAgentActionGroupCommandOutput, +} from "../commands/UpdateAgentActionGroupCommand"; +import { UpdateAgentAliasCommandInput, UpdateAgentAliasCommandOutput } from "../commands/UpdateAgentAliasCommand"; +import { UpdateAgentCommandInput, UpdateAgentCommandOutput } from "../commands/UpdateAgentCommand"; +import { + UpdateAgentKnowledgeBaseCommandInput, + UpdateAgentKnowledgeBaseCommandOutput, +} from "../commands/UpdateAgentKnowledgeBaseCommand"; +import { UpdateDataSourceCommandInput, UpdateDataSourceCommandOutput } from "../commands/UpdateDataSourceCommand"; +import { + UpdateKnowledgeBaseCommandInput, + UpdateKnowledgeBaseCommandOutput, +} from "../commands/UpdateKnowledgeBaseCommand"; +import { BedrockAgentServiceException as __BaseException } from "../models/BedrockAgentServiceException"; +import { + AccessDeniedException, + ActionGroupExecutor, + ActionGroupSummary, + Agent, + AgentActionGroup, + AgentAlias, + AgentAliasHistoryEvent, + AgentAliasRoutingConfigurationListItem, + AgentAliasSummary, + AgentKnowledgeBase, + AgentKnowledgeBaseSummary, + AgentSummary, + AgentVersion, + AgentVersionSummary, + APISchema, + ChunkingConfiguration, + ConflictException, + DataSource, + DataSourceConfiguration, + DataSourceSummary, + FixedSizeChunkingConfiguration, + InferenceConfiguration, + IngestionJob, + IngestionJobFilter, + IngestionJobSortBy, + IngestionJobSummary, + InternalServerException, + KnowledgeBase, + KnowledgeBaseConfiguration, + KnowledgeBaseSummary, + OpenSearchServerlessConfiguration, + OpenSearchServerlessFieldMapping, + PineconeConfiguration, + PineconeFieldMapping, + PromptConfiguration, + PromptOverrideConfiguration, + RedisEnterpriseCloudConfiguration, + RedisEnterpriseCloudFieldMapping, + ResourceNotFoundException, + S3DataSourceConfiguration, + S3Identifier, + ServerSideEncryptionConfiguration, + ServiceQuotaExceededException, + StorageConfiguration, + ThrottlingException, + ValidationException, + VectorIngestionConfiguration, + VectorKnowledgeBaseConfiguration, +} from "../models/models_0"; + +/** + * serializeAws_restJson1AssociateAgentKnowledgeBaseCommand + */ +export const se_AssociateAgentKnowledgeBaseCommand = async ( + input: AssociateAgentKnowledgeBaseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + description: [], + knowledgeBaseId: [], + knowledgeBaseState: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1CreateAgentCommand + */ +export const se_CreateAgentCommand = async ( + input: CreateAgentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents"; + let body: any; + body = JSON.stringify( + take(input, { + agentName: [], + agentResourceRoleArn: [], + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + customerEncryptionKeyArn: [], + description: [], + foundationModel: [], + idleSessionTTLInSeconds: [], + instruction: [], + promptOverrideConfiguration: (_) => se_PromptOverrideConfiguration(_, context), + tags: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1CreateAgentActionGroupCommand + */ +export const se_CreateAgentActionGroupCommand = async ( + input: CreateAgentActionGroupCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/actiongroups"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + actionGroupExecutor: (_) => _json(_), + actionGroupName: [], + actionGroupState: [], + apiSchema: (_) => _json(_), + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + description: [], + parentActionGroupSignature: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1CreateAgentAliasCommand + */ +export const se_CreateAgentAliasCommand = async ( + input: CreateAgentAliasCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents/{agentId}/agentaliases"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + let body: any; + body = JSON.stringify( + take(input, { + agentAliasName: [], + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + description: [], + routingConfiguration: (_) => _json(_), + tags: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1CreateDataSourceCommand + */ +export const se_CreateDataSourceCommand = async ( + input: CreateDataSourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/knowledgebases/{knowledgeBaseId}/datasources"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + dataSourceConfiguration: (_) => _json(_), + description: [], + name: [], + serverSideEncryptionConfiguration: (_) => _json(_), + vectorIngestionConfiguration: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1CreateKnowledgeBaseCommand + */ +export const se_CreateKnowledgeBaseCommand = async ( + input: CreateKnowledgeBaseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgebases"; + let body: any; + body = JSON.stringify( + take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + description: [], + knowledgeBaseConfiguration: (_) => _json(_), + name: [], + roleArn: [], + storageConfiguration: (_) => _json(_), + tags: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1DeleteAgentCommand + */ +export const se_DeleteAgentCommand = async ( + input: DeleteAgentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents/{agentId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + const query: any = map({ + skipResourceInUseCheck: [ + () => input.skipResourceInUseCheck !== void 0, + () => input.skipResourceInUseCheck!.toString(), + ], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1DeleteAgentActionGroupCommand + */ +export const se_DeleteAgentActionGroupCommand = async ( + input: DeleteAgentActionGroupCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "actionGroupId", + () => input.actionGroupId!, + "{actionGroupId}", + false + ); + const query: any = map({ + skipResourceInUseCheck: [ + () => input.skipResourceInUseCheck !== void 0, + () => input.skipResourceInUseCheck!.toString(), + ], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1DeleteAgentAliasCommand + */ +export const se_DeleteAgentAliasCommand = async ( + input: DeleteAgentAliasCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentaliases/{agentAliasId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentAliasId", + () => input.agentAliasId!, + "{agentAliasId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1DeleteAgentVersionCommand + */ +export const se_DeleteAgentVersionCommand = async ( + input: DeleteAgentVersionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + const query: any = map({ + skipResourceInUseCheck: [ + () => input.skipResourceInUseCheck !== void 0, + () => input.skipResourceInUseCheck!.toString(), + ], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1DeleteDataSourceCommand + */ +export const se_DeleteDataSourceCommand = async ( + input: DeleteDataSourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "dataSourceId", + () => input.dataSourceId!, + "{dataSourceId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1DeleteKnowledgeBaseCommand + */ +export const se_DeleteKnowledgeBaseCommand = async ( + input: DeleteKnowledgeBaseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgebases/{knowledgeBaseId}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1DisassociateAgentKnowledgeBaseCommand + */ +export const se_DisassociateAgentKnowledgeBaseCommand = async ( + input: DisassociateAgentKnowledgeBaseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetAgentCommand + */ +export const se_GetAgentCommand = async ( + input: GetAgentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents/{agentId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetAgentActionGroupCommand + */ +export const se_GetAgentActionGroupCommand = async ( + input: GetAgentActionGroupCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "actionGroupId", + () => input.actionGroupId!, + "{actionGroupId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetAgentAliasCommand + */ +export const se_GetAgentAliasCommand = async ( + input: GetAgentAliasCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentaliases/{agentAliasId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentAliasId", + () => input.agentAliasId!, + "{agentAliasId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetAgentKnowledgeBaseCommand + */ +export const se_GetAgentKnowledgeBaseCommand = async ( + input: GetAgentKnowledgeBaseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetAgentVersionCommand + */ +export const se_GetAgentVersionCommand = async ( + input: GetAgentVersionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetDataSourceCommand + */ +export const se_GetDataSourceCommand = async ( + input: GetDataSourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "dataSourceId", + () => input.dataSourceId!, + "{dataSourceId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetIngestionJobCommand + */ +export const se_GetIngestionJobCommand = async ( + input: GetIngestionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "dataSourceId", + () => input.dataSourceId!, + "{dataSourceId}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "ingestionJobId", + () => input.ingestionJobId!, + "{ingestionJobId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetKnowledgeBaseCommand + */ +export const se_GetKnowledgeBaseCommand = async ( + input: GetKnowledgeBaseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgebases/{knowledgeBaseId}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListAgentActionGroupsCommand + */ +export const se_ListAgentActionGroupsCommand = async ( + input: ListAgentActionGroupsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/actiongroups"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListAgentAliasesCommand + */ +export const se_ListAgentAliasesCommand = async ( + input: ListAgentAliasesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents/{agentId}/agentaliases"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + let body: any; + body = JSON.stringify( + take(input, { + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListAgentKnowledgeBasesCommand + */ +export const se_ListAgentKnowledgeBasesCommand = async ( + input: ListAgentKnowledgeBasesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListAgentsCommand + */ +export const se_ListAgentsCommand = async ( + input: ListAgentsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents"; + let body: any; + body = JSON.stringify( + take(input, { + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListAgentVersionsCommand + */ +export const se_ListAgentVersionsCommand = async ( + input: ListAgentVersionsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents/{agentId}/agentversions"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + let body: any; + body = JSON.stringify( + take(input, { + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListDataSourcesCommand + */ +export const se_ListDataSourcesCommand = async ( + input: ListDataSourcesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/knowledgebases/{knowledgeBaseId}/datasources"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListIngestionJobsCommand + */ +export const se_ListIngestionJobsCommand = async ( + input: ListIngestionJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "dataSourceId", + () => input.dataSourceId!, + "{dataSourceId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + filters: (_) => _json(_), + maxResults: [], + nextToken: [], + sortBy: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListKnowledgeBasesCommand + */ +export const se_ListKnowledgeBasesCommand = async ( + input: ListKnowledgeBasesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgebases"; + let body: any; + body = JSON.stringify( + take(input, { + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListTagsForResourceCommand + */ +export const se_ListTagsForResourceCommand = async ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}"; + resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1PrepareAgentCommand + */ +export const se_PrepareAgentCommand = async ( + input: PrepareAgentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents/{agentId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1StartIngestionJobCommand + */ +export const se_StartIngestionJobCommand = async ( + input: StartIngestionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "dataSourceId", + () => input.dataSourceId!, + "{dataSourceId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + description: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1TagResourceCommand + */ +export const se_TagResourceCommand = async ( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}"; + resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false); + let body: any; + body = JSON.stringify( + take(input, { + tags: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1UntagResourceCommand + */ +export const se_UntagResourceCommand = async ( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}"; + resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn!, "{resourceArn}", false); + const query: any = map({ + tagKeys: [ + __expectNonNull(input.tagKeys, `tagKeys`) != null, + () => (input.tagKeys! || []).map((_entry) => _entry as any), + ], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1UpdateAgentCommand + */ +export const se_UpdateAgentCommand = async ( + input: UpdateAgentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/agents/{agentId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + let body: any; + body = JSON.stringify( + take(input, { + agentName: [], + agentResourceRoleArn: [], + customerEncryptionKeyArn: [], + description: [], + foundationModel: [], + idleSessionTTLInSeconds: [], + instruction: [], + promptOverrideConfiguration: (_) => se_PromptOverrideConfiguration(_, context), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1UpdateAgentActionGroupCommand + */ +export const se_UpdateAgentActionGroupCommand = async ( + input: UpdateAgentActionGroupCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "actionGroupId", + () => input.actionGroupId!, + "{actionGroupId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + actionGroupExecutor: (_) => _json(_), + actionGroupName: [], + actionGroupState: [], + apiSchema: (_) => _json(_), + description: [], + parentActionGroupSignature: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1UpdateAgentAliasCommand + */ +export const se_UpdateAgentAliasCommand = async ( + input: UpdateAgentAliasCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentaliases/{agentAliasId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentAliasId", + () => input.agentAliasId!, + "{agentAliasId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + agentAliasName: [], + description: [], + routingConfiguration: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1UpdateAgentKnowledgeBaseCommand + */ +export const se_UpdateAgentKnowledgeBaseCommand = async ( + input: UpdateAgentKnowledgeBaseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "agentVersion", + () => input.agentVersion!, + "{agentVersion}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + description: [], + knowledgeBaseState: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1UpdateDataSourceCommand + */ +export const se_UpdateDataSourceCommand = async ( + input: UpdateDataSourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "dataSourceId", + () => input.dataSourceId!, + "{dataSourceId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + dataSourceConfiguration: (_) => _json(_), + description: [], + name: [], + serverSideEncryptionConfiguration: (_) => _json(_), + vectorIngestionConfiguration: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1UpdateKnowledgeBaseCommand + */ +export const se_UpdateKnowledgeBaseCommand = async ( + input: UpdateKnowledgeBaseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgebases/{knowledgeBaseId}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "knowledgeBaseId", + () => input.knowledgeBaseId!, + "{knowledgeBaseId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + description: [], + knowledgeBaseConfiguration: (_) => _json(_), + name: [], + roleArn: [], + storageConfiguration: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * deserializeAws_restJson1AssociateAgentKnowledgeBaseCommand + */ +export const de_AssociateAgentKnowledgeBaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_AssociateAgentKnowledgeBaseCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentKnowledgeBase: (_) => de_AgentKnowledgeBase(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1AssociateAgentKnowledgeBaseCommandError + */ +const de_AssociateAgentKnowledgeBaseCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1CreateAgentCommand + */ +export const de_CreateAgentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CreateAgentCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agent: (_) => de_Agent(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateAgentCommandError + */ +const de_CreateAgentCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1CreateAgentActionGroupCommand + */ +export const de_CreateAgentActionGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CreateAgentActionGroupCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentActionGroup: (_) => de_AgentActionGroup(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateAgentActionGroupCommandError + */ +const de_CreateAgentActionGroupCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1CreateAgentAliasCommand + */ +export const de_CreateAgentAliasCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CreateAgentAliasCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentAlias: (_) => de_AgentAlias(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateAgentAliasCommandError + */ +const de_CreateAgentAliasCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1CreateDataSourceCommand + */ +export const de_CreateDataSourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CreateDataSourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dataSource: (_) => de_DataSource(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateDataSourceCommandError + */ +const de_CreateDataSourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1CreateKnowledgeBaseCommand + */ +export const de_CreateKnowledgeBaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CreateKnowledgeBaseCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + knowledgeBase: (_) => de_KnowledgeBase(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateKnowledgeBaseCommandError + */ +const de_CreateKnowledgeBaseCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DeleteAgentCommand + */ +export const de_DeleteAgentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_DeleteAgentCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentId: __expectString, + agentStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteAgentCommandError + */ +const de_DeleteAgentCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DeleteAgentActionGroupCommand + */ +export const de_DeleteAgentActionGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_DeleteAgentActionGroupCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteAgentActionGroupCommandError + */ +const de_DeleteAgentActionGroupCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DeleteAgentAliasCommand + */ +export const de_DeleteAgentAliasCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_DeleteAgentAliasCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentAliasId: __expectString, + agentAliasStatus: __expectString, + agentId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteAgentAliasCommandError + */ +const de_DeleteAgentAliasCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DeleteAgentVersionCommand + */ +export const de_DeleteAgentVersionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_DeleteAgentVersionCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentId: __expectString, + agentStatus: __expectString, + agentVersion: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteAgentVersionCommandError + */ +const de_DeleteAgentVersionCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DeleteDataSourceCommand + */ +export const de_DeleteDataSourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_DeleteDataSourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dataSourceId: __expectString, + knowledgeBaseId: __expectString, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteDataSourceCommandError + */ +const de_DeleteDataSourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DeleteKnowledgeBaseCommand + */ +export const de_DeleteKnowledgeBaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_DeleteKnowledgeBaseCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + knowledgeBaseId: __expectString, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteKnowledgeBaseCommandError + */ +const de_DeleteKnowledgeBaseCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DisassociateAgentKnowledgeBaseCommand + */ +export const de_DisassociateAgentKnowledgeBaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_DisassociateAgentKnowledgeBaseCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DisassociateAgentKnowledgeBaseCommandError + */ +const de_DisassociateAgentKnowledgeBaseCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetAgentCommand + */ +export const de_GetAgentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetAgentCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agent: (_) => de_Agent(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetAgentCommandError + */ +const de_GetAgentCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetAgentActionGroupCommand + */ +export const de_GetAgentActionGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetAgentActionGroupCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentActionGroup: (_) => de_AgentActionGroup(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetAgentActionGroupCommandError + */ +const de_GetAgentActionGroupCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetAgentAliasCommand + */ +export const de_GetAgentAliasCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetAgentAliasCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentAlias: (_) => de_AgentAlias(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetAgentAliasCommandError + */ +const de_GetAgentAliasCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetAgentKnowledgeBaseCommand + */ +export const de_GetAgentKnowledgeBaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetAgentKnowledgeBaseCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentKnowledgeBase: (_) => de_AgentKnowledgeBase(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetAgentKnowledgeBaseCommandError + */ +const de_GetAgentKnowledgeBaseCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetAgentVersionCommand + */ +export const de_GetAgentVersionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetAgentVersionCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentVersion: (_) => de_AgentVersion(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetAgentVersionCommandError + */ +const de_GetAgentVersionCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetDataSourceCommand + */ +export const de_GetDataSourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetDataSourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dataSource: (_) => de_DataSource(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetDataSourceCommandError + */ +const de_GetDataSourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetIngestionJobCommand + */ +export const de_GetIngestionJobCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetIngestionJobCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ingestionJob: (_) => de_IngestionJob(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetIngestionJobCommandError + */ +const de_GetIngestionJobCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetKnowledgeBaseCommand + */ +export const de_GetKnowledgeBaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetKnowledgeBaseCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + knowledgeBase: (_) => de_KnowledgeBase(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetKnowledgeBaseCommandError + */ +const de_GetKnowledgeBaseCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListAgentActionGroupsCommand + */ +export const de_ListAgentActionGroupsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListAgentActionGroupsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + actionGroupSummaries: (_) => de_ActionGroupSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListAgentActionGroupsCommandError + */ +const de_ListAgentActionGroupsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListAgentAliasesCommand + */ +export const de_ListAgentAliasesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListAgentAliasesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentAliasSummaries: (_) => de_AgentAliasSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListAgentAliasesCommandError + */ +const de_ListAgentAliasesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListAgentKnowledgeBasesCommand + */ +export const de_ListAgentKnowledgeBasesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListAgentKnowledgeBasesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentKnowledgeBaseSummaries: (_) => de_AgentKnowledgeBaseSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListAgentKnowledgeBasesCommandError + */ +const de_ListAgentKnowledgeBasesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListAgentsCommand + */ +export const de_ListAgentsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListAgentsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentSummaries: (_) => de_AgentSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListAgentsCommandError + */ +const de_ListAgentsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListAgentVersionsCommand + */ +export const de_ListAgentVersionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListAgentVersionsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentVersionSummaries: (_) => de_AgentVersionSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListAgentVersionsCommandError + */ +const de_ListAgentVersionsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListDataSourcesCommand + */ +export const de_ListDataSourcesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListDataSourcesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dataSourceSummaries: (_) => de_DataSourceSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListDataSourcesCommandError + */ +const de_ListDataSourcesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListIngestionJobsCommand + */ +export const de_ListIngestionJobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListIngestionJobsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ingestionJobSummaries: (_) => de_IngestionJobSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListIngestionJobsCommandError + */ +const de_ListIngestionJobsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListKnowledgeBasesCommand + */ +export const de_ListKnowledgeBasesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListKnowledgeBasesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + knowledgeBaseSummaries: (_) => de_KnowledgeBaseSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListKnowledgeBasesCommandError + */ +const de_ListKnowledgeBasesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListTagsForResourceCommand + */ +export const de_ListTagsForResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListTagsForResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListTagsForResourceCommandError + */ +const de_ListTagsForResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1PrepareAgentCommand + */ +export const de_PrepareAgentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_PrepareAgentCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentId: __expectString, + agentStatus: __expectString, + agentVersion: __expectString, + preparedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1PrepareAgentCommandError + */ +const de_PrepareAgentCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1StartIngestionJobCommand + */ +export const de_StartIngestionJobCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_StartIngestionJobCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ingestionJob: (_) => de_IngestionJob(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1StartIngestionJobCommandError + */ +const de_StartIngestionJobCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1TagResourceCommand + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_TagResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1TagResourceCommandError + */ +const de_TagResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UntagResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommandError + */ +const de_UntagResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateAgentCommand + */ +export const de_UpdateAgentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_UpdateAgentCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agent: (_) => de_Agent(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateAgentCommandError + */ +const de_UpdateAgentCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateAgentActionGroupCommand + */ +export const de_UpdateAgentActionGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateAgentActionGroupCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentActionGroup: (_) => de_AgentActionGroup(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateAgentActionGroupCommandError + */ +const de_UpdateAgentActionGroupCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateAgentAliasCommand + */ +export const de_UpdateAgentAliasCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_UpdateAgentAliasCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentAlias: (_) => de_AgentAlias(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateAgentAliasCommandError + */ +const de_UpdateAgentAliasCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateAgentKnowledgeBaseCommand + */ +export const de_UpdateAgentKnowledgeBaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateAgentKnowledgeBaseCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + agentKnowledgeBase: (_) => de_AgentKnowledgeBase(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateAgentKnowledgeBaseCommandError + */ +const de_UpdateAgentKnowledgeBaseCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateDataSourceCommand + */ +export const de_UpdateDataSourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateDataSourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dataSource: (_) => de_DataSource(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateDataSourceCommandError + */ +const de_UpdateDataSourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateKnowledgeBaseCommand + */ +export const de_UpdateKnowledgeBaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_UpdateKnowledgeBaseCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + knowledgeBase: (_) => de_KnowledgeBase(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateKnowledgeBaseCommandError + */ +const de_UpdateKnowledgeBaseCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.bedrockagent#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrockagent#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockagent#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockagent#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockagent#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockagent#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +const throwDefaultError = withBaseException(__BaseException); +/** + * deserializeAws_restJson1AccessDeniedExceptionRes + */ +const de_AccessDeniedExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ConflictExceptionRes + */ +const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1InternalServerExceptionRes + */ +const de_InternalServerExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ResourceNotFoundExceptionRes + */ +const de_ResourceNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ServiceQuotaExceededExceptionRes + */ +const de_ServiceQuotaExceededExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ServiceQuotaExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ThrottlingExceptionRes + */ +const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ThrottlingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + fieldList: _json, + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +// se_ActionGroupExecutor omitted. + +// se_AgentAliasRoutingConfiguration omitted. + +// se_AgentAliasRoutingConfigurationListItem omitted. + +// se_APISchema omitted. + +// se_ChunkingConfiguration omitted. + +// se_DataSourceConfiguration omitted. + +// se_FixedSizeChunkingConfiguration omitted. + +/** + * serializeAws_restJson1InferenceConfiguration + */ +const se_InferenceConfiguration = (input: InferenceConfiguration, context: __SerdeContext): any => { + return take(input, { + maximumLength: [], + stopSequences: _json, + temperature: __serializeFloat, + topK: [], + topP: __serializeFloat, + }); +}; + +// se_IngestionJobFilter omitted. + +// se_IngestionJobFilters omitted. + +// se_IngestionJobFilterValues omitted. + +// se_IngestionJobSortBy omitted. + +// se_KnowledgeBaseConfiguration omitted. + +// se_OpenSearchServerlessConfiguration omitted. + +// se_OpenSearchServerlessFieldMapping omitted. + +// se_PineconeConfiguration omitted. + +// se_PineconeFieldMapping omitted. + +/** + * serializeAws_restJson1PromptConfiguration + */ +const se_PromptConfiguration = (input: PromptConfiguration, context: __SerdeContext): any => { + return take(input, { + basePromptTemplate: [], + inferenceConfiguration: (_) => se_InferenceConfiguration(_, context), + parserMode: [], + promptCreationMode: [], + promptState: [], + promptType: [], + }); +}; + +/** + * serializeAws_restJson1PromptConfigurations + */ +const se_PromptConfigurations = (input: PromptConfiguration[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_PromptConfiguration(entry, context); + }); +}; + +/** + * serializeAws_restJson1PromptOverrideConfiguration + */ +const se_PromptOverrideConfiguration = (input: PromptOverrideConfiguration, context: __SerdeContext): any => { + return take(input, { + overrideLambda: [], + promptConfigurations: (_) => se_PromptConfigurations(_, context), + }); +}; + +// se_RedisEnterpriseCloudConfiguration omitted. + +// se_RedisEnterpriseCloudFieldMapping omitted. + +// se_S3DataSourceConfiguration omitted. + +// se_S3Identifier omitted. + +// se_S3Prefixes omitted. + +// se_ServerSideEncryptionConfiguration omitted. + +// se_StopSequences omitted. + +// se_StorageConfiguration omitted. + +// se_TagsMap omitted. + +// se_VectorIngestionConfiguration omitted. + +// se_VectorKnowledgeBaseConfiguration omitted. + +// de_ActionGroupExecutor omitted. + +/** + * deserializeAws_restJson1ActionGroupSummaries + */ +const de_ActionGroupSummaries = (output: any, context: __SerdeContext): ActionGroupSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_ActionGroupSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1ActionGroupSummary + */ +const de_ActionGroupSummary = (output: any, context: __SerdeContext): ActionGroupSummary => { + return take(output, { + actionGroupId: __expectString, + actionGroupName: __expectString, + actionGroupState: __expectString, + description: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1Agent + */ +const de_Agent = (output: any, context: __SerdeContext): Agent => { + return take(output, { + agentArn: __expectString, + agentId: __expectString, + agentName: __expectString, + agentResourceRoleArn: __expectString, + agentStatus: __expectString, + agentVersion: __expectString, + clientToken: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + customerEncryptionKeyArn: __expectString, + description: __expectString, + failureReasons: _json, + foundationModel: __expectString, + idleSessionTTLInSeconds: __expectInt32, + instruction: __expectString, + preparedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + promptOverrideConfiguration: (_: any) => de_PromptOverrideConfiguration(_, context), + recommendedActions: _json, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1AgentActionGroup + */ +const de_AgentActionGroup = (output: any, context: __SerdeContext): AgentActionGroup => { + return take(output, { + actionGroupExecutor: (_: any) => _json(__expectUnion(_)), + actionGroupId: __expectString, + actionGroupName: __expectString, + actionGroupState: __expectString, + agentId: __expectString, + agentVersion: __expectString, + apiSchema: (_: any) => _json(__expectUnion(_)), + clientToken: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + description: __expectString, + parentActionSignature: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1AgentAlias + */ +const de_AgentAlias = (output: any, context: __SerdeContext): AgentAlias => { + return take(output, { + agentAliasArn: __expectString, + agentAliasHistoryEvents: (_: any) => de_AgentAliasHistoryEvents(_, context), + agentAliasId: __expectString, + agentAliasName: __expectString, + agentAliasStatus: __expectString, + agentId: __expectString, + clientToken: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + description: __expectString, + routingConfiguration: _json, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1AgentAliasHistoryEvent + */ +const de_AgentAliasHistoryEvent = (output: any, context: __SerdeContext): AgentAliasHistoryEvent => { + return take(output, { + endDate: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + routingConfiguration: _json, + startDate: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1AgentAliasHistoryEvents + */ +const de_AgentAliasHistoryEvents = (output: any, context: __SerdeContext): AgentAliasHistoryEvent[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_AgentAliasHistoryEvent(entry, context); + }); + return retVal; +}; + +// de_AgentAliasRoutingConfiguration omitted. + +// de_AgentAliasRoutingConfigurationListItem omitted. + +/** + * deserializeAws_restJson1AgentAliasSummaries + */ +const de_AgentAliasSummaries = (output: any, context: __SerdeContext): AgentAliasSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_AgentAliasSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1AgentAliasSummary + */ +const de_AgentAliasSummary = (output: any, context: __SerdeContext): AgentAliasSummary => { + return take(output, { + agentAliasId: __expectString, + agentAliasName: __expectString, + agentAliasStatus: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + description: __expectString, + routingConfiguration: _json, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1AgentKnowledgeBase + */ +const de_AgentKnowledgeBase = (output: any, context: __SerdeContext): AgentKnowledgeBase => { + return take(output, { + agentId: __expectString, + agentVersion: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + description: __expectString, + knowledgeBaseId: __expectString, + knowledgeBaseState: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1AgentKnowledgeBaseSummaries + */ +const de_AgentKnowledgeBaseSummaries = (output: any, context: __SerdeContext): AgentKnowledgeBaseSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_AgentKnowledgeBaseSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1AgentKnowledgeBaseSummary + */ +const de_AgentKnowledgeBaseSummary = (output: any, context: __SerdeContext): AgentKnowledgeBaseSummary => { + return take(output, { + description: __expectString, + knowledgeBaseId: __expectString, + knowledgeBaseState: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1AgentSummaries + */ +const de_AgentSummaries = (output: any, context: __SerdeContext): AgentSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_AgentSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1AgentSummary + */ +const de_AgentSummary = (output: any, context: __SerdeContext): AgentSummary => { + return take(output, { + agentId: __expectString, + agentName: __expectString, + agentStatus: __expectString, + description: __expectString, + latestAgentVersion: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1AgentVersion + */ +const de_AgentVersion = (output: any, context: __SerdeContext): AgentVersion => { + return take(output, { + agentArn: __expectString, + agentId: __expectString, + agentName: __expectString, + agentResourceRoleArn: __expectString, + agentStatus: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + customerEncryptionKeyArn: __expectString, + description: __expectString, + failureReasons: _json, + foundationModel: __expectString, + idleSessionTTLInSeconds: __expectInt32, + instruction: __expectString, + promptOverrideConfiguration: (_: any) => de_PromptOverrideConfiguration(_, context), + recommendedActions: _json, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + version: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1AgentVersionSummaries + */ +const de_AgentVersionSummaries = (output: any, context: __SerdeContext): AgentVersionSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_AgentVersionSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1AgentVersionSummary + */ +const de_AgentVersionSummary = (output: any, context: __SerdeContext): AgentVersionSummary => { + return take(output, { + agentName: __expectString, + agentStatus: __expectString, + agentVersion: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + description: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +// de_APISchema omitted. + +// de_ChunkingConfiguration omitted. + +/** + * deserializeAws_restJson1DataSource + */ +const de_DataSource = (output: any, context: __SerdeContext): DataSource => { + return take(output, { + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + dataSourceConfiguration: _json, + dataSourceId: __expectString, + description: __expectString, + knowledgeBaseId: __expectString, + name: __expectString, + serverSideEncryptionConfiguration: _json, + status: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + vectorIngestionConfiguration: _json, + }) as any; +}; + +// de_DataSourceConfiguration omitted. + +/** + * deserializeAws_restJson1DataSourceSummaries + */ +const de_DataSourceSummaries = (output: any, context: __SerdeContext): DataSourceSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_DataSourceSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1DataSourceSummary + */ +const de_DataSourceSummary = (output: any, context: __SerdeContext): DataSourceSummary => { + return take(output, { + dataSourceId: __expectString, + description: __expectString, + knowledgeBaseId: __expectString, + name: __expectString, + status: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +// de_FailureReasons omitted. + +// de_FixedSizeChunkingConfiguration omitted. + +/** + * deserializeAws_restJson1InferenceConfiguration + */ +const de_InferenceConfiguration = (output: any, context: __SerdeContext): InferenceConfiguration => { + return take(output, { + maximumLength: __expectInt32, + stopSequences: _json, + temperature: __limitedParseFloat32, + topK: __expectInt32, + topP: __limitedParseFloat32, + }) as any; +}; + +/** + * deserializeAws_restJson1IngestionJob + */ +const de_IngestionJob = (output: any, context: __SerdeContext): IngestionJob => { + return take(output, { + dataSourceId: __expectString, + description: __expectString, + failureReasons: _json, + ingestionJobId: __expectString, + knowledgeBaseId: __expectString, + startedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + statistics: _json, + status: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +// de_IngestionJobStatistics omitted. + +/** + * deserializeAws_restJson1IngestionJobSummaries + */ +const de_IngestionJobSummaries = (output: any, context: __SerdeContext): IngestionJobSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_IngestionJobSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1IngestionJobSummary + */ +const de_IngestionJobSummary = (output: any, context: __SerdeContext): IngestionJobSummary => { + return take(output, { + dataSourceId: __expectString, + description: __expectString, + ingestionJobId: __expectString, + knowledgeBaseId: __expectString, + startedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + statistics: _json, + status: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1KnowledgeBase + */ +const de_KnowledgeBase = (output: any, context: __SerdeContext): KnowledgeBase => { + return take(output, { + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + description: __expectString, + failureReasons: _json, + knowledgeBaseArn: __expectString, + knowledgeBaseConfiguration: _json, + knowledgeBaseId: __expectString, + name: __expectString, + roleArn: __expectString, + status: __expectString, + storageConfiguration: _json, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +// de_KnowledgeBaseConfiguration omitted. + +/** + * deserializeAws_restJson1KnowledgeBaseSummaries + */ +const de_KnowledgeBaseSummaries = (output: any, context: __SerdeContext): KnowledgeBaseSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_KnowledgeBaseSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1KnowledgeBaseSummary + */ +const de_KnowledgeBaseSummary = (output: any, context: __SerdeContext): KnowledgeBaseSummary => { + return take(output, { + description: __expectString, + knowledgeBaseId: __expectString, + name: __expectString, + status: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +// de_OpenSearchServerlessConfiguration omitted. + +// de_OpenSearchServerlessFieldMapping omitted. + +// de_PineconeConfiguration omitted. + +// de_PineconeFieldMapping omitted. + +/** + * deserializeAws_restJson1PromptConfiguration + */ +const de_PromptConfiguration = (output: any, context: __SerdeContext): PromptConfiguration => { + return take(output, { + basePromptTemplate: __expectString, + inferenceConfiguration: (_: any) => de_InferenceConfiguration(_, context), + parserMode: __expectString, + promptCreationMode: __expectString, + promptState: __expectString, + promptType: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1PromptConfigurations + */ +const de_PromptConfigurations = (output: any, context: __SerdeContext): PromptConfiguration[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_PromptConfiguration(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1PromptOverrideConfiguration + */ +const de_PromptOverrideConfiguration = (output: any, context: __SerdeContext): PromptOverrideConfiguration => { + return take(output, { + overrideLambda: __expectString, + promptConfigurations: (_: any) => de_PromptConfigurations(_, context), + }) as any; +}; + +// de_RecommendedActions omitted. + +// de_RedisEnterpriseCloudConfiguration omitted. + +// de_RedisEnterpriseCloudFieldMapping omitted. + +// de_S3DataSourceConfiguration omitted. + +// de_S3Identifier omitted. + +// de_S3Prefixes omitted. + +// de_ServerSideEncryptionConfiguration omitted. + +// de_StopSequences omitted. + +// de_StorageConfiguration omitted. + +// de_TagsMap omitted. + +// de_ValidationExceptionField omitted. + +// de_ValidationExceptionFieldList omitted. + +// de_VectorIngestionConfiguration omitted. + +// de_VectorKnowledgeBaseConfiguration omitted. + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const isSerializableHeaderValue = (value: any): boolean => + value !== undefined && + value !== null && + value !== "" && + (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && + (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); + +const parseBody = (streamBody: any, context: __SerdeContext): any => + collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; + }); + +const parseErrorBody = async (errorBody: any, context: __SerdeContext) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string | number): string => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/clients/client-bedrock-agent/src/runtimeConfig.browser.ts b/clients/client-bedrock-agent/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d712881a345e --- /dev/null +++ b/clients/client-bedrock-agent/src/runtimeConfig.browser.ts @@ -0,0 +1,44 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { BedrockAgentClientConfig } from "./BedrockAgentClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BedrockAgentClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/clients/client-bedrock-agent/src/runtimeConfig.native.ts b/clients/client-bedrock-agent/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..b0c37d840d7e --- /dev/null +++ b/clients/client-bedrock-agent/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { BedrockAgentClientConfig } from "./BedrockAgentClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BedrockAgentClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-bedrock-agent/src/runtimeConfig.shared.ts b/clients/client-bedrock-agent/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..3e4a156ae7fe --- /dev/null +++ b/clients/client-bedrock-agent/src/runtimeConfig.shared.ts @@ -0,0 +1,27 @@ +// smithy-typescript generated code +import { NoOpLogger } from "@smithy/smithy-client"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { BedrockAgentClientConfig } from "./BedrockAgentClient"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BedrockAgentClientConfig) => { + return { + apiVersion: "2023-06-05", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "Bedrock Agent", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-bedrock-agent/src/runtimeConfig.ts b/clients/client-bedrock-agent/src/runtimeConfig.ts new file mode 100644 index 000000000000..5789c9c77605 --- /dev/null +++ b/clients/client-bedrock-agent/src/runtimeConfig.ts @@ -0,0 +1,61 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { BedrockAgentClientConfig } from "./BedrockAgentClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BedrockAgentClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: + config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; diff --git a/clients/client-bedrock-agent/src/runtimeExtensions.ts b/clients/client-bedrock-agent/src/runtimeExtensions.ts new file mode 100644 index 000000000000..8c32402c15a5 --- /dev/null +++ b/clients/client-bedrock-agent/src/runtimeExtensions.ts @@ -0,0 +1,45 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { BedrockAgentExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: BedrockAgentExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +const asPartial = >(t: T) => t; + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: BedrockAgentExtensionConfiguration = { + ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)), + ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)), + }; + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return { + ...runtimeConfig, + ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), + ...resolveDefaultRuntimeConfig(extensionConfiguration), + ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), + }; +}; diff --git a/clients/client-bedrock-agent/tsconfig.cjs.json b/clients/client-bedrock-agent/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-bedrock-agent/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-bedrock-agent/tsconfig.es.json b/clients/client-bedrock-agent/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-bedrock-agent/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-bedrock-agent/tsconfig.json b/clients/client-bedrock-agent/tsconfig.json new file mode 100644 index 000000000000..344909de2128 --- /dev/null +++ b/clients/client-bedrock-agent/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node14/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/clients/client-bedrock-agent/tsconfig.types.json b/clients/client-bedrock-agent/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-bedrock-agent/tsconfig.types.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/clients/client-bedrock-agent/typedoc.json b/clients/client-bedrock-agent/typedoc.json new file mode 100644 index 000000000000..8a364aa93b69 --- /dev/null +++ b/clients/client-bedrock-agent/typedoc.json @@ -0,0 +1,6 @@ +{ + "extends": ["../../typedoc.client.json"], + "entryPoints": ["src/index.ts"], + "out": "docs", + "readme": "README.md" +} diff --git a/codegen/sdk-codegen/aws-models/bedrock-agent.json b/codegen/sdk-codegen/aws-models/bedrock-agent.json new file mode 100644 index 000000000000..ba7588844aca --- /dev/null +++ b/codegen/sdk-codegen/aws-models/bedrock-agent.json @@ -0,0 +1,6958 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.bedrockagent#APISchema": { + "type": "union", + "members": { + "s3": { + "target": "com.amazonaws.bedrockagent#S3Identifier" + }, + "payload": { + "target": "com.amazonaws.bedrockagent#Payload" + } + }, + "traits": { + "smithy.api#documentation": "Contains information about the API Schema for the Action Group" + } + }, + "com.amazonaws.bedrockagent#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockagent#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception is thrown when a request is denied per access permissions", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.bedrockagent#ActionGroupExecutor": { + "type": "union", + "members": { + "lambda": { + "target": "com.amazonaws.bedrockagent#LambdaArn" + } + }, + "traits": { + "smithy.api#documentation": "Type of Executors for an Action Group" + } + }, + "com.amazonaws.bedrockagent#ActionGroupResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#CreateAgentActionGroup" + }, + { + "target": "com.amazonaws.bedrockagent#DeleteAgentActionGroup" + }, + { + "target": "com.amazonaws.bedrockagent#GetAgentActionGroup" + }, + { + "target": "com.amazonaws.bedrockagent#ListAgentActionGroups" + }, + { + "target": "com.amazonaws.bedrockagent#UpdateAgentActionGroup" + } + ] + }, + "com.amazonaws.bedrockagent#ActionGroupSignature": { + "type": "enum", + "members": { + "AMAZON_USERINPUT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AMAZON.UserInput" + } + } + }, + "traits": { + "smithy.api#documentation": "Action Group Signature for a BuiltIn Action" + } + }, + "com.amazonaws.bedrockagent#ActionGroupState": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + }, + "traits": { + "smithy.api#documentation": "State of the action group" + } + }, + "com.amazonaws.bedrockagent#ActionGroupSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#ActionGroupSummary" + }, + "traits": { + "smithy.api#documentation": "List of ActionGroup Summaries", + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#ActionGroupSummary": { + "type": "structure", + "members": { + "actionGroupId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "actionGroupName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "actionGroupState": { + "target": "com.amazonaws.bedrockagent#ActionGroupState", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "ActionGroup Summary" + } + }, + "com.amazonaws.bedrockagent#Agent": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "agentArn": { + "target": "com.amazonaws.bedrockagent#AgentArn", + "traits": { + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#DraftVersion", + "traits": { + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken" + }, + "instruction": { + "target": "com.amazonaws.bedrockagent#Instruction" + }, + "agentStatus": { + "target": "com.amazonaws.bedrockagent#AgentStatus", + "traits": { + "smithy.api#required": {} + } + }, + "foundationModel": { + "target": "com.amazonaws.bedrockagent#ModelIdentifier" + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "idleSessionTTLInSeconds": { + "target": "com.amazonaws.bedrockagent#SessionTTL", + "traits": { + "smithy.api#required": {} + } + }, + "agentResourceRoleArn": { + "target": "com.amazonaws.bedrockagent#AgentRoleArn", + "traits": { + "smithy.api#required": {} + } + }, + "customerEncryptionKeyArn": { + "target": "com.amazonaws.bedrockagent#KmsKeyArn" + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "preparedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp" + }, + "failureReasons": { + "target": "com.amazonaws.bedrockagent#FailureReasons" + }, + "recommendedActions": { + "target": "com.amazonaws.bedrockagent#RecommendedActions" + }, + "promptOverrideConfiguration": { + "target": "com.amazonaws.bedrockagent#PromptOverrideConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Contains the information of an agent" + } + }, + "com.amazonaws.bedrockagent#AgentActionGroup": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#required": {} + } + }, + "actionGroupId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "actionGroupName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken" + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "parentActionSignature": { + "target": "com.amazonaws.bedrockagent#ActionGroupSignature" + }, + "actionGroupExecutor": { + "target": "com.amazonaws.bedrockagent#ActionGroupExecutor" + }, + "apiSchema": { + "target": "com.amazonaws.bedrockagent#APISchema" + }, + "actionGroupState": { + "target": "com.amazonaws.bedrockagent#ActionGroupState", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the information of an Agent Action Group" + } + }, + "com.amazonaws.bedrockagent#AgentAlias": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentAliasId": { + "target": "com.amazonaws.bedrockagent#AgentAliasId", + "traits": { + "smithy.api#required": {} + } + }, + "agentAliasName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "agentAliasArn": { + "target": "com.amazonaws.bedrockagent#AgentAliasArn", + "traits": { + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken" + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "routingConfiguration": { + "target": "com.amazonaws.bedrockagent#AgentAliasRoutingConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "agentAliasHistoryEvents": { + "target": "com.amazonaws.bedrockagent#AgentAliasHistoryEvents" + }, + "agentAliasStatus": { + "target": "com.amazonaws.bedrockagent#AgentAliasStatus", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the information of an agent alias" + } + }, + "com.amazonaws.bedrockagent#AgentAliasArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "Arn representation of the Agent Alias.", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:agent-alias/[0-9a-zA-Z]{10}/[0-9a-zA-Z]{10}$" + } + }, + "com.amazonaws.bedrockagent#AgentAliasHistoryEvent": { + "type": "structure", + "members": { + "routingConfiguration": { + "target": "com.amazonaws.bedrockagent#AgentAliasRoutingConfiguration" + }, + "endDate": { + "target": "com.amazonaws.bedrockagent#DateTimestamp" + }, + "startDate": { + "target": "com.amazonaws.bedrockagent#DateTimestamp" + } + }, + "traits": { + "smithy.api#documentation": "History event for an alias for an Agent." + } + }, + "com.amazonaws.bedrockagent#AgentAliasHistoryEvents": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#AgentAliasHistoryEvent" + }, + "traits": { + "smithy.api#documentation": "The list of history events for an alias for an Agent.", + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#AgentAliasId": { + "type": "string", + "traits": { + "smithy.api#documentation": "Id for an Agent Alias generated at the server side.", + "smithy.api#length": { + "min": 10, + "max": 10 + }, + "smithy.api#pattern": "^(\\bTSTALIASID\\b|[0-9a-zA-Z]+)$" + } + }, + "com.amazonaws.bedrockagent#AgentAliasRoutingConfiguration": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#AgentAliasRoutingConfigurationListItem" + }, + "traits": { + "smithy.api#documentation": "Routing configuration for an Agent alias.", + "smithy.api#length": { + "max": 1 + } + } + }, + "com.amazonaws.bedrockagent#AgentAliasRoutingConfigurationListItem": { + "type": "structure", + "members": { + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Details about the routing configuration for an Agent alias." + } + }, + "com.amazonaws.bedrockagent#AgentAliasStatus": { + "type": "enum", + "members": { + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "PREPARED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PREPARED" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATING" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + } + }, + "traits": { + "smithy.api#documentation": "The statuses an Agent Alias can be in." + } + }, + "com.amazonaws.bedrockagent#AgentAliasSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#AgentAliasSummary" + }, + "traits": { + "smithy.api#documentation": "The list of summaries of all the aliases for an Agent.", + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#AgentAliasSummary": { + "type": "structure", + "members": { + "agentAliasId": { + "target": "com.amazonaws.bedrockagent#AgentAliasId", + "traits": { + "smithy.api#required": {} + } + }, + "agentAliasName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "routingConfiguration": { + "target": "com.amazonaws.bedrockagent#AgentAliasRoutingConfiguration" + }, + "agentAliasStatus": { + "target": "com.amazonaws.bedrockagent#AgentAliasStatus", + "traits": { + "smithy.api#required": {} + } + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Summary of an alias for an Agent." + } + }, + "com.amazonaws.bedrockagent#AgentArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "Arn representation of the Agent.", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:agent/[0-9a-zA-Z]{10}$" + } + }, + "com.amazonaws.bedrockagent#AgentKnowledgeBase": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description", + "traits": { + "smithy.api#required": {} + } + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "knowledgeBaseState": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseState", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the information of an Agent Knowledge Base." + } + }, + "com.amazonaws.bedrockagent#AgentKnowledgeBaseSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#AgentKnowledgeBaseSummary" + }, + "traits": { + "smithy.api#documentation": "List of Agent Knowledge Base Summaries", + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#AgentKnowledgeBaseSummary": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "knowledgeBaseState": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseState", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Agent Knowledge Base Summary" + } + }, + "com.amazonaws.bedrockagent#AgentResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#CreateAgent" + }, + { + "target": "com.amazonaws.bedrockagent#DeleteAgent" + }, + { + "target": "com.amazonaws.bedrockagent#GetAgent" + }, + { + "target": "com.amazonaws.bedrockagent#ListAgents" + }, + { + "target": "com.amazonaws.bedrockagent#PrepareAgent" + }, + { + "target": "com.amazonaws.bedrockagent#UpdateAgent" + } + ] + }, + "com.amazonaws.bedrockagent#AgentRoleArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "ARN of a IAM role.", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/(service-role/)?AmazonBedrockExecutionRoleForAgents.+$" + } + }, + "com.amazonaws.bedrockagent#AgentStatus": { + "type": "enum", + "members": { + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "PREPARING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PREPARING" + } + }, + "PREPARED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PREPARED" + } + }, + "NOT_PREPARED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_PREPARED" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "VERSIONING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VERSIONING" + } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATING" + } + } + }, + "traits": { + "smithy.api#documentation": "Schema Type for Action APIs." + } + }, + "com.amazonaws.bedrockagent#AgentSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#AgentSummary" + }, + "traits": { + "smithy.api#documentation": "List of AgentSummary.", + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#AgentSummary": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "agentStatus": { + "target": "com.amazonaws.bedrockagent#AgentStatus", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "latestAgentVersion": { + "target": "com.amazonaws.bedrockagent#Version" + } + }, + "traits": { + "smithy.api#documentation": "Summary of Agent." + } + }, + "com.amazonaws.bedrockagent#AgentVersion": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "agentArn": { + "target": "com.amazonaws.bedrockagent#AgentArn", + "traits": { + "smithy.api#required": {} + } + }, + "version": { + "target": "com.amazonaws.bedrockagent#NumericalVersion", + "traits": { + "smithy.api#required": {} + } + }, + "instruction": { + "target": "com.amazonaws.bedrockagent#Instruction" + }, + "agentStatus": { + "target": "com.amazonaws.bedrockagent#AgentStatus", + "traits": { + "smithy.api#required": {} + } + }, + "foundationModel": { + "target": "com.amazonaws.bedrockagent#ModelIdentifier" + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "idleSessionTTLInSeconds": { + "target": "com.amazonaws.bedrockagent#SessionTTL", + "traits": { + "smithy.api#required": {} + } + }, + "agentResourceRoleArn": { + "target": "com.amazonaws.bedrockagent#AgentRoleArn", + "traits": { + "smithy.api#required": {} + } + }, + "customerEncryptionKeyArn": { + "target": "com.amazonaws.bedrockagent#KmsKeyArn" + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "failureReasons": { + "target": "com.amazonaws.bedrockagent#FailureReasons" + }, + "recommendedActions": { + "target": "com.amazonaws.bedrockagent#RecommendedActions" + }, + "promptOverrideConfiguration": { + "target": "com.amazonaws.bedrockagent#PromptOverrideConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Contains the information of an agent version." + } + }, + "com.amazonaws.bedrockagent#AgentVersionSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#AgentVersionSummary" + }, + "traits": { + "smithy.api#documentation": "List of AgentVersionSummary.", + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#AgentVersionSummary": { + "type": "structure", + "members": { + "agentName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "agentStatus": { + "target": "com.amazonaws.bedrockagent#AgentStatus", + "traits": { + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#required": {} + } + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + } + }, + "traits": { + "smithy.api#documentation": "Summary of agent version." + } + }, + "com.amazonaws.bedrockagent#AliasResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#CreateAgentAlias" + }, + { + "target": "com.amazonaws.bedrockagent#DeleteAgentAlias" + }, + { + "target": "com.amazonaws.bedrockagent#GetAgentAlias" + }, + { + "target": "com.amazonaws.bedrockagent#ListAgentAliases" + }, + { + "target": "com.amazonaws.bedrockagent#UpdateAgentAlias" + } + ] + }, + "com.amazonaws.bedrockagent#AmazonBedrockAgentBuildTimeLambda": { + "type": "service", + "version": "2023-06-05", + "resources": [ + { + "target": "com.amazonaws.bedrockagent#ActionGroupResource" + }, + { + "target": "com.amazonaws.bedrockagent#AgentResource" + }, + { + "target": "com.amazonaws.bedrockagent#AliasResource" + }, + { + "target": "com.amazonaws.bedrockagent#DataSourceResource" + }, + { + "target": "com.amazonaws.bedrockagent#IngestionJobResource" + }, + { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseResource" + }, + { + "target": "com.amazonaws.bedrockagent#TaggingResource" + }, + { + "target": "com.amazonaws.bedrockagent#VersionResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "Bedrock Agent", + "arnNamespace": "bedrock", + "endpointPrefix": "bedrock-agent", + "cloudTrailEventSource": "bedrock.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "bedrock" + }, + "aws.protocols#restJson1": {}, + "smithy.api#cors": { + "additionalAllowedHeaders": [ + "*", + "content-type", + "x-amz-content-sha256", + "x-amz-user-agent", + "x-amzn-platform-id", + "x-amzn-trace-id" + ], + "additionalExposedHeaders": ["x-amzn-errortype", "x-amzn-requestid", "x-amzn-trace-id"], + "maxAge": 86400 + }, + "smithy.api#documentation": "An example service, deployed with the Octane Service creator,\nwhich will echo the string", + "smithy.api#title": "Agents for Amazon Bedrock", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" + }, + "UseDualStack": { + "builtIn": "AWS::UseDualStack", + "required": true, + "default": false, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "Boolean" + }, + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "Boolean" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "String" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://bedrock-agent-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + }, + true + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://bedrock-agent-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://bedrock-agent.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://bedrock-agent.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent-fips.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent-fips.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent-fips.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent-fips.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent-fips.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent-fips.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent-fips.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent-fips.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://bedrock-agent.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips enabled and dualstack disabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.bedrockagent#AssociateAgentKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Associate a Knowledge Base to an existing Amazon Bedrock Agent", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#DraftVersion", + "traits": { + "smithy.api#documentation": "Draft Version of the Agent.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description", + "traits": { + "smithy.api#required": {} + } + }, + "knowledgeBaseState": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseState" + } + }, + "traits": { + "smithy.api#documentation": "Associate Agent Knowledge Base Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseResponse": { + "type": "structure", + "members": { + "agentKnowledgeBase": { + "target": "com.amazonaws.bedrockagent#AgentKnowledgeBase", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Associate Agent Knowledge Base Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#BasePromptTemplate": { + "type": "string", + "traits": { + "smithy.api#documentation": "Base Prompt Template.", + "smithy.api#length": { + "min": 1, + "max": 100000 + } + } + }, + "com.amazonaws.bedrockagent#BedrockEmbeddingModelArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "Arn of a Bedrock model.", + "smithy.api#length": { + "min": 20, + "max": 1011 + }, + "smithy.api#pattern": "^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))$" + } + }, + "com.amazonaws.bedrockagent#ChunkingConfiguration": { + "type": "structure", + "members": { + "chunkingStrategy": { + "target": "com.amazonaws.bedrockagent#ChunkingStrategy", + "traits": { + "smithy.api#required": {} + } + }, + "fixedSizeChunkingConfiguration": { + "target": "com.amazonaws.bedrockagent#FixedSizeChunkingConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Configures chunking strategy" + } + }, + "com.amazonaws.bedrockagent#ChunkingStrategy": { + "type": "enum", + "members": { + "FIXED_SIZE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FIXED_SIZE" + } + }, + "NONE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NONE" + } + } + }, + "traits": { + "smithy.api#documentation": "The type of chunking strategy" + } + }, + "com.amazonaws.bedrockagent#ClientToken": { + "type": "string", + "traits": { + "smithy.api#documentation": "Client specified token used for idempotency checks", + "smithy.api#length": { + "min": 33, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$" + } + }, + "com.amazonaws.bedrockagent#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockagent#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception is thrown when there is a conflict performing an operation", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.bedrockagent#CreateAgent": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#CreateAgentRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#CreateAgentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Creates an Amazon Bedrock Agent", + "smithy.api#http": { + "code": 202, + "method": "PUT", + "uri": "/agents/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#CreateAgentActionGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#CreateAgentActionGroupRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#CreateAgentActionGroupResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Creates an Action Group for existing Amazon Bedrock Agent", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#CreateAgentActionGroupRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#DraftVersion", + "traits": { + "smithy.api#documentation": "Draft Version of the Agent.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "actionGroupName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken", + "traits": { + "smithy.api#idempotencyToken": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "parentActionGroupSignature": { + "target": "com.amazonaws.bedrockagent#ActionGroupSignature" + }, + "actionGroupExecutor": { + "target": "com.amazonaws.bedrockagent#ActionGroupExecutor" + }, + "apiSchema": { + "target": "com.amazonaws.bedrockagent#APISchema" + }, + "actionGroupState": { + "target": "com.amazonaws.bedrockagent#ActionGroupState" + } + }, + "traits": { + "smithy.api#documentation": "Create Action Group Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#CreateAgentActionGroupResponse": { + "type": "structure", + "members": { + "agentActionGroup": { + "target": "com.amazonaws.bedrockagent#AgentActionGroup", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Create Action Group Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#CreateAgentAlias": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#CreateAgentAliasRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#CreateAgentAliasResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Creates an Alias for an existing Amazon Bedrock Agent", + "smithy.api#http": { + "code": 202, + "method": "PUT", + "uri": "/agents/{agentId}/agentaliases/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#CreateAgentAliasRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentAliasName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken", + "traits": { + "smithy.api#idempotencyToken": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "routingConfiguration": { + "target": "com.amazonaws.bedrockagent#AgentAliasRoutingConfiguration" + }, + "tags": { + "target": "com.amazonaws.bedrockagent#TagsMap" + } + }, + "traits": { + "smithy.api#documentation": "Create Agent Alias Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#CreateAgentAliasResponse": { + "type": "structure", + "members": { + "agentAlias": { + "target": "com.amazonaws.bedrockagent#AgentAlias", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Create Agent Alias Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#CreateAgentRequest": { + "type": "structure", + "members": { + "agentName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken", + "traits": { + "smithy.api#idempotencyToken": {} + } + }, + "instruction": { + "target": "com.amazonaws.bedrockagent#Instruction" + }, + "foundationModel": { + "target": "com.amazonaws.bedrockagent#ModelIdentifier" + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "idleSessionTTLInSeconds": { + "target": "com.amazonaws.bedrockagent#SessionTTL" + }, + "agentResourceRoleArn": { + "target": "com.amazonaws.bedrockagent#AgentRoleArn", + "traits": { + "smithy.api#required": {} + } + }, + "customerEncryptionKeyArn": { + "target": "com.amazonaws.bedrockagent#KmsKeyArn" + }, + "tags": { + "target": "com.amazonaws.bedrockagent#TagsMap" + }, + "promptOverrideConfiguration": { + "target": "com.amazonaws.bedrockagent#PromptOverrideConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Create Agent Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#CreateAgentResponse": { + "type": "structure", + "members": { + "agent": { + "target": "com.amazonaws.bedrockagent#Agent", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Create Agent Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#CreateDataSource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#CreateDataSourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#CreateDataSourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Create a new data source", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#CreateDataSourceRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken", + "traits": { + "smithy.api#idempotencyToken": {} + } + }, + "name": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "dataSourceConfiguration": { + "target": "com.amazonaws.bedrockagent#DataSourceConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.bedrockagent#ServerSideEncryptionConfiguration" + }, + "vectorIngestionConfiguration": { + "target": "com.amazonaws.bedrockagent#VectorIngestionConfiguration" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#CreateDataSourceResponse": { + "type": "structure", + "members": { + "dataSource": { + "target": "com.amazonaws.bedrockagent#DataSource", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#CreateKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#CreateKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#CreateKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Create a new knowledge base", + "smithy.api#http": { + "code": 202, + "method": "PUT", + "uri": "/knowledgebases/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#CreateKnowledgeBaseRequest": { + "type": "structure", + "members": { + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken", + "traits": { + "smithy.api#idempotencyToken": {} + } + }, + "name": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "roleArn": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseRoleArn", + "traits": { + "smithy.api#required": {} + } + }, + "knowledgeBaseConfiguration": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "storageConfiguration": { + "target": "com.amazonaws.bedrockagent#StorageConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.bedrockagent#TagsMap" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#CreateKnowledgeBaseResponse": { + "type": "structure", + "members": { + "knowledgeBase": { + "target": "com.amazonaws.bedrockagent#KnowledgeBase", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#CreationMode": { + "type": "enum", + "members": { + "DEFAULT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DEFAULT" + } + }, + "OVERRIDDEN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OVERRIDDEN" + } + } + }, + "traits": { + "smithy.api#documentation": "Creation Mode for Prompt Configuration." + } + }, + "com.amazonaws.bedrockagent#DataSource": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.bedrockagent#DataSourceStatus", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "dataSourceConfiguration": { + "target": "com.amazonaws.bedrockagent#DataSourceConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.bedrockagent#ServerSideEncryptionConfiguration" + }, + "vectorIngestionConfiguration": { + "target": "com.amazonaws.bedrockagent#VectorIngestionConfiguration" + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the information of a data source." + } + }, + "com.amazonaws.bedrockagent#DataSourceConfiguration": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.bedrockagent#DataSourceType", + "traits": { + "smithy.api#required": {} + } + }, + "s3Configuration": { + "target": "com.amazonaws.bedrockagent#S3DataSourceConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Specifies a raw data source location to ingest." + } + }, + "com.amazonaws.bedrockagent#DataSourceResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#CreateDataSource" + }, + { + "target": "com.amazonaws.bedrockagent#DeleteDataSource" + }, + { + "target": "com.amazonaws.bedrockagent#GetDataSource" + }, + { + "target": "com.amazonaws.bedrockagent#ListDataSources" + }, + { + "target": "com.amazonaws.bedrockagent#UpdateDataSource" + } + ] + }, + "com.amazonaws.bedrockagent#DataSourceStatus": { + "type": "enum", + "members": { + "AVAILABLE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AVAILABLE" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + } + }, + "traits": { + "smithy.api#documentation": "The status of a data source." + } + }, + "com.amazonaws.bedrockagent#DataSourceSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#DataSourceSummary" + }, + "traits": { + "smithy.api#documentation": "list of data source summaries" + } + }, + "com.amazonaws.bedrockagent#DataSourceSummary": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.bedrockagent#DataSourceStatus", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Summary information of a data source." + } + }, + "com.amazonaws.bedrockagent#DataSourceType": { + "type": "enum", + "members": { + "S3": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "S3" + } + } + }, + "traits": { + "smithy.api#documentation": "The type of the data source location." + } + }, + "com.amazonaws.bedrockagent#DateTimestamp": { + "type": "timestamp", + "traits": { + "smithy.api#documentation": "Time Stamp.", + "smithy.api#timestampFormat": "date-time" + } + }, + "com.amazonaws.bedrockagent#DeleteAgent": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#DeleteAgentRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#DeleteAgentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes an Agent for existing Amazon Bedrock Agent", + "smithy.api#http": { + "code": 202, + "method": "DELETE", + "uri": "/agents/{agentId}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#DeleteAgentActionGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#DeleteAgentActionGroupRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#DeleteAgentActionGroupResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes an Action Group for existing Amazon Bedrock Agent.", + "smithy.api#http": { + "code": 204, + "method": "DELETE", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#DeleteAgentActionGroupRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#DraftVersion", + "traits": { + "smithy.api#documentation": "Draft Version of the Agent.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "actionGroupId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent ActionGroup is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "skipResourceInUseCheck": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "Skips checking if resource is in use when set to true. Defaults to false", + "smithy.api#httpQuery": "skipResourceInUseCheck" + } + } + }, + "traits": { + "smithy.api#documentation": "Delete Action Group Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#DeleteAgentActionGroupResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Delete Action Group Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#DeleteAgentAlias": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#DeleteAgentAliasRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#DeleteAgentAliasResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes an Alias for a Amazon Bedrock Agent", + "smithy.api#http": { + "code": 202, + "method": "DELETE", + "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#DeleteAgentAliasRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentAliasId": { + "target": "com.amazonaws.bedrockagent#AgentAliasId", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent Alias is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Delete Agent Alias Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#DeleteAgentAliasResponse": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentAliasId": { + "target": "com.amazonaws.bedrockagent#AgentAliasId", + "traits": { + "smithy.api#required": {} + } + }, + "agentAliasStatus": { + "target": "com.amazonaws.bedrockagent#AgentAliasStatus", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Delete Agent Alias Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#DeleteAgentRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "skipResourceInUseCheck": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "Skips checking if resource is in use when set to true. Defaults to false", + "smithy.api#httpQuery": "skipResourceInUseCheck" + } + } + }, + "traits": { + "smithy.api#documentation": "Delete Agent Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#DeleteAgentResponse": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentStatus": { + "target": "com.amazonaws.bedrockagent#AgentStatus", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Delete Agent Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#DeleteAgentVersion": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#DeleteAgentVersionRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#DeleteAgentVersionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Deletes an Agent version for existing Amazon Bedrock Agent", + "smithy.api#http": { + "code": 202, + "method": "DELETE", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#DeleteAgentVersionRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#NumericalVersion", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "skipResourceInUseCheck": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "Skips checking if resource is in use when set to true. Defaults to false", + "smithy.api#httpQuery": "skipResourceInUseCheck" + } + } + }, + "traits": { + "smithy.api#documentation": "Delete Agent Version Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#DeleteAgentVersionResponse": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#NumericalVersion", + "traits": { + "smithy.api#required": {} + } + }, + "agentStatus": { + "target": "com.amazonaws.bedrockagent#AgentStatus", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Delete Agent Version Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#DeleteDataSource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#DeleteDataSourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#DeleteDataSourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Delete an existing data source", + "smithy.api#http": { + "code": 202, + "method": "DELETE", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#DeleteDataSourceRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#DeleteDataSourceResponse": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.bedrockagent#DataSourceStatus", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#DeleteKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#DeleteKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#DeleteKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Delete an existing knowledge base", + "smithy.api#http": { + "code": 202, + "method": "DELETE", + "uri": "/knowledgebases/{knowledgeBaseId}" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#DeleteKnowledgeBaseRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#DeleteKnowledgeBaseResponse": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseStatus", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#Description": { + "type": "string", + "traits": { + "smithy.api#documentation": "Description of the Resource.", + "smithy.api#length": { + "min": 1, + "max": 200 + } + } + }, + "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Disassociate an existing Knowledge Base from an Amazon Bedrock Agent", + "smithy.api#http": { + "code": 204, + "method": "DELETE", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#DraftVersion", + "traits": { + "smithy.api#documentation": "Draft Version of the Agent.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when a Knowledge Base is associated to an Agent", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Disassociate Agent Knowledge Base Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Disassociate Agent Knowledge Base Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#DraftVersion": { + "type": "string", + "traits": { + "smithy.api#documentation": "Draft Agent Version.", + "smithy.api#length": { + "min": 5, + "max": 5 + }, + "smithy.api#pattern": "^DRAFT$" + } + }, + "com.amazonaws.bedrockagent#FailureReason": { + "type": "string", + "traits": { + "smithy.api#documentation": "Failure Reason for Error.", + "smithy.api#length": { + "max": 2048 + } + } + }, + "com.amazonaws.bedrockagent#FailureReasons": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#FailureReason" + }, + "traits": { + "smithy.api#documentation": "Failure Reasons for Error.", + "smithy.api#length": { + "max": 2048 + } + } + }, + "com.amazonaws.bedrockagent#FieldName": { + "type": "string", + "traits": { + "smithy.api#documentation": "Name of the field", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^.*$" + } + }, + "com.amazonaws.bedrockagent#FixedSizeChunkingConfiguration": { + "type": "structure", + "members": { + "maxTokens": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The maximum number of tokens per chunk.", + "smithy.api#range": { + "min": 1 + }, + "smithy.api#required": {} + } + }, + "overlapPercentage": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The overlap percentage between adjacent chunks.", + "smithy.api#range": { + "min": 1, + "max": 99 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configures fixed size chunking strategy" + } + }, + "com.amazonaws.bedrockagent#GetAgent": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetAgentRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetAgentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Gets an Agent for existing Amazon Bedrock Agent", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetAgentActionGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetAgentActionGroupRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetAgentActionGroupResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Gets an Action Group for existing Amazon Bedrock Agent Version", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetAgentActionGroupRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#documentation": "Version number generated when a version is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "actionGroupId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent Action Group is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Action Group Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentActionGroupResponse": { + "type": "structure", + "members": { + "agentActionGroup": { + "target": "com.amazonaws.bedrockagent#AgentActionGroup", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Action Group Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentAlias": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetAgentAliasRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetAgentAliasResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Describes an Alias for a Amazon Bedrock Agent", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetAgentAliasRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentAliasId": { + "target": "com.amazonaws.bedrockagent#AgentAliasId", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent Alias is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Agent Alias Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentAliasResponse": { + "type": "structure", + "members": { + "agentAlias": { + "target": "com.amazonaws.bedrockagent#AgentAlias", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Agent Alias Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetAgentKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetAgentKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Gets a knowledge base associated to an existing Amazon Bedrock Agent Version", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetAgentKnowledgeBaseRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#documentation": "Version number generated when a version is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when a Knowledge Base is associated", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Agent Knowledge Base Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentKnowledgeBaseResponse": { + "type": "structure", + "members": { + "agentKnowledgeBase": { + "target": "com.amazonaws.bedrockagent#AgentKnowledgeBase", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Agent Knowledge Base Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Agent Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentResponse": { + "type": "structure", + "members": { + "agent": { + "target": "com.amazonaws.bedrockagent#Agent", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Agent Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentVersion": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetAgentVersionRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetAgentVersionResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Gets an Agent version for existing Amazon Bedrock Agent", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetAgentVersionRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#NumericalVersion", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Agent Version Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetAgentVersionResponse": { + "type": "structure", + "members": { + "agentVersion": { + "target": "com.amazonaws.bedrockagent#AgentVersion", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Get Agent Version Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#GetDataSource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetDataSourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetDataSourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Get an existing data source", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetDataSourceRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetDataSourceResponse": { + "type": "structure", + "members": { + "dataSource": { + "target": "com.amazonaws.bedrockagent#DataSource", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#GetIngestionJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetIngestionJobRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetIngestionJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Get an ingestion job", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetIngestionJobRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "ingestionJobId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetIngestionJobResponse": { + "type": "structure", + "members": { + "ingestionJob": { + "target": "com.amazonaws.bedrockagent#IngestionJob", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#GetKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Get an existing knowledge base", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/knowledgebases/{knowledgeBaseId}" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetKnowledgeBaseRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetKnowledgeBaseResponse": { + "type": "structure", + "members": { + "knowledgeBase": { + "target": "com.amazonaws.bedrockagent#KnowledgeBase", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#Id": { + "type": "string", + "traits": { + "smithy.api#documentation": "Identifier for a resource.", + "smithy.api#pattern": "^[0-9a-zA-Z]{10}$" + } + }, + "com.amazonaws.bedrockagent#InferenceConfiguration": { + "type": "structure", + "members": { + "temperature": { + "target": "com.amazonaws.bedrockagent#Temperature" + }, + "topP": { + "target": "com.amazonaws.bedrockagent#TopP" + }, + "topK": { + "target": "com.amazonaws.bedrockagent#TopK" + }, + "maximumLength": { + "target": "com.amazonaws.bedrockagent#MaximumLength" + }, + "stopSequences": { + "target": "com.amazonaws.bedrockagent#StopSequences" + } + }, + "traits": { + "smithy.api#documentation": "Configuration for inference in prompt configuration" + } + }, + "com.amazonaws.bedrockagent#IngestionJob": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "ingestionJobId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "status": { + "target": "com.amazonaws.bedrockagent#IngestionJobStatus", + "traits": { + "smithy.api#required": {} + } + }, + "statistics": { + "target": "com.amazonaws.bedrockagent#IngestionJobStatistics" + }, + "failureReasons": { + "target": "com.amazonaws.bedrockagent#FailureReasons" + }, + "startedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the information of an ingestion job." + } + }, + "com.amazonaws.bedrockagent#IngestionJobFilter": { + "type": "structure", + "members": { + "attribute": { + "target": "com.amazonaws.bedrockagent#IngestionJobFilterAttribute", + "traits": { + "smithy.api#required": {} + } + }, + "operator": { + "target": "com.amazonaws.bedrockagent#IngestionJobFilterOperator", + "traits": { + "smithy.api#required": {} + } + }, + "values": { + "target": "com.amazonaws.bedrockagent#IngestionJobFilterValues", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Filters the response returned by ListIngestionJobs operation." + } + }, + "com.amazonaws.bedrockagent#IngestionJobFilterAttribute": { + "type": "enum", + "members": { + "STATUS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STATUS" + } + } + }, + "traits": { + "smithy.api#documentation": "The name of the field to filter ingestion jobs." + } + }, + "com.amazonaws.bedrockagent#IngestionJobFilterOperator": { + "type": "enum", + "members": { + "EQ": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EQ" + } + } + }, + "traits": { + "smithy.api#documentation": "The operator used to filter ingestion jobs." + } + }, + "com.amazonaws.bedrockagent#IngestionJobFilterValue": { + "type": "string", + "traits": { + "smithy.api#documentation": "The value used to filter ingestion jobs.", + "smithy.api#length": { + "min": 0, + "max": 100 + }, + "smithy.api#pattern": "^.*$" + } + }, + "com.amazonaws.bedrockagent#IngestionJobFilterValues": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#IngestionJobFilterValue" + }, + "traits": { + "smithy.api#documentation": "The list of values used to filter ingestion jobs.", + "smithy.api#length": { + "min": 0, + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#IngestionJobFilters": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#IngestionJobFilter" + }, + "traits": { + "smithy.api#documentation": "List of IngestionJobFilters", + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.bedrockagent#IngestionJobResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#GetIngestionJob" + }, + { + "target": "com.amazonaws.bedrockagent#ListIngestionJobs" + }, + { + "target": "com.amazonaws.bedrockagent#StartIngestionJob" + } + ] + }, + "com.amazonaws.bedrockagent#IngestionJobSortBy": { + "type": "structure", + "members": { + "attribute": { + "target": "com.amazonaws.bedrockagent#IngestionJobSortByAttribute", + "traits": { + "smithy.api#required": {} + } + }, + "order": { + "target": "com.amazonaws.bedrockagent#SortOrder", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Sorts the response returned by ListIngestionJobs operation." + } + }, + "com.amazonaws.bedrockagent#IngestionJobSortByAttribute": { + "type": "enum", + "members": { + "STATUS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STATUS" + } + }, + "STARTED_AT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STARTED_AT" + } + } + }, + "traits": { + "smithy.api#documentation": "The name of the field to sort ingestion jobs." + } + }, + "com.amazonaws.bedrockagent#IngestionJobStatistics": { + "type": "structure", + "members": { + "numberOfDocumentsScanned": { + "target": "smithy.api#PrimitiveLong", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "Number of scanned documents" + } + }, + "numberOfNewDocumentsIndexed": { + "target": "smithy.api#PrimitiveLong", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "Number of indexed documents" + } + }, + "numberOfModifiedDocumentsIndexed": { + "target": "smithy.api#PrimitiveLong", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "Number of modified documents indexed" + } + }, + "numberOfDocumentsDeleted": { + "target": "smithy.api#PrimitiveLong", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "Number of deleted documents" + } + }, + "numberOfDocumentsFailed": { + "target": "smithy.api#PrimitiveLong", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "Number of failed documents" + } + } + }, + "traits": { + "smithy.api#documentation": "The document level statistics of an ingestion job" + } + }, + "com.amazonaws.bedrockagent#IngestionJobStatus": { + "type": "enum", + "members": { + "STARTING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STARTING" + } + }, + "IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IN_PROGRESS" + } + }, + "COMPLETE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETE" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + } + }, + "traits": { + "smithy.api#documentation": "The status of an ingestion job." + } + }, + "com.amazonaws.bedrockagent#IngestionJobSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#IngestionJobSummary" + }, + "traits": { + "smithy.api#documentation": "List of IngestionJobSummaries" + } + }, + "com.amazonaws.bedrockagent#IngestionJobSummary": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "ingestionJobId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "status": { + "target": "com.amazonaws.bedrockagent#IngestionJobStatus", + "traits": { + "smithy.api#required": {} + } + }, + "startedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "statistics": { + "target": "com.amazonaws.bedrockagent#IngestionJobStatistics" + } + }, + "traits": { + "smithy.api#documentation": "Summary information of an ingestion job." + } + }, + "com.amazonaws.bedrockagent#Instruction": { + "type": "string", + "traits": { + "smithy.api#documentation": "Instruction for the agent.", + "smithy.api#length": { + "min": 40, + "max": 1200 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagent#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockagent#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception is thrown if there was an unexpected error during processing of request", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.bedrockagent#KmsKeyArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "A KMS key ARN", + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBase": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "knowledgeBaseArn": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseArn", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "roleArn": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseRoleArn", + "traits": { + "smithy.api#required": {} + } + }, + "knowledgeBaseConfiguration": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "storageConfiguration": { + "target": "com.amazonaws.bedrockagent#StorageConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseStatus", + "traits": { + "smithy.api#required": {} + } + }, + "createdAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + }, + "failureReasons": { + "target": "com.amazonaws.bedrockagent#FailureReasons" + } + }, + "traits": { + "smithy.api#documentation": "Contains the information of a knowledge base." + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "ARN of a KnowledgeBase", + "smithy.api#length": { + "max": 128 + }, + "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):bedrock:[a-zA-Z0-9-]*:[0-9]{12}:knowledge-base/[0-9a-zA-Z]+$" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseConfiguration": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseType", + "traits": { + "smithy.api#required": {} + } + }, + "vectorKnowledgeBaseConfiguration": { + "target": "com.amazonaws.bedrockagent#VectorKnowledgeBaseConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Configures a bedrock knowledge base." + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#AssociateAgentKnowledgeBase" + }, + { + "target": "com.amazonaws.bedrockagent#CreateKnowledgeBase" + }, + { + "target": "com.amazonaws.bedrockagent#DeleteKnowledgeBase" + }, + { + "target": "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBase" + }, + { + "target": "com.amazonaws.bedrockagent#GetAgentKnowledgeBase" + }, + { + "target": "com.amazonaws.bedrockagent#GetKnowledgeBase" + }, + { + "target": "com.amazonaws.bedrockagent#ListAgentKnowledgeBases" + }, + { + "target": "com.amazonaws.bedrockagent#ListKnowledgeBases" + }, + { + "target": "com.amazonaws.bedrockagent#UpdateAgentKnowledgeBase" + }, + { + "target": "com.amazonaws.bedrockagent#UpdateKnowledgeBase" + } + ] + }, + "com.amazonaws.bedrockagent#KnowledgeBaseRoleArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "ARN of a IAM role.", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/(service-role/)?AmazonBedrockExecutionRoleForKnowledgeBase.+$" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseState": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + }, + "traits": { + "smithy.api#documentation": "State of the knowledge base; whether it is enabled or disabled" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseStatus": { + "type": "enum", + "members": { + "CREATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "UPDATING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + } + }, + "traits": { + "smithy.api#documentation": "The status of a knowledge base." + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseStorageType": { + "type": "enum", + "members": { + "OPENSEARCH_SERVERLESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OPENSEARCH_SERVERLESS" + } + }, + "PINECONE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PINECONE" + } + }, + "REDIS_ENTERPRISE_CLOUD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REDIS_ENTERPRISE_CLOUD" + } + } + }, + "traits": { + "smithy.api#documentation": "The storage type of a knowledge base." + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseSummary" + }, + "traits": { + "smithy.api#documentation": "List of KnowledgeBaseSummaries" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseSummary": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "status": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseStatus", + "traits": { + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Summary information of a knowledge base." + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseType": { + "type": "enum", + "members": { + "VECTOR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VECTOR" + } + } + }, + "traits": { + "smithy.api#documentation": "The type of a knowledge base." + } + }, + "com.amazonaws.bedrockagent#LambdaArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "ARN of a Lambda.", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9-_\\.]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?$" + } + }, + "com.amazonaws.bedrockagent#ListAgentActionGroups": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListAgentActionGroupsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListAgentActionGroupsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists an Action Group for existing Amazon Bedrock Agent Version", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "actionGroupSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListAgentActionGroupsRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is Listed", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is Listed", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults" + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Action Groups Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListAgentActionGroupsResponse": { + "type": "structure", + "members": { + "actionGroupSummaries": { + "target": "com.amazonaws.bedrockagent#ActionGroupSummaries", + "traits": { + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Action Groups Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ListAgentAliases": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListAgentAliasesRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListAgentAliasesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists all the Aliases for an Amazon Bedrock Agent", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/agents/{agentId}/agentaliases/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "agentAliasSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListAgentAliasesRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults" + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Agent Aliases Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListAgentAliasesResponse": { + "type": "structure", + "members": { + "agentAliasSummaries": { + "target": "com.amazonaws.bedrockagent#AgentAliasSummaries", + "traits": { + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Agent Aliases Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ListAgentKnowledgeBases": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListAgentKnowledgeBasesRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListAgentKnowledgeBasesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "List of Knowledge Bases associated to an existing Amazon Bedrock Agent Version", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "agentKnowledgeBaseSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListAgentKnowledgeBasesRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#documentation": "Version number generated when a version is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults" + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Agent Knowledge Bases Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListAgentKnowledgeBasesResponse": { + "type": "structure", + "members": { + "agentKnowledgeBaseSummaries": { + "target": "com.amazonaws.bedrockagent#AgentKnowledgeBaseSummaries", + "traits": { + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Agent Knowledge Bases Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ListAgentVersions": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListAgentVersionsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListAgentVersionsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists Agent Versions", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/agents/{agentId}/agentversions/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "agentVersionSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListAgentVersionsRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults" + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Agent Versions Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListAgentVersionsResponse": { + "type": "structure", + "members": { + "agentVersionSummaries": { + "target": "com.amazonaws.bedrockagent#AgentVersionSummaries", + "traits": { + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Agent Versions Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ListAgents": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListAgentsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListAgentsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists Agents", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/agents/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "agentSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListAgentsRequest": { + "type": "structure", + "members": { + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults" + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Agent Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListAgentsResponse": { + "type": "structure", + "members": { + "agentSummaries": { + "target": "com.amazonaws.bedrockagent#AgentSummaries", + "traits": { + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#documentation": "List Agent Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ListDataSources": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListDataSourcesRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListDataSourcesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "List data sources", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "dataSourceSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListDataSourcesRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults" + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListDataSourcesResponse": { + "type": "structure", + "members": { + "dataSourceSummaries": { + "target": "com.amazonaws.bedrockagent#DataSourceSummaries", + "traits": { + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ListIngestionJobs": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListIngestionJobsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListIngestionJobsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "List ingestion jobs", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "ingestionJobSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListIngestionJobsRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "filters": { + "target": "com.amazonaws.bedrockagent#IngestionJobFilters" + }, + "sortBy": { + "target": "com.amazonaws.bedrockagent#IngestionJobSortBy" + }, + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults" + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListIngestionJobsResponse": { + "type": "structure", + "members": { + "ingestionJobSummaries": { + "target": "com.amazonaws.bedrockagent#IngestionJobSummaries", + "traits": { + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ListKnowledgeBases": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListKnowledgeBasesRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListKnowledgeBasesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "List Knowledge Bases", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "knowledgeBaseSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListKnowledgeBasesRequest": { + "type": "structure", + "members": { + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults" + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListKnowledgeBasesResponse": { + "type": "structure", + "members": { + "knowledgeBaseSummaries": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseSummaries", + "traits": { + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "List tags for a resource", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/tags/{resourceArn}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockagent#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.bedrockagent#TaggableResourcesArn", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "tags": { + "target": "com.amazonaws.bedrockagent#TagsMap" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#documentation": "Max Results.", + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + }, + "com.amazonaws.bedrockagent#MaximumLength": { + "type": "integer", + "traits": { + "smithy.api#documentation": "Maximum length of output", + "smithy.api#range": { + "min": 0, + "max": 4096 + } + } + }, + "com.amazonaws.bedrockagent#ModelIdentifier": { + "type": "string", + "traits": { + "smithy.api#documentation": "ARN or name of a Bedrock model.", + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "(^[a-zA-Z0-9-_.]+$)|(^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))$)|(^([0-9a-zA-Z][_-]?)+$)|^([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63})$" + } + }, + "com.amazonaws.bedrockagent#Name": { + "type": "string", + "traits": { + "smithy.api#documentation": "Name for a resource.", + "smithy.api#pattern": "^([0-9a-zA-Z][_-]?){1,100}$" + } + }, + "com.amazonaws.bedrockagent#NextToken": { + "type": "string", + "traits": { + "smithy.api#documentation": "Opaque continuation token of previous paginated response.", + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^\\S*$" + } + }, + "com.amazonaws.bedrockagent#NonBlankString": { + "type": "string", + "traits": { + "smithy.api#documentation": "Non Blank String", + "smithy.api#pattern": "^[\\s\\S]+$" + } + }, + "com.amazonaws.bedrockagent#NumericalVersion": { + "type": "string", + "traits": { + "smithy.api#documentation": "Numerical Agent Version.", + "smithy.api#pattern": "^[0-9]{1,5}$" + } + }, + "com.amazonaws.bedrockagent#OpenSearchServerlessCollectionArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "Arn of an OpenSearch Serverless collection.", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws:aoss:[a-z]{2}(-gov)?-[a-z]+-\\d{1}:\\d{12}:collection/[a-z0-9-]{3,32}$" + } + }, + "com.amazonaws.bedrockagent#OpenSearchServerlessConfiguration": { + "type": "structure", + "members": { + "collectionArn": { + "target": "com.amazonaws.bedrockagent#OpenSearchServerlessCollectionArn", + "traits": { + "smithy.api#required": {} + } + }, + "vectorIndexName": { + "target": "com.amazonaws.bedrockagent#OpenSearchServerlessIndexName", + "traits": { + "smithy.api#required": {} + } + }, + "fieldMapping": { + "target": "com.amazonaws.bedrockagent#OpenSearchServerlessFieldMapping", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the configurations to use OpenSearch Serverless to store knowledge base data." + } + }, + "com.amazonaws.bedrockagent#OpenSearchServerlessFieldMapping": { + "type": "structure", + "members": { + "vectorField": { + "target": "com.amazonaws.bedrockagent#FieldName", + "traits": { + "smithy.api#required": {} + } + }, + "textField": { + "target": "com.amazonaws.bedrockagent#FieldName", + "traits": { + "smithy.api#required": {} + } + }, + "metadataField": { + "target": "com.amazonaws.bedrockagent#FieldName", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A mapping of Bedrock Knowledge Base fields to OpenSearch Serverless field names" + } + }, + "com.amazonaws.bedrockagent#OpenSearchServerlessIndexName": { + "type": "string", + "traits": { + "smithy.api#documentation": "Arn of an OpenSearch Serverless index.", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^.*$" + } + }, + "com.amazonaws.bedrockagent#Payload": { + "type": "string", + "traits": { + "smithy.api#documentation": "String OpenAPI Payload", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagent#PineconeConfiguration": { + "type": "structure", + "members": { + "connectionString": { + "target": "com.amazonaws.bedrockagent#PineconeConnectionString", + "traits": { + "smithy.api#required": {} + } + }, + "credentialsSecretArn": { + "target": "com.amazonaws.bedrockagent#SecretArn", + "traits": { + "smithy.api#required": {} + } + }, + "namespace": { + "target": "com.amazonaws.bedrockagent#PineconeNamespace" + }, + "fieldMapping": { + "target": "com.amazonaws.bedrockagent#PineconeFieldMapping", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the configurations to use Pinecone to store knowledge base data." + } + }, + "com.amazonaws.bedrockagent#PineconeConnectionString": { + "type": "string", + "traits": { + "smithy.api#documentation": "Pinecone connection string", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^.*$" + } + }, + "com.amazonaws.bedrockagent#PineconeFieldMapping": { + "type": "structure", + "members": { + "textField": { + "target": "com.amazonaws.bedrockagent#FieldName", + "traits": { + "smithy.api#required": {} + } + }, + "metadataField": { + "target": "com.amazonaws.bedrockagent#FieldName", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A mapping of Bedrock Knowledge Base fields to Pinecone field names" + } + }, + "com.amazonaws.bedrockagent#PineconeNamespace": { + "type": "string", + "traits": { + "smithy.api#documentation": "Pinecone namespace", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^.*$" + } + }, + "com.amazonaws.bedrockagent#PrepareAgent": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#PrepareAgentRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#PrepareAgentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Prepares an existing Amazon Bedrock Agent to receive runtime requests", + "smithy.api#http": { + "code": 202, + "method": "POST", + "uri": "/agents/{agentId}/" + }, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#PrepareAgentRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "PrepareAgent Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#PrepareAgentResponse": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#required": {} + } + }, + "agentStatus": { + "target": "com.amazonaws.bedrockagent#AgentStatus", + "traits": { + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#Version", + "traits": { + "smithy.api#required": {} + } + }, + "preparedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "PrepareAgent Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#PromptConfiguration": { + "type": "structure", + "members": { + "promptType": { + "target": "com.amazonaws.bedrockagent#PromptType" + }, + "promptCreationMode": { + "target": "com.amazonaws.bedrockagent#CreationMode" + }, + "promptState": { + "target": "com.amazonaws.bedrockagent#PromptState" + }, + "basePromptTemplate": { + "target": "com.amazonaws.bedrockagent#BasePromptTemplate" + }, + "inferenceConfiguration": { + "target": "com.amazonaws.bedrockagent#InferenceConfiguration" + }, + "parserMode": { + "target": "com.amazonaws.bedrockagent#CreationMode" + } + }, + "traits": { + "smithy.api#documentation": "BasePromptConfiguration per Prompt Type." + } + }, + "com.amazonaws.bedrockagent#PromptConfigurations": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#PromptConfiguration" + }, + "traits": { + "smithy.api#documentation": "List of BasePromptConfiguration", + "smithy.api#length": { + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#PromptOverrideConfiguration": { + "type": "structure", + "members": { + "promptConfigurations": { + "target": "com.amazonaws.bedrockagent#PromptConfigurations", + "traits": { + "smithy.api#required": {} + } + }, + "overrideLambda": { + "target": "com.amazonaws.bedrockagent#LambdaArn" + } + }, + "traits": { + "smithy.api#documentation": "Configuration for prompt override.", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagent#PromptState": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + }, + "traits": { + "smithy.api#documentation": "Prompt State." + } + }, + "com.amazonaws.bedrockagent#PromptType": { + "type": "enum", + "members": { + "PRE_PROCESSING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PRE_PROCESSING" + } + }, + "ORCHESTRATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ORCHESTRATION" + } + }, + "POST_PROCESSING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "POST_PROCESSING" + } + }, + "KNOWLEDGE_BASE_RESPONSE_GENERATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "KNOWLEDGE_BASE_RESPONSE_GENERATION" + } + } + }, + "traits": { + "smithy.api#documentation": "Prompt Type." + } + }, + "com.amazonaws.bedrockagent#RecommendedAction": { + "type": "string", + "traits": { + "smithy.api#documentation": "The recommended action users can take to resolve an error in failureReasons.", + "smithy.api#length": { + "max": 2048 + } + } + }, + "com.amazonaws.bedrockagent#RecommendedActions": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#RecommendedAction" + }, + "traits": { + "smithy.api#documentation": "The recommended actions users can take to resolve an error in failureReasons.", + "smithy.api#length": { + "max": 2048 + } + } + }, + "com.amazonaws.bedrockagent#RedisEnterpriseCloudConfiguration": { + "type": "structure", + "members": { + "endpoint": { + "target": "com.amazonaws.bedrockagent#RedisEnterpriseCloudEndpoint", + "traits": { + "smithy.api#required": {} + } + }, + "vectorIndexName": { + "target": "com.amazonaws.bedrockagent#RedisEnterpriseCloudIndexName", + "traits": { + "smithy.api#required": {} + } + }, + "credentialsSecretArn": { + "target": "com.amazonaws.bedrockagent#SecretArn", + "traits": { + "smithy.api#required": {} + } + }, + "fieldMapping": { + "target": "com.amazonaws.bedrockagent#RedisEnterpriseCloudFieldMapping", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains the configurations to use Redis Enterprise Cloud to store knowledge base data." + } + }, + "com.amazonaws.bedrockagent#RedisEnterpriseCloudEndpoint": { + "type": "string", + "traits": { + "smithy.api#documentation": "Redis enterprise cloud endpoint", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^.*$" + } + }, + "com.amazonaws.bedrockagent#RedisEnterpriseCloudFieldMapping": { + "type": "structure", + "members": { + "vectorField": { + "target": "com.amazonaws.bedrockagent#FieldName", + "traits": { + "smithy.api#required": {} + } + }, + "textField": { + "target": "com.amazonaws.bedrockagent#FieldName", + "traits": { + "smithy.api#required": {} + } + }, + "metadataField": { + "target": "com.amazonaws.bedrockagent#FieldName", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A mapping of Bedrock Knowledge Base fields to Redis Cloud field names" + } + }, + "com.amazonaws.bedrockagent#RedisEnterpriseCloudIndexName": { + "type": "string", + "traits": { + "smithy.api#documentation": "Name of a redis enterprise cloud index", + "smithy.api#length": { + "max": 2048 + }, + "smithy.api#pattern": "^.*$" + } + }, + "com.amazonaws.bedrockagent#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockagent#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception is thrown when a resource referenced by the operation does not exist", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.bedrockagent#S3BucketArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "A S3 bucket ARN", + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):s3:::[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$" + } + }, + "com.amazonaws.bedrockagent#S3BucketName": { + "type": "string", + "traits": { + "smithy.api#documentation": "A bucket in S3.", + "smithy.api#length": { + "min": 3, + "max": 63 + }, + "smithy.api#pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$" + } + }, + "com.amazonaws.bedrockagent#S3DataSourceConfiguration": { + "type": "structure", + "members": { + "bucketArn": { + "target": "com.amazonaws.bedrockagent#S3BucketArn", + "traits": { + "smithy.api#required": {} + } + }, + "inclusionPrefixes": { + "target": "com.amazonaws.bedrockagent#S3Prefixes" + } + }, + "traits": { + "smithy.api#documentation": "Configures an S3 data source location." + } + }, + "com.amazonaws.bedrockagent#S3Identifier": { + "type": "structure", + "members": { + "s3BucketName": { + "target": "com.amazonaws.bedrockagent#S3BucketName" + }, + "s3ObjectKey": { + "target": "com.amazonaws.bedrockagent#S3ObjectKey" + } + }, + "traits": { + "smithy.api#documentation": "The identifier for the S3 resource." + } + }, + "com.amazonaws.bedrockagent#S3ObjectKey": { + "type": "string", + "traits": { + "smithy.api#documentation": "A object key in S3.", + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^[\\.\\-\\!\\*\\_\\'\\(\\)a-zA-Z0-9][\\.\\-\\!\\*\\_\\'\\(\\)\\/a-zA-Z0-9]*$" + } + }, + "com.amazonaws.bedrockagent#S3Prefix": { + "type": "string", + "traits": { + "smithy.api#documentation": "Prefix for s3 object.", + "smithy.api#length": { + "min": 1, + "max": 300 + } + } + }, + "com.amazonaws.bedrockagent#S3Prefixes": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#S3Prefix" + }, + "traits": { + "smithy.api#documentation": "A list of S3 prefixes.", + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.bedrockagent#SecretArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "Arn of a SecretsManager Secret.", + "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):secretsmanager:[a-z0-9-]{1,20}:([0-9]{12}|):secret:[a-zA-Z0-9/_+=.@-]{1,63}$" + } + }, + "com.amazonaws.bedrockagent#ServerSideEncryptionConfiguration": { + "type": "structure", + "members": { + "kmsKeyArn": { + "target": "com.amazonaws.bedrockagent#KmsKeyArn" + } + }, + "traits": { + "smithy.api#documentation": "Server-side encryption configuration." + } + }, + "com.amazonaws.bedrockagent#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockagent#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception is thrown when a request is made beyond the service quota", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.bedrockagent#SessionTTL": { + "type": "integer", + "traits": { + "smithy.api#documentation": "Max Session Time.", + "smithy.api#range": { + "min": 60, + "max": 3600 + } + } + }, + "com.amazonaws.bedrockagent#SortOrder": { + "type": "enum", + "members": { + "ASCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ASCENDING" + } + }, + "DESCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DESCENDING" + } + } + }, + "traits": { + "smithy.api#documentation": "Order to sort results by." + } + }, + "com.amazonaws.bedrockagent#StartIngestionJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#StartIngestionJobRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#StartIngestionJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Start a new ingestion job", + "smithy.api#http": { + "code": 202, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#StartIngestionJobRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken", + "traits": { + "smithy.api#idempotencyToken": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#StartIngestionJobResponse": { + "type": "structure", + "members": { + "ingestionJob": { + "target": "com.amazonaws.bedrockagent#IngestionJob", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#StopSequences": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#documentation": "List of stop sequences", + "smithy.api#length": { + "min": 0, + "max": 4 + } + } + }, + "com.amazonaws.bedrockagent#StorageConfiguration": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseStorageType", + "traits": { + "smithy.api#required": {} + } + }, + "opensearchServerlessConfiguration": { + "target": "com.amazonaws.bedrockagent#OpenSearchServerlessConfiguration" + }, + "pineconeConfiguration": { + "target": "com.amazonaws.bedrockagent#PineconeConfiguration" + }, + "redisEnterpriseCloudConfiguration": { + "target": "com.amazonaws.bedrockagent#RedisEnterpriseCloudConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Configures the physical storage of ingested data in a knowledge base." + } + }, + "com.amazonaws.bedrockagent#TagKey": { + "type": "string", + "traits": { + "smithy.api#documentation": "Key of a tag", + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s._:/=+@-]*$" + } + }, + "com.amazonaws.bedrockagent#TagKeyList": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#TagKey" + }, + "traits": { + "smithy.api#documentation": "List of Tag Keys", + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.bedrockagent#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#TagResourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#TagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Tag a resource", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/tags/{resourceArn}" + } + } + }, + "com.amazonaws.bedrockagent#TagResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.bedrockagent#TaggableResourcesArn", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.bedrockagent#TagsMap", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#TagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#TagValue": { + "type": "string", + "traits": { + "smithy.api#documentation": "Value of a tag", + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s._:/=+@-]*$" + } + }, + "com.amazonaws.bedrockagent#TaggableResourcesArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base]", + "smithy.api#length": { + "min": 20, + "max": 1011 + }, + "smithy.api#pattern": "(^arn:aws:bedrock:[a-zA-Z0-9-]+:/d{12}:(agent|agent-alias|knowledge-base)/[A-Z0-9]{10}(?:/[A-Z0-9]{10})?$)" + } + }, + "com.amazonaws.bedrockagent#TaggingResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#ListTagsForResource" + }, + { + "target": "com.amazonaws.bedrockagent#TagResource" + }, + { + "target": "com.amazonaws.bedrockagent#UntagResource" + } + ] + }, + "com.amazonaws.bedrockagent#TagsMap": { + "type": "map", + "key": { + "target": "com.amazonaws.bedrockagent#TagKey" + }, + "value": { + "target": "com.amazonaws.bedrockagent#TagValue" + }, + "traits": { + "smithy.api#documentation": "A map of tag keys and values" + } + }, + "com.amazonaws.bedrockagent#Temperature": { + "type": "float", + "traits": { + "smithy.api#documentation": "Controls randomness, higher values increase diversity", + "smithy.api#range": { + "min": 0, + "max": 1 + } + } + }, + "com.amazonaws.bedrockagent#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockagent#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception is thrown when the number of requests exceeds the limit", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, + "com.amazonaws.bedrockagent#TopK": { + "type": "integer", + "traits": { + "smithy.api#documentation": "Sample from the k most likely next tokens", + "smithy.api#range": { + "min": 0, + "max": 500 + } + } + }, + "com.amazonaws.bedrockagent#TopP": { + "type": "float", + "traits": { + "smithy.api#documentation": "Cumulative probability cutoff for token selection", + "smithy.api#range": { + "min": 0, + "max": 1 + } + } + }, + "com.amazonaws.bedrockagent#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#UntagResourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#UntagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Untag a resource", + "smithy.api#http": { + "code": 200, + "method": "DELETE", + "uri": "/tags/{resourceArn}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockagent#UntagResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.bedrockagent#TaggableResourcesArn", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tagKeys": { + "target": "com.amazonaws.bedrockagent#TagKeyList", + "traits": { + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#UntagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#UpdateAgent": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#UpdateAgentRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#UpdateAgentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Updates an existing Amazon Bedrock Agent", + "smithy.api#http": { + "code": 202, + "method": "PUT", + "uri": "/agents/{agentId}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#UpdateAgentActionGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#UpdateAgentActionGroupRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#UpdateAgentActionGroupResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Updates an existing Action Group for Amazon Bedrock Agent", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#UpdateAgentActionGroupRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#DraftVersion", + "traits": { + "smithy.api#documentation": "Draft Version of the Agent.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "actionGroupId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Action Group is created under Agent", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "actionGroupName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "parentActionGroupSignature": { + "target": "com.amazonaws.bedrockagent#ActionGroupSignature" + }, + "actionGroupExecutor": { + "target": "com.amazonaws.bedrockagent#ActionGroupExecutor" + }, + "actionGroupState": { + "target": "com.amazonaws.bedrockagent#ActionGroupState" + }, + "apiSchema": { + "target": "com.amazonaws.bedrockagent#APISchema" + } + }, + "traits": { + "smithy.api#documentation": "Update Action Group Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#UpdateAgentActionGroupResponse": { + "type": "structure", + "members": { + "agentActionGroup": { + "target": "com.amazonaws.bedrockagent#AgentActionGroup", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Update Action Group Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#UpdateAgentAlias": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#UpdateAgentAliasRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#UpdateAgentAliasResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Updates an existing Alias for an Amazon Bedrock Agent", + "smithy.api#http": { + "code": 202, + "method": "PUT", + "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#UpdateAgentAliasRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentAliasId": { + "target": "com.amazonaws.bedrockagent#AgentAliasId", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent Alias is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentAliasName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "routingConfiguration": { + "target": "com.amazonaws.bedrockagent#AgentAliasRoutingConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Update Agent Alias Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#UpdateAgentAliasResponse": { + "type": "structure", + "members": { + "agentAlias": { + "target": "com.amazonaws.bedrockagent#AgentAlias", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Update Agent Alias Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#UpdateAgentKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Updates an existing Knowledge Base associated to an Amazon Bedrock Agent", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentVersion": { + "target": "com.amazonaws.bedrockagent#DraftVersion", + "traits": { + "smithy.api#documentation": "Draft Version of the Agent.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when a Knowledge Base is associated to an Agent", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "knowledgeBaseState": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseState" + } + }, + "traits": { + "smithy.api#documentation": "Update Agent Knowledge Base Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseResponse": { + "type": "structure", + "members": { + "agentKnowledgeBase": { + "target": "com.amazonaws.bedrockagent#AgentKnowledgeBase", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Update Agent Knowledge Base Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#UpdateAgentRequest": { + "type": "structure", + "members": { + "agentId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "Id generated at the server side when an Agent is created", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "agentName": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "instruction": { + "target": "com.amazonaws.bedrockagent#Instruction" + }, + "foundationModel": { + "target": "com.amazonaws.bedrockagent#ModelIdentifier" + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "idleSessionTTLInSeconds": { + "target": "com.amazonaws.bedrockagent#SessionTTL" + }, + "agentResourceRoleArn": { + "target": "com.amazonaws.bedrockagent#AgentRoleArn", + "traits": { + "smithy.api#required": {} + } + }, + "customerEncryptionKeyArn": { + "target": "com.amazonaws.bedrockagent#KmsKeyArn" + }, + "promptOverrideConfiguration": { + "target": "com.amazonaws.bedrockagent#PromptOverrideConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Update Agent Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#UpdateAgentResponse": { + "type": "structure", + "members": { + "agent": { + "target": "com.amazonaws.bedrockagent#Agent", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Update Agent Response", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#UpdateDataSource": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#UpdateDataSourceRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#UpdateDataSourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Update an existing data source", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#UpdateDataSourceRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "dataSourceConfiguration": { + "target": "com.amazonaws.bedrockagent#DataSourceConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "serverSideEncryptionConfiguration": { + "target": "com.amazonaws.bedrockagent#ServerSideEncryptionConfiguration" + }, + "vectorIngestionConfiguration": { + "target": "com.amazonaws.bedrockagent#VectorIngestionConfiguration" + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#UpdateDataSourceResponse": { + "type": "structure", + "members": { + "dataSource": { + "target": "com.amazonaws.bedrockagent#DataSource", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#UpdateKnowledgeBase": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#UpdateKnowledgeBaseRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#UpdateKnowledgeBaseResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#ConflictException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Update an existing knowledge base", + "smithy.api#http": { + "code": 202, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#UpdateKnowledgeBaseRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.bedrockagent#Name", + "traits": { + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.bedrockagent#Description" + }, + "roleArn": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseRoleArn", + "traits": { + "smithy.api#required": {} + } + }, + "knowledgeBaseConfiguration": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseConfiguration", + "traits": { + "smithy.api#required": {} + } + }, + "storageConfiguration": { + "target": "com.amazonaws.bedrockagent#StorageConfiguration", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#UpdateKnowledgeBaseResponse": { + "type": "structure", + "members": { + "knowledgeBase": { + "target": "com.amazonaws.bedrockagent#KnowledgeBase", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagent#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockagent#NonBlankString" + }, + "fieldList": { + "target": "com.amazonaws.bedrockagent#ValidationExceptionFieldList" + } + }, + "traits": { + "smithy.api#documentation": "This exception is thrown when the request's input validation fails", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.bedrockagent#ValidationExceptionField": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.bedrockagent#NonBlankString", + "traits": { + "smithy.api#required": {} + } + }, + "message": { + "target": "com.amazonaws.bedrockagent#NonBlankString", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Stores information about a field passed inside a request that resulted in an exception" + } + }, + "com.amazonaws.bedrockagent#ValidationExceptionFieldList": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#ValidationExceptionField" + }, + "traits": { + "smithy.api#documentation": "list of ValidationExceptionField" + } + }, + "com.amazonaws.bedrockagent#VectorIngestionConfiguration": { + "type": "structure", + "members": { + "chunkingConfiguration": { + "target": "com.amazonaws.bedrockagent#ChunkingConfiguration" + } + }, + "traits": { + "smithy.api#documentation": "Configures ingestion for a vector knowledge base" + } + }, + "com.amazonaws.bedrockagent#VectorKnowledgeBaseConfiguration": { + "type": "structure", + "members": { + "embeddingModelArn": { + "target": "com.amazonaws.bedrockagent#BedrockEmbeddingModelArn", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configurations for a vector knowledge base." + } + }, + "com.amazonaws.bedrockagent#Version": { + "type": "string", + "traits": { + "smithy.api#documentation": "Agent Version.", + "smithy.api#length": { + "min": 1, + "max": 5 + }, + "smithy.api#pattern": "^(DRAFT|[0-9]{0,4}[1-9][0-9]{0,4})$" + } + }, + "com.amazonaws.bedrockagent#VersionResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#DeleteAgentVersion" + }, + { + "target": "com.amazonaws.bedrockagent#GetAgentVersion" + }, + { + "target": "com.amazonaws.bedrockagent#ListAgentVersions" + } + ] + } + } +}