diff --git a/clients/client-controlcatalog/.gitignore b/clients/client-controlcatalog/.gitignore new file mode 100644 index 000000000000..54f14c9aef25 --- /dev/null +++ b/clients/client-controlcatalog/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/clients/client-controlcatalog/LICENSE b/clients/client-controlcatalog/LICENSE new file mode 100644 index 000000000000..1349aa7c9923 --- /dev/null +++ b/clients/client-controlcatalog/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-controlcatalog/README.md b/clients/client-controlcatalog/README.md new file mode 100644 index 000000000000..87b61e5028bd --- /dev/null +++ b/clients/client-controlcatalog/README.md @@ -0,0 +1,256 @@ + + +# @aws-sdk/client-controlcatalog + +## Description + +AWS SDK for JavaScript ControlCatalog Client for Node.js, Browser and React Native. + +

Welcome to the Amazon Web Services Control Catalog API reference. This guide is for +developers who need detailed information about how to programmatically identify and filter +the common controls and related metadata that are available to Amazon Web Services customers. This API reference provides +descriptions, syntax, and usage examples for each of the actions and data types that are +supported by Amazon Web Services Control Catalog.

+

Use the following links to get started with the Amazon Web Services Control Catalog API:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-controlcatalog +using your favorite package manager: + +- `npm install @aws-sdk/client-controlcatalog` +- `yarn add @aws-sdk/client-controlcatalog` +- `pnpm add @aws-sdk/client-controlcatalog` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ControlCatalogClient` and +the commands you need, for example `ListDomainsCommand`: + +```js +// ES5 example +const { ControlCatalogClient, ListDomainsCommand } = require("@aws-sdk/client-controlcatalog"); +``` + +```ts +// ES6+ example +import { ControlCatalogClient, ListDomainsCommand } from "@aws-sdk/client-controlcatalog"; +``` + +### 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 ControlCatalogClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ListDomainsCommand(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-controlcatalog"; +const client = new AWS.ControlCatalog({ region: "REGION" }); + +// async/await. +try { + const data = await client.listDomains(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .listDomains(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.listDomains(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-controlcatalog` 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) + +
+ +ListCommonControls + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/controlcatalog/command/ListCommonControlsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListCommonControlsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListCommonControlsCommandOutput/) + +
+
+ +ListDomains + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/controlcatalog/command/ListDomainsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListDomainsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListDomainsCommandOutput/) + +
+
+ +ListObjectives + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/controlcatalog/command/ListObjectivesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListObjectivesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListObjectivesCommandOutput/) + +
diff --git a/clients/client-controlcatalog/api-extractor.json b/clients/client-controlcatalog/api-extractor.json new file mode 100644 index 000000000000..d5bf5ffeee85 --- /dev/null +++ b/clients/client-controlcatalog/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/clients/client-controlcatalog/package.json b/clients/client-controlcatalog/package.json new file mode 100644 index 000000000000..00e29fb0ab7e --- /dev/null +++ b/clients/client-controlcatalog/package.json @@ -0,0 +1,101 @@ +{ + "name": "@aws-sdk/client-controlcatalog", + "description": "AWS SDK for JavaScript Controlcatalog 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 controlcatalog" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "*", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^2.2.0", + "@smithy/core": "^1.4.2", + "@smithy/fetch-http-handler": "^2.5.0", + "@smithy/hash-node": "^2.2.0", + "@smithy/invalid-dependency": "^2.2.0", + "@smithy/middleware-content-length": "^2.2.0", + "@smithy/middleware-endpoint": "^2.5.1", + "@smithy/middleware-retry": "^2.3.1", + "@smithy/middleware-serde": "^2.3.0", + "@smithy/middleware-stack": "^2.2.0", + "@smithy/node-config-provider": "^2.3.0", + "@smithy/node-http-handler": "^2.5.0", + "@smithy/protocol-http": "^3.3.0", + "@smithy/smithy-client": "^2.5.1", + "@smithy/types": "^2.12.0", + "@smithy/url-parser": "^2.2.0", + "@smithy/util-base64": "^2.3.0", + "@smithy/util-body-length-browser": "^2.2.0", + "@smithy/util-body-length-node": "^2.3.0", + "@smithy/util-defaults-mode-browser": "^2.2.1", + "@smithy/util-defaults-mode-node": "^2.3.1", + "@smithy/util-endpoints": "^1.2.0", + "@smithy/util-middleware": "^2.2.0", + "@smithy/util-retry": "^2.2.0", + "@smithy/util-utf8": "^2.3.0", + "tslib": "^2.6.2" + }, + "devDependencies": { + "@smithy/service-client-documentation-generator": "^2.2.0", + "@tsconfig/node14": "1.0.3", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~4.9.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-controlcatalog", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-controlcatalog" + } +} diff --git a/clients/client-controlcatalog/src/ControlCatalog.ts b/clients/client-controlcatalog/src/ControlCatalog.ts new file mode 100644 index 000000000000..7c549f411441 --- /dev/null +++ b/clients/client-controlcatalog/src/ControlCatalog.ts @@ -0,0 +1,103 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + ListCommonControlsCommand, + ListCommonControlsCommandInput, + ListCommonControlsCommandOutput, +} from "./commands/ListCommonControlsCommand"; +import { ListDomainsCommand, ListDomainsCommandInput, ListDomainsCommandOutput } from "./commands/ListDomainsCommand"; +import { + ListObjectivesCommand, + ListObjectivesCommandInput, + ListObjectivesCommandOutput, +} from "./commands/ListObjectivesCommand"; +import { ControlCatalogClient, ControlCatalogClientConfig } from "./ControlCatalogClient"; + +const commands = { + ListCommonControlsCommand, + ListDomainsCommand, + ListObjectivesCommand, +}; + +export interface ControlCatalog { + /** + * @see {@link ListCommonControlsCommand} + */ + listCommonControls(): Promise; + listCommonControls( + args: ListCommonControlsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listCommonControls( + args: ListCommonControlsCommandInput, + cb: (err: any, data?: ListCommonControlsCommandOutput) => void + ): void; + listCommonControls( + args: ListCommonControlsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListCommonControlsCommandOutput) => void + ): void; + + /** + * @see {@link ListDomainsCommand} + */ + listDomains(): Promise; + listDomains(args: ListDomainsCommandInput, options?: __HttpHandlerOptions): Promise; + listDomains(args: ListDomainsCommandInput, cb: (err: any, data?: ListDomainsCommandOutput) => void): void; + listDomains( + args: ListDomainsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListDomainsCommandOutput) => void + ): void; + + /** + * @see {@link ListObjectivesCommand} + */ + listObjectives(): Promise; + listObjectives( + args: ListObjectivesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listObjectives(args: ListObjectivesCommandInput, cb: (err: any, data?: ListObjectivesCommandOutput) => void): void; + listObjectives( + args: ListObjectivesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListObjectivesCommandOutput) => void + ): void; +} + +/** + *

Welcome to the Amazon Web Services Control Catalog API reference. This guide is for + * developers who need detailed information about how to programmatically identify and filter + * the common controls and related metadata that are available to Amazon Web Services customers. This API reference provides + * descriptions, syntax, and usage examples for each of the actions and data types that are + * supported by Amazon Web Services Control Catalog.

+ *

Use the following links to get started with the Amazon Web Services Control Catalog API:

+ *
    + *
  • + *

    + * Actions: An + * alphabetical list of all Control Catalog API operations.

    + *
  • + *
  • + *

    + * Data types: An + * alphabetical list of all Control Catalog data types.

    + *
  • + *
  • + *

    + * Common + * parameters: Parameters that all operations can use.

    + *
  • + *
  • + *

    + * Common errors: + * Client and server errors that all operations can return.

    + *
  • + *
+ * @public + */ +export class ControlCatalog extends ControlCatalogClient implements ControlCatalog {} +createAggregatedClient(commands, ControlCatalog); diff --git a/clients/client-controlcatalog/src/ControlCatalogClient.ts b/clients/client-controlcatalog/src/ControlCatalogClient.ts new file mode 100644 index 000000000000..90624e168809 --- /dev/null +++ b/clients/client-controlcatalog/src/ControlCatalogClient.ts @@ -0,0 +1,340 @@ +// 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 { + defaultControlCatalogHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { ListCommonControlsCommandInput, ListCommonControlsCommandOutput } from "./commands/ListCommonControlsCommand"; +import { ListDomainsCommandInput, ListDomainsCommandOutput } from "./commands/ListDomainsCommand"; +import { ListObjectivesCommandInput, ListObjectivesCommandOutput } from "./commands/ListObjectivesCommand"; +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 = ListCommonControlsCommandInput | ListDomainsCommandInput | ListObjectivesCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | ListCommonControlsCommandOutput + | ListDomainsCommandOutput + | ListObjectivesCommandOutput; + +/** + * @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 provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * 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 ControlCatalogClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + UserAgentInputConfig & + HttpAuthSchemeInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of ControlCatalogClient class constructor that set the region, credentials and other options. + */ +export interface ControlCatalogClientConfig extends ControlCatalogClientConfigType {} + +/** + * @public + */ +export type ControlCatalogClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + UserAgentResolvedConfig & + HttpAuthSchemeResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of ControlCatalogClient class. This is resolved and normalized from the {@link ControlCatalogClientConfig | constructor configuration interface}. + */ +export interface ControlCatalogClientResolvedConfig extends ControlCatalogClientResolvedConfigType {} + +/** + *

Welcome to the Amazon Web Services Control Catalog API reference. This guide is for + * developers who need detailed information about how to programmatically identify and filter + * the common controls and related metadata that are available to Amazon Web Services customers. This API reference provides + * descriptions, syntax, and usage examples for each of the actions and data types that are + * supported by Amazon Web Services Control Catalog.

+ *

Use the following links to get started with the Amazon Web Services Control Catalog API:

+ *
    + *
  • + *

    + * Actions: An + * alphabetical list of all Control Catalog API operations.

    + *
  • + *
  • + *

    + * Data types: An + * alphabetical list of all Control Catalog data types.

    + *
  • + *
  • + *

    + * Common + * parameters: Parameters that all operations can use.

    + *
  • + *
  • + *

    + * Common errors: + * Client and server errors that all operations can return.

    + *
  • + *
+ * @public + */ +export class ControlCatalogClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + ControlCatalogClientResolvedConfig +> { + /** + * The resolved configuration of ControlCatalogClient class. This is resolved and normalized from the {@link ControlCatalogClientConfig | constructor configuration interface}. + */ + readonly config: ControlCatalogClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveUserAgentConfig(_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(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(getUserAgentPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(), + identityProviderConfigProvider: this.getIdentityProviderConfigProvider(), + }) + ); + 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(); + } + private getDefaultHttpAuthSchemeParametersProvider() { + return defaultControlCatalogHttpAuthSchemeParametersProvider; + } + private getIdentityProviderConfigProvider() { + return async (config: ControlCatalogClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }); + } +} diff --git a/clients/client-controlcatalog/src/auth/httpAuthExtensionConfiguration.ts b/clients/client-controlcatalog/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 000000000000..41d86c2ae68d --- /dev/null +++ b/clients/client-controlcatalog/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { ControlCatalogHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: ControlCatalogHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): ControlCatalogHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: ControlCatalogHttpAuthSchemeProvider; + 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: ControlCatalogHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): ControlCatalogHttpAuthSchemeProvider { + 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-controlcatalog/src/auth/httpAuthSchemeProvider.ts b/clients/client-controlcatalog/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 000000000000..d658d2dae133 --- /dev/null +++ b/clients/client-controlcatalog/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,138 @@ +// 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 { ControlCatalogClientConfig, ControlCatalogClientResolvedConfig } from "../ControlCatalogClient"; + +/** + * @internal + */ +export interface ControlCatalogHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface ControlCatalogHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + ControlCatalogClientResolvedConfig, + HandlerExecutionContext, + ControlCatalogHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultControlCatalogHttpAuthSchemeParametersProvider = async ( + config: ControlCatalogClientResolvedConfig, + 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: ControlCatalogHttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "controlcatalog", + region: authParameters.region, + }, + propertiesExtractor: (config: ControlCatalogClientConfig, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface ControlCatalogHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultControlCatalogHttpAuthSchemeProvider: ControlCatalogHttpAuthSchemeProvider = (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: ControlCatalogHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: ControlCatalogHttpAuthSchemeProvider; +} + +/** + * @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-controlcatalog/src/commands/ListCommonControlsCommand.ts b/clients/client-controlcatalog/src/commands/ListCommonControlsCommand.ts new file mode 100644 index 000000000000..edd7d0edd7c1 --- /dev/null +++ b/clients/client-controlcatalog/src/commands/ListCommonControlsCommand.ts @@ -0,0 +1,121 @@ +// 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 { ControlCatalogClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ControlCatalogClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListCommonControlsRequest, ListCommonControlsResponse } from "../models/models_0"; +import { de_ListCommonControlsCommand, se_ListCommonControlsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListCommonControlsCommand}. + */ +export interface ListCommonControlsCommandInput extends ListCommonControlsRequest {} +/** + * @public + * + * The output of {@link ListCommonControlsCommand}. + */ +export interface ListCommonControlsCommandOutput extends ListCommonControlsResponse, __MetadataBearer {} + +/** + *

Returns a paginated list of common controls from the Amazon Web Services Control + * Catalog.

+ *

You can apply an optional filter to see common controls that have a specific objective. If + * you don’t provide a filter, the operation returns all common controls.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ControlCatalogClient, ListCommonControlsCommand } from "@aws-sdk/client-controlcatalog"; // ES Modules import + * // const { ControlCatalogClient, ListCommonControlsCommand } = require("@aws-sdk/client-controlcatalog"); // CommonJS import + * const client = new ControlCatalogClient(config); + * const input = { // ListCommonControlsRequest + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * CommonControlFilter: { // CommonControlFilter + * Objectives: [ // ObjectiveResourceFilterList + * { // ObjectiveResourceFilter + * Arn: "STRING_VALUE", + * }, + * ], + * }, + * }; + * const command = new ListCommonControlsCommand(input); + * const response = await client.send(command); + * // { // ListCommonControlsResponse + * // CommonControls: [ // CommonControlSummaryList // required + * // { // CommonControlSummary + * // Arn: "STRING_VALUE", // required + * // Name: "STRING_VALUE", // required + * // Description: "STRING_VALUE", // required + * // Domain: { // AssociatedDomainSummary + * // Arn: "STRING_VALUE", + * // Name: "STRING_VALUE", + * // }, + * // Objective: { // AssociatedObjectiveSummary + * // Arn: "STRING_VALUE", + * // Name: "STRING_VALUE", + * // }, + * // CreateTime: new Date("TIMESTAMP"), // required + * // LastUpdateTime: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListCommonControlsCommandInput - {@link ListCommonControlsCommandInput} + * @returns {@link ListCommonControlsCommandOutput} + * @see {@link ListCommonControlsCommandInput} for command's `input` shape. + * @see {@link ListCommonControlsCommandOutput} for command's `response` shape. + * @see {@link ControlCatalogClientResolvedConfig | config} for ControlCatalogClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal service error occurred during the processing of your request. Try again later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling.

+ * + * @throws {@link ValidationException} (client fault) + *

The request has invalid or missing parameters.

+ * + * @throws {@link ControlCatalogServiceException} + *

Base exception class for all service exceptions from ControlCatalog service.

+ * + * @public + */ +export class ListCommonControlsCommand extends $Command + .classBuilder< + ListCommonControlsCommandInput, + ListCommonControlsCommandOutput, + ControlCatalogClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ControlCatalogClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("ControlCatalog", "ListCommonControls", {}) + .n("ControlCatalogClient", "ListCommonControlsCommand") + .f(void 0, void 0) + .ser(se_ListCommonControlsCommand) + .de(de_ListCommonControlsCommand) + .build() {} diff --git a/clients/client-controlcatalog/src/commands/ListDomainsCommand.ts b/clients/client-controlcatalog/src/commands/ListDomainsCommand.ts new file mode 100644 index 000000000000..41e30cf775be --- /dev/null +++ b/clients/client-controlcatalog/src/commands/ListDomainsCommand.ts @@ -0,0 +1,103 @@ +// 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 { ControlCatalogClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ControlCatalogClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListDomainsRequest, ListDomainsResponse } from "../models/models_0"; +import { de_ListDomainsCommand, se_ListDomainsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListDomainsCommand}. + */ +export interface ListDomainsCommandInput extends ListDomainsRequest {} +/** + * @public + * + * The output of {@link ListDomainsCommand}. + */ +export interface ListDomainsCommandOutput extends ListDomainsResponse, __MetadataBearer {} + +/** + *

Returns a paginated list of domains from the Amazon Web Services Control Catalog.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ControlCatalogClient, ListDomainsCommand } from "@aws-sdk/client-controlcatalog"; // ES Modules import + * // const { ControlCatalogClient, ListDomainsCommand } = require("@aws-sdk/client-controlcatalog"); // CommonJS import + * const client = new ControlCatalogClient(config); + * const input = { // ListDomainsRequest + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * }; + * const command = new ListDomainsCommand(input); + * const response = await client.send(command); + * // { // ListDomainsResponse + * // Domains: [ // DomainSummaryList // required + * // { // DomainSummary + * // Arn: "STRING_VALUE", // required + * // Name: "STRING_VALUE", // required + * // Description: "STRING_VALUE", // required + * // CreateTime: new Date("TIMESTAMP"), // required + * // LastUpdateTime: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListDomainsCommandInput - {@link ListDomainsCommandInput} + * @returns {@link ListDomainsCommandOutput} + * @see {@link ListDomainsCommandInput} for command's `input` shape. + * @see {@link ListDomainsCommandOutput} for command's `response` shape. + * @see {@link ControlCatalogClientResolvedConfig | config} for ControlCatalogClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal service error occurred during the processing of your request. Try again later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling.

+ * + * @throws {@link ValidationException} (client fault) + *

The request has invalid or missing parameters.

+ * + * @throws {@link ControlCatalogServiceException} + *

Base exception class for all service exceptions from ControlCatalog service.

+ * + * @public + */ +export class ListDomainsCommand extends $Command + .classBuilder< + ListDomainsCommandInput, + ListDomainsCommandOutput, + ControlCatalogClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ControlCatalogClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("ControlCatalog", "ListDomains", {}) + .n("ControlCatalogClient", "ListDomainsCommand") + .f(void 0, void 0) + .ser(se_ListDomainsCommand) + .de(de_ListDomainsCommand) + .build() {} diff --git a/clients/client-controlcatalog/src/commands/ListObjectivesCommand.ts b/clients/client-controlcatalog/src/commands/ListObjectivesCommand.ts new file mode 100644 index 000000000000..44a5e8e4c577 --- /dev/null +++ b/clients/client-controlcatalog/src/commands/ListObjectivesCommand.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 { ControlCatalogClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ControlCatalogClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListObjectivesRequest, ListObjectivesResponse } from "../models/models_0"; +import { de_ListObjectivesCommand, se_ListObjectivesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListObjectivesCommand}. + */ +export interface ListObjectivesCommandInput extends ListObjectivesRequest {} +/** + * @public + * + * The output of {@link ListObjectivesCommand}. + */ +export interface ListObjectivesCommandOutput extends ListObjectivesResponse, __MetadataBearer {} + +/** + *

Returns a paginated list of objectives from the Amazon Web Services Control Catalog.

+ *

You can apply an optional filter to see the objectives that belong to a specific domain. + * If you don’t provide a filter, the operation returns all objectives.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ControlCatalogClient, ListObjectivesCommand } from "@aws-sdk/client-controlcatalog"; // ES Modules import + * // const { ControlCatalogClient, ListObjectivesCommand } = require("@aws-sdk/client-controlcatalog"); // CommonJS import + * const client = new ControlCatalogClient(config); + * const input = { // ListObjectivesRequest + * MaxResults: Number("int"), + * NextToken: "STRING_VALUE", + * ObjectiveFilter: { // ObjectiveFilter + * Domains: [ // DomainResourceFilterList + * { // DomainResourceFilter + * Arn: "STRING_VALUE", + * }, + * ], + * }, + * }; + * const command = new ListObjectivesCommand(input); + * const response = await client.send(command); + * // { // ListObjectivesResponse + * // Objectives: [ // ObjectiveSummaryList // required + * // { // ObjectiveSummary + * // Arn: "STRING_VALUE", // required + * // Name: "STRING_VALUE", // required + * // Description: "STRING_VALUE", // required + * // Domain: { // AssociatedDomainSummary + * // Arn: "STRING_VALUE", + * // Name: "STRING_VALUE", + * // }, + * // CreateTime: new Date("TIMESTAMP"), // required + * // LastUpdateTime: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // NextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListObjectivesCommandInput - {@link ListObjectivesCommandInput} + * @returns {@link ListObjectivesCommandOutput} + * @see {@link ListObjectivesCommandInput} for command's `input` shape. + * @see {@link ListObjectivesCommandOutput} for command's `response` shape. + * @see {@link ControlCatalogClientResolvedConfig | config} for ControlCatalogClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal service error occurred during the processing of your request. Try again later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling.

+ * + * @throws {@link ValidationException} (client fault) + *

The request has invalid or missing parameters.

+ * + * @throws {@link ControlCatalogServiceException} + *

Base exception class for all service exceptions from ControlCatalog service.

+ * + * @public + */ +export class ListObjectivesCommand extends $Command + .classBuilder< + ListObjectivesCommandInput, + ListObjectivesCommandOutput, + ControlCatalogClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ControlCatalogClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("ControlCatalog", "ListObjectives", {}) + .n("ControlCatalogClient", "ListObjectivesCommand") + .f(void 0, void 0) + .ser(se_ListObjectivesCommand) + .de(de_ListObjectivesCommand) + .build() {} diff --git a/clients/client-controlcatalog/src/commands/index.ts b/clients/client-controlcatalog/src/commands/index.ts new file mode 100644 index 000000000000..b13889c948a2 --- /dev/null +++ b/clients/client-controlcatalog/src/commands/index.ts @@ -0,0 +1,4 @@ +// smithy-typescript generated code +export * from "./ListCommonControlsCommand"; +export * from "./ListDomainsCommand"; +export * from "./ListObjectivesCommand"; diff --git a/clients/client-controlcatalog/src/endpoint/EndpointParameters.ts b/clients/client-controlcatalog/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..07a8131760b1 --- /dev/null +++ b/clients/client-controlcatalog/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: "controlcatalog", + }; +}; + +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-controlcatalog/src/endpoint/endpointResolver.ts b/clients/client-controlcatalog/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..26fe4c3775a6 --- /dev/null +++ b/clients/client-controlcatalog/src/endpoint/endpointResolver.ts @@ -0,0 +1,19 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/clients/client-controlcatalog/src/endpoint/ruleset.ts b/clients/client-controlcatalog/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..fde2f534aa0d --- /dev/null +++ b/clients/client-controlcatalog/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/controlcatalog.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://controlcatalog-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://controlcatalog-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://controlcatalog.{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://controlcatalog.{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-controlcatalog/src/extensionConfiguration.ts b/clients/client-controlcatalog/src/extensionConfiguration.ts new file mode 100644 index 000000000000..afc3e2a63e3e --- /dev/null +++ b/clients/client-controlcatalog/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 ControlCatalogExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/clients/client-controlcatalog/src/index.ts b/clients/client-controlcatalog/src/index.ts new file mode 100644 index 000000000000..3efd96bf1e67 --- /dev/null +++ b/clients/client-controlcatalog/src/index.ts @@ -0,0 +1,44 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + *

Welcome to the Amazon Web Services Control Catalog API reference. This guide is for + * developers who need detailed information about how to programmatically identify and filter + * the common controls and related metadata that are available to Amazon Web Services customers. This API reference provides + * descriptions, syntax, and usage examples for each of the actions and data types that are + * supported by Amazon Web Services Control Catalog.

+ *

Use the following links to get started with the Amazon Web Services Control Catalog API:

+ *
    + *
  • + *

    + * Actions: An + * alphabetical list of all Control Catalog API operations.

    + *
  • + *
  • + *

    + * Data types: An + * alphabetical list of all Control Catalog data types.

    + *
  • + *
  • + *

    + * Common + * parameters: Parameters that all operations can use.

    + *
  • + *
  • + *

    + * Common errors: + * Client and server errors that all operations can return.

    + *
  • + *
+ * + * @packageDocumentation + */ +export * from "./ControlCatalogClient"; +export * from "./ControlCatalog"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export { RuntimeExtension } from "./runtimeExtensions"; +export { ControlCatalogExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./pagination"; +export * from "./models"; + +export { ControlCatalogServiceException } from "./models/ControlCatalogServiceException"; diff --git a/clients/client-controlcatalog/src/models/ControlCatalogServiceException.ts b/clients/client-controlcatalog/src/models/ControlCatalogServiceException.ts new file mode 100644 index 000000000000..25af74949566 --- /dev/null +++ b/clients/client-controlcatalog/src/models/ControlCatalogServiceException.ts @@ -0,0 +1,22 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export { __ServiceException, __ServiceExceptionOptions }; + +/** + * @public + * + * Base exception class for all service exceptions from ControlCatalog service. + */ +export class ControlCatalogServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, ControlCatalogServiceException.prototype); + } +} diff --git a/clients/client-controlcatalog/src/models/index.ts b/clients/client-controlcatalog/src/models/index.ts new file mode 100644 index 000000000000..9eaceb12865f --- /dev/null +++ b/clients/client-controlcatalog/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/clients/client-controlcatalog/src/models/models_0.ts b/clients/client-controlcatalog/src/models/models_0.ts new file mode 100644 index 000000000000..e822283978ad --- /dev/null +++ b/clients/client-controlcatalog/src/models/models_0.ts @@ -0,0 +1,428 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +import { ControlCatalogServiceException as __BaseException } from "./ControlCatalogServiceException"; + +/** + *

You do not have sufficient access to perform this action.

+ * @public + */ +export class AccessDeniedException extends __BaseException { + readonly name: "AccessDeniedException" = "AccessDeniedException"; + readonly $fault: "client" = "client"; + Message?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, AccessDeniedException.prototype); + this.Message = opts.Message; + } +} + +/** + *

A summary of the domain that a common control or an objective belongs to.

+ * @public + */ +export interface AssociatedDomainSummary { + /** + *

The Amazon Resource Name (ARN) of the related domain.

+ * @public + */ + Arn?: string; + + /** + *

The name of the related domain.

+ * @public + */ + Name?: string; +} + +/** + *

A summary of the objective that a common control supports.

+ * @public + */ +export interface AssociatedObjectiveSummary { + /** + *

The Amazon Resource Name (ARN) of the related objective.

+ * @public + */ + Arn?: string; + + /** + *

The name of the related objective.

+ * @public + */ + Name?: string; +} + +/** + *

The objective resource that's being used as a filter.

+ * @public + */ +export interface ObjectiveResourceFilter { + /** + *

The Amazon Resource Name (ARN) of the objective.

+ * @public + */ + Arn?: string; +} + +/** + *

An optional filter that narrows the results to a specific objective.

+ * @public + */ +export interface CommonControlFilter { + /** + *

The objective that's used as filter criteria.

+ *

You can use this parameter to specify one objective ARN at a time. Passing multiple ARNs + * in the CommonControlFilter isn’t currently supported.

+ * @public + */ + Objectives?: ObjectiveResourceFilter[]; +} + +/** + *

An internal service error occurred during the processing of your request. Try again later.

+ * @public + */ +export class InternalServerException extends __BaseException { + readonly name: "InternalServerException" = "InternalServerException"; + readonly $fault: "server" = "server"; + $retryable = {}; + Message?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServerException.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface ListCommonControlsRequest { + /** + *

The maximum number of results on a page or for an API request call.

+ * @public + */ + MaxResults?: number; + + /** + *

The pagination token that's used to fetch the next set of results.

+ * @public + */ + NextToken?: string; + + /** + *

An optional filter that narrows the results to a specific objective.

+ *

This filter allows you to specify one objective ARN at a time. Passing multiple ARNs in + * the CommonControlFilter isn’t currently supported.

+ * @public + */ + CommonControlFilter?: CommonControlFilter; +} + +/** + *

A summary of metadata for a common control.

+ * @public + */ +export interface CommonControlSummary { + /** + *

The Amazon Resource Name (ARN) that identifies the common control.

+ * @public + */ + Arn: string | undefined; + + /** + *

The name of the common control.

+ * @public + */ + Name: string | undefined; + + /** + *

The description of the common control.

+ * @public + */ + Description: string | undefined; + + /** + *

The domain that the common control belongs to.

+ * @public + */ + Domain: AssociatedDomainSummary | undefined; + + /** + *

The objective that the common control belongs to.

+ * @public + */ + Objective: AssociatedObjectiveSummary | undefined; + + /** + *

The time when the common control was created.

+ * @public + */ + CreateTime: Date | undefined; + + /** + *

The time when the common control was most recently updated.

+ * @public + */ + LastUpdateTime: Date | undefined; +} + +/** + * @public + */ +export interface ListCommonControlsResponse { + /** + *

The list of common controls that the ListCommonControls API returns.

+ * @public + */ + CommonControls: CommonControlSummary[] | undefined; + + /** + *

The pagination token that's used to fetch the next set of results.

+ * @public + */ + NextToken?: string; +} + +/** + *

The request was denied due to request throttling.

+ * @public + */ +export class ThrottlingException extends __BaseException { + readonly name: "ThrottlingException" = "ThrottlingException"; + readonly $fault: "client" = "client"; + $retryable = { + throttling: true, + }; + Message?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ThrottlingException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ThrottlingException.prototype); + this.Message = opts.Message; + } +} + +/** + *

The request has invalid or missing parameters.

+ * @public + */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + Message?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface ListDomainsRequest { + /** + *

The maximum number of results on a page or for an API request call.

+ * @public + */ + MaxResults?: number; + + /** + *

The pagination token that's used to fetch the next set of results.

+ * @public + */ + NextToken?: string; +} + +/** + *

A summary of metadata for a domain.

+ * @public + */ +export interface DomainSummary { + /** + *

The Amazon Resource Name (ARN) that identifies the domain.

+ * @public + */ + Arn: string | undefined; + + /** + *

The name of the domain.

+ * @public + */ + Name: string | undefined; + + /** + *

The description of the domain.

+ * @public + */ + Description: string | undefined; + + /** + *

The time when the domain was created.

+ * @public + */ + CreateTime: Date | undefined; + + /** + *

The time when the domain was most recently updated.

+ * @public + */ + LastUpdateTime: Date | undefined; +} + +/** + * @public + */ +export interface ListDomainsResponse { + /** + *

The list of domains that the ListDomains API returns.

+ * @public + */ + Domains: DomainSummary[] | undefined; + + /** + *

The pagination token that's used to fetch the next set of results.

+ * @public + */ + NextToken?: string; +} + +/** + *

The domain resource that's being used as a filter.

+ * @public + */ +export interface DomainResourceFilter { + /** + *

The Amazon Resource Name (ARN) of the domain.

+ * @public + */ + Arn?: string; +} + +/** + *

An optional filter that narrows the list of objectives to a specific domain.

+ * @public + */ +export interface ObjectiveFilter { + /** + *

The domain that's used as filter criteria.

+ *

You can use this parameter to specify one domain ARN at a time. Passing multiple ARNs in + * the ObjectiveFilter isn’t currently supported.

+ * @public + */ + Domains?: DomainResourceFilter[]; +} + +/** + * @public + */ +export interface ListObjectivesRequest { + /** + *

The maximum number of results on a page or for an API request call.

+ * @public + */ + MaxResults?: number; + + /** + *

The pagination token that's used to fetch the next set of results.

+ * @public + */ + NextToken?: string; + + /** + *

An optional filter that narrows the results to a specific domain.

+ *

This filter allows you to specify one domain ARN at a time. + * Passing multiple ARNs in the ObjectiveFilter isn’t currently supported.

+ * @public + */ + ObjectiveFilter?: ObjectiveFilter; +} + +/** + *

A summary of metadata for an objective.

+ * @public + */ +export interface ObjectiveSummary { + /** + *

The Amazon Resource Name (ARN) that identifies the objective.

+ * @public + */ + Arn: string | undefined; + + /** + *

The name of the objective.

+ * @public + */ + Name: string | undefined; + + /** + *

The description of the objective.

+ * @public + */ + Description: string | undefined; + + /** + *

The domain that the objective belongs to.

+ * @public + */ + Domain: AssociatedDomainSummary | undefined; + + /** + *

The time when the objective was created.

+ * @public + */ + CreateTime: Date | undefined; + + /** + *

The time when the objective was most recently updated.

+ * @public + */ + LastUpdateTime: Date | undefined; +} + +/** + * @public + */ +export interface ListObjectivesResponse { + /** + *

The list of objectives that the ListObjectives API returns.

+ * @public + */ + Objectives: ObjectiveSummary[] | undefined; + + /** + *

The pagination token that's used to fetch the next set of results.

+ * @public + */ + NextToken?: string; +} diff --git a/clients/client-controlcatalog/src/pagination/Interfaces.ts b/clients/client-controlcatalog/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..9a1c095d769c --- /dev/null +++ b/clients/client-controlcatalog/src/pagination/Interfaces.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@smithy/types"; + +import { ControlCatalogClient } from "../ControlCatalogClient"; + +/** + * @public + */ +export interface ControlCatalogPaginationConfiguration extends PaginationConfiguration { + client: ControlCatalogClient; +} diff --git a/clients/client-controlcatalog/src/pagination/ListCommonControlsPaginator.ts b/clients/client-controlcatalog/src/pagination/ListCommonControlsPaginator.ts new file mode 100644 index 000000000000..a7632a4d6dbd --- /dev/null +++ b/clients/client-controlcatalog/src/pagination/ListCommonControlsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + ListCommonControlsCommand, + ListCommonControlsCommandInput, + ListCommonControlsCommandOutput, +} from "../commands/ListCommonControlsCommand"; +import { ControlCatalogClient } from "../ControlCatalogClient"; +import { ControlCatalogPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListCommonControls: ( + config: ControlCatalogPaginationConfiguration, + input: ListCommonControlsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ControlCatalogPaginationConfiguration, + ListCommonControlsCommandInput, + ListCommonControlsCommandOutput +>(ControlCatalogClient, ListCommonControlsCommand, "NextToken", "NextToken", "MaxResults"); diff --git a/clients/client-controlcatalog/src/pagination/ListDomainsPaginator.ts b/clients/client-controlcatalog/src/pagination/ListDomainsPaginator.ts new file mode 100644 index 000000000000..dd6979c36374 --- /dev/null +++ b/clients/client-controlcatalog/src/pagination/ListDomainsPaginator.ts @@ -0,0 +1,20 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { ListDomainsCommand, ListDomainsCommandInput, ListDomainsCommandOutput } from "../commands/ListDomainsCommand"; +import { ControlCatalogClient } from "../ControlCatalogClient"; +import { ControlCatalogPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListDomains: ( + config: ControlCatalogPaginationConfiguration, + input: ListDomainsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ControlCatalogPaginationConfiguration, + ListDomainsCommandInput, + ListDomainsCommandOutput +>(ControlCatalogClient, ListDomainsCommand, "NextToken", "NextToken", "MaxResults"); diff --git a/clients/client-controlcatalog/src/pagination/ListObjectivesPaginator.ts b/clients/client-controlcatalog/src/pagination/ListObjectivesPaginator.ts new file mode 100644 index 000000000000..6cb706c8e529 --- /dev/null +++ b/clients/client-controlcatalog/src/pagination/ListObjectivesPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + ListObjectivesCommand, + ListObjectivesCommandInput, + ListObjectivesCommandOutput, +} from "../commands/ListObjectivesCommand"; +import { ControlCatalogClient } from "../ControlCatalogClient"; +import { ControlCatalogPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListObjectives: ( + config: ControlCatalogPaginationConfiguration, + input: ListObjectivesCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ControlCatalogPaginationConfiguration, + ListObjectivesCommandInput, + ListObjectivesCommandOutput +>(ControlCatalogClient, ListObjectivesCommand, "NextToken", "NextToken", "MaxResults"); diff --git a/clients/client-controlcatalog/src/pagination/index.ts b/clients/client-controlcatalog/src/pagination/index.ts new file mode 100644 index 000000000000..ae3b3a3917ca --- /dev/null +++ b/clients/client-controlcatalog/src/pagination/index.ts @@ -0,0 +1,5 @@ +// smithy-typescript generated code +export * from "./Interfaces"; +export * from "./ListCommonControlsPaginator"; +export * from "./ListDomainsPaginator"; +export * from "./ListObjectivesPaginator"; diff --git a/clients/client-controlcatalog/src/protocols/Aws_restJson1.ts b/clients/client-controlcatalog/src/protocols/Aws_restJson1.ts new file mode 100644 index 000000000000..396daede01d6 --- /dev/null +++ b/clients/client-controlcatalog/src/protocols/Aws_restJson1.ts @@ -0,0 +1,403 @@ +// smithy-typescript generated code +import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core"; +import { requestBuilder as rb } from "@smithy/core"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { + _json, + collectBody, + decorateServiceException as __decorateServiceException, + expectNonNull as __expectNonNull, + expectNumber as __expectNumber, + expectObject as __expectObject, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + map, + parseEpochTimestamp as __parseEpochTimestamp, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; + +import { ListCommonControlsCommandInput, ListCommonControlsCommandOutput } from "../commands/ListCommonControlsCommand"; +import { ListDomainsCommandInput, ListDomainsCommandOutput } from "../commands/ListDomainsCommand"; +import { ListObjectivesCommandInput, ListObjectivesCommandOutput } from "../commands/ListObjectivesCommand"; +import { ControlCatalogServiceException as __BaseException } from "../models/ControlCatalogServiceException"; +import { + AccessDeniedException, + CommonControlFilter, + CommonControlSummary, + DomainResourceFilter, + DomainSummary, + InternalServerException, + ObjectiveFilter, + ObjectiveResourceFilter, + ObjectiveSummary, + ThrottlingException, + ValidationException, +} from "../models/models_0"; + +/** + * serializeAws_restJson1ListCommonControlsCommand + */ +export const se_ListCommonControlsCommand = async ( + input: ListCommonControlsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/common-controls"); + const query: any = map({ + [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], + [_nT]: [, input[_NT]!], + }); + let body: any; + body = JSON.stringify( + take(input, { + CommonControlFilter: (_) => _json(_), + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListDomainsCommand + */ +export const se_ListDomainsCommand = async ( + input: ListDomainsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/domains"); + const query: any = map({ + [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], + [_nT]: [, input[_NT]!], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListObjectivesCommand + */ +export const se_ListObjectivesCommand = async ( + input: ListObjectivesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/objectives"); + const query: any = map({ + [_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()], + [_nT]: [, input[_NT]!], + }); + let body: any; + body = JSON.stringify( + take(input, { + ObjectiveFilter: (_) => _json(_), + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * deserializeAws_restJson1ListCommonControlsCommand + */ +export const de_ListCommonControlsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CommonControls: (_) => de_CommonControlSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListDomainsCommand + */ +export const de_ListDomainsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Domains: (_) => de_DomainSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListObjectivesCommand + */ +export const de_ListObjectivesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Objectives: (_) => de_ObjectiveSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserialize_Aws_restJson1CommandError + */ +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.controlcatalog#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.controlcatalog#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.controlcatalog#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.controlcatalog#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } +}; + +const throwDefaultError = withBaseException(__BaseException); +/** + * deserializeAws_restJson1AccessDeniedExceptionRes + */ +const de_AccessDeniedExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + Message: __expectString, + }); + Object.assign(contents, doc); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1InternalServerExceptionRes + */ +const de_InternalServerExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + Message: __expectString, + }); + Object.assign(contents, doc); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ThrottlingExceptionRes + */ +const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + Message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ThrottlingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + Message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +// se_CommonControlFilter omitted. + +// se_DomainResourceFilter omitted. + +// se_DomainResourceFilterList omitted. + +// se_ObjectiveFilter omitted. + +// se_ObjectiveResourceFilter omitted. + +// se_ObjectiveResourceFilterList omitted. + +// de_AssociatedDomainSummary omitted. + +// de_AssociatedObjectiveSummary omitted. + +/** + * deserializeAws_restJson1CommonControlSummary + */ +const de_CommonControlSummary = (output: any, context: __SerdeContext): CommonControlSummary => { + return take(output, { + Arn: __expectString, + CreateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Description: __expectString, + Domain: _json, + LastUpdateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Name: __expectString, + Objective: _json, + }) as any; +}; + +/** + * deserializeAws_restJson1CommonControlSummaryList + */ +const de_CommonControlSummaryList = (output: any, context: __SerdeContext): CommonControlSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_CommonControlSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1DomainSummary + */ +const de_DomainSummary = (output: any, context: __SerdeContext): DomainSummary => { + return take(output, { + Arn: __expectString, + CreateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Description: __expectString, + LastUpdateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Name: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1DomainSummaryList + */ +const de_DomainSummaryList = (output: any, context: __SerdeContext): DomainSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_DomainSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1ObjectiveSummary + */ +const de_ObjectiveSummary = (output: any, context: __SerdeContext): ObjectiveSummary => { + return take(output, { + Arn: __expectString, + CreateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Description: __expectString, + Domain: _json, + LastUpdateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Name: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1ObjectiveSummaryList + */ +const de_ObjectiveSummaryList = (output: any, context: __SerdeContext): ObjectiveSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_ObjectiveSummary(entry, context); + }); + return retVal; +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const isSerializableHeaderValue = (value: any): boolean => + value !== undefined && + value !== null && + value !== "" && + (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && + (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); + +const _MR = "MaxResults"; +const _NT = "NextToken"; +const _mR = "maxResults"; +const _nT = "nextToken"; diff --git a/clients/client-controlcatalog/src/runtimeConfig.browser.ts b/clients/client-controlcatalog/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c53a252db879 --- /dev/null +++ b/clients/client-controlcatalog/src/runtimeConfig.browser.ts @@ -0,0 +1,44 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { ControlCatalogClientConfig } from "./ControlCatalogClient"; +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: ControlCatalogClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: 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-controlcatalog/src/runtimeConfig.native.ts b/clients/client-controlcatalog/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..62ec985f57d0 --- /dev/null +++ b/clients/client-controlcatalog/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { ControlCatalogClientConfig } from "./ControlCatalogClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ControlCatalogClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-controlcatalog/src/runtimeConfig.shared.ts b/clients/client-controlcatalog/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..a3830b004553 --- /dev/null +++ b/clients/client-controlcatalog/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 { defaultControlCatalogHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { ControlCatalogClientConfig } from "./ControlCatalogClient"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ControlCatalogClientConfig) => { + return { + apiVersion: "2018-05-10", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultControlCatalogHttpAuthSchemeProvider, + 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 ?? "ControlCatalog", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-controlcatalog/src/runtimeConfig.ts b/clients/client-controlcatalog/src/runtimeConfig.ts new file mode 100644 index 000000000000..08b20b9532c7 --- /dev/null +++ b/clients/client-controlcatalog/src/runtimeConfig.ts @@ -0,0 +1,59 @@ +// 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 { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { ControlCatalogClientConfig } from "./ControlCatalogClient"; +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: ControlCatalogClientConfig) => { + 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 ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: 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), + }; +}; diff --git a/clients/client-controlcatalog/src/runtimeExtensions.ts b/clients/client-controlcatalog/src/runtimeExtensions.ts new file mode 100644 index 000000000000..fdcbb6edc4c8 --- /dev/null +++ b/clients/client-controlcatalog/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 { ControlCatalogExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: ControlCatalogExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +const asPartial = >(t: T) => t; + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: ControlCatalogExtensionConfiguration = { + ...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-controlcatalog/tsconfig.cjs.json b/clients/client-controlcatalog/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-controlcatalog/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-controlcatalog/tsconfig.es.json b/clients/client-controlcatalog/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-controlcatalog/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-controlcatalog/tsconfig.json b/clients/client-controlcatalog/tsconfig.json new file mode 100644 index 000000000000..344909de2128 --- /dev/null +++ b/clients/client-controlcatalog/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node14/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/clients/client-controlcatalog/tsconfig.types.json b/clients/client-controlcatalog/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-controlcatalog/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/controlcatalog.json b/codegen/sdk-codegen/aws-models/controlcatalog.json new file mode 100644 index 000000000000..09bf48d29a10 --- /dev/null +++ b/codegen/sdk-codegen/aws-models/controlcatalog.json @@ -0,0 +1,1436 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.controlcatalog#AccessDeniedException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.controlcatalog#AssociatedDomainSummary": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.controlcatalog#DomainArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the related domain.

" + } + }, + "Name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the related domain.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A summary of the domain that a common control or an objective belongs to.

" + } + }, + "com.amazonaws.controlcatalog#AssociatedObjectiveSummary": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.controlcatalog#ObjectiveArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the related objective.

" + } + }, + "Name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the related objective.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A summary of the objective that a common control supports.

" + } + }, + "com.amazonaws.controlcatalog#CommonControlArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 41, + "max": 2048 + }, + "smithy.api#pattern": "^arn:(aws(?:[-a-z]*)?):controlcatalog:::common-control/[0-9a-z]+$" + } + }, + "com.amazonaws.controlcatalog#CommonControlFilter": { + "type": "structure", + "members": { + "Objectives": { + "target": "com.amazonaws.controlcatalog#ObjectiveResourceFilterList", + "traits": { + "smithy.api#documentation": "

The objective that's used as filter criteria.

\n

You can use this parameter to specify one objective ARN at a time. Passing multiple ARNs\n in the CommonControlFilter isn’t currently supported.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

An optional filter that narrows the results to a specific objective.

" + } + }, + "com.amazonaws.controlcatalog#CommonControlResource": { + "type": "resource", + "identifiers": { + "CommonControlArn": { + "target": "com.amazonaws.controlcatalog#CommonControlArn" + } + }, + "list": { + "target": "com.amazonaws.controlcatalog#ListCommonControls" + }, + "traits": { + "aws.api#arn": { + "template": "{CommonControlArn}", + "noAccount": true, + "absolute": true + }, + "aws.iam#disableConditionKeyInference": {}, + "aws.iam#iamResource": { + "name": "common-control" + } + } + }, + "com.amazonaws.controlcatalog#CommonControlSummary": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.controlcatalog#CommonControlArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that identifies the common control.

", + "smithy.api#required": {} + } + }, + "Name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the common control.

", + "smithy.api#required": {} + } + }, + "Description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the common control.

", + "smithy.api#required": {} + } + }, + "Domain": { + "target": "com.amazonaws.controlcatalog#AssociatedDomainSummary", + "traits": { + "smithy.api#documentation": "

The domain that the common control belongs to.

", + "smithy.api#required": {} + } + }, + "Objective": { + "target": "com.amazonaws.controlcatalog#AssociatedObjectiveSummary", + "traits": { + "smithy.api#documentation": "

The objective that the common control belongs to.

", + "smithy.api#required": {} + } + }, + "CreateTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the common control was created.

", + "smithy.api#required": {} + } + }, + "LastUpdateTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the common control was most recently updated.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A summary of metadata for a common control.

" + } + }, + "com.amazonaws.controlcatalog#CommonControlSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.controlcatalog#CommonControlSummary" + } + }, + "com.amazonaws.controlcatalog#ControlCatalog": { + "type": "service", + "version": "2018-05-10", + "resources": [ + { + "target": "com.amazonaws.controlcatalog#CommonControlResource" + }, + { + "target": "com.amazonaws.controlcatalog#DomainResource" + }, + { + "target": "com.amazonaws.controlcatalog#ObjectiveResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "ControlCatalog", + "arnNamespace": "controlcatalog", + "cloudTrailEventSource": "controlcatalog.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "controlcatalog" + }, + "aws.iam#supportedPrincipalTypes": ["Root", "IAMUser", "IAMRole", "FederatedUser"], + "aws.protocols#restJson1": {}, + "smithy.api#cors": { + "origin": "*", + "additionalAllowedHeaders": [ + "*", + "access-control-allow-origin", + "Amz-Sdk-Invocation-Id", + "Amz-Sdk-Request", + "Authorization", + "Content-Length", + "Content-Type", + "Date", + "Host", + "X-Amz-Content-Sha256", + "X-Amz-Date", + "X-Amz-Security-Token", + "X-Amz-Target", + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ] + }, + "smithy.api#documentation": "

Welcome to the Amazon Web Services Control Catalog API reference. This guide is for \n developers who need detailed information about how to programmatically identify and filter \n the common controls and related metadata that are available to Amazon Web Services customers. This API reference provides \n descriptions, syntax, and usage examples for each of the actions and data types that are \n supported by Amazon Web Services Control Catalog.

\n

Use the following links to get started with the Amazon Web Services Control Catalog API:

\n
    \n
  • \n

    \n Actions: An\n alphabetical list of all Control Catalog API operations.

    \n
  • \n
  • \n

    \n Data types: An\n alphabetical list of all Control Catalog data types.

    \n
  • \n
  • \n

    \n Common\n parameters: Parameters that all operations can use.

    \n
  • \n
  • \n

    \n Common errors:\n Client and server errors that all operations can return.

    \n
  • \n
", + "smithy.api#title": "AWS Control Catalog", + "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://controlcatalog-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://controlcatalog-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://controlcatalog.{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://controlcatalog.{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://controlcatalog-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://controlcatalog-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://controlcatalog.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://controlcatalog.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://controlcatalog-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://controlcatalog-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://controlcatalog.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://controlcatalog.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://controlcatalog-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://controlcatalog-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://controlcatalog.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://controlcatalog.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://controlcatalog-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://controlcatalog.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://controlcatalog-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://controlcatalog.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.controlcatalog#DomainArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 33, + "max": 2048 + }, + "smithy.api#pattern": "^arn:(aws(?:[-a-z]*)?):controlcatalog:::domain/[0-9a-z]+$" + } + }, + "com.amazonaws.controlcatalog#DomainResource": { + "type": "resource", + "identifiers": { + "DomainArn": { + "target": "com.amazonaws.controlcatalog#DomainArn" + } + }, + "list": { + "target": "com.amazonaws.controlcatalog#ListDomains" + }, + "traits": { + "aws.api#arn": { + "template": "{DomainArn}", + "noAccount": true, + "absolute": true + }, + "aws.iam#disableConditionKeyInference": {}, + "aws.iam#iamResource": { + "name": "domain" + } + } + }, + "com.amazonaws.controlcatalog#DomainResourceFilter": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.controlcatalog#DomainArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the domain.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The domain resource that's being used as a filter.

" + } + }, + "com.amazonaws.controlcatalog#DomainResourceFilterList": { + "type": "list", + "member": { + "target": "com.amazonaws.controlcatalog#DomainResourceFilter" + } + }, + "com.amazonaws.controlcatalog#DomainSummary": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.controlcatalog#DomainArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that identifies the domain.

", + "smithy.api#required": {} + } + }, + "Name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the domain.

", + "smithy.api#required": {} + } + }, + "Description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the domain.

", + "smithy.api#required": {} + } + }, + "CreateTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the domain was created.

", + "smithy.api#required": {} + } + }, + "LastUpdateTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the domain was most recently updated.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A summary of metadata for a domain.

" + } + }, + "com.amazonaws.controlcatalog#DomainSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.controlcatalog#DomainSummary" + } + }, + "com.amazonaws.controlcatalog#InternalServerException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

An internal service error occurred during the processing of your request. Try again later.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.controlcatalog#ListCommonControls": { + "type": "operation", + "input": { + "target": "com.amazonaws.controlcatalog#ListCommonControlsRequest" + }, + "output": { + "target": "com.amazonaws.controlcatalog#ListCommonControlsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.controlcatalog#AccessDeniedException" + }, + { + "target": "com.amazonaws.controlcatalog#InternalServerException" + }, + { + "target": "com.amazonaws.controlcatalog#ThrottlingException" + }, + { + "target": "com.amazonaws.controlcatalog#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a paginated list of common controls from the Amazon Web Services Control\n Catalog.

\n

You can apply an optional filter to see common controls that have a specific objective. If\n you don’t provide a filter, the operation returns all common controls.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/common-controls" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "CommonControls" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.controlcatalog#ListCommonControlsRequest": { + "type": "structure", + "members": { + "MaxResults": { + "target": "com.amazonaws.controlcatalog#MaxListCommonControlsResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results on a page or for an API request call.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.controlcatalog#PaginationToken", + "traits": { + "smithy.api#documentation": "

The pagination token that's used to fetch the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "CommonControlFilter": { + "target": "com.amazonaws.controlcatalog#CommonControlFilter", + "traits": { + "smithy.api#documentation": "

An optional filter that narrows the results to a specific objective.

\n

This filter allows you to specify one objective ARN at a time. Passing multiple ARNs in\n the CommonControlFilter isn’t currently supported.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.controlcatalog#ListCommonControlsResponse": { + "type": "structure", + "members": { + "CommonControls": { + "target": "com.amazonaws.controlcatalog#CommonControlSummaryList", + "traits": { + "smithy.api#documentation": "

The list of common controls that the ListCommonControls API returns.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.controlcatalog#PaginationToken", + "traits": { + "smithy.api#documentation": "

The pagination token that's used to fetch the next set of results.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.controlcatalog#ListDomains": { + "type": "operation", + "input": { + "target": "com.amazonaws.controlcatalog#ListDomainsRequest" + }, + "output": { + "target": "com.amazonaws.controlcatalog#ListDomainsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.controlcatalog#AccessDeniedException" + }, + { + "target": "com.amazonaws.controlcatalog#InternalServerException" + }, + { + "target": "com.amazonaws.controlcatalog#ThrottlingException" + }, + { + "target": "com.amazonaws.controlcatalog#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a paginated list of domains from the Amazon Web Services Control Catalog.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/domains" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Domains" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.controlcatalog#ListDomainsRequest": { + "type": "structure", + "members": { + "MaxResults": { + "target": "com.amazonaws.controlcatalog#MaxListDomainsResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results on a page or for an API request call.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.controlcatalog#PaginationToken", + "traits": { + "smithy.api#documentation": "

The pagination token that's used to fetch the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.controlcatalog#ListDomainsResponse": { + "type": "structure", + "members": { + "Domains": { + "target": "com.amazonaws.controlcatalog#DomainSummaryList", + "traits": { + "smithy.api#documentation": "

The list of domains that the ListDomains API returns.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.controlcatalog#PaginationToken", + "traits": { + "smithy.api#documentation": "

The pagination token that's used to fetch the next set of results.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.controlcatalog#ListObjectives": { + "type": "operation", + "input": { + "target": "com.amazonaws.controlcatalog#ListObjectivesRequest" + }, + "output": { + "target": "com.amazonaws.controlcatalog#ListObjectivesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.controlcatalog#AccessDeniedException" + }, + { + "target": "com.amazonaws.controlcatalog#InternalServerException" + }, + { + "target": "com.amazonaws.controlcatalog#ThrottlingException" + }, + { + "target": "com.amazonaws.controlcatalog#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a paginated list of objectives from the Amazon Web Services Control Catalog.

\n

You can apply an optional filter to see the objectives that belong to a specific domain.\n If you don’t provide a filter, the operation returns all objectives.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/objectives" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Objectives" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.controlcatalog#ListObjectivesRequest": { + "type": "structure", + "members": { + "MaxResults": { + "target": "com.amazonaws.controlcatalog#MaxListObjectivesResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results on a page or for an API request call.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "NextToken": { + "target": "com.amazonaws.controlcatalog#PaginationToken", + "traits": { + "smithy.api#documentation": "

The pagination token that's used to fetch the next set of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "ObjectiveFilter": { + "target": "com.amazonaws.controlcatalog#ObjectiveFilter", + "traits": { + "smithy.api#documentation": "

An optional filter that narrows the results to a specific domain.

\n

This filter allows you to specify one domain ARN at a time. \n Passing multiple ARNs in the ObjectiveFilter isn’t currently supported.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.controlcatalog#ListObjectivesResponse": { + "type": "structure", + "members": { + "Objectives": { + "target": "com.amazonaws.controlcatalog#ObjectiveSummaryList", + "traits": { + "smithy.api#documentation": "

The list of objectives that the ListObjectives API returns.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.controlcatalog#PaginationToken", + "traits": { + "smithy.api#documentation": "

The pagination token that's used to fetch the next set of results.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.controlcatalog#MaxListCommonControlsResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.controlcatalog#MaxListDomainsResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.controlcatalog#MaxListObjectivesResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.controlcatalog#ObjectiveArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 36, + "max": 2048 + }, + "smithy.api#pattern": "^arn:(aws(?:[-a-z]*)?):controlcatalog:::objective/[0-9a-z]+$" + } + }, + "com.amazonaws.controlcatalog#ObjectiveFilter": { + "type": "structure", + "members": { + "Domains": { + "target": "com.amazonaws.controlcatalog#DomainResourceFilterList", + "traits": { + "smithy.api#documentation": "

The domain that's used as filter criteria.

\n

You can use this parameter to specify one domain ARN at a time. Passing multiple ARNs in\n the ObjectiveFilter isn’t currently supported.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

An optional filter that narrows the list of objectives to a specific domain.

" + } + }, + "com.amazonaws.controlcatalog#ObjectiveResource": { + "type": "resource", + "identifiers": { + "ObjectiveArn": { + "target": "com.amazonaws.controlcatalog#ObjectiveArn" + } + }, + "list": { + "target": "com.amazonaws.controlcatalog#ListObjectives" + }, + "traits": { + "aws.api#arn": { + "template": "{ObjectiveArn}", + "noAccount": true, + "absolute": true + }, + "aws.iam#disableConditionKeyInference": {}, + "aws.iam#iamResource": { + "name": "objective" + } + } + }, + "com.amazonaws.controlcatalog#ObjectiveResourceFilter": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.controlcatalog#ObjectiveArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the objective.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The objective resource that's being used as a filter.

" + } + }, + "com.amazonaws.controlcatalog#ObjectiveResourceFilterList": { + "type": "list", + "member": { + "target": "com.amazonaws.controlcatalog#ObjectiveResourceFilter" + } + }, + "com.amazonaws.controlcatalog#ObjectiveSummary": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.controlcatalog#ObjectiveArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that identifies the objective.

", + "smithy.api#required": {} + } + }, + "Name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the objective.

", + "smithy.api#required": {} + } + }, + "Description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The description of the objective.

", + "smithy.api#required": {} + } + }, + "Domain": { + "target": "com.amazonaws.controlcatalog#AssociatedDomainSummary", + "traits": { + "smithy.api#documentation": "

The domain that the objective belongs to.

", + "smithy.api#required": {} + } + }, + "CreateTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the objective was created.

", + "smithy.api#required": {} + } + }, + "LastUpdateTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the objective was most recently updated.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A summary of metadata for an objective.

" + } + }, + "com.amazonaws.controlcatalog#ObjectiveSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.controlcatalog#ObjectiveSummary" + } + }, + "com.amazonaws.controlcatalog#PaginationToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 1024 + } + } + }, + "com.amazonaws.controlcatalog#ThrottlingException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied due to request throttling.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": { + "throttling": true + } + } + }, + "com.amazonaws.controlcatalog#ValidationException": { + "type": "structure", + "members": { + "Message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request has invalid or missing parameters.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + } + } +}