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

AWS User Notifications Contacts is a service that allows you to create and manage email contacts for AWS User Notifications. The AWS User Notifications Contacts API Reference provides descriptions, API request parameters, and the JSON response for all email contact related API actions.

+ +## Installing + +To install this package, simply type add or install @aws-sdk/client-notificationscontacts +using your favorite package manager: + +- `npm install @aws-sdk/client-notificationscontacts` +- `yarn add @aws-sdk/client-notificationscontacts` +- `pnpm add @aws-sdk/client-notificationscontacts` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `NotificationsContactsClient` and +the commands you need, for example `ListEmailContactsCommand`: + +```js +// ES5 example +const { NotificationsContactsClient, ListEmailContactsCommand } = require("@aws-sdk/client-notificationscontacts"); +``` + +```ts +// ES6+ example +import { NotificationsContactsClient, ListEmailContactsCommand } from "@aws-sdk/client-notificationscontacts"; +``` + +### 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 NotificationsContactsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ListEmailContactsCommand(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-notificationscontacts"; +const client = new AWS.NotificationsContacts({ region: "REGION" }); + +// async/await. +try { + const data = await client.listEmailContacts(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .listEmailContacts(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.listEmailContacts(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-notificationscontacts` 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) + +
+ +ActivateEmailContact + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/ActivateEmailContactCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/ActivateEmailContactCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/ActivateEmailContactCommandOutput/) + +
+
+ +CreateEmailContact + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/CreateEmailContactCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/CreateEmailContactCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/CreateEmailContactCommandOutput/) + +
+
+ +DeleteEmailContact + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/DeleteEmailContactCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/DeleteEmailContactCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/DeleteEmailContactCommandOutput/) + +
+
+ +GetEmailContact + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/GetEmailContactCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/GetEmailContactCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/GetEmailContactCommandOutput/) + +
+
+ +ListEmailContacts + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/ListEmailContactsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/ListEmailContactsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/ListEmailContactsCommandOutput/) + +
+
+ +ListTagsForResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/ListTagsForResourceCommandOutput/) + +
+
+ +SendActivationCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/SendActivationCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/SendActivationCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/SendActivationCodeCommandOutput/) + +
+
+ +TagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/TagResourceCommandOutput/) + +
+
+ +UntagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/notificationscontacts/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-notificationscontacts/Interface/UntagResourceCommandOutput/) + +
diff --git a/clients/client-notificationscontacts/api-extractor.json b/clients/client-notificationscontacts/api-extractor.json new file mode 100644 index 000000000000..d5bf5ffeee85 --- /dev/null +++ b/clients/client-notificationscontacts/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/clients/client-notificationscontacts/package.json b/clients/client-notificationscontacts/package.json new file mode 100644 index 000000000000..db4f76b0d8c2 --- /dev/null +++ b/clients/client-notificationscontacts/package.json @@ -0,0 +1,101 @@ +{ + "name": "@aws-sdk/client-notificationscontacts", + "description": "AWS SDK for JavaScript Notificationscontacts 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 notificationscontacts" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "*", + "@aws-sdk/client-sts": "*", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "devDependencies": { + "@tsconfig/node16": "16.1.3", + "@types/node": "^16.18.96", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~4.9.5" + }, + "engines": { + "node": ">=16.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-notificationscontacts", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-notificationscontacts" + } +} diff --git a/clients/client-notificationscontacts/src/NotificationsContacts.ts b/clients/client-notificationscontacts/src/NotificationsContacts.ts new file mode 100644 index 000000000000..56f9b23d71ae --- /dev/null +++ b/clients/client-notificationscontacts/src/NotificationsContacts.ts @@ -0,0 +1,206 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + ActivateEmailContactCommand, + ActivateEmailContactCommandInput, + ActivateEmailContactCommandOutput, +} from "./commands/ActivateEmailContactCommand"; +import { + CreateEmailContactCommand, + CreateEmailContactCommandInput, + CreateEmailContactCommandOutput, +} from "./commands/CreateEmailContactCommand"; +import { + DeleteEmailContactCommand, + DeleteEmailContactCommandInput, + DeleteEmailContactCommandOutput, +} from "./commands/DeleteEmailContactCommand"; +import { + GetEmailContactCommand, + GetEmailContactCommandInput, + GetEmailContactCommandOutput, +} from "./commands/GetEmailContactCommand"; +import { + ListEmailContactsCommand, + ListEmailContactsCommandInput, + ListEmailContactsCommandOutput, +} from "./commands/ListEmailContactsCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { + SendActivationCodeCommand, + SendActivationCodeCommandInput, + SendActivationCodeCommandOutput, +} from "./commands/SendActivationCodeCommand"; +import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { NotificationsContactsClient, NotificationsContactsClientConfig } from "./NotificationsContactsClient"; + +const commands = { + ActivateEmailContactCommand, + CreateEmailContactCommand, + DeleteEmailContactCommand, + GetEmailContactCommand, + ListEmailContactsCommand, + ListTagsForResourceCommand, + SendActivationCodeCommand, + TagResourceCommand, + UntagResourceCommand, +}; + +export interface NotificationsContacts { + /** + * @see {@link ActivateEmailContactCommand} + */ + activateEmailContact( + args: ActivateEmailContactCommandInput, + options?: __HttpHandlerOptions + ): Promise; + activateEmailContact( + args: ActivateEmailContactCommandInput, + cb: (err: any, data?: ActivateEmailContactCommandOutput) => void + ): void; + activateEmailContact( + args: ActivateEmailContactCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ActivateEmailContactCommandOutput) => void + ): void; + + /** + * @see {@link CreateEmailContactCommand} + */ + createEmailContact( + args: CreateEmailContactCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createEmailContact( + args: CreateEmailContactCommandInput, + cb: (err: any, data?: CreateEmailContactCommandOutput) => void + ): void; + createEmailContact( + args: CreateEmailContactCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateEmailContactCommandOutput) => void + ): void; + + /** + * @see {@link DeleteEmailContactCommand} + */ + deleteEmailContact( + args: DeleteEmailContactCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteEmailContact( + args: DeleteEmailContactCommandInput, + cb: (err: any, data?: DeleteEmailContactCommandOutput) => void + ): void; + deleteEmailContact( + args: DeleteEmailContactCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteEmailContactCommandOutput) => void + ): void; + + /** + * @see {@link GetEmailContactCommand} + */ + getEmailContact( + args: GetEmailContactCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getEmailContact(args: GetEmailContactCommandInput, cb: (err: any, data?: GetEmailContactCommandOutput) => void): void; + getEmailContact( + args: GetEmailContactCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetEmailContactCommandOutput) => void + ): void; + + /** + * @see {@link ListEmailContactsCommand} + */ + listEmailContacts(): Promise; + listEmailContacts( + args: ListEmailContactsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listEmailContacts( + args: ListEmailContactsCommandInput, + cb: (err: any, data?: ListEmailContactsCommandOutput) => void + ): void; + listEmailContacts( + args: ListEmailContactsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListEmailContactsCommandOutput) => void + ): void; + + /** + * @see {@link ListTagsForResourceCommand} + */ + listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + + /** + * @see {@link SendActivationCodeCommand} + */ + sendActivationCode( + args: SendActivationCodeCommandInput, + options?: __HttpHandlerOptions + ): Promise; + sendActivationCode( + args: SendActivationCodeCommandInput, + cb: (err: any, data?: SendActivationCodeCommandOutput) => void + ): void; + sendActivationCode( + args: SendActivationCodeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SendActivationCodeCommandOutput) => void + ): void; + + /** + * @see {@link TagResourceCommand} + */ + tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UntagResourceCommand} + */ + untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void; + untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; +} + +/** + *

AWS User Notifications Contacts is a service that allows you to create and manage email contacts for AWS User Notifications. The AWS User Notifications Contacts API Reference provides descriptions, API request parameters, and the JSON response for all email contact related API actions.

+ * @public + */ +export class NotificationsContacts extends NotificationsContactsClient implements NotificationsContacts {} +createAggregatedClient(commands, NotificationsContacts); diff --git a/clients/client-notificationscontacts/src/NotificationsContactsClient.ts b/clients/client-notificationscontacts/src/NotificationsContactsClient.ts new file mode 100644 index 000000000000..3e7b1a405406 --- /dev/null +++ b/clients/client-notificationscontacts/src/NotificationsContactsClient.ts @@ -0,0 +1,334 @@ +// 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 { + defaultNotificationsContactsHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { + ActivateEmailContactCommandInput, + ActivateEmailContactCommandOutput, +} from "./commands/ActivateEmailContactCommand"; +import { CreateEmailContactCommandInput, CreateEmailContactCommandOutput } from "./commands/CreateEmailContactCommand"; +import { DeleteEmailContactCommandInput, DeleteEmailContactCommandOutput } from "./commands/DeleteEmailContactCommand"; +import { GetEmailContactCommandInput, GetEmailContactCommandOutput } from "./commands/GetEmailContactCommand"; +import { ListEmailContactsCommandInput, ListEmailContactsCommandOutput } from "./commands/ListEmailContactsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { SendActivationCodeCommandInput, SendActivationCodeCommandOutput } from "./commands/SendActivationCodeCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +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 = + | ActivateEmailContactCommandInput + | CreateEmailContactCommandInput + | DeleteEmailContactCommandInput + | GetEmailContactCommandInput + | ListEmailContactsCommandInput + | ListTagsForResourceCommandInput + | SendActivationCodeCommandInput + | TagResourceCommandInput + | UntagResourceCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | ActivateEmailContactCommandOutput + | CreateEmailContactCommandOutput + | DeleteEmailContactCommandOutput + | GetEmailContactCommandOutput + | ListEmailContactsCommandOutput + | ListTagsForResourceCommandOutput + | SendActivationCodeCommandOutput + | TagResourceCommandOutput + | UntagResourceCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type NotificationsContactsClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of NotificationsContactsClient class constructor that set the region, credentials and other options. + */ +export interface NotificationsContactsClientConfig extends NotificationsContactsClientConfigType {} + +/** + * @public + */ +export type NotificationsContactsClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of NotificationsContactsClient class. This is resolved and normalized from the {@link NotificationsContactsClientConfig | constructor configuration interface}. + */ +export interface NotificationsContactsClientResolvedConfig extends NotificationsContactsClientResolvedConfigType {} + +/** + *

AWS User Notifications Contacts is a service that allows you to create and manage email contacts for AWS User Notifications. The AWS User Notifications Contacts API Reference provides descriptions, API request parameters, and the JSON response for all email contact related API actions.

+ * @public + */ +export class NotificationsContactsClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + NotificationsContactsClientResolvedConfig +> { + /** + * The resolved configuration of NotificationsContactsClient class. This is resolved and normalized from the {@link NotificationsContactsClientConfig | constructor configuration interface}. + */ + readonly config: NotificationsContactsClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultNotificationsContactsHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: NotificationsContactsClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/clients/client-notificationscontacts/src/auth/httpAuthExtensionConfiguration.ts b/clients/client-notificationscontacts/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 000000000000..944b7d6c8765 --- /dev/null +++ b/clients/client-notificationscontacts/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { NotificationsContactsHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: NotificationsContactsHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): NotificationsContactsHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: NotificationsContactsHttpAuthSchemeProvider; + 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: NotificationsContactsHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): NotificationsContactsHttpAuthSchemeProvider { + 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-notificationscontacts/src/auth/httpAuthSchemeProvider.ts b/clients/client-notificationscontacts/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 000000000000..5bdd43932101 --- /dev/null +++ b/clients/client-notificationscontacts/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,145 @@ +// 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 { + NotificationsContactsClientConfig, + NotificationsContactsClientResolvedConfig, +} from "../NotificationsContactsClient"; + +/** + * @internal + */ +export interface NotificationsContactsHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface NotificationsContactsHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + NotificationsContactsClientResolvedConfig, + HandlerExecutionContext, + NotificationsContactsHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultNotificationsContactsHttpAuthSchemeParametersProvider = async ( + config: NotificationsContactsClientResolvedConfig, + 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: NotificationsContactsHttpAuthSchemeParameters +): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "notifications-contacts", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface NotificationsContactsHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultNotificationsContactsHttpAuthSchemeProvider: NotificationsContactsHttpAuthSchemeProvider = ( + authParameters +) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: NotificationsContactsHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: NotificationsContactsHttpAuthSchemeProvider; +} + +/** + * @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-notificationscontacts/src/commands/ActivateEmailContactCommand.ts b/clients/client-notificationscontacts/src/commands/ActivateEmailContactCommand.ts new file mode 100644 index 000000000000..7817771842ca --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/ActivateEmailContactCommand.ts @@ -0,0 +1,117 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { + ActivateEmailContactRequest, + ActivateEmailContactRequestFilterSensitiveLog, + ActivateEmailContactResponse, +} from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_ActivateEmailContactCommand, se_ActivateEmailContactCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ActivateEmailContactCommand}. + */ +export interface ActivateEmailContactCommandInput extends ActivateEmailContactRequest {} +/** + * @public + * + * The output of {@link ActivateEmailContactCommand}. + */ +export interface ActivateEmailContactCommandOutput extends ActivateEmailContactResponse, __MetadataBearer {} + +/** + *

Activates an email contact using an activation code. This code is in the activation email sent to the email address associated with this email contact.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, ActivateEmailContactCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, ActivateEmailContactCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // ActivateEmailContactRequest + * arn: "STRING_VALUE", // required + * code: "STRING_VALUE", // required + * }; + * const command = new ActivateEmailContactCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ActivateEmailContactCommandInput - {@link ActivateEmailContactCommandInput} + * @returns {@link ActivateEmailContactCommandOutput} + * @see {@link ActivateEmailContactCommandInput} for command's `input` shape. + * @see {@link ActivateEmailContactCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Updating or deleting a resource can cause an inconsistent state.

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

Unexpected error during processing of request.

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

Your request references a resource which does not exist.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class ActivateEmailContactCommand extends $Command + .classBuilder< + ActivateEmailContactCommandInput, + ActivateEmailContactCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "ActivateEmailContact", {}) + .n("NotificationsContactsClient", "ActivateEmailContactCommand") + .f(ActivateEmailContactRequestFilterSensitiveLog, void 0) + .ser(se_ActivateEmailContactCommand) + .de(de_ActivateEmailContactCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ActivateEmailContactRequest; + output: {}; + }; + sdk: { + input: ActivateEmailContactCommandInput; + output: ActivateEmailContactCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/CreateEmailContactCommand.ts b/clients/client-notificationscontacts/src/commands/CreateEmailContactCommand.ts new file mode 100644 index 000000000000..ec88124e5c5f --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/CreateEmailContactCommand.ts @@ -0,0 +1,122 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { + CreateEmailContactRequest, + CreateEmailContactRequestFilterSensitiveLog, + CreateEmailContactResponse, +} from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_CreateEmailContactCommand, se_CreateEmailContactCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link CreateEmailContactCommand}. + */ +export interface CreateEmailContactCommandInput extends CreateEmailContactRequest {} +/** + * @public + * + * The output of {@link CreateEmailContactCommand}. + */ +export interface CreateEmailContactCommandOutput extends CreateEmailContactResponse, __MetadataBearer {} + +/** + *

Creates an email contact for the provided email address.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, CreateEmailContactCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, CreateEmailContactCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // CreateEmailContactRequest + * name: "STRING_VALUE", // required + * emailAddress: "STRING_VALUE", // required + * tags: { // TagMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new CreateEmailContactCommand(input); + * const response = await client.send(command); + * // { // CreateEmailContactResponse + * // arn: "STRING_VALUE", // required + * // }; + * + * ``` + * + * @param CreateEmailContactCommandInput - {@link CreateEmailContactCommandInput} + * @returns {@link CreateEmailContactCommandOutput} + * @see {@link CreateEmailContactCommandInput} for command's `input` shape. + * @see {@link CreateEmailContactCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Updating or deleting a resource can cause an inconsistent state.

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

Unexpected error during processing of request.

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

Request would cause a service quota to be exceeded.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class CreateEmailContactCommand extends $Command + .classBuilder< + CreateEmailContactCommandInput, + CreateEmailContactCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "CreateEmailContact", {}) + .n("NotificationsContactsClient", "CreateEmailContactCommand") + .f(CreateEmailContactRequestFilterSensitiveLog, void 0) + .ser(se_CreateEmailContactCommand) + .de(de_CreateEmailContactCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: CreateEmailContactRequest; + output: CreateEmailContactResponse; + }; + sdk: { + input: CreateEmailContactCommandInput; + output: CreateEmailContactCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/DeleteEmailContactCommand.ts b/clients/client-notificationscontacts/src/commands/DeleteEmailContactCommand.ts new file mode 100644 index 000000000000..56b5c5a1e972 --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/DeleteEmailContactCommand.ts @@ -0,0 +1,115 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteEmailContactRequest, DeleteEmailContactResponse } from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_DeleteEmailContactCommand, se_DeleteEmailContactCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DeleteEmailContactCommand}. + */ +export interface DeleteEmailContactCommandInput extends DeleteEmailContactRequest {} +/** + * @public + * + * The output of {@link DeleteEmailContactCommand}. + */ +export interface DeleteEmailContactCommandOutput extends DeleteEmailContactResponse, __MetadataBearer {} + +/** + *

Deletes an email contact.

+ * + *

Deleting an email contact removes it from all associated notification configurations.

+ *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, DeleteEmailContactCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, DeleteEmailContactCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // DeleteEmailContactRequest + * arn: "STRING_VALUE", // required + * }; + * const command = new DeleteEmailContactCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteEmailContactCommandInput - {@link DeleteEmailContactCommandInput} + * @returns {@link DeleteEmailContactCommandOutput} + * @see {@link DeleteEmailContactCommandInput} for command's `input` shape. + * @see {@link DeleteEmailContactCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Updating or deleting a resource can cause an inconsistent state.

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

Unexpected error during processing of request.

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

Your request references a resource which does not exist.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class DeleteEmailContactCommand extends $Command + .classBuilder< + DeleteEmailContactCommandInput, + DeleteEmailContactCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "DeleteEmailContact", {}) + .n("NotificationsContactsClient", "DeleteEmailContactCommand") + .f(void 0, void 0) + .ser(se_DeleteEmailContactCommand) + .de(de_DeleteEmailContactCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DeleteEmailContactRequest; + output: {}; + }; + sdk: { + input: DeleteEmailContactCommandInput; + output: DeleteEmailContactCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/GetEmailContactCommand.ts b/clients/client-notificationscontacts/src/commands/GetEmailContactCommand.ts new file mode 100644 index 000000000000..deb0c3c55617 --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/GetEmailContactCommand.ts @@ -0,0 +1,122 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { + GetEmailContactRequest, + GetEmailContactResponse, + GetEmailContactResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_GetEmailContactCommand, se_GetEmailContactCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetEmailContactCommand}. + */ +export interface GetEmailContactCommandInput extends GetEmailContactRequest {} +/** + * @public + * + * The output of {@link GetEmailContactCommand}. + */ +export interface GetEmailContactCommandOutput extends GetEmailContactResponse, __MetadataBearer {} + +/** + *

Returns an email contact.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, GetEmailContactCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, GetEmailContactCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // GetEmailContactRequest + * arn: "STRING_VALUE", // required + * }; + * const command = new GetEmailContactCommand(input); + * const response = await client.send(command); + * // { // GetEmailContactResponse + * // emailContact: { // EmailContact + * // arn: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // address: "STRING_VALUE", // required + * // status: "STRING_VALUE", // required + * // creationTime: new Date("TIMESTAMP"), // required + * // updateTime: new Date("TIMESTAMP"), // required + * // }, + * // }; + * + * ``` + * + * @param GetEmailContactCommandInput - {@link GetEmailContactCommandInput} + * @returns {@link GetEmailContactCommandOutput} + * @see {@link GetEmailContactCommandInput} for command's `input` shape. + * @see {@link GetEmailContactCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Unexpected error during processing of request.

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

Your request references a resource which does not exist.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class GetEmailContactCommand extends $Command + .classBuilder< + GetEmailContactCommandInput, + GetEmailContactCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "GetEmailContact", {}) + .n("NotificationsContactsClient", "GetEmailContactCommand") + .f(void 0, GetEmailContactResponseFilterSensitiveLog) + .ser(se_GetEmailContactCommand) + .de(de_GetEmailContactCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetEmailContactRequest; + output: GetEmailContactResponse; + }; + sdk: { + input: GetEmailContactCommandInput; + output: GetEmailContactCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/ListEmailContactsCommand.ts b/clients/client-notificationscontacts/src/commands/ListEmailContactsCommand.ts new file mode 100644 index 000000000000..45c8169eb434 --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/ListEmailContactsCommand.ts @@ -0,0 +1,123 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { + ListEmailContactsRequest, + ListEmailContactsResponse, + ListEmailContactsResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_ListEmailContactsCommand, se_ListEmailContactsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListEmailContactsCommand}. + */ +export interface ListEmailContactsCommandInput extends ListEmailContactsRequest {} +/** + * @public + * + * The output of {@link ListEmailContactsCommand}. + */ +export interface ListEmailContactsCommandOutput extends ListEmailContactsResponse, __MetadataBearer {} + +/** + *

Lists all email contacts created under the Account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, ListEmailContactsCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, ListEmailContactsCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // ListEmailContactsRequest + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListEmailContactsCommand(input); + * const response = await client.send(command); + * // { // ListEmailContactsResponse + * // nextToken: "STRING_VALUE", + * // emailContacts: [ // EmailContacts // required + * // { // EmailContact + * // arn: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // address: "STRING_VALUE", // required + * // status: "STRING_VALUE", // required + * // creationTime: new Date("TIMESTAMP"), // required + * // updateTime: new Date("TIMESTAMP"), // required + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListEmailContactsCommandInput - {@link ListEmailContactsCommandInput} + * @returns {@link ListEmailContactsCommandOutput} + * @see {@link ListEmailContactsCommandInput} for command's `input` shape. + * @see {@link ListEmailContactsCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Unexpected error during processing of request.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class ListEmailContactsCommand extends $Command + .classBuilder< + ListEmailContactsCommandInput, + ListEmailContactsCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "ListEmailContacts", {}) + .n("NotificationsContactsClient", "ListEmailContactsCommand") + .f(void 0, ListEmailContactsResponseFilterSensitiveLog) + .ser(se_ListEmailContactsCommand) + .de(de_ListEmailContactsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListEmailContactsRequest; + output: ListEmailContactsResponse; + }; + sdk: { + input: ListEmailContactsCommandInput; + output: ListEmailContactsCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/ListTagsForResourceCommand.ts b/clients/client-notificationscontacts/src/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..6f55298ee9b0 --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,113 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { ListTagsForResourceRequest, ListTagsForResourceResponse } from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandInput extends ListTagsForResourceRequest {} +/** + * @public + * + * The output of {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceResponse, __MetadataBearer {} + +/** + *

Lists all of the tags associated with the Amazon Resource Name (ARN) that you specify. The resource can be a user, server, or role.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, ListTagsForResourceCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, ListTagsForResourceCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // ListTagsForResourceRequest + * arn: "STRING_VALUE", // required + * }; + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * // { // ListTagsForResourceResponse + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param ListTagsForResourceCommandInput - {@link ListTagsForResourceCommandInput} + * @returns {@link ListTagsForResourceCommandOutput} + * @see {@link ListTagsForResourceCommandInput} for command's `input` shape. + * @see {@link ListTagsForResourceCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Unexpected error during processing of request.

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

Your request references a resource which does not exist.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class ListTagsForResourceCommand extends $Command + .classBuilder< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "ListTagsForResource", {}) + .n("NotificationsContactsClient", "ListTagsForResourceCommand") + .f(void 0, void 0) + .ser(se_ListTagsForResourceCommand) + .de(de_ListTagsForResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListTagsForResourceRequest; + output: ListTagsForResourceResponse; + }; + sdk: { + input: ListTagsForResourceCommandInput; + output: ListTagsForResourceCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/SendActivationCodeCommand.ts b/clients/client-notificationscontacts/src/commands/SendActivationCodeCommand.ts new file mode 100644 index 000000000000..07c16fd11391 --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/SendActivationCodeCommand.ts @@ -0,0 +1,115 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { SendActivationCodeRequest, SendActivationCodeResponse } from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_SendActivationCodeCommand, se_SendActivationCodeCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SendActivationCodeCommand}. + */ +export interface SendActivationCodeCommandInput extends SendActivationCodeRequest {} +/** + * @public + * + * The output of {@link SendActivationCodeCommand}. + */ +export interface SendActivationCodeCommandOutput extends SendActivationCodeResponse, __MetadataBearer {} + +/** + *

Sends an activation email to the email address associated with the specified email contact.

+ * + *

It might take a few minutes for the activation email to arrive. If it doesn't arrive, check in your spam folder or try sending another activation email.

+ *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, SendActivationCodeCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, SendActivationCodeCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // SendActivationCodeRequest + * arn: "STRING_VALUE", // required + * }; + * const command = new SendActivationCodeCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param SendActivationCodeCommandInput - {@link SendActivationCodeCommandInput} + * @returns {@link SendActivationCodeCommandOutput} + * @see {@link SendActivationCodeCommandInput} for command's `input` shape. + * @see {@link SendActivationCodeCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Updating or deleting a resource can cause an inconsistent state.

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

Unexpected error during processing of request.

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

Your request references a resource which does not exist.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class SendActivationCodeCommand extends $Command + .classBuilder< + SendActivationCodeCommandInput, + SendActivationCodeCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "SendActivationCode", {}) + .n("NotificationsContactsClient", "SendActivationCodeCommand") + .f(void 0, void 0) + .ser(se_SendActivationCodeCommand) + .de(de_SendActivationCodeCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SendActivationCodeRequest; + output: {}; + }; + sdk: { + input: SendActivationCodeCommandInput; + output: SendActivationCodeCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/TagResourceCommand.ts b/clients/client-notificationscontacts/src/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..2be1b5d468db --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/TagResourceCommand.ts @@ -0,0 +1,112 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { TagResourceRequest, TagResourceResponse } from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TagResourceCommand}. + */ +export interface TagResourceCommandInput extends TagResourceRequest {} +/** + * @public + * + * The output of {@link TagResourceCommand}. + */ +export interface TagResourceCommandOutput extends TagResourceResponse, __MetadataBearer {} + +/** + *

Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Taggable resources in AWS User Notifications Contacts include email contacts.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, TagResourceCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, TagResourceCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // TagResourceRequest + * arn: "STRING_VALUE", // required + * tags: { // TagMap // required + * "": "STRING_VALUE", + * }, + * }; + * const command = new TagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param TagResourceCommandInput - {@link TagResourceCommandInput} + * @returns {@link TagResourceCommandOutput} + * @see {@link TagResourceCommandInput} for command's `input` shape. + * @see {@link TagResourceCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Unexpected error during processing of request.

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

Your request references a resource which does not exist.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class TagResourceCommand extends $Command + .classBuilder< + TagResourceCommandInput, + TagResourceCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "TagResource", {}) + .n("NotificationsContactsClient", "TagResourceCommand") + .f(void 0, void 0) + .ser(se_TagResourceCommand) + .de(de_TagResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TagResourceRequest; + output: {}; + }; + sdk: { + input: TagResourceCommandInput; + output: TagResourceCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/UntagResourceCommand.ts b/clients/client-notificationscontacts/src/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..cdc4835b2db1 --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/UntagResourceCommand.ts @@ -0,0 +1,112 @@ +// 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 { commonParams } from "../endpoint/EndpointParameters"; +import { UntagResourceRequest, UntagResourceResponse } from "../models/models_0"; +import { + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../NotificationsContactsClient"; +import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandInput extends UntagResourceRequest {} +/** + * @public + * + * The output of {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandOutput extends UntagResourceResponse, __MetadataBearer {} + +/** + *

Detaches a key-value pair from a resource, as identified by its Amazon Resource Name (ARN). Taggable resources in AWS User Notifications Contacts include email contacts..

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NotificationsContactsClient, UntagResourceCommand } from "@aws-sdk/client-notificationscontacts"; // ES Modules import + * // const { NotificationsContactsClient, UntagResourceCommand } = require("@aws-sdk/client-notificationscontacts"); // CommonJS import + * const client = new NotificationsContactsClient(config); + * const input = { // UntagResourceRequest + * arn: "STRING_VALUE", // required + * tagKeys: [ // TagKeys // required + * "STRING_VALUE", + * ], + * }; + * const command = new UntagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UntagResourceCommandInput - {@link UntagResourceCommandInput} + * @returns {@link UntagResourceCommandOutput} + * @see {@link UntagResourceCommandInput} for command's `input` shape. + * @see {@link UntagResourceCommandOutput} for command's `response` shape. + * @see {@link NotificationsContactsClientResolvedConfig | config} for NotificationsContactsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

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

Unexpected error during processing of request.

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

Your request references a resource which does not exist.

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

The request was denied due to request throttling.

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

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link NotificationsContactsServiceException} + *

Base exception class for all service exceptions from NotificationsContacts service.

+ * + * @public + */ +export class UntagResourceCommand extends $Command + .classBuilder< + UntagResourceCommandInput, + UntagResourceCommandOutput, + NotificationsContactsClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: NotificationsContactsClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("NotificationsContacts", "UntagResource", {}) + .n("NotificationsContactsClient", "UntagResourceCommand") + .f(void 0, void 0) + .ser(se_UntagResourceCommand) + .de(de_UntagResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UntagResourceRequest; + output: {}; + }; + sdk: { + input: UntagResourceCommandInput; + output: UntagResourceCommandOutput; + }; + }; +} diff --git a/clients/client-notificationscontacts/src/commands/index.ts b/clients/client-notificationscontacts/src/commands/index.ts new file mode 100644 index 000000000000..9f1ec6f9b446 --- /dev/null +++ b/clients/client-notificationscontacts/src/commands/index.ts @@ -0,0 +1,10 @@ +// smithy-typescript generated code +export * from "./ActivateEmailContactCommand"; +export * from "./CreateEmailContactCommand"; +export * from "./DeleteEmailContactCommand"; +export * from "./GetEmailContactCommand"; +export * from "./ListEmailContactsCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./SendActivationCodeCommand"; +export * from "./TagResourceCommand"; +export * from "./UntagResourceCommand"; diff --git a/clients/client-notificationscontacts/src/endpoint/EndpointParameters.ts b/clients/client-notificationscontacts/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..c00238692aa2 --- /dev/null +++ b/clients/client-notificationscontacts/src/endpoint/EndpointParameters.ts @@ -0,0 +1,37 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; + region?: string | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return { + ...options, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "notifications-contacts", + }; +}; + +export const commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + UseFIPS?: boolean; + Endpoint?: string; + Region?: string; +} diff --git a/clients/client-notificationscontacts/src/endpoint/endpointResolver.ts b/clients/client-notificationscontacts/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..b08a72482ca0 --- /dev/null +++ b/clients/client-notificationscontacts/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseFIPS"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/clients/client-notificationscontacts/src/endpoint/ruleset.ts b/clients/client-notificationscontacts/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..ae155fc4da17 --- /dev/null +++ b/clients/client-notificationscontacts/src/endpoint/ruleset.ts @@ -0,0 +1,22 @@ +// @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/notificationscontacts.json */ + +const l="ref"; +const a=true, +b=false, +c="isSet", +d="error", +e="endpoint", +f="tree", +g={"required":false,"type":"String"}, +h={[l]:"Endpoint"}, +i={"authSchemes":[{"name":"sigv4","signingRegion":"{PartitionResult#implicitGlobalRegion}"}]}, +j=[{"fn":"booleanEquals","argv":[{[l]:"UseFIPS"},true]}], +k=[{[l]:"Region"}]; +const _data={version:"1.0",parameters:{UseFIPS:{required:a,default:b,type:"Boolean"},Endpoint:g,Region:g},rules:[{conditions:[{fn:c,argv:[h]}],rules:[{conditions:j,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{endpoint:{url:h,properties:{},headers:{}},type:e}],type:f},{rules:[{conditions:[{fn:c,argv:k}],rules:[{conditions:[{fn:"aws.partition",argv:k,assign:"PartitionResult"}],rules:[{conditions:j,endpoint:{url:"https://notifications-contacts-fips.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dualStackDnsSuffix}",properties:i,headers:{}},type:e},{endpoint:{url:"https://notifications-contacts.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dualStackDnsSuffix}",properties:i,headers:{}},type:e}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}],type:f}]}; +export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-notificationscontacts/src/extensionConfiguration.ts b/clients/client-notificationscontacts/src/extensionConfiguration.ts new file mode 100644 index 000000000000..72c19a611b7c --- /dev/null +++ b/clients/client-notificationscontacts/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 NotificationsContactsExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/clients/client-notificationscontacts/src/index.ts b/clients/client-notificationscontacts/src/index.ts new file mode 100644 index 000000000000..896fe9cbc5d1 --- /dev/null +++ b/clients/client-notificationscontacts/src/index.ts @@ -0,0 +1,17 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + *

AWS User Notifications Contacts is a service that allows you to create and manage email contacts for AWS User Notifications. The AWS User Notifications Contacts API Reference provides descriptions, API request parameters, and the JSON response for all email contact related API actions.

+ * + * @packageDocumentation + */ +export * from "./NotificationsContactsClient"; +export * from "./NotificationsContacts"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { NotificationsContactsExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./pagination"; +export * from "./models"; + +export { NotificationsContactsServiceException } from "./models/NotificationsContactsServiceException"; diff --git a/clients/client-notificationscontacts/src/models/NotificationsContactsServiceException.ts b/clients/client-notificationscontacts/src/models/NotificationsContactsServiceException.ts new file mode 100644 index 000000000000..0ff3f3437c1b --- /dev/null +++ b/clients/client-notificationscontacts/src/models/NotificationsContactsServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from NotificationsContacts service. + */ +export class NotificationsContactsServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, NotificationsContactsServiceException.prototype); + } +} diff --git a/clients/client-notificationscontacts/src/models/index.ts b/clients/client-notificationscontacts/src/models/index.ts new file mode 100644 index 000000000000..9eaceb12865f --- /dev/null +++ b/clients/client-notificationscontacts/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/clients/client-notificationscontacts/src/models/models_0.ts b/clients/client-notificationscontacts/src/models/models_0.ts new file mode 100644 index 000000000000..abcbd499fae6 --- /dev/null +++ b/clients/client-notificationscontacts/src/models/models_0.ts @@ -0,0 +1,582 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client"; + +import { NotificationsContactsServiceException as __BaseException } from "./NotificationsContactsServiceException"; + +/** + *

You do not have sufficient access to perform this action.

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

The Amazon Resource Name (ARN) of the resource.

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

The activation code for this email contact.

+ *

An email contact has a maximum of five activation attempts. Activation codes expire after 12 hours and are generated by the SendActivationCode API action.

+ * @public + */ + code: string | undefined; +} + +/** + * @public + */ +export interface ActivateEmailContactResponse {} + +/** + *

Updating or deleting a resource can cause an inconsistent state.

+ * @public + */ +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + /** + *

The resource ID that prompted the conflict error.

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

The resource type that prompted the conflict error.

+ * @public + */ + resourceType: string | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ConflictException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ConflictException.prototype); + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + } +} + +/** + *

Unexpected error during processing of request.

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

Your request references a resource which does not exist.

+ * @public + */ +export class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; + readonly $fault: "client" = "client"; + /** + *

The ID of the resource that wasn't found.

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

The type of resource that wasn't found.

+ * @public + */ + resourceType: string | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + } +} + +/** + *

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, + }; + /** + *

Identifies the service being throttled.

+ * @public + */ + serviceCode?: string | undefined; + + /** + *

Identifies the quota that is being throttled.

+ * @public + */ + quotaCode?: string | undefined; + + /** + *

The number of seconds a client should wait before retrying the request.

+ * @public + */ + retryAfterSeconds?: number | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ThrottlingException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ThrottlingException.prototype); + this.serviceCode = opts.serviceCode; + this.quotaCode = opts.quotaCode; + this.retryAfterSeconds = opts.retryAfterSeconds; + } +} + +/** + *

Stores information about a field passed inside a request that resulted in an exception.

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

The field name where the invalid entry was detected.

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

A message with the reason for the validation exception error.

+ * @public + */ + message: string | undefined; +} + +/** + * @public + * @enum + */ +export const ValidationExceptionReason = { + FIELD_VALIDATION_FAILED: "fieldValidationFailed", + OTHER: "other", +} as const; + +/** + * @public + */ +export type ValidationExceptionReason = (typeof ValidationExceptionReason)[keyof typeof ValidationExceptionReason]; + +/** + *

The input fails to satisfy the constraints specified by an AWS service.

+ * @public + */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + /** + *

The reason why your input is considered invalid.

+ * @public + */ + reason: ValidationExceptionReason | undefined; + + /** + *

The list of input fields that are invalid.

+ * @public + */ + fieldList?: ValidationExceptionField[] | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + this.reason = opts.reason; + this.fieldList = opts.fieldList; + } +} + +/** + * @public + */ +export interface CreateEmailContactRequest { + /** + *

The name of the email contact.

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

The email address this email contact points to. The activation email and any subscribed emails are sent here.

+ * + *

This email address can't receive emails until it's activated.

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

A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.

+ * @public + */ + tags?: Record | undefined; +} + +/** + * @public + */ +export interface CreateEmailContactResponse { + /** + *

The Amazon Resource Name (ARN) of the resource.

+ * @public + */ + arn: string | undefined; +} + +/** + *

Request would cause a service quota to be exceeded.

+ * @public + */ +export class ServiceQuotaExceededException extends __BaseException { + readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; + readonly $fault: "client" = "client"; + /** + *

The ID of the resource that exceeds the service quota.

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

The type of the resource that exceeds the service quota.

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

The code for the service quota exceeded in Service Quotas.

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

The code for the service quota in Service Quotas.

+ * @public + */ + quotaCode: string | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceQuotaExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + this.serviceCode = opts.serviceCode; + this.quotaCode = opts.quotaCode; + } +} + +/** + * @public + */ +export interface DeleteEmailContactRequest { + /** + *

The Amazon Resource Name (ARN) of the resource.

+ * @public + */ + arn: string | undefined; +} + +/** + * @public + */ +export interface DeleteEmailContactResponse {} + +/** + * @public + * @enum + */ +export const EmailContactStatus = { + ACTIVE: "active", + INACTIVE: "inactive", +} as const; + +/** + * @public + */ +export type EmailContactStatus = (typeof EmailContactStatus)[keyof typeof EmailContactStatus]; + +/** + *

An email contact.

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

The Amazon Resource Name (ARN) of the email contact.

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

The name of the email contact.

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

The email address this email contact points to. The activation email and any subscribed emails are sent here.

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

The status of the email contact. Only activated email contacts receive emails.

+ * @public + */ + status: EmailContactStatus | undefined; + + /** + *

The creation time of the resource.

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

The time the resource was last updated.

+ * @public + */ + updateTime: Date | undefined; +} + +/** + * @public + */ +export interface GetEmailContactRequest { + /** + *

The Amazon Resource Name (ARN) of the email contact to get.

+ * @public + */ + arn: string | undefined; +} + +/** + * @public + */ +export interface GetEmailContactResponse { + /** + *

The email contact for the provided email address.

+ * @public + */ + emailContact: EmailContact | undefined; +} + +/** + * @public + */ +export interface ListEmailContactsRequest { + /** + *

The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

+ * @public + */ + maxResults?: number | undefined; + + /** + *

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

+ * @public + */ + nextToken?: string | undefined; +} + +/** + * @public + */ +export interface ListEmailContactsResponse { + /** + *

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

+ * @public + */ + nextToken?: string | undefined; + + /** + *

A list of email contacts.

+ * @public + */ + emailContacts: EmailContact[] | undefined; +} + +/** + * @public + */ +export interface SendActivationCodeRequest { + /** + *

The Amazon Resource Name (ARN) of the resource.

+ * @public + */ + arn: string | undefined; +} + +/** + * @public + */ +export interface SendActivationCodeResponse {} + +/** + * @public + */ +export interface ListTagsForResourceRequest { + /** + *

The ARN you specified to list the tags of.

+ * @public + */ + arn: string | undefined; +} + +/** + * @public + */ +export interface ListTagsForResourceResponse { + /** + *

Key-value pairs that are assigned to a resource, usually for the purpose of grouping and searching for items. Tags are metadata that you define.

+ * @public + */ + tags?: Record | undefined; +} + +/** + * @public + */ +export interface TagResourceRequest { + /** + *

The ARN of the configuration.

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

A list of tags to apply to the configuration.

+ * @public + */ + tags: Record | undefined; +} + +/** + * @public + */ +export interface TagResourceResponse {} + +/** + * @public + */ +export interface UntagResourceRequest { + /** + *

The value of the resource that will have the tag removed. An Amazon Resource Name (ARN) is an identifier for a specific AWS resource, such as a server, user, or role.

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

Specifies a list of tag keys that you want to remove from the specified resources.

+ * @public + */ + tagKeys: string[] | undefined; +} + +/** + * @public + */ +export interface UntagResourceResponse {} + +/** + * @internal + */ +export const ActivateEmailContactRequestFilterSensitiveLog = (obj: ActivateEmailContactRequest): any => ({ + ...obj, + ...(obj.code && { code: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const CreateEmailContactRequestFilterSensitiveLog = (obj: CreateEmailContactRequest): any => ({ + ...obj, + ...(obj.name && { name: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const EmailContactFilterSensitiveLog = (obj: EmailContact): any => ({ + ...obj, + ...(obj.name && { name: SENSITIVE_STRING }), + ...(obj.address && { address: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const GetEmailContactResponseFilterSensitiveLog = (obj: GetEmailContactResponse): any => ({ + ...obj, + ...(obj.emailContact && { emailContact: EmailContactFilterSensitiveLog(obj.emailContact) }), +}); + +/** + * @internal + */ +export const ListEmailContactsResponseFilterSensitiveLog = (obj: ListEmailContactsResponse): any => ({ + ...obj, + ...(obj.emailContacts && { emailContacts: obj.emailContacts.map((item) => EmailContactFilterSensitiveLog(item)) }), +}); diff --git a/clients/client-notificationscontacts/src/pagination/Interfaces.ts b/clients/client-notificationscontacts/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..77f059fb7f93 --- /dev/null +++ b/clients/client-notificationscontacts/src/pagination/Interfaces.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@smithy/types"; + +import { NotificationsContactsClient } from "../NotificationsContactsClient"; + +/** + * @public + */ +export interface NotificationsContactsPaginationConfiguration extends PaginationConfiguration { + client: NotificationsContactsClient; +} diff --git a/clients/client-notificationscontacts/src/pagination/ListEmailContactsPaginator.ts b/clients/client-notificationscontacts/src/pagination/ListEmailContactsPaginator.ts new file mode 100644 index 000000000000..4224e33fe901 --- /dev/null +++ b/clients/client-notificationscontacts/src/pagination/ListEmailContactsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + ListEmailContactsCommand, + ListEmailContactsCommandInput, + ListEmailContactsCommandOutput, +} from "../commands/ListEmailContactsCommand"; +import { NotificationsContactsClient } from "../NotificationsContactsClient"; +import { NotificationsContactsPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListEmailContacts: ( + config: NotificationsContactsPaginationConfiguration, + input: ListEmailContactsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + NotificationsContactsPaginationConfiguration, + ListEmailContactsCommandInput, + ListEmailContactsCommandOutput +>(NotificationsContactsClient, ListEmailContactsCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-notificationscontacts/src/pagination/index.ts b/clients/client-notificationscontacts/src/pagination/index.ts new file mode 100644 index 000000000000..0cbaea2e6eab --- /dev/null +++ b/clients/client-notificationscontacts/src/pagination/index.ts @@ -0,0 +1,3 @@ +// smithy-typescript generated code +export * from "./Interfaces"; +export * from "./ListEmailContactsPaginator"; diff --git a/clients/client-notificationscontacts/src/protocols/Aws_restJson1.ts b/clients/client-notificationscontacts/src/protocols/Aws_restJson1.ts new file mode 100644 index 000000000000..1c6bcfed0111 --- /dev/null +++ b/clients/client-notificationscontacts/src/protocols/Aws_restJson1.ts @@ -0,0 +1,626 @@ +// 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, + expectObject as __expectObject, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + map, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + resolvedPath as __resolvedPath, + strictParseInt32 as __strictParseInt32, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; + +import { + ActivateEmailContactCommandInput, + ActivateEmailContactCommandOutput, +} from "../commands/ActivateEmailContactCommand"; +import { CreateEmailContactCommandInput, CreateEmailContactCommandOutput } from "../commands/CreateEmailContactCommand"; +import { DeleteEmailContactCommandInput, DeleteEmailContactCommandOutput } from "../commands/DeleteEmailContactCommand"; +import { GetEmailContactCommandInput, GetEmailContactCommandOutput } from "../commands/GetEmailContactCommand"; +import { ListEmailContactsCommandInput, ListEmailContactsCommandOutput } from "../commands/ListEmailContactsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { SendActivationCodeCommandInput, SendActivationCodeCommandOutput } from "../commands/SendActivationCodeCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { + AccessDeniedException, + ConflictException, + EmailContact, + InternalServerException, + ResourceNotFoundException, + ServiceQuotaExceededException, + ThrottlingException, + ValidationException, +} from "../models/models_0"; +import { NotificationsContactsServiceException as __BaseException } from "../models/NotificationsContactsServiceException"; + +/** + * serializeAws_restJson1ActivateEmailContactCommand + */ +export const se_ActivateEmailContactCommand = async ( + input: ActivateEmailContactCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/emailcontacts/{arn}/activate/{code}"); + b.p("arn", () => input.arn!, "{arn}", false); + b.p("code", () => input.code!, "{code}", false); + let body: any; + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1CreateEmailContactCommand + */ +export const se_CreateEmailContactCommand = async ( + input: CreateEmailContactCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/2022-09-19/emailcontacts"); + let body: any; + body = JSON.stringify( + take(input, { + emailAddress: [], + name: [], + tags: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DeleteEmailContactCommand + */ +export const se_DeleteEmailContactCommand = async ( + input: DeleteEmailContactCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/emailcontacts/{arn}"); + b.p("arn", () => input.arn!, "{arn}", false); + let body: any; + b.m("DELETE").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GetEmailContactCommand + */ +export const se_GetEmailContactCommand = async ( + input: GetEmailContactCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/emailcontacts/{arn}"); + b.p("arn", () => input.arn!, "{arn}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListEmailContactsCommand + */ +export const se_ListEmailContactsCommand = async ( + input: ListEmailContactsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/emailcontacts"); + const query: any = map({ + [_mR]: [() => input.maxResults !== void 0, () => input[_mR]!.toString()], + [_nT]: [, input[_nT]!], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListTagsForResourceCommand + */ +export const se_ListTagsForResourceCommand = async ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/tags/{arn}"); + b.p("arn", () => input.arn!, "{arn}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1SendActivationCodeCommand + */ +export const se_SendActivationCodeCommand = async ( + input: SendActivationCodeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/2022-10-31/emailcontacts/{arn}/activate/send"); + b.p("arn", () => input.arn!, "{arn}", false); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TagResourceCommand + */ +export const se_TagResourceCommand = async ( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/tags/{arn}"); + b.p("arn", () => input.arn!, "{arn}", false); + let body: any; + body = JSON.stringify( + take(input, { + tags: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1UntagResourceCommand + */ +export const se_UntagResourceCommand = async ( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/tags/{arn}"); + b.p("arn", () => input.arn!, "{arn}", false); + const query: any = map({ + [_tK]: [__expectNonNull(input.tagKeys, `tagKeys`) != null, () => input[_tK]! || []], + }); + let body: any; + b.m("DELETE").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * deserializeAws_restJson1ActivateEmailContactCommand + */ +export const de_ActivateEmailContactCommand = 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), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1CreateEmailContactCommand + */ +export const de_CreateEmailContactCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && 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, { + arn: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteEmailContactCommand + */ +export const de_DeleteEmailContactCommand = 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), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1GetEmailContactCommand + */ +export const de_GetEmailContactCommand = 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, { + emailContact: (_) => de_EmailContact(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListEmailContactsCommand + */ +export const de_ListEmailContactsCommand = 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, { + emailContacts: (_) => de_EmailContacts(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListTagsForResourceCommand + */ +export const de_ListTagsForResourceCommand = 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, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1SendActivationCodeCommand + */ +export const de_SendActivationCodeCommand = 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), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1TagResourceCommand + */ +export const de_TagResourceCommand = 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), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = 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), + }); + await collectBody(output.body, context); + 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.notificationscontacts#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.notificationscontacts#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.notificationscontacts#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.notificationscontacts#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.notificationscontacts#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.notificationscontacts#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.notificationscontacts#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(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_restJson1ConflictExceptionRes + */ +const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + resourceId: __expectString, + resourceType: __expectString, + }); + Object.assign(contents, doc); + const exception = new ConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1InternalServerExceptionRes + */ +const de_InternalServerExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ResourceNotFoundExceptionRes + */ +const de_ResourceNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + resourceId: __expectString, + resourceType: __expectString, + }); + Object.assign(contents, doc); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ServiceQuotaExceededExceptionRes + */ +const de_ServiceQuotaExceededExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + quotaCode: __expectString, + resourceId: __expectString, + resourceType: __expectString, + serviceCode: __expectString, + }); + Object.assign(contents, doc); + const exception = new ServiceQuotaExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ThrottlingExceptionRes + */ +const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({ + [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => __strictParseInt32(parsedOutput.headers[_ra])], + }); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + quotaCode: __expectString, + serviceCode: __expectString, + }); + Object.assign(contents, doc); + const exception = new ThrottlingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + fieldList: _json, + message: __expectString, + reason: __expectString, + }); + Object.assign(contents, doc); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +// se_TagMap omitted. + +/** + * deserializeAws_restJson1EmailContact + */ +const de_EmailContact = (output: any, context: __SerdeContext): EmailContact => { + return take(output, { + address: __expectString, + arn: __expectString, + creationTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + name: __expectString, + status: __expectString, + updateTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1EmailContacts + */ +const de_EmailContacts = (output: any, context: __SerdeContext): EmailContact[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_EmailContact(entry, context); + }); + return retVal; +}; + +// de_TagMap omitted. + +// de_ValidationExceptionField omitted. + +// de_ValidationExceptionFieldList omitted. + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const _mR = "maxResults"; +const _nT = "nextToken"; +const _rAS = "retryAfterSeconds"; +const _ra = "retry-after"; +const _tK = "tagKeys"; diff --git a/clients/client-notificationscontacts/src/runtimeConfig.browser.ts b/clients/client-notificationscontacts/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5c9f06200648 --- /dev/null +++ b/clients/client-notificationscontacts/src/runtimeConfig.browser.ts @@ -0,0 +1,44 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { NotificationsContactsClientConfig } from "./NotificationsContactsClient"; +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: NotificationsContactsClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/clients/client-notificationscontacts/src/runtimeConfig.native.ts b/clients/client-notificationscontacts/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..c39dd18c7bc5 --- /dev/null +++ b/clients/client-notificationscontacts/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { NotificationsContactsClientConfig } from "./NotificationsContactsClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NotificationsContactsClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-notificationscontacts/src/runtimeConfig.shared.ts b/clients/client-notificationscontacts/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..370a33c40a98 --- /dev/null +++ b/clients/client-notificationscontacts/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 { defaultNotificationsContactsHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { NotificationsContactsClientConfig } from "./NotificationsContactsClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NotificationsContactsClientConfig) => { + 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 ?? defaultNotificationsContactsHttpAuthSchemeProvider, + 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 ?? "NotificationsContacts", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-notificationscontacts/src/runtimeConfig.ts b/clients/client-notificationscontacts/src/runtimeConfig.ts new file mode 100644 index 000000000000..f4d7316b96b6 --- /dev/null +++ b/clients/client-notificationscontacts/src/runtimeConfig.ts @@ -0,0 +1,60 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { NotificationsContactsClientConfig } from "./NotificationsContactsClient"; +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: NotificationsContactsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: + config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + }; +}; diff --git a/clients/client-notificationscontacts/src/runtimeExtensions.ts b/clients/client-notificationscontacts/src/runtimeExtensions.ts new file mode 100644 index 000000000000..f9024a3d556a --- /dev/null +++ b/clients/client-notificationscontacts/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 { NotificationsContactsExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: NotificationsContactsExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +const asPartial = >(t: T) => t; + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: NotificationsContactsExtensionConfiguration = { + ...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-notificationscontacts/tsconfig.cjs.json b/clients/client-notificationscontacts/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-notificationscontacts/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-notificationscontacts/tsconfig.es.json b/clients/client-notificationscontacts/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-notificationscontacts/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-notificationscontacts/tsconfig.json b/clients/client-notificationscontacts/tsconfig.json new file mode 100644 index 000000000000..e7f5ec56b742 --- /dev/null +++ b/clients/client-notificationscontacts/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node16/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/clients/client-notificationscontacts/tsconfig.types.json b/clients/client-notificationscontacts/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-notificationscontacts/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/notificationscontacts.json b/codegen/sdk-codegen/aws-models/notificationscontacts.json new file mode 100644 index 000000000000..27f6a73cd8d7 --- /dev/null +++ b/codegen/sdk-codegen/aws-models/notificationscontacts.json @@ -0,0 +1,1659 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.notificationscontacts#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.notificationscontacts#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.notificationscontacts#ActivateEmailContact": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#ActivateEmailContactRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#ActivateEmailContactResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#ConflictException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to activate the email contact associated with the given ARN if the provided code is valid" + }, + "smithy.api#documentation": "

Activates an email contact using an activation code. This code is in the activation email sent to the email address associated with this email contact.

", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/emailcontacts/{arn}/activate/{code}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.notificationscontacts#ActivateEmailContactRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "code": { + "target": "com.amazonaws.notificationscontacts#Token", + "traits": { + "smithy.api#documentation": "

The activation code for this email contact.

\n

An email contact has a maximum of five activation attempts. Activation codes expire after 12 hours and are generated by the SendActivationCode API action.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#ActivateEmailContactResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.notificationscontacts#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + }, + "resourceId": { + "target": "com.amazonaws.notificationscontacts#ResourceId", + "traits": { + "smithy.api#documentation": "

The resource ID that prompted the conflict error.

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.notificationscontacts#ResourceType", + "traits": { + "smithy.api#documentation": "

The resource type that prompted the conflict error.

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

Updating or deleting a resource can cause an inconsistent state.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.notificationscontacts#CreateEmailContact": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#CreateEmailContactRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#CreateEmailContactResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#ConflictException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to create an email contact" + }, + "smithy.api#documentation": "

Creates an email contact for the provided email address.

", + "smithy.api#http": { + "code": 201, + "method": "POST", + "uri": "/2022-09-19/emailcontacts" + } + } + }, + "com.amazonaws.notificationscontacts#CreateEmailContactRequest": { + "type": "structure", + "members": { + "name": { + "target": "com.amazonaws.notificationscontacts#EmailContactName", + "traits": { + "smithy.api#documentation": "

The name of the email contact.

", + "smithy.api#required": {} + } + }, + "emailAddress": { + "target": "com.amazonaws.notificationscontacts#EmailContactAddress", + "traits": { + "smithy.api#documentation": "

The email address this email contact points to. The activation email and any subscribed emails are sent here.

\n \n

This email address can't receive emails until it's activated.

\n
", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.notificationscontacts#TagMap", + "traits": { + "smithy.api#documentation": "

A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#CreateEmailContactResponse": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#CreationTime": { + "type": "timestamp", + "traits": { + "smithy.api#timestampFormat": "date-time" + } + }, + "com.amazonaws.notificationscontacts#DeleteEmailContact": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#DeleteEmailContactRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#DeleteEmailContactResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#ConflictException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to delete an email contact associated with the given ARN" + }, + "smithy.api#documentation": "

Deletes an email contact.

\n \n

Deleting an email contact removes it from all associated notification configurations.

\n
", + "smithy.api#http": { + "code": 200, + "method": "DELETE", + "uri": "/emailcontacts/{arn}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.notificationscontacts#DeleteEmailContactRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#DeleteEmailContactResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#EmailContact": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the email contact.

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.notificationscontacts#EmailContactName", + "traits": { + "smithy.api#documentation": "

The name of the email contact.

", + "smithy.api#required": {} + } + }, + "address": { + "target": "com.amazonaws.notificationscontacts#SensitiveEmailContactAddress", + "traits": { + "smithy.api#documentation": "

The email address this email contact points to. The activation email and any subscribed emails are sent here.

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.notificationscontacts#EmailContactStatus", + "traits": { + "smithy.api#documentation": "

The status of the email contact. Only activated email contacts receive emails.

", + "smithy.api#required": {} + } + }, + "creationTime": { + "target": "com.amazonaws.notificationscontacts#CreationTime", + "traits": { + "smithy.api#documentation": "

The creation time of the resource.

", + "smithy.api#required": {} + } + }, + "updateTime": { + "target": "com.amazonaws.notificationscontacts#UpdateTime", + "traits": { + "smithy.api#documentation": "

The time the resource was last updated.

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

An email contact.

" + } + }, + "com.amazonaws.notificationscontacts#EmailContactAddress": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 6, + "max": 254 + }, + "smithy.api#pattern": "^(.+)@(.+)$" + } + }, + "com.amazonaws.notificationscontacts#EmailContactArn": { + "type": "string", + "traits": { + "aws.api#arnReference": { + "service": "com.amazonaws.notificationscontacts#NotificationsContacts", + "resource": "com.amazon.aws.services.notifications.contacts.orchestration.service#EmailContact" + }, + "smithy.api#pattern": "^arn:aws:notifications-contacts::[0-9]{12}:emailcontact/[a-z0-9]{27}$" + } + }, + "com.amazonaws.notificationscontacts#EmailContactName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "[\\w-.~]+", + "smithy.api#sensitive": {}, + "smithy.api#suppress": ["PatternTrait"] + } + }, + "com.amazonaws.notificationscontacts#EmailContactResource": { + "type": "resource", + "identifiers": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn" + } + }, + "create": { + "target": "com.amazonaws.notificationscontacts#CreateEmailContact" + }, + "read": { + "target": "com.amazonaws.notificationscontacts#GetEmailContact" + }, + "delete": { + "target": "com.amazonaws.notificationscontacts#DeleteEmailContact" + }, + "list": { + "target": "com.amazonaws.notificationscontacts#ListEmailContacts" + }, + "operations": [ + { + "target": "com.amazonaws.notificationscontacts#ActivateEmailContact" + }, + { + "target": "com.amazonaws.notificationscontacts#SendActivationCode" + } + ], + "traits": { + "aws.api#arn": { + "template": "{arn}", + "absolute": true, + "noRegion": true + }, + "aws.cloudformation#cfnResource": {} + } + }, + "com.amazonaws.notificationscontacts#EmailContactStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "inactive", + "name": "INACTIVE" + }, + { + "value": "active", + "name": "ACTIVE" + } + ] + } + }, + "com.amazonaws.notificationscontacts#EmailContacts": { + "type": "list", + "member": { + "target": "com.amazonaws.notificationscontacts#EmailContact" + } + }, + "com.amazonaws.notificationscontacts#ErrorMessage": { + "type": "string" + }, + "com.amazonaws.notificationscontacts#GetEmailContact": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#GetEmailContactRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#GetEmailContactResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to get an email contact associated with the given ARN" + }, + "smithy.api#documentation": "

Returns an email contact.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/emailcontacts/{arn}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.notificationscontacts#GetEmailContactRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the email contact to get.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#GetEmailContactResponse": { + "type": "structure", + "members": { + "emailContact": { + "target": "com.amazonaws.notificationscontacts#EmailContact", + "traits": { + "smithy.api#documentation": "

The email contact for the provided email address.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.notificationscontacts#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Unexpected error during processing of request.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.notificationscontacts#ListEmailContacts": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#ListEmailContactsRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#ListEmailContactsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to list email contacts" + }, + "smithy.api#documentation": "

Lists all email contacts created under the Account.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/emailcontacts" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "emailContacts" + }, + "smithy.api#readonly": {}, + "smithy.test#smokeTests": [ + { + "id": "ListEmailContactsSuccess", + "params": { + "maxResults": 1 + }, + "expect": { + "success": {} + }, + "vendorParamsShape": "aws.test#AwsVendorParams", + "vendorParams": { + "region": "us-east-1" + } + } + ] + } + }, + "com.amazonaws.notificationscontacts#ListEmailContactsRequest": { + "type": "structure", + "members": { + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

", + "smithy.api#httpQuery": "nextToken" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#ListEmailContactsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

" + } + }, + "emailContacts": { + "target": "com.amazonaws.notificationscontacts#EmailContacts", + "traits": { + "smithy.api#documentation": "

A list of email contacts.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to get tags for a resource" + }, + "smithy.api#documentation": "

Lists all of the tags associated with the Amazon Resource Name (ARN) that you specify. The resource can be a user, server, or role.

", + "smithy.api#http": { + "method": "GET", + "uri": "/tags/{arn}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.notificationscontacts#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The ARN you specified to list the tags of.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "tags": { + "target": "com.amazonaws.notificationscontacts#TagMap", + "traits": { + "smithy.api#documentation": "

Key-value pairs that are assigned to a resource, usually for the purpose of grouping and searching for items. Tags are metadata that you define.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#NotificationsContacts": { + "type": "service", + "version": "2018-05-10", + "operations": [ + { + "target": "com.amazonaws.notificationscontacts#ListTagsForResource" + }, + { + "target": "com.amazonaws.notificationscontacts#TagResource" + }, + { + "target": "com.amazonaws.notificationscontacts#UntagResource" + } + ], + "resources": [ + { + "target": "com.amazonaws.notificationscontacts#EmailContactResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "NotificationsContacts", + "arnNamespace": "notifications-contacts", + "endpointPrefix": "notifications-contacts", + "cloudTrailEventSource": "notifications-contacts.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "notifications-contacts" + }, + "aws.endpoints#dualStackOnlyEndpoints": {}, + "aws.endpoints#standardPartitionalEndpoints": { + "endpointPatternType": "service_region_dnsSuffix" + }, + "aws.iam#supportedPrincipalTypes": ["Root", "IAMUser", "IAMRole", "FederatedUser"], + "aws.protocols#restJson1": {}, + "smithy.api#cors": { + "additionalAllowedHeaders": [ + "*", + "content-type", + "x-amz-content-sha256", + "x-amz-user-agent", + "x-amzn-platform-id", + "x-amzn-trace-id" + ], + "additionalExposedHeaders": ["x-amzn-errortype", "x-amzn-requestid", "x-amzn-trace-id"], + "maxAge": 86400 + }, + "smithy.api#documentation": "

AWS User Notifications Contacts is a service that allows you to create and manage email contacts for AWS User Notifications. The AWS User Notifications Contacts API Reference provides descriptions, API request parameters, and the JSON response for all email contact related API actions.

", + "smithy.api#title": "AWS User Notifications Contacts", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "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" + }, + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the 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": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "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 + ] + } + ], + "endpoint": { + "url": "https://notifications-contacts-fips.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dualStackDnsSuffix}", + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "{PartitionResult#implicitGlobalRegion}" + } + ] + }, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [], + "endpoint": { + "url": "https://notifications-contacts.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dualStackDnsSuffix}", + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "{PartitionResult#implicitGlobalRegion}" + } + ] + }, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For custom endpoint with region not set and fips disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "Endpoint": "https://example.com", + "UseFIPS": false + } + }, + { + "documentation": "For custom endpoint with fips enabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Endpoint": "https://example.com", + "UseFIPS": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-east-1" + } + ] + }, + "url": "https://notifications-contacts-fips.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-east-1" + } + ] + }, + "url": "https://notifications-contacts.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false + } + }, + { + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "cn-northwest-1" + } + ] + }, + "url": "https://notifications-contacts-fips.cn-northwest-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-northwest-1", + "UseFIPS": true + } + }, + { + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "cn-northwest-1" + } + ] + }, + "url": "https://notifications-contacts.cn-northwest-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-northwest-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-gov-west-1" + } + ] + }, + "url": "https://notifications-contacts-fips.us-gov-west-1.api.aws" + } + }, + "params": { + "Region": "us-gov-west-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-gov-west-1" + } + ] + }, + "url": "https://notifications-contacts.us-gov-west-1.api.aws" + } + }, + "params": { + "Region": "us-gov-west-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-iso-east-1" + } + ] + }, + "url": "https://notifications-contacts-fips.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-iso-east-1" + } + ] + }, + "url": "https://notifications-contacts.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isob-east-1" + } + ] + }, + "url": "https://notifications-contacts-fips.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isob-east-1" + } + ] + }, + "url": "https://notifications-contacts.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false + } + }, + { + "documentation": "For region eu-isoe-west-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "eu-isoe-west-1" + } + ] + }, + "url": "https://notifications-contacts-fips.eu-isoe-west-1.cloud.adc-e.uk" + } + }, + "params": { + "Region": "eu-isoe-west-1", + "UseFIPS": true + } + }, + { + "documentation": "For region eu-isoe-west-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "eu-isoe-west-1" + } + ] + }, + "url": "https://notifications-contacts.eu-isoe-west-1.cloud.adc-e.uk" + } + }, + "params": { + "Region": "eu-isoe-west-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-isof-south-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isof-south-1" + } + ] + }, + "url": "https://notifications-contacts-fips.us-isof-south-1.csp.hci.ic.gov" + } + }, + "params": { + "Region": "us-isof-south-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-isof-south-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isof-south-1" + } + ] + }, + "url": "https://notifications-contacts.us-isof-south-1.csp.hci.ic.gov" + } + }, + "params": { + "Region": "us-isof-south-1", + "UseFIPS": false + } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.notificationscontacts#QuotaCode": { + "type": "string" + }, + "com.amazonaws.notificationscontacts#ResourceId": { + "type": "string" + }, + "com.amazonaws.notificationscontacts#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.notificationscontacts#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + }, + "resourceId": { + "target": "com.amazonaws.notificationscontacts#ResourceId", + "traits": { + "smithy.api#documentation": "

The ID of the resource that wasn't found.

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.notificationscontacts#ResourceType", + "traits": { + "smithy.api#documentation": "

The type of resource that wasn't found.

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

Your request references a resource which does not exist.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.notificationscontacts#ResourceType": { + "type": "string" + }, + "com.amazonaws.notificationscontacts#SendActivationCode": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#SendActivationCodeRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#SendActivationCodeResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#ConflictException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to send an activation link to the email associated with the given ARN" + }, + "smithy.api#documentation": "

Sends an activation email to the email address associated with the specified email contact.

\n \n

It might take a few minutes for the activation email to arrive. If it doesn't arrive, check in your spam folder or try sending another activation email.

\n
", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/2022-10-31/emailcontacts/{arn}/activate/send" + } + } + }, + "com.amazonaws.notificationscontacts#SendActivationCodeRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the resource.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#SendActivationCodeResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#SensitiveEmailContactAddress": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 6, + "max": 254 + }, + "smithy.api#pattern": "^(.+)@(.+)$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.notificationscontacts#ServiceCode": { + "type": "string" + }, + "com.amazonaws.notificationscontacts#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.notificationscontacts#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + }, + "resourceId": { + "target": "com.amazonaws.notificationscontacts#ResourceId", + "traits": { + "smithy.api#documentation": "

The ID of the resource that exceeds the service quota.

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.notificationscontacts#ResourceType", + "traits": { + "smithy.api#documentation": "

The type of the resource that exceeds the service quota.

", + "smithy.api#required": {} + } + }, + "serviceCode": { + "target": "com.amazonaws.notificationscontacts#ServiceCode", + "traits": { + "smithy.api#documentation": "

The code for the service quota exceeded in Service Quotas.

", + "smithy.api#required": {} + } + }, + "quotaCode": { + "target": "com.amazonaws.notificationscontacts#QuotaCode", + "traits": { + "smithy.api#documentation": "

The code for the service quota in Service Quotas.

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

Request would cause a service quota to be exceeded.

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.notificationscontacts#TagKey": { + "type": "string", + "traits": { + "smithy.api#pattern": "^(?!aws:).{1,128}$" + } + }, + "com.amazonaws.notificationscontacts#TagKeys": { + "type": "list", + "member": { + "target": "com.amazonaws.notificationscontacts#TagKey" + } + }, + "com.amazonaws.notificationscontacts#TagMap": { + "type": "map", + "key": { + "target": "com.amazonaws.notificationscontacts#TagKey" + }, + "value": { + "target": "com.amazonaws.notificationscontacts#TagValue" + }, + "traits": { + "smithy.api#documentation": "Map of tags assigned to a resource", + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.notificationscontacts#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#TagResourceRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#TagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to tag a resource" + }, + "smithy.api#documentation": "

Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Taggable resources in AWS User Notifications Contacts include email contacts.

", + "smithy.api#http": { + "method": "POST", + "uri": "/tags/{arn}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.notificationscontacts#TagResourceRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The ARN of the configuration.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.notificationscontacts#TagMap", + "traits": { + "smithy.api#documentation": "

A list of tags to apply to the configuration.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#TagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, + "com.amazonaws.notificationscontacts#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.notificationscontacts#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + }, + "serviceCode": { + "target": "com.amazonaws.notificationscontacts#ServiceCode", + "traits": { + "smithy.api#documentation": "

Identifies the service being throttled.

" + } + }, + "quotaCode": { + "target": "com.amazonaws.notificationscontacts#QuotaCode", + "traits": { + "smithy.api#documentation": "

Identifies the quota that is being throttled.

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

The number of seconds a client should wait before retrying the request.

", + "smithy.api#httpHeader": "Retry-After" + } + } + }, + "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.notificationscontacts#Token": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 7, + "max": 7 + }, + "smithy.api#pattern": "^[a-z0-9]{7}$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.notificationscontacts#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.notificationscontacts#UntagResourceRequest" + }, + "output": { + "target": "com.amazonaws.notificationscontacts#UntagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.notificationscontacts#AccessDeniedException" + }, + { + "target": "com.amazonaws.notificationscontacts#InternalServerException" + }, + { + "target": "com.amazonaws.notificationscontacts#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.notificationscontacts#ThrottlingException" + }, + { + "target": "com.amazonaws.notificationscontacts#ValidationException" + } + ], + "traits": { + "aws.api#controlPlane": {}, + "aws.iam#iamAction": { + "documentation": "Grants permission to remove tags from a resource" + }, + "smithy.api#documentation": "

Detaches a key-value pair from a resource, as identified by its Amazon Resource Name (ARN). Taggable resources in AWS User Notifications Contacts include email contacts..

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/tags/{arn}" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.notificationscontacts#UntagResourceRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.notificationscontacts#EmailContactArn", + "traits": { + "smithy.api#documentation": "

The value of the resource that will have the tag removed. An Amazon Resource Name (ARN) is an identifier for a specific AWS resource, such as a server, user, or role.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tagKeys": { + "target": "com.amazonaws.notificationscontacts#TagKeys", + "traits": { + "smithy.api#documentation": "

Specifies a list of tag keys that you want to remove from the specified resources.

", + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.notificationscontacts#UntagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.notificationscontacts#UpdateTime": { + "type": "timestamp", + "traits": { + "smithy.api#timestampFormat": "date-time" + } + }, + "com.amazonaws.notificationscontacts#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.notificationscontacts#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + }, + "reason": { + "target": "com.amazonaws.notificationscontacts#ValidationExceptionReason", + "traits": { + "smithy.api#documentation": "

The reason why your input is considered invalid.

", + "smithy.api#required": {} + } + }, + "fieldList": { + "target": "com.amazonaws.notificationscontacts#ValidationExceptionFieldList", + "traits": { + "smithy.api#documentation": "

The list of input fields that are invalid.

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

The input fails to satisfy the constraints specified by an AWS service.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.notificationscontacts#ValidationExceptionField": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The field name where the invalid entry was detected.

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

A message with the reason for the validation exception error.

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

Stores information about a field passed inside a request that resulted in an exception.

" + } + }, + "com.amazonaws.notificationscontacts#ValidationExceptionFieldList": { + "type": "list", + "member": { + "target": "com.amazonaws.notificationscontacts#ValidationExceptionField" + } + }, + "com.amazonaws.notificationscontacts#ValidationExceptionReason": { + "type": "enum", + "members": { + "FIELD_VALIDATION_FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "fieldValidationFailed" + } + }, + "OTHER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "other" + } + } + } + } + } +}