diff --git a/clients/client-bedrock-data-automation-runtime/.gitignore b/clients/client-bedrock-data-automation-runtime/.gitignore new file mode 100644 index 000000000000..54f14c9aef25 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/clients/client-bedrock-data-automation-runtime/LICENSE b/clients/client-bedrock-data-automation-runtime/LICENSE new file mode 100644 index 000000000000..1349aa7c9923 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/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-2024 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-data-automation-runtime/README.md b/clients/client-bedrock-data-automation-runtime/README.md new file mode 100644 index 000000000000..2b5274f8128e --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/README.md @@ -0,0 +1,227 @@ + + +# @aws-sdk/client-bedrock-data-automation-runtime + +## Description + +AWS SDK for JavaScript BedrockDataAutomationRuntime Client for Node.js, Browser and React Native. + +Amazon Bedrock Keystone Runtime + +## Installing + +To install this package, simply type add or install @aws-sdk/client-bedrock-data-automation-runtime +using your favorite package manager: + +- `npm install @aws-sdk/client-bedrock-data-automation-runtime` +- `yarn add @aws-sdk/client-bedrock-data-automation-runtime` +- `pnpm add @aws-sdk/client-bedrock-data-automation-runtime` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `BedrockDataAutomationRuntimeClient` and +the commands you need, for example `GetDataAutomationStatusCommand`: + +```js +// ES5 example +const { + BedrockDataAutomationRuntimeClient, + GetDataAutomationStatusCommand, +} = require("@aws-sdk/client-bedrock-data-automation-runtime"); +``` + +```ts +// ES6+ example +import { + BedrockDataAutomationRuntimeClient, + GetDataAutomationStatusCommand, +} from "@aws-sdk/client-bedrock-data-automation-runtime"; +``` + +### 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 BedrockDataAutomationRuntimeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetDataAutomationStatusCommand(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-data-automation-runtime"; +const client = new AWS.BedrockDataAutomationRuntime({ region: "REGION" }); + +// async/await. +try { + const data = await client.getDataAutomationStatus(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getDataAutomationStatus(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getDataAutomationStatus(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-data-automation-runtime` 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) + +
+ +GetDataAutomationStatus + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-data-automation-runtime/command/GetDataAutomationStatusCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-data-automation-runtime/Interface/GetDataAutomationStatusCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-data-automation-runtime/Interface/GetDataAutomationStatusCommandOutput/) + +
+
+ +InvokeDataAutomationAsync + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-data-automation-runtime/command/InvokeDataAutomationAsyncCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-data-automation-runtime/Interface/InvokeDataAutomationAsyncCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-data-automation-runtime/Interface/InvokeDataAutomationAsyncCommandOutput/) + +
diff --git a/clients/client-bedrock-data-automation-runtime/api-extractor.json b/clients/client-bedrock-data-automation-runtime/api-extractor.json new file mode 100644 index 000000000000..d5bf5ffeee85 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/clients/client-bedrock-data-automation-runtime/package.json b/clients/client-bedrock-data-automation-runtime/package.json new file mode 100644 index 000000000000..0f6624642fc8 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/package.json @@ -0,0 +1,103 @@ +{ + "name": "@aws-sdk/client-bedrock-data-automation-runtime", + "description": "AWS SDK for JavaScript Bedrock Data Automation Runtime 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: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 || exit 0", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo bedrock-data-automation-runtime" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "*", + "@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-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": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@tsconfig/node16": "16.1.3", + "@types/node": "^16.18.96", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~4.9.5" + }, + "engines": { + "node": ">=16.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-data-automation-runtime", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-bedrock-data-automation-runtime" + } +} diff --git a/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntime.ts b/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntime.ts new file mode 100644 index 000000000000..b40ee309f6fe --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntime.ts @@ -0,0 +1,68 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + BedrockDataAutomationRuntimeClient, + BedrockDataAutomationRuntimeClientConfig, +} from "./BedrockDataAutomationRuntimeClient"; +import { + GetDataAutomationStatusCommand, + GetDataAutomationStatusCommandInput, + GetDataAutomationStatusCommandOutput, +} from "./commands/GetDataAutomationStatusCommand"; +import { + InvokeDataAutomationAsyncCommand, + InvokeDataAutomationAsyncCommandInput, + InvokeDataAutomationAsyncCommandOutput, +} from "./commands/InvokeDataAutomationAsyncCommand"; + +const commands = { + GetDataAutomationStatusCommand, + InvokeDataAutomationAsyncCommand, +}; + +export interface BedrockDataAutomationRuntime { + /** + * @see {@link GetDataAutomationStatusCommand} + */ + getDataAutomationStatus( + args: GetDataAutomationStatusCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getDataAutomationStatus( + args: GetDataAutomationStatusCommandInput, + cb: (err: any, data?: GetDataAutomationStatusCommandOutput) => void + ): void; + getDataAutomationStatus( + args: GetDataAutomationStatusCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetDataAutomationStatusCommandOutput) => void + ): void; + + /** + * @see {@link InvokeDataAutomationAsyncCommand} + */ + invokeDataAutomationAsync( + args: InvokeDataAutomationAsyncCommandInput, + options?: __HttpHandlerOptions + ): Promise; + invokeDataAutomationAsync( + args: InvokeDataAutomationAsyncCommandInput, + cb: (err: any, data?: InvokeDataAutomationAsyncCommandOutput) => void + ): void; + invokeDataAutomationAsync( + args: InvokeDataAutomationAsyncCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: InvokeDataAutomationAsyncCommandOutput) => void + ): void; +} + +/** + * Amazon Bedrock Keystone Runtime + * @public + */ +export class BedrockDataAutomationRuntime + extends BedrockDataAutomationRuntimeClient + implements BedrockDataAutomationRuntime {} +createAggregatedClient(commands, BedrockDataAutomationRuntime); diff --git a/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntimeClient.ts b/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntimeClient.ts new file mode 100644 index 000000000000..6ee64682d725 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntimeClient.ts @@ -0,0 +1,310 @@ +// 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 { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +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 { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + AwsCredentialIdentityProvider, + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + 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 { + defaultBedrockDataAutomationRuntimeHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { + GetDataAutomationStatusCommandInput, + GetDataAutomationStatusCommandOutput, +} from "./commands/GetDataAutomationStatusCommand"; +import { + InvokeDataAutomationAsyncCommandInput, + InvokeDataAutomationAsyncCommandOutput, +} from "./commands/InvokeDataAutomationAsyncCommand"; +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 = GetDataAutomationStatusCommandInput | InvokeDataAutomationAsyncCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = GetDataAutomationStatusCommandOutput | InvokeDataAutomationAsyncCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * 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; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * 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 BedrockDataAutomationRuntimeClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of BedrockDataAutomationRuntimeClient class constructor that set the region, credentials and other options. + */ +export interface BedrockDataAutomationRuntimeClientConfig extends BedrockDataAutomationRuntimeClientConfigType {} + +/** + * @public + */ +export type BedrockDataAutomationRuntimeClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of BedrockDataAutomationRuntimeClient class. This is resolved and normalized from the {@link BedrockDataAutomationRuntimeClientConfig | constructor configuration interface}. + */ +export interface BedrockDataAutomationRuntimeClientResolvedConfig + extends BedrockDataAutomationRuntimeClientResolvedConfigType {} + +/** + * Amazon Bedrock Keystone Runtime + * @public + */ +export class BedrockDataAutomationRuntimeClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + BedrockDataAutomationRuntimeClientResolvedConfig +> { + /** + * The resolved configuration of BedrockDataAutomationRuntimeClient class. This is resolved and normalized from the {@link BedrockDataAutomationRuntimeClientConfig | constructor configuration interface}. + */ + readonly config: BedrockDataAutomationRuntimeClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use(getUserAgentPlugin(this.config)); + 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( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultBedrockDataAutomationRuntimeHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: BedrockDataAutomationRuntimeClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(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-data-automation-runtime/src/auth/httpAuthExtensionConfiguration.ts b/clients/client-bedrock-data-automation-runtime/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 000000000000..13dc22960131 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { BedrockDataAutomationRuntimeHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: BedrockDataAutomationRuntimeHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): BedrockDataAutomationRuntimeHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: BedrockDataAutomationRuntimeHttpAuthSchemeProvider; + credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: BedrockDataAutomationRuntimeHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): BedrockDataAutomationRuntimeHttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void { + _credentials = credentials; + }, + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined { + return _credentials; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; diff --git a/clients/client-bedrock-data-automation-runtime/src/auth/httpAuthSchemeProvider.ts b/clients/client-bedrock-data-automation-runtime/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 000000000000..49881877a3be --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,144 @@ +// smithy-typescript generated code +import { + AwsSdkSigV4AuthInputConfig, + AwsSdkSigV4AuthResolvedConfig, + AwsSdkSigV4PreviouslyResolved, + resolveAwsSdkSigV4Config, +} from "@aws-sdk/core"; +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { + BedrockDataAutomationRuntimeClientConfig, + BedrockDataAutomationRuntimeClientResolvedConfig, +} from "../BedrockDataAutomationRuntimeClient"; + +/** + * @internal + */ +export interface BedrockDataAutomationRuntimeHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface BedrockDataAutomationRuntimeHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + BedrockDataAutomationRuntimeClientResolvedConfig, + HandlerExecutionContext, + BedrockDataAutomationRuntimeHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultBedrockDataAutomationRuntimeHttpAuthSchemeParametersProvider = async ( + config: BedrockDataAutomationRuntimeClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; + +function createAwsAuthSigv4HttpAuthOption( + authParameters: BedrockDataAutomationRuntimeHttpAuthSchemeParameters +): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "bedrock", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface BedrockDataAutomationRuntimeHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultBedrockDataAutomationRuntimeHttpAuthSchemeProvider: BedrockDataAutomationRuntimeHttpAuthSchemeProvider = + (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; + }; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: BedrockDataAutomationRuntimeHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: BedrockDataAutomationRuntimeHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved +): T & HttpAuthSchemeResolvedConfig => { + const config_0 = resolveAwsSdkSigV4Config(config); + return { + ...config_0, + } as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/clients/client-bedrock-data-automation-runtime/src/commands/GetDataAutomationStatusCommand.ts b/clients/client-bedrock-data-automation-runtime/src/commands/GetDataAutomationStatusCommand.ts new file mode 100644 index 000000000000..1fba86df24c6 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/commands/GetDataAutomationStatusCommand.ts @@ -0,0 +1,116 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { + BedrockDataAutomationRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../BedrockDataAutomationRuntimeClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { GetDataAutomationStatusRequest, GetDataAutomationStatusResponse } from "../models/models_0"; +import { de_GetDataAutomationStatusCommand, se_GetDataAutomationStatusCommand } from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetDataAutomationStatusCommand}. + */ +export interface GetDataAutomationStatusCommandInput extends GetDataAutomationStatusRequest {} +/** + * @public + * + * The output of {@link GetDataAutomationStatusCommand}. + */ +export interface GetDataAutomationStatusCommandOutput extends GetDataAutomationStatusResponse, __MetadataBearer {} + +/** + * API used to get data automation status. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockDataAutomationRuntimeClient, GetDataAutomationStatusCommand } from "@aws-sdk/client-bedrock-data-automation-runtime"; // ES Modules import + * // const { BedrockDataAutomationRuntimeClient, GetDataAutomationStatusCommand } = require("@aws-sdk/client-bedrock-data-automation-runtime"); // CommonJS import + * const client = new BedrockDataAutomationRuntimeClient(config); + * const input = { // GetDataAutomationStatusRequest + * invocationArn: "STRING_VALUE", // required + * }; + * const command = new GetDataAutomationStatusCommand(input); + * const response = await client.send(command); + * // { // GetDataAutomationStatusResponse + * // status: "Created" || "InProgress" || "Success" || "ServiceError" || "ClientError", + * // errorType: "STRING_VALUE", + * // errorMessage: "STRING_VALUE", + * // outputConfiguration: { // OutputConfiguration + * // s3Uri: "STRING_VALUE", // required + * // }, + * // }; + * + * ``` + * + * @param GetDataAutomationStatusCommandInput - {@link GetDataAutomationStatusCommandInput} + * @returns {@link GetDataAutomationStatusCommandOutput} + * @see {@link GetDataAutomationStatusCommandInput} for command's `input` shape. + * @see {@link GetDataAutomationStatusCommandOutput} for command's `response` shape. + * @see {@link BedrockDataAutomationRuntimeClientResolvedConfig | config} for BedrockDataAutomationRuntimeClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception will be thrown when customer does not have access to API. + * + * @throws {@link InternalServerException} (server fault) + * This exception is for any internal un-expected service errors. + * + * @throws {@link ResourceNotFoundException} (client fault) + * This exception will be thrown when resource provided from customer not found. + * + * @throws {@link ThrottlingException} (client fault) + * This exception will be thrown when customer reached API TPS limit. + * + * @throws {@link ValidationException} (client fault) + * This exception will be thrown when customer provided invalid parameters. + * + * @throws {@link BedrockDataAutomationRuntimeServiceException} + *

Base exception class for all service exceptions from BedrockDataAutomationRuntime service.

+ * + * @public + */ +export class GetDataAutomationStatusCommand extends $Command + .classBuilder< + GetDataAutomationStatusCommandInput, + GetDataAutomationStatusCommandOutput, + BedrockDataAutomationRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockDataAutomationRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockKeystoneRuntimeService", "GetDataAutomationStatus", {}) + .n("BedrockDataAutomationRuntimeClient", "GetDataAutomationStatusCommand") + .f(void 0, void 0) + .ser(se_GetDataAutomationStatusCommand) + .de(de_GetDataAutomationStatusCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetDataAutomationStatusRequest; + output: GetDataAutomationStatusResponse; + }; + sdk: { + input: GetDataAutomationStatusCommandInput; + output: GetDataAutomationStatusCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-data-automation-runtime/src/commands/InvokeDataAutomationAsyncCommand.ts b/clients/client-bedrock-data-automation-runtime/src/commands/InvokeDataAutomationAsyncCommand.ts new file mode 100644 index 000000000000..b335afedf37a --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/commands/InvokeDataAutomationAsyncCommand.ts @@ -0,0 +1,139 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { + BedrockDataAutomationRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../BedrockDataAutomationRuntimeClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { InvokeDataAutomationAsyncRequest, InvokeDataAutomationAsyncResponse } from "../models/models_0"; +import { de_InvokeDataAutomationAsyncCommand, se_InvokeDataAutomationAsyncCommand } from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link InvokeDataAutomationAsyncCommand}. + */ +export interface InvokeDataAutomationAsyncCommandInput extends InvokeDataAutomationAsyncRequest {} +/** + * @public + * + * The output of {@link InvokeDataAutomationAsyncCommand}. + */ +export interface InvokeDataAutomationAsyncCommandOutput extends InvokeDataAutomationAsyncResponse, __MetadataBearer {} + +/** + * Async API: Invoke data automation. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockDataAutomationRuntimeClient, InvokeDataAutomationAsyncCommand } from "@aws-sdk/client-bedrock-data-automation-runtime"; // ES Modules import + * // const { BedrockDataAutomationRuntimeClient, InvokeDataAutomationAsyncCommand } = require("@aws-sdk/client-bedrock-data-automation-runtime"); // CommonJS import + * const client = new BedrockDataAutomationRuntimeClient(config); + * const input = { // InvokeDataAutomationAsyncRequest + * clientToken: "STRING_VALUE", + * inputConfiguration: { // InputConfiguration + * s3Uri: "STRING_VALUE", // required + * }, + * outputConfiguration: { // OutputConfiguration + * s3Uri: "STRING_VALUE", // required + * }, + * dataAutomationConfiguration: { // DataAutomationConfiguration + * dataAutomationArn: "STRING_VALUE", // required + * stage: "LIVE" || "DEVELOPMENT", + * }, + * encryptionConfiguration: { // EncryptionConfiguration + * kmsKeyId: "STRING_VALUE", // required + * kmsEncryptionContext: { // EncryptionContextMap + * "": "STRING_VALUE", + * }, + * }, + * notificationConfiguration: { // NotificationConfiguration + * eventBridgeConfiguration: { // EventBridgeConfiguration + * eventBridgeEnabled: true || false, // required + * }, + * }, + * blueprints: [ // BlueprintList + * { // Blueprint + * blueprintArn: "STRING_VALUE", // required + * version: "STRING_VALUE", + * stage: "DEVELOPMENT" || "LIVE", + * }, + * ], + * }; + * const command = new InvokeDataAutomationAsyncCommand(input); + * const response = await client.send(command); + * // { // InvokeDataAutomationAsyncResponse + * // invocationArn: "STRING_VALUE", // required + * // }; + * + * ``` + * + * @param InvokeDataAutomationAsyncCommandInput - {@link InvokeDataAutomationAsyncCommandInput} + * @returns {@link InvokeDataAutomationAsyncCommandOutput} + * @see {@link InvokeDataAutomationAsyncCommandInput} for command's `input` shape. + * @see {@link InvokeDataAutomationAsyncCommandOutput} for command's `response` shape. + * @see {@link BedrockDataAutomationRuntimeClientResolvedConfig | config} for BedrockDataAutomationRuntimeClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + * This exception will be thrown when customer does not have access to API. + * + * @throws {@link InternalServerException} (server fault) + * This exception is for any internal un-expected service errors. + * + * @throws {@link ServiceQuotaExceededException} (client fault) + * This exception will be thrown when service quota is exceeded. + * + * @throws {@link ThrottlingException} (client fault) + * This exception will be thrown when customer reached API TPS limit. + * + * @throws {@link ValidationException} (client fault) + * This exception will be thrown when customer provided invalid parameters. + * + * @throws {@link BedrockDataAutomationRuntimeServiceException} + *

Base exception class for all service exceptions from BedrockDataAutomationRuntime service.

+ * + * @public + */ +export class InvokeDataAutomationAsyncCommand extends $Command + .classBuilder< + InvokeDataAutomationAsyncCommandInput, + InvokeDataAutomationAsyncCommandOutput, + BedrockDataAutomationRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockDataAutomationRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockKeystoneRuntimeService", "InvokeDataAutomationAsync", {}) + .n("BedrockDataAutomationRuntimeClient", "InvokeDataAutomationAsyncCommand") + .f(void 0, void 0) + .ser(se_InvokeDataAutomationAsyncCommand) + .de(de_InvokeDataAutomationAsyncCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: InvokeDataAutomationAsyncRequest; + output: InvokeDataAutomationAsyncResponse; + }; + sdk: { + input: InvokeDataAutomationAsyncCommandInput; + output: InvokeDataAutomationAsyncCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-data-automation-runtime/src/commands/index.ts b/clients/client-bedrock-data-automation-runtime/src/commands/index.ts new file mode 100644 index 000000000000..d025ec0f6563 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/commands/index.ts @@ -0,0 +1,3 @@ +// smithy-typescript generated code +export * from "./GetDataAutomationStatusCommand"; +export * from "./InvokeDataAutomationAsyncCommand"; diff --git a/clients/client-bedrock-data-automation-runtime/src/endpoint/EndpointParameters.ts b/clients/client-bedrock-data-automation-runtime/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..a164c103c4b7 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/endpoint/EndpointParameters.ts @@ -0,0 +1,41 @@ +// 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 const commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/clients/client-bedrock-data-automation-runtime/src/endpoint/endpointResolver.ts b/clients/client-bedrock-data-automation-runtime/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..ccee107f30d6 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/clients/client-bedrock-data-automation-runtime/src/endpoint/ruleset.ts b/clients/client-bedrock-data-automation-runtime/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..b9c168634777 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/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-data-automation-runtime.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-data-automation-runtime-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-data-automation-runtime-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-data-automation-runtime.{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-data-automation-runtime.{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-data-automation-runtime/src/extensionConfiguration.ts b/clients/client-bedrock-data-automation-runtime/src/extensionConfiguration.ts new file mode 100644 index 000000000000..46027e6ff985 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/extensionConfiguration.ts @@ -0,0 +1,15 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface BedrockDataAutomationRuntimeExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/clients/client-bedrock-data-automation-runtime/src/index.ts b/clients/client-bedrock-data-automation-runtime/src/index.ts new file mode 100644 index 000000000000..cacc902a7ca3 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/index.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + * Amazon Bedrock Keystone Runtime + * + * @packageDocumentation + */ +export * from "./BedrockDataAutomationRuntimeClient"; +export * from "./BedrockDataAutomationRuntime"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { BedrockDataAutomationRuntimeExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./models"; + +export { BedrockDataAutomationRuntimeServiceException } from "./models/BedrockDataAutomationRuntimeServiceException"; diff --git a/clients/client-bedrock-data-automation-runtime/src/models/BedrockDataAutomationRuntimeServiceException.ts b/clients/client-bedrock-data-automation-runtime/src/models/BedrockDataAutomationRuntimeServiceException.ts new file mode 100644 index 000000000000..a36f5001399c --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/models/BedrockDataAutomationRuntimeServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from BedrockDataAutomationRuntime service. + */ +export class BedrockDataAutomationRuntimeServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, BedrockDataAutomationRuntimeServiceException.prototype); + } +} diff --git a/clients/client-bedrock-data-automation-runtime/src/models/index.ts b/clients/client-bedrock-data-automation-runtime/src/models/index.ts new file mode 100644 index 000000000000..9eaceb12865f --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/clients/client-bedrock-data-automation-runtime/src/models/models_0.ts b/clients/client-bedrock-data-automation-runtime/src/models/models_0.ts new file mode 100644 index 000000000000..014000601194 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/models/models_0.ts @@ -0,0 +1,379 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +import { BedrockDataAutomationRuntimeServiceException as __BaseException } from "./BedrockDataAutomationRuntimeServiceException"; + +/** + * This exception will be thrown when customer does not have access to API. + * @public + */ +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); + } +} + +/** + * Structure for request of GetDataAutomationStatus API. + * @public + */ +export interface GetDataAutomationStatusRequest { + /** + * Invocation arn. + * @public + */ + invocationArn: string | undefined; +} + +/** + * Output configuration. + * @public + */ +export interface OutputConfiguration { + /** + * S3 uri. + * @public + */ + s3Uri: string | undefined; +} + +/** + * @public + * @enum + */ +export const AutomationJobStatus = { + CLIENT_ERROR: "ClientError", + CREATED: "Created", + IN_PROGRESS: "InProgress", + SERVICE_ERROR: "ServiceError", + SUCCESS: "Success", +} as const; + +/** + * @public + */ +export type AutomationJobStatus = (typeof AutomationJobStatus)[keyof typeof AutomationJobStatus]; + +/** + * Response of GetDataAutomationStatus API. + * @public + */ +export interface GetDataAutomationStatusResponse { + /** + * Job Status. + * @public + */ + status?: AutomationJobStatus | undefined; + + /** + * Error Type. + * @public + */ + errorType?: string | undefined; + + /** + * Error Message. + * @public + */ + errorMessage?: string | undefined; + + /** + * Output configuration. + * @public + */ + outputConfiguration?: OutputConfiguration | undefined; +} + +/** + * This exception is for any internal un-expected service errors. + * @public + */ +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); + } +} + +/** + * This exception will be thrown when resource provided from customer not found. + * @public + */ +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); + } +} + +/** + * This exception will be thrown when customer reached API TPS limit. + * @public + */ +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); + } +} + +/** + * This exception will be thrown when customer provided invalid parameters. + * @public + */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + } +} + +/** + * @public + * @enum + */ +export const BlueprintStage = { + DEVELOPMENT: "DEVELOPMENT", + LIVE: "LIVE", +} as const; + +/** + * @public + */ +export type BlueprintStage = (typeof BlueprintStage)[keyof typeof BlueprintStage]; + +/** + * Structure for single blueprint entity. + * @public + */ +export interface Blueprint { + /** + * Arn of blueprint. + * @public + */ + blueprintArn: string | undefined; + + /** + * Version of blueprint. + * @public + */ + version?: string | undefined; + + /** + * Stage of blueprint. + * @public + */ + stage?: BlueprintStage | undefined; +} + +/** + * @public + * @enum + */ +export const DataAutomationStage = { + DEVELOPMENT: "DEVELOPMENT", + LIVE: "LIVE", +} as const; + +/** + * @public + */ +export type DataAutomationStage = (typeof DataAutomationStage)[keyof typeof DataAutomationStage]; + +/** + * Data automation configuration. + * @public + */ +export interface DataAutomationConfiguration { + /** + * Data automation arn. + * @public + */ + dataAutomationArn: string | undefined; + + /** + * Data automation stage. + * @public + */ + stage?: DataAutomationStage | undefined; +} + +/** + * Encryption configuration. + * @public + */ +export interface EncryptionConfiguration { + /** + * KMS key id. + * @public + */ + kmsKeyId: string | undefined; + + /** + * KMS encryption context. + * @public + */ + kmsEncryptionContext?: Record | undefined; +} + +/** + * Input configuration. + * @public + */ +export interface InputConfiguration { + /** + * S3 uri. + * @public + */ + s3Uri: string | undefined; +} + +/** + * Event bridge configuration. + * @public + */ +export interface EventBridgeConfiguration { + /** + * Event bridge flag. + * @public + */ + eventBridgeEnabled: boolean | undefined; +} + +/** + * Notification configuration. + * @public + */ +export interface NotificationConfiguration { + /** + * Event bridge configuration. + * @public + */ + eventBridgeConfiguration: EventBridgeConfiguration | undefined; +} + +/** + * Invoke Data Automation Async Request + * @public + */ +export interface InvokeDataAutomationAsyncRequest { + /** + * Idempotency token. + * @public + */ + clientToken?: string | undefined; + + /** + * Input configuration. + * @public + */ + inputConfiguration: InputConfiguration | undefined; + + /** + * Output configuration. + * @public + */ + outputConfiguration: OutputConfiguration | undefined; + + /** + * Data automation configuration. + * @public + */ + dataAutomationConfiguration?: DataAutomationConfiguration | undefined; + + /** + * Encryption configuration. + * @public + */ + encryptionConfiguration?: EncryptionConfiguration | undefined; + + /** + * Notification configuration. + * @public + */ + notificationConfiguration?: NotificationConfiguration | undefined; + + /** + * Blueprint list. + * @public + */ + blueprints?: Blueprint[] | undefined; +} + +/** + * Invoke Data Automation Async Response + * @public + */ +export interface InvokeDataAutomationAsyncResponse { + /** + * ARN of the automation job + * @public + */ + invocationArn: string | undefined; +} + +/** + * This exception will be thrown when service quota is exceeded. + * @public + */ +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); + } +} diff --git a/clients/client-bedrock-data-automation-runtime/src/protocols/Aws_json1_1.ts b/clients/client-bedrock-data-automation-runtime/src/protocols/Aws_json1_1.ts new file mode 100644 index 000000000000..475e96df9153 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/protocols/Aws_json1_1.ts @@ -0,0 +1,335 @@ +// smithy-typescript generated code +import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { + _json, + collectBody, + decorateServiceException as __decorateServiceException, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + HeaderBag as __HeaderBag, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { + GetDataAutomationStatusCommandInput, + GetDataAutomationStatusCommandOutput, +} from "../commands/GetDataAutomationStatusCommand"; +import { + InvokeDataAutomationAsyncCommandInput, + InvokeDataAutomationAsyncCommandOutput, +} from "../commands/InvokeDataAutomationAsyncCommand"; +import { BedrockDataAutomationRuntimeServiceException as __BaseException } from "../models/BedrockDataAutomationRuntimeServiceException"; +import { + AccessDeniedException, + Blueprint, + DataAutomationConfiguration, + EncryptionConfiguration, + EventBridgeConfiguration, + GetDataAutomationStatusRequest, + InputConfiguration, + InternalServerException, + InvokeDataAutomationAsyncRequest, + NotificationConfiguration, + OutputConfiguration, + ResourceNotFoundException, + ServiceQuotaExceededException, + ThrottlingException, + ValidationException, +} from "../models/models_0"; + +/** + * serializeAws_json1_1GetDataAutomationStatusCommand + */ +export const se_GetDataAutomationStatusCommand = async ( + input: GetDataAutomationStatusCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetDataAutomationStatus"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1InvokeDataAutomationAsyncCommand + */ +export const se_InvokeDataAutomationAsyncCommand = async ( + input: InvokeDataAutomationAsyncCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("InvokeDataAutomationAsync"); + let body: any; + body = JSON.stringify(se_InvokeDataAutomationAsyncRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * deserializeAws_json1_1GetDataAutomationStatusCommand + */ +export const de_GetDataAutomationStatusCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetDataAutomationStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1InvokeDataAutomationAsyncCommand + */ +export const de_InvokeDataAutomationAsyncCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: InvokeDataAutomationAsyncCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserialize_Aws_json1_1CommandError + */ +const de_CommandError = 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.bedrockdataautomationruntime#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.bedrockdataautomationruntime#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.bedrockdataautomationruntime#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.bedrockdataautomationruntime#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockdataautomationruntime#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } +}; + +/** + * deserializeAws_json1_1AccessDeniedExceptionRes + */ +const de_AccessDeniedExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1InternalServerExceptionRes + */ +const de_InternalServerExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1ResourceNotFoundExceptionRes + */ +const de_ResourceNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1ServiceQuotaExceededExceptionRes + */ +const de_ServiceQuotaExceededExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ServiceQuotaExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1ThrottlingExceptionRes + */ +const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ThrottlingException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1ValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +// se_Blueprint omitted. + +// se_BlueprintList omitted. + +// se_DataAutomationConfiguration omitted. + +// se_EncryptionConfiguration omitted. + +// se_EncryptionContextMap omitted. + +// se_EventBridgeConfiguration omitted. + +// se_GetDataAutomationStatusRequest omitted. + +// se_InputConfiguration omitted. + +/** + * serializeAws_json1_1InvokeDataAutomationAsyncRequest + */ +const se_InvokeDataAutomationAsyncRequest = (input: InvokeDataAutomationAsyncRequest, context: __SerdeContext): any => { + return take(input, { + blueprints: _json, + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + dataAutomationConfiguration: _json, + encryptionConfiguration: _json, + inputConfiguration: _json, + notificationConfiguration: _json, + outputConfiguration: _json, + }); +}; + +// se_NotificationConfiguration omitted. + +// se_OutputConfiguration omitted. + +// de_AccessDeniedException omitted. + +// de_GetDataAutomationStatusResponse omitted. + +// de_InternalServerException omitted. + +// de_InvokeDataAutomationAsyncResponse omitted. + +// de_OutputConfiguration omitted. + +// de_ResourceNotFoundException omitted. + +// de_ServiceQuotaExceededException omitted. + +// de_ThrottlingException omitted. + +// de_ValidationException 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 throwDefaultError = withBaseException(__BaseException); +const buildHttpRpcRequest = async ( + context: __SerdeContext, + headers: __HeaderBag, + path: string, + resolvedHostname: string | undefined, + body: any +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents: any = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new __HttpRequest(contents); +}; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `AmazonBedrockKeystoneRuntimeService.${operation}`, + }; +} diff --git a/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.browser.ts b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..7d97bd74d330 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/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 { createDefaultUserAgentProvider } 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 { BedrockDataAutomationRuntimeClientConfig } from "./BedrockDataAutomationRuntimeClient"; +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: BedrockDataAutomationRuntimeClientConfig) => { + 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 ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.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-data-automation-runtime/src/runtimeConfig.native.ts b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..cb709dfc2ba5 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { BedrockDataAutomationRuntimeClientConfig } from "./BedrockDataAutomationRuntimeClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BedrockDataAutomationRuntimeClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.shared.ts b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..7137fb73cced --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.shared.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultBedrockDataAutomationRuntimeHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { BedrockDataAutomationRuntimeClientConfig } from "./BedrockDataAutomationRuntimeClient"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BedrockDataAutomationRuntimeClientConfig) => { + return { + apiVersion: "2024-06-13", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultBedrockDataAutomationRuntimeHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc: IdentityProviderConfig) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "Bedrock Data Automation Runtime", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.ts b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.ts new file mode 100644 index 000000000000..a2ff8a98e194 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.ts @@ -0,0 +1,60 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } 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 { BedrockDataAutomationRuntimeClientConfig } from "./BedrockDataAutomationRuntimeClient"; +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: BedrockDataAutomationRuntimeClientConfig) => { + 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 ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ 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: RequestHandler.create(config?.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), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + }; +}; diff --git a/clients/client-bedrock-data-automation-runtime/src/runtimeExtensions.ts b/clients/client-bedrock-data-automation-runtime/src/runtimeExtensions.ts new file mode 100644 index 000000000000..210609da3711 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/src/runtimeExtensions.ts @@ -0,0 +1,48 @@ +// 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 { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { BedrockDataAutomationRuntimeExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: BedrockDataAutomationRuntimeExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +const asPartial = >(t: T) => t; + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: BedrockDataAutomationRuntimeExtensionConfiguration = { + ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)), + ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)), + }; + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return { + ...runtimeConfig, + ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), + ...resolveDefaultRuntimeConfig(extensionConfiguration), + ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), + ...resolveHttpAuthRuntimeConfig(extensionConfiguration), + }; +}; diff --git a/clients/client-bedrock-data-automation-runtime/tsconfig.cjs.json b/clients/client-bedrock-data-automation-runtime/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-bedrock-data-automation-runtime/tsconfig.es.json b/clients/client-bedrock-data-automation-runtime/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-bedrock-data-automation-runtime/tsconfig.json b/clients/client-bedrock-data-automation-runtime/tsconfig.json new file mode 100644 index 000000000000..e7f5ec56b742 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node16/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-data-automation-runtime/tsconfig.types.json b/clients/client-bedrock-data-automation-runtime/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-bedrock-data-automation-runtime/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/codegen/sdk-codegen/aws-models/bedrock-data-automation-runtime.json b/codegen/sdk-codegen/aws-models/bedrock-data-automation-runtime.json new file mode 100644 index 000000000000..2fe61d839c55 --- /dev/null +++ b/codegen/sdk-codegen/aws-models/bedrock-data-automation-runtime.json @@ -0,0 +1,1310 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockdataautomationruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception will be thrown when customer does not have access to API.", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.bedrockdataautomationruntime#AmazonBedrockKeystoneRuntimeService": { + "type": "service", + "version": "2024-06-13", + "resources": [ + { + "target": "com.amazonaws.bedrockdataautomationruntime#AutomationJobResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "Bedrock Data Automation Runtime", + "arnNamespace": "bedrock", + "endpointPrefix": "bedrock-data-automation-runtime", + "cloudTrailEventSource": "bedrock.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "bedrock" + }, + "aws.protocols#awsJson1_1": {}, + "smithy.api#documentation": "Amazon Bedrock Keystone Runtime", + "smithy.api#title": "Runtime for Amazon Bedrock Data Automation", + "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-data-automation-runtime-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-data-automation-runtime-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-data-automation-runtime.{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-data-automation-runtime.{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-data-automation-runtime-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-data-automation-runtime-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-data-automation-runtime.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-data-automation-runtime.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-data-automation-runtime-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-data-automation-runtime-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-data-automation-runtime.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-data-automation-runtime.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-data-automation-runtime-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-data-automation-runtime-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-data-automation-runtime.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-data-automation-runtime.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-data-automation-runtime-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-data-automation-runtime.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-data-automation-runtime-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-data-automation-runtime.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.bedrockdataautomationruntime#AutomationJobResource": { + "type": "resource", + "identifiers": { + "invocationArn": { + "target": "com.amazonaws.bedrockdataautomationruntime#InvocationArn" + } + }, + "create": { + "target": "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsync" + }, + "read": { + "target": "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatus" + } + }, + "com.amazonaws.bedrockdataautomationruntime#AutomationJobStatus": { + "type": "enum", + "members": { + "CREATED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Created" + } + }, + "IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "InProgress" + } + }, + "SUCCESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Success" + } + }, + "SERVICE_ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ServiceError" + } + }, + "CLIENT_ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ClientError" + } + } + }, + "traits": { + "smithy.api#documentation": "List of status supported by automation jobs" + } + }, + "com.amazonaws.bedrockdataautomationruntime#Blueprint": { + "type": "structure", + "members": { + "blueprintArn": { + "target": "com.amazonaws.bedrockdataautomationruntime#BlueprintArn", + "traits": { + "smithy.api#documentation": "Arn of blueprint.", + "smithy.api#required": {} + } + }, + "version": { + "target": "com.amazonaws.bedrockdataautomationruntime#BlueprintVersion", + "traits": { + "smithy.api#documentation": "Version of blueprint." + } + }, + "stage": { + "target": "com.amazonaws.bedrockdataautomationruntime#BlueprintStage", + "traits": { + "smithy.api#documentation": "Stage of blueprint." + } + } + }, + "traits": { + "smithy.api#documentation": "Structure for single blueprint entity." + } + }, + "com.amazonaws.bedrockdataautomationruntime#BlueprintArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "ARN of a Blueprint", + "smithy.api#length": { + "max": 128 + }, + "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):bedrock:[a-zA-Z0-9-]*:(aws|[0-9]{12}):blueprint/(bedrock-data-insights-public-[a-zA-Z0-9-_]{1,30}|bedrock-data-automation-public-[a-zA-Z0-9-_]{1,30}|[a-zA-Z0-9-]{12,36})$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#BlueprintList": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockdataautomationruntime#Blueprint", + "traits": { + "smithy.api#documentation": "Blueprint." + } + }, + "traits": { + "smithy.api#documentation": "Blueprint list.", + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.bedrockdataautomationruntime#BlueprintStage": { + "type": "enum", + "members": { + "DEVELOPMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DEVELOPMENT" + } + }, + "LIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LIVE" + } + } + }, + "traits": { + "smithy.api#documentation": "Blueprint stage enum." + } + }, + "com.amazonaws.bedrockdataautomationruntime#BlueprintVersion": { + "type": "string", + "traits": { + "smithy.api#documentation": "Blueprint version.", + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[0-9]*$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#DataAutomationArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "Data automation arn.", + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):bedrock:[a-zA-Z0-9-]*:(aws|[0-9]{12}):data-automation-project/[a-zA-Z0-9-_]+$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#DataAutomationConfiguration": { + "type": "structure", + "members": { + "dataAutomationArn": { + "target": "com.amazonaws.bedrockdataautomationruntime#DataAutomationArn", + "traits": { + "smithy.api#documentation": "Data automation arn.", + "smithy.api#required": {} + } + }, + "stage": { + "target": "com.amazonaws.bedrockdataautomationruntime#DataAutomationStage", + "traits": { + "smithy.api#documentation": "Data automation stage." + } + } + }, + "traits": { + "smithy.api#documentation": "Data automation configuration." + } + }, + "com.amazonaws.bedrockdataautomationruntime#DataAutomationStage": { + "type": "enum", + "members": { + "LIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LIVE" + } + }, + "DEVELOPMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DEVELOPMENT" + } + } + }, + "traits": { + "smithy.api#documentation": "Data automation stage." + } + }, + "com.amazonaws.bedrockdataautomationruntime#EncryptionConfiguration": { + "type": "structure", + "members": { + "kmsKeyId": { + "target": "com.amazonaws.bedrockdataautomationruntime#NonEmptyString", + "traits": { + "smithy.api#documentation": "KMS key id.", + "smithy.api#required": {} + } + }, + "kmsEncryptionContext": { + "target": "com.amazonaws.bedrockdataautomationruntime#EncryptionContextMap", + "traits": { + "smithy.api#documentation": "KMS encryption context." + } + } + }, + "traits": { + "smithy.api#documentation": "Encryption configuration." + } + }, + "com.amazonaws.bedrockdataautomationruntime#EncryptionContextKey": { + "type": "string", + "traits": { + "smithy.api#documentation": "Excryption context key.", + "smithy.api#length": { + "min": 1, + "max": 2000 + }, + "smithy.api#pattern": "^.*\\S.*$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#EncryptionContextMap": { + "type": "map", + "key": { + "target": "com.amazonaws.bedrockdataautomationruntime#EncryptionContextKey" + }, + "value": { + "target": "com.amazonaws.bedrockdataautomationruntime#EncryptionContextValue" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.bedrockdataautomationruntime#EncryptionContextValue": { + "type": "string", + "traits": { + "smithy.api#documentation": "Encryption context value.", + "smithy.api#length": { + "min": 1, + "max": 2000 + }, + "smithy.api#pattern": "^.*\\S.*$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#EventBridgeConfiguration": { + "type": "structure", + "members": { + "eventBridgeEnabled": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Event bridge flag.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Event bridge configuration." + } + }, + "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatus": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusRequest" + }, + "output": { + "target": "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockdataautomationruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockdataautomationruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockdataautomationruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "API used to get data automation status.", + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusRequest": { + "type": "structure", + "members": { + "invocationArn": { + "target": "com.amazonaws.bedrockdataautomationruntime#InvocationArn", + "traits": { + "smithy.api#documentation": "Invocation arn.", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Structure for request of GetDataAutomationStatus API.", + "smithy.api#input": {}, + "smithy.api#references": [ + { + "resource": "com.amazonaws.bedrockdataautomationruntime#AutomationJobResource" + } + ] + } + }, + "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusResponse": { + "type": "structure", + "members": { + "status": { + "target": "com.amazonaws.bedrockdataautomationruntime#AutomationJobStatus", + "traits": { + "smithy.api#documentation": "Job Status." + } + }, + "errorType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Error Type." + } + }, + "errorMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Error Message." + } + }, + "outputConfiguration": { + "target": "com.amazonaws.bedrockdataautomationruntime#OutputConfiguration", + "traits": { + "smithy.api#documentation": "Output configuration." + } + } + }, + "traits": { + "smithy.api#documentation": "Response of GetDataAutomationStatus API.", + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockdataautomationruntime#IdempotencyToken": { + "type": "string", + "traits": { + "smithy.api#documentation": "Client specified token used for idempotency checks", + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#InputConfiguration": { + "type": "structure", + "members": { + "s3Uri": { + "target": "com.amazonaws.bedrockdataautomationruntime#S3Uri", + "traits": { + "smithy.api#documentation": "S3 uri.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Input configuration." + } + }, + "com.amazonaws.bedrockdataautomationruntime#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockdataautomationruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception is for any internal un-expected service errors.", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.bedrockdataautomationruntime#InvocationArn": { + "type": "string", + "traits": { + "smithy.api#documentation": "Invocation arn.", + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):bedrock:[a-zA-Z0-9-]*:[0-9]{12}:(insights-invocation|data-automation-invocation)/[a-zA-Z0-9-_]+$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsync": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncRequest" + }, + "output": { + "target": "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockdataautomationruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockdataautomationruntime#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockdataautomationruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockdataautomationruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Async API: Invoke data automation.", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncRequest": { + "type": "structure", + "members": { + "clientToken": { + "target": "com.amazonaws.bedrockdataautomationruntime#IdempotencyToken", + "traits": { + "smithy.api#documentation": "Idempotency token.", + "smithy.api#idempotencyToken": {} + } + }, + "inputConfiguration": { + "target": "com.amazonaws.bedrockdataautomationruntime#InputConfiguration", + "traits": { + "smithy.api#documentation": "Input configuration.", + "smithy.api#required": {} + } + }, + "outputConfiguration": { + "target": "com.amazonaws.bedrockdataautomationruntime#OutputConfiguration", + "traits": { + "smithy.api#documentation": "Output configuration.", + "smithy.api#required": {} + } + }, + "dataAutomationConfiguration": { + "target": "com.amazonaws.bedrockdataautomationruntime#DataAutomationConfiguration", + "traits": { + "smithy.api#documentation": "Data automation configuration." + } + }, + "encryptionConfiguration": { + "target": "com.amazonaws.bedrockdataautomationruntime#EncryptionConfiguration", + "traits": { + "smithy.api#documentation": "Encryption configuration." + } + }, + "notificationConfiguration": { + "target": "com.amazonaws.bedrockdataautomationruntime#NotificationConfiguration", + "traits": { + "smithy.api#documentation": "Notification configuration." + } + }, + "blueprints": { + "target": "com.amazonaws.bedrockdataautomationruntime#BlueprintList", + "traits": { + "smithy.api#documentation": "Blueprint list." + } + } + }, + "traits": { + "smithy.api#documentation": "Invoke Data Automation Async Request", + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncResponse": { + "type": "structure", + "members": { + "invocationArn": { + "target": "com.amazonaws.bedrockdataautomationruntime#InvocationArn", + "traits": { + "smithy.api#documentation": "ARN of the automation job", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Invoke Data Automation Async Response", + "smithy.api#output": {}, + "smithy.api#references": [ + { + "resource": "com.amazonaws.bedrockdataautomationruntime#AutomationJobResource" + } + ] + } + }, + "com.amazonaws.bedrockdataautomationruntime#NonBlankString": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[\\s\\S]*$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#NonEmptyString": { + "type": "string", + "traits": { + "smithy.api#pattern": "^.*\\S.*$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#NotificationConfiguration": { + "type": "structure", + "members": { + "eventBridgeConfiguration": { + "target": "com.amazonaws.bedrockdataautomationruntime#EventBridgeConfiguration", + "traits": { + "smithy.api#documentation": "Event bridge configuration.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Notification configuration." + } + }, + "com.amazonaws.bedrockdataautomationruntime#OutputConfiguration": { + "type": "structure", + "members": { + "s3Uri": { + "target": "com.amazonaws.bedrockdataautomationruntime#S3Uri", + "traits": { + "smithy.api#documentation": "S3 uri.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Output configuration." + } + }, + "com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockdataautomationruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception will be thrown when resource provided from customer not found.", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.bedrockdataautomationruntime#S3Uri": { + "type": "string", + "traits": { + "smithy.api#documentation": "A path in S3", + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^s3://[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]([^\\x00-\\x1F\\x7F\\{^}%`\\]\">\\[~<#|]*)?$" + } + }, + "com.amazonaws.bedrockdataautomationruntime#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockdataautomationruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception will be thrown when service quota is exceeded.", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.bedrockdataautomationruntime#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockdataautomationruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception will be thrown when customer reached API TPS limit.", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, + "com.amazonaws.bedrockdataautomationruntime#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockdataautomationruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "This exception will be thrown when customer provided invalid parameters.", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + } + } +}